A Digital Beehive: A scientific study proposal.

I'm a senior undergraduate biology student at Fairmont State University (Fairmont, WV). My adviser has been keeping bees (currently the State Beekeeper of the Year) and doing scientific studies with them for years. He has just presented a study where he has been gathering and logging the weight of a hive for two years straight, logging every 10-30 minutes the weight of the hive (changed after first year to 10 minutes from 30 minutes). It has raised some questions that we think further data collection would answer.

We want to be able to collect weather data in real time. I'm looking at the USB Weather Board from SparkFun combined with the ARGENT Weather Sensor Assembly 80422. The board allows you to connect an external light sensor so the TEMT6000 Breakout Board also from SparkFun would be good so that the main board can be protected under the shelter of a roof that protects the hive and scale.

This sensor pack would let us log:

  • Wind Speed
  • Wind Direction
  • Rainfall
  • Barometric pressure
  • Relative humidity
  • Ambient light
  • Temperature

We also want to incorporate a counter that will count the number of bees leaving and entering the hive, which is outlined at: http://www.instructables.com/id/Honey-Bee-Counter/

A further metric is that by internal monitoring of the hive temperature you can estimate brood size (amount of new bees being raised). This requires a HUGE amount of temperature sensors to be installed within the hive. Here's where the feasibility problem and issues comes in. I'd be looking at the temperature sensor Texas Instruments TMP275 which allows for up to 8 sensors to be tied together within a bus. If we go with 8 sensors per frame, 10 frames per box, we'd be looking at 80 sensors per brood box, and the hive can eventually have 3 or 4 brood boxes once mature. So 240 to 320 temperature senors would need to be captured from 30 to 40 data buses each with 8 sensors.

Logging the weather data seems pretty straight forward and the bee counter project seems straight forward (the author of that project is onboard to help us implement the counter as well). But logging all that data for estimating brood size can be a big deal I think.

A similar project for estimating brood size was done at this site: http://mietz.imkerforum.de/ and the author used custom hardware and a ATMEL board that he designed. Does anyone know of a way to implement this kind of mass-sensor data into Arduino(s) and get it all collected back at a central computer?

Everything will need to be timestamped according to the time on the central data logging computer, connection can be made by Ethernet, or any other method, we're going to have to run more wires from the house to the hive for this project anyway. Currently just a single serial cable is run from the house to the hive along with power for the digital scale.

Any help would be appreciated, we're pretty novices when it comes to this stuff and ultimiately this is for scientific research so we're going to want the design to be robust and redundant as possible. ;-)

But logging all that data for estimating brood size can be a big deal I think.

Simple multiplexing setups using inexpensive chips probably could be used to sequentially get input from the sensors. The collected data could be sent to a pc or server that is running a data base. Have you done any testing on your project parts yet?

Haven't purchased anything yet, once we have a firm plan we can proceed to that stage. Purely exploratory at the moment, also need to write a grant proposal here in next week or two as well.

The DS18B20 temperature sensor has the same specs as the TMP275 but you can have around 120 of them on the same OneWire bus (subject to correct provision of power). That might cut down on the amount of wiring and interfacing to a CPU that would be needed compared to the TMP275.

Pete

It would be easier, yes, but there's a significant difference in cost

http://www.digikey.com/product-detail/en/TMP275AIDGKT/296-19883-2-ND/1120754 would be about $1.31 a sensor, where http://www.digikey.com/product-detail/en/DS18B20U%2B/DS18B20U%2B-ND/1017603 is about $2.90 a sensor... Or the TMP275 would be $104.8 a brood box, where the DS18B20 would be $232 a brood box. That price difference is kind of a deal breaker I think. Ideally if there was a cheaper sensor we could use we'd use that. The TMP102 can only chain 4 at once I think, and is about $1.07 a sensor ( http://www.digikey.com/product-detail/en/TMP102AIDRLT/296-22055-2-ND/1649871 ) but the difference there of 24 cents a sensor for double the sensors on a line is probably worth it and the package for the 102 would be A LOT harder to deal with soldering, lol. ;-)

kasslloyd: It would be easier, yes, but there's a significant difference in cost

http://www.digikey.com/product-detail/en/TMP275AIDGKT/296-19883-2-ND/1120754 would be about $1.31 a sensor, where http://www.digikey.com/product-detail/en/DS18B20U%2B/DS18B20U%2B-ND/1017603 is about $2.90 a sensor... Or the TMP275 would be $104.8 a brood box, where the DS18B20 would be $232 a brood box. That price difference is kind of a deal breaker I think. Ideally if there was a cheaper sensor we could use we'd use that. The TMP102 can only chain 4 at once I think, and is about $1.07 a sensor ( http://www.digikey.com/product-detail/en/TMP102AIDRLT/296-22055-2-ND/1649871 ) but the difference there of 24 cents a sensor for double the sensors on a line is probably worth it and the package for the 102 would be A LOT harder to deal with soldering, lol. ;-)

http://www.mouser.com/Sensors/Temperature-Sensors/_/N-7gz50/?Ns=Pricing|0

I'm more wondering about the effects of so much wire and current in the home of animals that detect EM fields given off by flowers. But your prof with all his years of study would know the answer to that.

It's a good question, bees do perceive electrical currents. This study (http://onlinelibrary.wiley.com/doi/10.1002/bem.2250090310/abstract) found that there was no adverse affects to bees exposed to VERY high electric fields when dry, and adverse when wet (i.e. actually getting shocked). We're dealing with quite low currents here with these sensors, so the electromagnetic field would be very small in comparison to the one used in that study. It's certainly a good question that requires study I think...

Mouser's pricing isn't really any better for these chips, so I'm not sure why you linked? Do you have suggestions for other high precision (0.5C+-) sensors that can be multiplexed onto the same data line? We're dealing with potentially hundreds of sensors, so they have to be multiplexed somehow. ;-)

I was looking at the ones in the 1 to 2 deg C accuracy range able to detect change down at 1 deg... for 26 cents in singles, less in qty. Throw in a few high accuracy units right next to some of the cheap ones, for calibration, and you might fit your budget.

Is there example circuits on how to multiplex MANY of these cheap sensors, any that use 2-wire or 1-wire seem to be a lot more expensive?

The below multiplex chips might be worth a look.

https://www.sparkfun.com/products/9056

http://www.mouser.com/ProductDetail/Texas-Instruments/CD74HC4067E/?qs=sGAEpiMZZMtxrAS98ir%252bs43QrNr9Atf58JTtFNZl5tQ%3d

In my unlearned noob mind would this be possible? Daisy chain devices, have one main chip, that then branches of for each hive box, then 1 chip per hive box, that branches off to each frame (10 per box), then one chip per frame, that branches off to each sensor in the frame, and each would be addressable and I can cycle through them all getting a specific reading for specific sensor and know what sensor I'm reading at any time? If this is the case I can probably use MUCH cheaper chips.... would need help getting a proper wiring schematic and coding it in the arduino but yea...

Arduino ---Chip(main)---Chip(main:h0)---Chip(main:h1:f0)---Chip(main:h1:f0:s0)
                       |               |                  +Chip(main:h1:f0:s1)
                       |               |                  +Chip(main:h1:f0:s2)
                       |               |                  +Chip(main:h1:f0:s3)
                       |               |                  +Chip(main:h1:f0:s4)
                       |               |                  +Chip(main:h1:f0:s5)
                       |               |                  +Chip(main:h1:f0:s6)
                       |               |                  +Chip(main:h1:f0:s7)
                       |               |
                       |               +Chip(main:h1:f1)---Chip(main:h1:f1:s0)
                       |               |                  +Chip(main:h1:f1:s1)
                       |               |                  +Chip(main:h1:f1:s2)
                       |               |                  +Chip(main:h1:f1:s3)
                       |               |                  +Chip(main:h1:f1:s4)
                       |               |                  +Chip(main:h1:f1:s5)
                       |               |                  +Chip(main:h1:f1:s6)
                       |               |                  +Chip(main:h1:f1:s7)
                       |               |
                       |               +Chip(main:h1:f2)---Chip(main:h1:f2:s0)
                       |               |                  +Chip(main:h1:f2:s1)
                       |               |                  +Chip(main:h1:f2:s2)
                       |               |                  +Chip(main:h1:f2:s3)
                       |               |                  +Chip(main:h1:f2:s4)
                       |               |                  +Chip(main:h1:f2:s5)
                       |               |                  +Chip(main:h1:f2:s6)
                       |               |                  +Chip(main:h1:f2:s7)
                       |               |
                       |               +Chip(main:h1:f3)---Chip(main:h1:f3:s0)
                       |               |                  +Chip(main:h1:f3:s1)
                       |               |                  +Chip(main:h1:f3:s2)
                       |               |                  +Chip(main:h1:f3:s3)
                       |               |                  +Chip(main:h1:f3:s4)
                       |               |                  +Chip(main:h1:f3:s5)
                       |               |                  +Chip(main:h1:f3:s6)
                       |               |                  +Chip(main:h1:f3:s7)
                       |               |
                       |               +Chip(main:h1:f4)---Chip(main:h1:f4:s0)
                       |               |                  +Chip(main:h1:f4:s1)
                       |               |                  +Chip(main:h1:f4:s2)
                       |               |                  +Chip(main:h1:f4:s3)
                       |               |                  +Chip(main:h1:f4:s4)
                       |               |                  +Chip(main:h1:f4:s5)
                       |               |                  +Chip(main:h1:f4:s6)
                       |               |                  +Chip(main:h1:f4:s7)
                       |               |
                       |               +Chip(main:h1:f5)---Chip(main:h1:f5:s0)
                       |               |                  +Chip(main:h1:f5:s1)
                       |               |                  +Chip(main:h1:f5:s2)
                       |               |                  +Chip(main:h1:f5:s3)
                       |               |                  +Chip(main:h1:f5:s4)
                       |               |                  +Chip(main:h1:f5:s5)
                       |               |                  +Chip(main:h1:f5:s6)
                       |               |                  +Chip(main:h1:f5:s7)
                       |               |
                       |               +Chip(main:h1:f6)---Chip(main:h1:f6:s0)
                       |               |                  +Chip(main:h1:f6:s1)
                       |               |                  +Chip(main:h1:f6:s2)
                       |               |                  +Chip(main:h1:f6:s3)
                       |               |                  +Chip(main:h1:f6:s4)
                       |               |                  +Chip(main:h1:f6:s5)
                       |               |                  +Chip(main:h1:f6:s6)
                       |               |                  +Chip(main:h1:f6:s7)
                       |               |
                       |               +Chip(main:h1:f7)---Chip(main:h1:f7:s0)
                       |               |                  +Chip(main:h1:f7:s1)
                       |               |                  +Chip(main:h1:f7:s2)
                       |               |                  +Chip(main:h1:f7:s3)
                       |               |                  +Chip(main:h1:f7:s4)
                       |               |                  +Chip(main:h1:f7:s5)
                       |               |                  +Chip(main:h1:f7:s6)
                       |               |                  +Chip(main:h1:f7:s7)
                       |               |
                       |               +Chip(main:h1:f8)---Chip(main:h1:f8:s0)
                       |               |                  +Chip(main:h1:f8:s1)
                       |               |                  +Chip(main:h1:f8:s2)
                       |               |                  +Chip(main:h1:f8:s3)
                       |               |                  +Chip(main:h1:f8:s4)
                       |               |                  +Chip(main:h1:f8:s5)
                       |               |                  +Chip(main:h1:f8:s6)
                       |               |                  +Chip(main:h1:f8:s7)
                       |               |
                       |               +Chip(main:h1:f9)---Chip(main:h1:f9:s0)
                       |                                  +Chip(main:h1:f9:s1)
                       |                                  +Chip(main:h1:f9:s2)
                       |                                  +Chip(main:h1:f9:s3)
                       |                                  +Chip(main:h1:f9:s4)
                       |                                  +Chip(main:h1:f9:s5)
                       |                                  +Chip(main:h1:f9:s6)
                       |                                  +Chip(main:h1:f9:s7)
                       |
                       +Chip(main:h1) (and so on, for h0-3 for 4 hive boxes)

kasslloyd: Is there example circuits on how to multiplex MANY of these cheap sensors, any that use 2-wire or 1-wire seem to be a lot more expensive?

The real cheap ones are completely analog and they might not be accurate enough for your needs. You can arrange many to connect to the same analog pin and have a different digital pin to power each of those in turn, one at a time. You will have some problems and need to calibrate daily if not more often. For 100 sensors you will need 1 or 2 AVR chips if not more, you want short runs from sensor to A/D pin. I can buy 10 of those sensors for less than $3.00 not counting shipping.

What a shame you can't just get your data from an IR camera, and I don't mean near-IR.

Yourduino wants $1.50 for a single DS18B20. Want to bet Terry King would give you a volume discount on 100+? http://yourduino.com/sunshop2/index.php?l=product_detail&p=134

Ya an IR camera would be nice, but due to 10 frames packed in a box with only like an inch or less between them, not really possible. ;-)

Not a bad price, through hole would be easier for a noob like me to solder but also bigger component to deal with and interfering with the bee's hive building area... good price too, and if he'd offer a good discount (donate to science? lol), then we'd be set.

The project I'm getting my idea from used custom ATMEL board and code, which he's willing to share the plans and code with me. So I think that's looking to be the more attractive method now, although I need to build multiple of the boards for redundancy purposes. Arduino would be nice since it's a standard board that you can quickly get replacements for.... He used the TMP275 so I'd probably be stuck with that chip unless he'd be willing to recode/design the whole thing. ;-)

1-wire with the DS18B20 sounds nice though, probably a ton easier to design and wire up.

1-wire is slow so only so many per 1-wire/1-pin. Good news is that several such wires could be monitored by 1 AVR chip.

If anyone who is good at circuit design would want to try to outline circuits for this with the 1-wire DS18B20 sensors, and a viable way to control up to 4 of these boxes, and address each temp sensor. Data doesn’t need to be collected VERY fast, maybe once per 10 minutes would be more than enough for our purposes.

Here’s a quick image I threw together in Illustrator if you’re not familiar with the terms, a frame is what the bees build their honey combs on, there will be two circuit boards imbeded in it horizontally to put 8 temp sensors evenly spaced throughout the honey comb space in the frame. A frame box holds 10 of these frames. The brood area can be say 4 boxes in size so we’d need the ability to add a box or remove a box at any time throughout the season. Ideally if there was a way to give a box/frame a unique ID number that would also be recorded as well would be wonderful, probably require some other chip embed into each frame/box, but that would net the best trackable data, so we’d know for sure we’re tracking the same frame throughout the entire season.

You could put the ID into the AVR program as data and have a function to "print it out".

I believe that Afremont has practical experience with DS18B20's. He certainly does with 1-wire.

If it was me, I'd have the sensors in each frame with a molex connector to one AVR per box.

Probably have to be something smaller than molex, the frames dimensions are not exactly huge. There would be enough area on the top to carve out and put a circuit board in and then epoxy it in to seal it off from water and secure it… A frame top is 1 1/8" wide and 17 5/8" long. The circuit would need to be pretty skinny to fit embed into the top. Attached is some dimensions of hive boxes and frames. For the brood chambers we’d be using the large size (9 1/8" deep frames).

(here’s a source to help understand a hive construction: http://www.beesource.com/resources/usda/types-of-hives-and-hive-equipment/ )

Oops, I thought an AVR per frame… per box is more reasonable. Any good way to give a frame, regardless of which box/position it’s plugged in a unique ID that is readable along with all the sensors on that frame?

It seems 1-wire devices include a unique ID with them, if that's the case if theres 8 1-wire temp sensors per frame, then if you can pull that unique ID then a unique ID could be generated for the whole board by using those 8 ID's of the chips? Is this feasible?

If that's not doable then maybe this chip: DS2401 it's specificly designed for 1-wire to provide a unique ID, http://pdfserv.maximintegrated.com/en/ds/DS2401.pdf

It seems 1-wire devices include a unique ID with them, if that's the case if theres 8 1-wire temp sensors per frame, then if you can pull that unique ID then a unique ID could be generated for the whole board by using those 8 ID's of the chips? Is this feasible?

Entirely. I'd go with the ID of the 1st device since it's unique and likely 8 bytes or more.

Have you PM'd Afremont?

Here's a USB business card that uses a surface mount ATtiny85, just so you have an idea of size.

http://www.frank-zhao.com/cache/usbbusinesscard.php

The Tiny85 is 8 pins of what the 328P is 28 pins. The surface mount versions are all thin.

The DS18B20 is a bit bigger than a match head. They can be made right into a thin cable.

You could take through-hole AVR's, bend the legs out to the sides and connect the ones you need with female jumpers or female crimp connectors on wires. Solder if you dare, use heat-shrink if you don't. You don't need a board. You only need power, ground, a bypass cap, and whatever pins connect to your sensors. You don't need 16 MHz external crystal either, you can run on the internal 8 MHz oscillator and divide that down to use less power. Epoxy that, it won't be 1/2" thick.

Yea I sent a PM.

If its just an AVR per box, then it’s size is irrelevent, since it can be outside of the hive, just put a connector on the outside of the box that goes in to connect to each of the frames. Then the AVR for the box can be safely mounted outside. If it’s per frame, then that will need some tiny chips, which would be an issue I think. :-\

There will need to be a way for the AVR to tell each frame apart, without any mixups, even if the order of frames change.

I would then assume the AVR’s for the boxes would then connect to an Arduino that will read via a serial line the temp data out? Or, we could just actually burn the Arduino patform onto individual AVR’s per box, then connect all those back up to the central computer and write a simple program that reads out the temp data every 10 minutes and saves it as a CSV, that would be the ideal?

We could run several Cat5 cables from the hive back into the house, then put individual serial lines on those wires, then connect it all up via USB-to-Serial connectors inside, then a small program to read out those datas and write to a CSV… nothing complex here, just needs to be stable ;-\