After many (many!) attempts and learning’s.

Everything from PCB design via software, PCB manufacture via toner transfer and ensuring your board is soldered correctly has had to be designed, re-engineered and put into practice on almost a production line state of mind.

Finally the initial board is ready to rock!

Completed BeeSafe Board, Version 1

Completed BeeSafe Board, Version 1

This board features, 5 LED’s; 4 of which are configurable. 3 Temperature Sensors, input for a switch and an I2C based accelerometer. *NB* The board above only has 1 of the three temperature sensors attached as at time of writing the other two sensors were in the post.

This board connects into a Raspberry Pi via the large 26 Pin header in the top left. Connected to the Pi is a USB GPS and USB 3G Data stick. *NB* the Pi’s on board USB ports aren’t able to provide enough power to support the 3G Data stick so an additional hub or secondary PCB will have to be provided should 3G be needed (Which I suspect it will!).

In total the BeeSafe project has the following sensors and communication gateways:

Circuit Temperature BeeSafe Board
Brood Temperature BeeSafe Board
External Environmental Temperature BeeSafe Board
XYZ Accelerometer BeeSafe Board
5 x Status LED’s BeeSafe Board
Switch Sensor BeeSafe Board
GPS Raspberry Pi
3G Data Modem Raspberry Pi
Ethernet Connection Raspberry Pi

With the hardware now complete (for the moment!); my attention has turned to the software to power BeeSafe. This is comprised of two parts: Software localised on the device and software hosted in the cloud to collect, store and interpret all the data.

A lot of people have asked why I chose to use the Raspberry Pi to power this device, a micro-controller such as Arduino would have been more than capable of reading temperature sensors, XYZ data, parsing GPS data and submitting it all via a comm’s device to the cloud. But the Pi stands out as a standalone computer. It’s capable of hosting its on database, serve pages and data to other computers and networks. An Arduino works in a single hive, but a Pi could work with many.

An Example; quite often bee hives are clustered together and are known as apiaries. If each beehive had a 1-2-1 connection to the internet that would mean each hive would require a 3G stick, its own sim card and data plan. Quickly the costs of keeping an apiary online would rack up.

Using a Raspberry Pi you could create a star network, one device could become a host. Using a USB WiFi stick to create a local WiFi access point (like your WiFi at home, one hub serves many users with an internet connection). This could keep costs and maintenance down as each apiary would only need one connection to the internet.

Additionally, if there is no cell signal, a Raspberry Pi could be used as a localised storage option for all the data collected. While this means you would loose some of the advantages of monitoring your Bee Hive remotely, the data is still invaluable and could be downloaded at a later point.

The next steps for BeeSafe include a start up program that will scan the hardware and configure everything into appropriate sections. For the moment I am doing this manually using a mix of python scrips to test the internet connection, GPS data, LED’s, temperature and XYZ position.

My ultimate goal is to produce a initial start up script that will on boot, self-test the LED’s, check for internet connection, scan for temperature sensors, check for the presence of an Accelerometer and then store all this data within an XML file to be used by the default BeeSafe program.

An example of the XML configuration file is below:

<?xml version=”1.0″?>
<BeeSafe>
<BeeSafeDeviceID></BeeSafeDeviceID> #Unique Serial Number used to identify the BeeSafe
<RedLED><RedLED> #GPIO Pin number for Red LED
<AmberLED></AmberLED> #GPIO Pin number for AmberLED
<GreenLED0></GreenLED0> #GPIO Pin number for First Green LED
<GreenLED1></GreenLED1> #GPIO Pin number for Second GreenLED
<BoardTemp></BoardTemp> #Identifier for Board Temp Sensor
<BroodTemp></BroodTemp> #Identifier for BroodTemp Sensor
<EnvironmentTemp></EnvironmentTemp> #Identifier for External Temp Sensor
<MagSwitch></MagSwitch> #GPIO Pin number for Magnetic Switch
<XYZ></XYZ> #Identifier for I2C Accelerometer
</BeeSafe>


The BeeSafe Device ID is used to track and log the data submitted by a BeeSafe device, my initial thoughts were that I could use the serial number from the Raspberry Pi attached, but this quickly led to issues as should a user wish to swap out the Pi for another one, the serial number would change and the data would be lost. Additionally I did not want to tie a BeeSafe device to a specific email address as should an individual user have more than one BeeSafe active, managing each device this way could prove to be problematic.

So whats the solution?
A BeeSafe’s Device ID will be generated on demand from the cloud, as a new device comes online and communicates with the cloud for the first time, it will be assigned a device ID which will be saved to the XML config file. While this ID will not be dependent on the PI it is connected to, the Pi’s serial number will be submitted so that should the worst occur and the SD card with the config file be lost, if the same Pi attempts to reconnect to the cloud, as a new user, it will be assigned the same device ID.

From a human perspective; one user can be in control of many BeeSafe devices.
Should the worst occur and the user need to be contacted, if more than one device has an alert status (such as a whole apiary) the user would be alerted once rather than receiving multiple alerts for a cluster of hives suffering the same issue. For example, if a cluster of BeeHives have collapsed, a single alert would be sent out stating that X number of hives currently need attention, rather than bombarding the user with an alert for each individual hive.

Manufacturing PCB’s in a small scale is often expensive, time consuming and inconvenient for the hobby engineer. Setting time aside to design a PCB, sending the design off to be manufactured and the getting it back to realise its the wrong size or worse that a pin is in the wrong place is often a costly process.

I have for a number of years been building PCB’s at home using various bits of software and manufacturing techniques. These boards were very simple and usually designed to convert DC to DC power from batteries or other sources into another voltage – usually to power a 3rd party circuit or in a pinch my iPhone.

My tried and traditional method of PCB manufacture has been to design the part using Adobe Illustrator, flip the board and print it onto ‘PCB’ toner transfer paper, iron the transfer onto a copper clad board and then etch the board using PCB etchant.

While this has worked great, it has a number of limitations; the level of detail I can work with on illustrator isn’t quite setup for PCB designing, everything is a manual process, the iron on transfer often didn’t work (well) completely and so I had to use a pen to fill in the gaps – making for a messy PCB.

Attending a MakerFair in Brighton (South Coast of England) in the summer, I got chatting to a number of people who represented ‘Build Brighton’ – http://www.buildbrighton.com

Seeing the quality of the PCB’s they had designed and made using gloss paper and a laminator inspired my to change my process.

Deciding to start from the beginning I have throw away all the old processes that didn’t work and refreshed them with new.

PCB Design software:

I evaluated a number of bits of PCB software, the list including:

  • EaglePCB
  • FreePCB
  • ExpressPCB
  • OsmondPCB (Mac only)

I finally settled on FreePCB, I was looking for something that would allow me to build without needing a schematic first. With the software it was very easy to define a PCB board size / shape and then add parts from a pre-defined library. If the part you needed didnt exist, it was very easy to add the part to your own custom library and then import it to your design.

Its worth noting that FreePCB allows the use of multiple layers per board – this is something new to me and I am keen to find a project that will allow me to build a circuit board with both top and bottom tracks & components.

Once I had a basic grasp of FreePCB, I began the redesign of my latest project dubbed ‘BeeSafe’; you can read more on that here http://www.mathewjenkinson.co.uk/beesafe-pcb-initial-thoughts-and-feedback/

Using predefined parts, I was able to define the board size (adjusted to the same size as the Raspberry Pi) move the GPIO cable to a more suitable location, place LED’s and switches and locate the 3xAxis accelerometer. The process itself was straight forward and easy to follow, I was able to adjust the track sizes and route all the connections with ease.

As the board itself was now positioned the right way around, I did not have to flip the image. Exporting to a super high resolution tiff file means that the image coming out from the printer was super crisp. The paper used in the printer is super high quality gloss paper, it has a plastic feel to the coated sheet and the toner doesn’t bleed or blur.

PCB Image printed on to Gloss paper.

To transfer the image to the PCB board is a two step process. One part cleaning and one part heat. Its important to ensure that the copper clad board is 100% clean and free from oils and finger prints as this will reduce the contact the toner has with the board and ultimately effect the end result.

To clean the board, I start with dish soap and a coarse sponge. Scrubbing the board to remove grime, oils and finger prints gets the top layer off and a final buff is done using steel wool, which brings the board up in a nice shine – removing the copper oxide layer.

From here I need to apply heat. Using a laminator and a laminator pouch I run the board through the laminator flipping and turning the board to ensure constant heat distribution along the surfaces. The end goal being that the toner melts off the gloss paper and adheres to the surface of the (now clean) PCB. I have found that that using a laminator pouch acts to prevent the paper + PCB from slipping and keeps the overall temperature stable for longer.

*NB* After a weekend of making PCB’s I can confirm there is a SIGNIFICANT difference between toner transfer with and without a lamination pouch. With the pouch returns a near 100% transfer of toner and pattern while without  can be incredibly hit and miss.

Track transfer via laminator

Track transfer via laminator

Once the board has cooled and can be handled, I cut it from the plastic surround and then submerge it in water to help dissolve the paper. This doesn’t usually take long as the paper is thin and soon falls off the board.

The next step is etching. This is a chemical milling process where the board is submersed in a liquid solution that will dissolve away the copper, any part covered by the toner will be protected and after 20 mins or so (depending on the strength of solution, temp etc) the board will be finished and can be removed from the solution. NB – do not tip the waste down the sink / toilet as it is still quite toxic and may corrode your pipes!

PCB after etching - before drilling

PCB after etching – before drilling

While the toner is still attached to the board, I drill the holes. I have found that the drill travels less and tends to protect the track below.

Finally you need to remove the toner from the board, this can be done in a number of ways. Nail polish works well, as does a quick scrub under a hot tap with a brillo pad.

PCB Being soldered

PCB Being soldered

The final step is to solder your components and test your board!

Happy Making!