Introduction: Honey Bee Counter II
3/18/2020 - new instructable... https://www.instructables.com/id/Easy-Bee-Counter/
12/21/2019 The project that doesn't die!... I've made a few updates to this design. Just finishing up this design but wanted to start pushing this out. This version of the bee counter is all through hole components. I really wanted to make a kit that was easy to assemble for folks just starting out.
https://www.instructables.com/id/Easy-Bee-Counter/
This is an old project... please see the link above for the latest designs.
Hello, I've made this project easier to build, data log, and post data. This bee counter like the last design counts bees going in and out through twelve gates.
We've teamed up with some new researchers and business owners to provide bee metrics. You can reach me at Thomashudson.org.
.... and we're still interested in helping you build your own bee counter and this new design allows you to add dattalogging, connect to ethernet, wifi, or cellular. It also makes it easy to protect your most sensitive electronic parts..
Step 1: What You Need
What I like about this project is you can build it in pieces as you get comfortable with the parts...
You need a uController... say an Arduino
You need the bee sensor board:
Printed Circuit Board via Oshpark $19 for 3...
Qre1113 reflectance sensors (24 sensors for 12 gates) $10.08
Shift registers qty(3) $1.08 74HC165
pull down resistor array 100k qty(3) $2.04 100k resistor array
resistors LED qty(1) $0.68 47ohm resistor array
Headers qty(13) $5.85 six pin headers for the gates!
Extras
you need some plastic or wood pieces to surround your bee counter
you might want an ethernet, wifi, or data logging shield to log data
a plastic enclosure for your ucontroller
Step 2: How It Works - Electronics
Each gate has two QRE1113 sensors. When a bee is present, reflected IR light triggers the IR sensor HIGH and the shift register reads HIGH. Otherwise the 100K resistors pull the IR sensors low (to ground).
This design uses 3 shift registers. Each shift register can read 8 sensors or 4 gates for a total of 24 sensors and 12 gates. The shift registers continue to track the presence of bees and determines which way the bee is going.
Only one led from each sensor is used; such that, one IR LED provides enough light for reflectance to trigger both IR receivers when a bee passes under one. This reduces parts and simplifies the board.
The parts list for the main board is as follows:
Costs Per Board $6.5 via oshpark
Qre1113 reflectance sensors (24 sensors) $10.08
Shift registers qty(3) $1.08 74HC165
resistors 100k qty(3) $2.04 100k resistor array
resistors LED (47 or 100) qty(1) $0.68 47ohm resistor array, 100ohm resistor array
Headers for gates qty(13) $5.85 six pin headers
You connect the bee counter to your Arduino with five wires.
VCC=> 3.3V or 5V (for 3.3 volts use 45ohm LED resistor and for 5volts use 100ohm LED resistor)
MISO - master_in_serial_out, connects to QH
SCK - clock
Load - Parallel load pin
Gnd - ground
These are very standard connections for reading shift registers. Here is the classic button example from arduino
You may notice that I've broken out the VCC for the IR LEDs. This is done if you want to pulse (PWM) the LEDs and save on power.
Step 3: Soldering... Putting the Parts on the Sensor Board
Ok, brace yourselves... This is a great project to learn surface mount soldering!
All the parts are surface mount accept for the gates. The gates are made from 6 pin headers. You need to cut the middle 4 pins. Only the two outside pins are soldered.
There are a lot of surface mount soldering tutorials out there...but all you need for this project is:
- a soldering iron with a semi-fine point
- some flux... not sure where the best place to source this is now... I use a pen.
- some solder
- maybe a solder wick if you get too much solder on your board
- a brass sponge
Once you get everything soldered you can apply power and test your LEDs using a camera. Remember we only are powering one of the two LEDs so you will only see the the LED closest to the center lit up.
Solder the V2 jumper (labeled VCC) if you don't want to control V2 separately. Per the schematic, V2 allows you to control the LEDs independently. This might be useful for PWM of the LEDs. I've not tested this yet but it should work to reduce power.
Step 4: Hooking It Up and Getting Data
Before you get data... and even before you solder your gates on... I suggest testing your sensors with this easy shift register code.
pload Pin = 5; // Connects to /PL aka Parallel load aka latch pin the 165
dataPin = 6; // Connects to the Q7 aka MISO pin the 165
clockPin = 7; // Connects to the Clock pin the 165
plus VCC and GND.
I use a piece of white paper and slide it about 3-5mm over each sensor. The IR light will hit the sensor and reflect back into the receiver and trigger a 1 on your test code above.
Once that code is tested with your sensors you can try to save the data to an SD card... send it to your serial monitor, or post it to a webservice. You then need to come up with some simple data to COUNT BEES! This can be as simple as an if then statement. If the IN sensor is triggered first, followed by the OUT sensor ... you know the bee was going OUT. If the OUT sensor is triggered first, followed by the IN sensor is triggered, you know the bee is going IN. I can expand upon this code but it quickly becomes application specific.
I posted code here: github
Step 5: Bee Counter Enclosure
You need two enclosures. You need to wrap your bee counter in thin wood or 1/8" plastic. Then you have an ~18" cable from the hive entrance to your uController. You need an enclosure for the uController too.
I used ~3/16" pieces of plastic for the top of the bee counter and 1/16" at the bottom. I got this from the scrap bin at Tap Plastics. You want your top piece sturdy enough to overhang your entrance by 1" to stop direct sun light from triggering your sensors. The bottom of your bee enclosure must be black or painted black so it doesn't inadvertently reflect IR back into your sensor even though the spec sheet says the range is only ~1/4".
Also, I learned DON'T USE SILICONE. The bees hate silicone and will work feverishly to try to remove it.
The 2nd enclosure can be any water proof box that can house your uController.

Participated in the
Animal Innovations Contest
70 Comments
Question 1 year ago on Step 5
Hello! Thank you so much for posting this. I am working on collecting components to make the build, but the links on many of the electronic components are dead ends. My electronics substitution skills are not good enough to adjust. Would it be possible for you to provide updated digikey links for the following: Thanks!!!
Qre1113 reflectance sensors (24 sensors) $10.08
Shift registers qty(3) $1.08 74HC165
resistors 100k qty(3) $2.04 100k resistor array
resistors LED (47 or 100) qty(1) $0.68 47ohm resistor array, 100ohm resistor array
Answer 1 year ago
this is old... check out the github site... There are a few active participants but I'm a bit too busy right this second!
https://github.com/hydronics2/2019-easy-bee-counter
2 years ago
Hi,
I prepared complete cover for 12 gates.
It is avilable at https://www.thingiverse.com/thing:4803233
I also finished very early version of your project - it works great. Yesterday i started counting my bees :)
Thaknk you so much.
Regards,
Mundo
Reply 2 years ago
That's cool. Thanks for sharing.
Reply 1 year ago
Awesome job! Thanks for sharing.
2 years ago
check out the new easy-bee-counter => https://github.com/hydronics2/2019-easy-bee-counter/blob/master/README.md
Question 2 years ago on Introduction
Just finished building this and ran the Blink_IR_Leads program to test things out. Thinking that I've done something major wrong... Only LEDs 4, 7, 13, 15, 20, 21 & 22 are lighting up. I've checked out all my solder points under a magnifying glass - and they all look good as far as I'm concerned. Any words of wisdom? Thanks,
Dunc
Answer 2 years ago
It's probably a few of those tough to solder surface mount resistors. You should try the easy to solder through hole version -> https://github.com/hydronics2/2019-easy-bee-counter/blob/master/README.md
3 years ago
When I try to open the gerber file I get an invalid file message. When I try to extract it, I get a empty zip file message. Any idea what is going on? Thanks.
Reply 3 years ago
yes... I can't figure out what is going on... I tried uploading multiple times and it gets currupted on download. the easy fix is to download all the individual files and zip them yourself. https://github.com/hydronics2/2019-easy-bee-counter/tree/master/PCB_files/Kicad_v/gerbers
Reply 3 years ago
Ok. I wasn't sure Kicad version was. Guess that will work. Thanks!
Reply 3 years ago
These are the files you need... just zip them and upload them to the board house...
3 years ago
Just finishing up this design but wanted to start pushing this out. This version of the bee counter is all through hole components. I really wanted to make an easy to assemble bee counter for folks just starting out.
https://github.com/hydronics2/2019-easy-bee-counter
Reply 3 years ago
I want to try building this new iteration of your bee counter project - just ordered the parts - and would like to know if you already have the code for the feather footprint version?
3 years ago
Wow, wow, wow. I am so impressed Thomas. Thank you so much
for completing this latest design so quickly and for using through hole
components. I will feel much more competent building this one than i did with
the last design. Thank you for increasing the length of the PCB to that of the
hive entrance and for increasing the width to reduce/eliminate ambient light
interference. I really like the idea of using a blank PCB board to create the
"sandwich" look and eliminate having to find the right material to
enclose the gates. Plus soldering the blank PCB board to the headers will surely
keeps everything tight without silicone or glues which bees don't like. Love
the idea of the uController mounted on the board and everything connected and
powered by the 5-volt USB. You really did think of everything and I'm grateful.
I look forward to you posting the code whenever you are
ready as I have little (to scale) home made "bees" to use for
testing.
Merry Christmas Thomas. Thanks again, Randy
Question 3 years ago
does anyone have this file in gerber please
Answer 3 years ago
I think I'm going to try to knock out a new board in the next week... It'll be a little untested but might be worth the wait.
Reply 3 years ago
https://github.com/hydronics2/2019-easy-bee-counter
4 years ago
Hello,I'm digging into this project again. It's been so long sense the last design I plan to make some improvements.
The price of Printed Circuit Boards (PCBs) has come down quite a bit so I'm making a large sensor board, 24 gates and about 14.5" long to go all the way across the hive body. Also about ~1.5" wide to block out any IR from the sun. Let me know if you have any questions/ideas.
Reply 3 years ago
Hi Thomas, great project. Just wanted to see if you have an update on the the improvements you were planning to make?