hydronics2 / 2019-easy-bee-counter

Bee-counter-easy
Other
43 stars 12 forks source link

2019 Easy Bee Counter V.1

This version of the bee counter is easy to solder and assemble (all through-hole). It's been tested and works* with sample code provided.

The current tested design is easy to program and approachable to beginner programmers. The printed circuit board accepts multiple Arduino platforms made by Adafruit including their line of Adafruit Feather type micro-controllers and Adafruit ItsyBitsy micro-controllers. The Adafruit feathers include wifi and long range radio features (*esp8266, esp32, and **LoRA). All the ItsyBitsy 3V models (M0, M4, and 32u4) should work fine.

*the esp8266 is missing A5 so you have to jumper to another pin **see below issue with SPI

Foo

Data Analysis - *why count bees?

Instructions

Arduino Code

Major Differences/Improvements

General Operation

Honeybees are forced through 24 gates where optical sensors (48 sensors) determine whether the bee is present and determine the direction of the bee movement. Each optical sensors has an IR LED and an IR sensor. If no bee is present the IR light is absorbed into the black surface. If a bee is present the IR light reflects off the bee and triggers the sensor. https://github.com/hydronics2/2019-easy-bee-counter/blob/master/pics/IR_photo_diode.PNG

Micro-Controller Pinout

Feather ESP32 Pinout

feather

ItsyBitsy Pinout

itsy

Shift-in registers

There are 6 shift-in registers. Here's a great description for how to connect and program shift registers. The micro-controller's SPI pins read the shift registers. All six shift registers are read at the same time. The sensors are normally pulled low and show 3.3V or HIGH when a transistor is triggered and a bee is present.

Unfortunately the shift registers we're using (the most popular shift register chip!) are not full SPI devices and wont share the SPI with other devices.. They're like the worst SPI devices!... therefore some boards like the Adalogger or LoRa just wont work out of the box. You can still do it by cutting some traces and patching the SPI lines to free pins and bitbanging the SPI to the shift registers.. buy yeah not optimum. You can get a true-spi shift register but the pinout will be different than the 74hc165 used here.

IR LEDs

The 48 LEDs are divided into two sets of 24 with each set controlled by an N-ch mosfet. The normal forward voltage of each IR LED is 1.2V and about 20ma as shown on the data sheet. Two LEDs are connected in series with a 22ohm resistor. There are jumpers on the board that allow the LEDs to bypass the current limiting resistors. Do not solder the jumper until fully tested! Refer to these instructions

Power

The PCB design connects the USB power pin from the uController to the 3.3V regulator so that a usb cable connected to the micro-controller can power the entire project.

Bill of Materials

uController

The code was tested with the feather esp32 Huzzah and itsyBitsy M0 but will work with all these boards.

Alternative pricing from Chinese distributor LCSC

Someone pointed out some alternative pricing that can really bring the cost down.