Instructables
Picture of Honey Bee Counter
Where the honeybee's division of labor has stayed on a steady progression for 25 million years... our human superorganism has grown more complex and in all directions... hence the bee counter... By:  thomashudson.org

Live data from - June 25, 2012
I've moved away from live data... my version 2 has an SD card and I'm partnering with a university to do some research... feel free to make your own WIFI enabled swarm detector and I'd love to partner someone that wants to sell them to the masses.



 

Step 1: Manifesto

Picture of Manifesto
IMG_2969.JPG
Bee Counter - Version 2, October 14, 2012
 - micro SD datalogging
 - real time clock turns OFF the counter at night for reduced power
 - decoupled the LEDs from the microcontroller to reduce average power to 6.6 ma when not in use
 - small battery will last for months
 - solar cell power ready
 - unlimited temperature sensors
 - can perform estimates of size of the bee (worker vs drones) and therefore monitor drone/worker activity
 - 3D printed turn-styles or gates
 - for sale complete without battery $400 or make your own (see below)



Here are the specs for Version 1. This instructable details out Version 1 which is easily upgradable to version 2 though I've not provided complete plans.
-  95% Accuracy
-  Runs off USB power
- should be rain resistant with a top cover
-  bees adapt to new opening in a few minutes
- real time monitoring on google docs
- USB connection dumps data onto your laptop text file

Here's the plans to build your own. There are general instructions for prototyping or you can go to the circuit page and copy my exact board and circuit.

1. Buy a couple of infrared (IR) sensors
      - Sparkfun: http://www.sparkfun.com/products/9542
      - Get some 30K 50K and 100K resistors for testing the digital input sensitivity..
      - Get some 10 , 20, and 50 ohm resistors for powering the IR LED

2. Prototype your parts with an Arduino
      - I used a dead bee on a wire
      - its an easy circuit

3. Select a Microcontroller... I used the Teensy ++
      - same user interface as Arduino..
      - has 46 inputs/outputs,
      - its cheap, and
      - designed locally here in Portland..

4. Design your Printed Circuit Board with EAGLE for free
      - i took a 4 hour class at dorkbotpdx.org here in Portland. the software is free.
      - have it printed through dorkbot in Portland $45 for 3 boards
      
5. put everything together
      - solder your components on the board
      - calibrate your sensors
      - fine tune your programming

Rough cost and components for my board ~ $110
Printed Circuit Board $45
- qty(44) QRE1113 IR Sensors $33
- Teensy ++ $24
- resistors and pins $10
- my time $ouch!

Message me if your interested in me putting together a kit as it would probably be $130 if you want to do the soldering and hot glue gunning yourself!
 
Remove these adsRemove these ads by Signing Up
1-40 of 47Next »
hydronics (author) 2 years ago
New York Maker Faire was a blast... thanks all!
IMG_3503.JPG
dzanches2 months ago

Congrats on such excellent work. I also have built by own "stingless bee" counter using Arduino-based stuffs. It performs great when the traffic of bees is low, but when a food source is discovered, lots of bees exit and enter the colony, so they have to stand in line, in a snake-like fashion, waiting to pass through the counting channel so the sensor "thinks" this is one individual, and counts one, instead of 4 or 5 . Have you had the same problem? As a remark I have to add that you cant use more than 5 channels to count stingless bees given their nest entrance is just one or two centimeters in diameter. I really would love to have a foraging force in my colonies like in your video, would make things easier to my counter. cheers

I too am interested in how to discern each bee when traffic is high and they are flooding out. I want to detect swarming.

msubees2 months ago

Thanks for all the instructions....I wonder if I order 6 from you, how much total it would be? thanks! Zach (bees.msu at gmail)

veggy373 months ago

Many thanks for the super quick response.

Let me know the cost of buying a board from you.

veggy373 months ago

I am currently going through trying to build this to a certain degree and experimenting. I have however come up with a couple of issues.

1. there is no bottom solder mask file in the gerber files! should there be one? I am being asked for one when trying to manufacture a board!?

2. not sure if your understanding goes as far as to know if QRD 1114 would be just as good as the 1113 you use, in that I can get these with legs as opposed to the smt version the 1113 is available in?

3. do you have the full schematic in a .sch file as opposed to the .jpg ?

4. I am looking at running it at the hive from batteries, do you have any idea on the current draw of the whole thing?

5. On your original build the 'gates' look like they are made from compressed foam cut into blocks am I close or is there something more suitable. am worried the bees will chew through it in time?

Many thanks, brilliant project!!

hydronics (author)  veggy373 months ago

Hi, I've shared the eagle files on Oshpark here: https://oshpark.com/shared_projects/fX1p64yL. Send me an email if you want more details/cad files, etc.

I also have a couple of boards that I can sell you that I've been hanging on to. The power draw is about 75ma with the current code and schematic. There is a battery discussion below. There could be a lot of improvements. Pulsing it could get you down to less than a miliamp.

The 'gates' are made from ABS. I recommend you 3d print them. You can go to your local Maker or Hacker space and they might help you out.

Digikey has the QRE113 in stock: http://www.digikey.com/product-detail/en/QRE1113/Q... The geometry for the QRD113/114 have closer pins. You'll have to compare the electrical differences yourself.

skm10992 years ago
I and my son built one of these, with just 2 "gates" to try it out, and it works.

There are 2 problems with the idea of powering it from a usb cable.
1. USB cables are usually 6' long, which means your laptop for collecting the data is only 6 feet away from the hive. If you have 110v ac nearby, you can use a powered USB hub and get 12' away from the hive to collect data and for power, but that is still not very far. I've seen a lot of hives in the corners of fields that were hundreds of feet from a power source.

We did some calculations and with 22 gates (44 sensors) an 8-pack of rechargeable "c" cells will last less than 20 hours, which is not nearly enough for observing bees on a daily basis (unless you change the batteries 8 times a week).

USB works for a few sensors, but not 44 of them.
If anybody wants to know, my son (who has several degrees in engineering and related fields) can post the math involved.

putting 4 sensors with one resistor leaves you with only .2 volts of headroom above what the diodes draw at nominal values. There is a chart in the data sheet, figure 8, that shows the forward voltage vs Ambient temperature. Taking the temperature into consideration, say from 0 degrees to 100 degrees F. times 4 (for 4 sensors in series with 1 resistor) you can easily need more voltage than a USB hub can supply.

If you figure adding other things to be powered with this counter, such as temperature/humidity sensors, a readout screen, or anything else, you could be above the power available on even a USB powered hub.

We ended up with a 9v wall wart transformer capable of 1 amp. and calculated that that will work at temperatures from 0 to 100F with power to spare for an lcd screen, etc.

With the 9v wall wart, you get less than 3ma variation between 0-100F. With a 5v USB, allowing for temperature variation you can have about 100 ma variation.

But that links us to an extension cord and 110vac all the time.That may work for some Bee Hives, but probably not a lot of them.

We looked at a car battery, and it worked out to a week of life before needing recharged. Ant then you have to lug a car battery into the field with you to change it out once a week.

Also, when figuring the number of sensors needed, you would have to consider that bee hives comein 2 common widths, a ten-frame hive and an 8-frame hive. The width will be 2.5-3" different, so the maximum number of "gates" will be different.
We have 8-frame hives and using 3/8" width slots and 5/16" spacers between slots, we can get about 19 gates. Certainly enough for the bees, but it changes the power calculations as well as the size of the circuit board.

I was also thinking about the speed necessary to read 44 sensors and update the counts, but my son suggested if we use the atmel commands, instead of the arduino built in port reading, we can read 8 ports at a time, as that is the way the chip reads them--as a byte.

I have an idea for a case that I can make to take care of waterproofing everything, so that shouldn't be a problem.

We still need to find a way to get the data without going up to the hive and plugging something in or removing an sd card.

Has anybody else built one of these, even as a prototype?
hydronics (author)  skm10992 years ago
Hey SKM... nice work. I like where you are going. For my urban backyard bee hive I just leave an old laptop out next to the hive and the bees provide the security :)... The university I supplied the counters to also suggested a remote logger and external battery source. They want to use a Hobo-dattalogger as that's what they currently use though I agree with you that an SD card might do the trick just as good... we've not decided on a direction as of yet. As far as power goes, I measured the power usage around 97ma but if I turn off the USB communication it drops down to 75ma... I estimated that a 12volt 12AH battery will last 12.5 days.
Thanks,
still working on it some more.

I got the SD card modules off ebay for $2.95 each, and small sd cards are about $5 now. There is a library already for writing to an SD card with the Arduino, as well as examble code in the back of the book I bought: "Arduino Cookbook".

There are things to consider in code, what happens when it tries to write to the sd card you just pulled to exchange it, or what you do if you power down to change the sd card, etc. as well as how to make the sd card removable but watertight for during storms.

We did battery calculations too, and came up with shorter times than you did by a good bit. I don't know who is closer to actual battery life, lots of variables, but it seemed from the data sheets that your estimated battery life is close to maximum.

It also seems from the data sheet that 1 millimeter is a good sensitive range from the sensor and it looks like the bees might have more than that amount in height in the prototype, but it could be just optical illusion.

What dimensions did you use for the gates, and what width for the blocks? We figured .312 for gates and .375 for blocks for calculation purposes. And our hive is an 8-frame instead of a 10-frame, so that affects our total width. We went with 8 wide so the full supers don't approach 100 lbs in weight when full for harvesting.

How many sensors were in the unit that gave you 75ma draw?

Thanks for the link to the hobo-datalogger, I'll check it out. What University were you supplying? Do you know what they were using them to research?

If I wanted to send you a file, where would I send it?
SKM
smitchel at bnin dot net
hydronics (author)  skm10992 years ago
I think you are correct, that an SD card would be a better fit for the University. They wanted to use a HOBO but why not just incorporate the SD card into the microcontroller and call it good. Here is a link the the one that fits the Teensy++.  I might build one for my self too.

I was thinking the better option for the backyard bee keeper.. would be to incorporate a swarm alert email... for this to work I thought it would be nice to use a WIFI card... maybe something like this: https://www.sparkfun.com/products/11049

 
 The hardware is easy but the software takes a bit more thinking... I'm just not too interested in designing a complete product for sale. Sounds like a lot of work. I'd like to partner with someone who might be interested in this route.

The power measurements were done with all 44 sensors running. it measured higher amperage when the USB communication was running.
Hi Thomas,

To be honest you really have the best cool idea. I salute you creativity...

I not much a software guy. Sure like the sound of it using WIFI. Can I ask you some question as following:-

a) why you do using Arduino Mega 2560 you can pot a WIFI Shield more easy and simple?

b) Why Teensy++ it is better then Arduino.

About the partnering, I may help you. Could drop me email tsang.waimeng@gmail.com. we can further discuss from there. Hope to hear from you soon. Warmest Regard Tsang
Kelly021 year ago
Amazing! Nice work!
milw1 year ago
did you or skm1099 find any collaborators? I'm getting my first bees soon and am interested in potential business development.
milw1 year ago
did you or skm1099 find any collaborators? I'm getting my first bees soon and am interested in potential business development.
_bio1 year ago
Is there any change on the PCB / linked Gerber file in Version 2.0, I think there may be one if you talking about decoupled LEDs? Is this layout also downloadable?

Is the worker vs. drone recognition only done by the speed switching the two IR sensor? That means that the bees past the two gates by a average constant speed. Did you see this in the previous data? Interesting!

May you post the modified code for version 2 with bee type recognition. Is there also a 3D printing file for the gates downloadable?
hydronics (author)  _bio1 year ago
I added the STL file for the 3d print. I wasn't able to upload the sketchup file but I can send it to you if you message me.
hydronics (author)  _bio1 year ago
Hey, just messaged you. the worker vs. drone recognition is definatily a good bet at this point because it is still winter and I've not fully tested the programming... you are correct they'll be a speed test. There are two sensors so I could use the distance between the sensors to measure speed or just estimate... (right now i'm just estimating)..

I can send you the 3d gate file. send me an email that I messaged you. -tom
JensonBut1 year ago
This is very interesting and a bit strange but still very interesting something worth researching guess I'm gonna need to conduct my own study
hydronics (author) 2 years ago
I was at the min-maker faire Victoria last weekend... so much fun. Have you ever brought your project to a mini-maker faire? It is so much fun!
mini Victoria 2.JPGmini Victoria1.JPG
slobak2 years ago
This is awesome! Definitely going to think about trying this. Thanks so much for doing all the research and writing it up.

Has anyone figured out a way to track where your bees are foraging?
dotbaz2 years ago
This is great!

I had a go at doing this but not so good with hardware, so now working on a version tracking bees in the vicinity of the hive with a video camera - first results here: http://www.youtube.com/watch?v=o3a1_6tIAvA.

I might just build this now....

Cheers. Barry.
beePath-0023.jpg
skm1099 dotbaz2 years ago
Hmm. We have Yellow Jackets that actually land on the front of the hive. They don't go in, but are looking for any spilled sugar-water from the quart size hive feeders that sit on the from of new hives. When I last had the suit on and was checking them, we also have a few flies buzzing around the front of the hive that would be in the field of view of a camera.

I was wondering if the video method you use has a way of checking that it is counting actual bees, or is it counting flying insects?

Great video and congratulations on getting the video counting/tracking going.

It looks like you know some about web cams, I have wanted to put one inside the hive, but the problem is the focus. It would have to focus a couple of inches in from of the lens. Do you know any way to get an ordinary webcam to focus that close?

dotbaz skm10992 years ago
Currently it only looks for objects, but part of the calculations are to work out the ovalness of each bee. I think flies would look to be round all the time so it could be modified to weed them out I guess.

Don't know much about webcams but I'd think the problem you'd have would be light levels. To focus maybe try getting some old reading glasses and use one of those lenses in front.

You might want to look at these sensors http://www.omega.co.uk/ppt/pptsc.asp?ref=OM-EL-USB-1&Nav=dase01 just drop it in the hive and leave it! I believe the internal hive temperature is supposed to be kept at about 33 degrees centigrade, so might be a boring trace!

Cheers. Barry.
hydronics (author)  dotbaz2 years ago
that's so cool... are you using computer vision? what flavor... have you tried to convert the to number? I'm sure there is a correlation between the number of bees tracked and activity... but its pretty cool weather you get any data out of it or not...
Thanks!

I wrote it from scratch in c & perl using a c jpeg library to decode each frame. Haven't yet counted them, as I'm currently debugging a bit to follow the bee traces when they overlap.

Keen to build one of your counters. Cheers. Barry.
skm10992 years ago
The queen is much larger than the drones or worker bees. So much so,that she cannot fly while she is "laying", so the only time she would leave the hive (by flying) is during swarming, which bees do on occasion and can usually be avoided by adding a super on top of the hive, if during regular inspections you find they have filled up the existing space.

The queen's size is so different from every other bee in the hive that they sell a separator, a plate with a grid of holes, which bees fit through but queens cannot, that you put between the 2-3 supers that the colony needs to have full of honey to overwinter and the upper supers, where the honey will be stored (and that you harvest), so that the queen will not be laying brood in the area that you intend to harvest honey. I mention that to point out that how predictable the size of the queen is, and so much different than the resat of the bees. They are about double the size of regular bees.

So unless you make the gates big enough that a couple of bees can fit through (messing up your count), the queen won't fit anyway!

I'm going to make a couple of these, but I want to use a stand alone Arduino board, and also hook up temperature, humidity, light level, and maybe any other sensors that will tell me about conditions in the hive. Audio would be great if someone could show me how, as the pitch of the "humming" inside a hive tells what they are doing, i.e. they make a certain sound sound a week or two before swarming. If you know, you can act to prevent swarming and add a super. This was documented in a patent application as far back as the early 1950's.

An idea for an output more useful than an external display is to make it accessible by a cellphone.
This would be more useful as you might want to observe bee activity by the hour of the day, comparing to sunlight/cloud cover patterns of that day, so you might want a simple web interface to send the data to a nearby wifi network, like your house, to collect the data. Or use an SD card (on ebay for $5 or less) and write hourly data to that.

With the wifi boards available for the arduino, you could give your counter an IP address and check in on traffic, etc from an internet-enabled phone like the Nokia N900 without ever having to approach the hive.

That will take more power, so maybe add some more (AA or 9v)batteries to keep the runtime up into weeks instead of days.

I would like to collaborate with others who are building these now. I have some ideas for a case to keep things watertight, yet well enough attached that storms or skunks won't dislodge it.

skm
smitchel@bnin.net
hydronics (author)  skm10992 years ago
nice... can't wait to see what you come up with...
I wonder if it is possible to detect if a "marked" queen leaves and returns using this system.
hydronics (author)  boggystudios2 years ago
Yes! we could probably brain storm a few options to accomplish this... maybe version 2.0... I've heard of this but just saw this article today on tagging bees... http://www.rfidjournal.com/article/view/8466
RFID Bee.jpg
The ones that come with our nucs have some white paint on their back so I figured it would reflect more IR light back to the sensor. If it does then a little bit of testing and software adjustment could possibly accomplish this.
hydronics (author)  boggystudios2 years ago
yes, the white paint would definitively increase the reflection of IR as these sensors are incredibly responsive to color... Right now I have them set up as digital inputs without the fancy response mechanism that Polulu and sparkfun have built into their DI sensor boards (extra capacitors to sense distance)....one issue is if the queen passed through the gate upside down the bit of white would be facing the wrong way...
http://ohioline.osu.edu/hyg-fact/2000/2162.html
diy_bloke2 years ago
The sparkfun circuit is inherently different fro yours as the former seems geared to measuring the RC time for response while yeras is more of a voltage divider. Might ineed need to fiddle a bit with the resistor to make a digital signal from what could be considered an analog signal.
Wondering how you dealt with bees hovering in the entry, or is that in that 5% error margin?
hydronics (author)  diy_bloke2 years ago
Yea, bees do hover a bit from time to time and I had to tweak the code to keep them from double counting... yea you're right the sparkfun DI is pretty fancy as mine is pretty dumb but super effective... I think they use these sensors a lot in copy machines to tell where the paper is...
i love to see projects that combine tech with nature :) thanks for sharing this one.
got a little suggestion here, hope you don't mind... :P
the miss-count can be a results of a bee triggering one sensor then changing it's mind and backs-up. can bees walk backwards? :)

if a bee can trigger both sensor simultaneously, you might like to wait for this state, before increasing the ins/outs. something like:
if(lai=1 && lao=1)
{
if(ai=0 && ao=1)
ins++;
if(ai=1 && ao=0)
outs++;
}
can't test it but in theory it may offer a greater accuracy.
hydronics (author)  axodus2 years ago
They don't actually simultaneously trigger.. That said the loop is so fast.... I need to de-bounce the trigger a bit but it works pretty darn good as is... I'm pretty sure we'll be better than 95%... The guard bees do wonder but they're so over shadowed by the volume... Data is comming soon!
omnibot2 years ago
This is really cool!
If you could weigh the hive at the same time you could graph almost every aspect of the bees work and even predict production and determine health and activity of the hive over a year. This could be seriously scientific.
hydronics (author)  omnibot2 years ago
Sounds good... Go ahead... Version 2.0 is all you!
Foxtrot702 years ago
Excellent Work! Great idea forcing the bees to pass thru a divider gate system with IR sensors at both ends to track departure and arrivals. Hmmm...sounds like an airport concourse! LOL.
1-40 of 47Next »