Arduinos, Bees, and tweeting Oh My!

Some time ago while sitting through an all-day meeting Kate Dahlhousen and I went 90 degrees to the topic at hand and decided that there wasn’t enough data on bees. In an effort to rectify this situation I’ve built a beehive datalogger using an Arduino and some fancy sensor bits to try to work out some details on what bees do in addition to being busy.

Goals:

Getting visibility into the behavior and internal conditions of a hive has been documented from early on in modern beekeeping. Dunham’s 1926 paper shows how bees can regulate the temperature of a hive to within tight tolerances, and provides references that show how a hive will cluster together in the winter months to keep the internal temperature at ~95deg F. More recently the availability of inexpensive sensing and processing hardware has spawned a bunch of interesting experiments with people wiring up beehives and getting an idea of what is going on in the hive without having to deal with 40K angry residents. The OpenEnergy Bee monitor project and Beehacker site have done interesting environmental monitoring projects inside hives, showing how a large volume of data about the colony can be collected without continual interruptions/intrusions into the hive.

Expanding on these ideas, I’ve added a number of temperature and humidity sensors in the hive that will allow a better spatial understanding of the temperatures in the hive – with 10 sensors in the bottom hive body and 4 in the top I’m hoping to be able to spatially map out where the colony is clustered over the course of the winter.

Hardware:

Temperature Sensors: I’m using DS18B20 temp sensors from Maxim – these temperature sensors are cheap, small, accurate to 0.5deg C and well supported on most microcontroller platforms. The hive has 15 of these set up on a common bus, reading all 15 only takes 1 digital pin on the Arduino.

Humidity: The hive has two HIH4030 humidity sensors for sensing the humidity in the colony and outside the hive. There is also a HIH6130 combo temp/humidity sensor mounted to the Arduino datalogger for monitoring conditions within the hardware enclosure.

Hive Weight: There’s a Flexiforce resistive force sensor set up under one corner of the hive to measure the relative change in hive mass over the summer. I’m hoping to use this data to predict how much honey will be available come fall harvest.

Time: When logging data, it is important to know what time your measurements were taken at. I had a spare Chronodot lying around* to add to the project – this is an environmentally compensated super accurate real-time-clock that is battery backed and will give time data in a variety of formats.

*Imagine, a handfull of battery-powered super accurate RTCs… you could have some in a box hidden away up at some high elevation, and another reference set down at low elevation…..

Brains: I’m using two Arduinos to do the heavy lifting of grabbing the data and publishing it out to the web. One Arduino manages the sensors and handles datalogging using Sparkfun’s SD shield and a Prototype Shield. This ends up being a bit of a wiring mess, and the libraries/code necessary to grab the data from the sensor network uses most of the available program memory for the Arduino. Schematically the BeeDuino looks something like this:

Beeduino_layout

A second Arduino is used to handle communications to the outside world using a WiFi Shield. The two communicate over a serial port using Bill Porters EasyTransfer library.

Hiveware:

Arranging all this stuff into a packed hive took some planning. The temperature probes are set up in two groups – 10 on the bottom hive body (as that is where the bees will likely spend most of the winter) with another 4 available for the top body, and one last sensor for external temperature measurements. The temperature sensors were attached to three frames (imaginatively labeled A, B, and C) using beeswax.

IMG_5426

The A frame has 4 temp sensors, arranged at the center, top, and bottom of the frame, and one located in the center of the frame about 1/4 of the span across the frame towards the front of the hive. The B and C frames have the same layout, without the bottom sensor. The temperature probes and wires were stuck down and encapsulated in melted beeswax, it will be interesting to see what the bees do to the probes over the long term – I hope they don’t un-mount them and dump them all out the front of the hive!

TL;DR – What’s it do?

The datalogger (Beeduino) and communication Arduino (Tweetduino) are set up in the hive currently logging data every 5 minutes. When the Beeduino is done writing a dataset to the onboard SD card it transfers a subset of the data to the TweetDuino, which then proceeds to spit the data up on Twitter. I’m currently struggling with getting reliable tweets, however once that is sorted out I’m hoping to have a live graph of the current and historical hive temperatures available on this page.

In the next post I’ll go over the Arduino software running the whole mess.

1 thought on “Arduinos, Bees, and tweeting Oh My!

  1. Pingback: A first snapshot of hive activity! | Giantkillerrobot's Blog

Leave a comment