A bee counter using IR sensors at the hive entrance tracks bees entering and leaving, providing early warning of swarming, disease, pesticide exposure, and queen loss without disturbing colonies.
Why Monitor Hive Activity
Healthy colony: 200-500 trips/hour peak foraging (10AM-2PM India). Sudden drop = pesticide exposure. Massive afternoon exit = swarming. Increasing pollen return ratio = good nectar flow. Decreasing departure time = growing colony.
IR Sensor Principles
Two parallel IR break-beams spaced 10mm determine direction by which beam breaks first. 4-8 channels per hive entrance, 8mm wide each (just wider than a bee), force single-file passage for 90%+ accuracy.
Building the Hardware
IR emitter-detector pairs in 8mm channels. DHT22 inside hive (in super, away from brood) monitors internal temp/humidity. Healthy brood maintained at 34-36C; deviations indicate stress.
Bidirectional Counting Code
Bidirectional counter with hive monitoring:
#include <DHT.h>
DHT dht(12,DHT22);
int irPins[4][2]={{A0,A1},{A2,A3},{A4,A5},{A6,A7}};
long beesIn=0,beesOut=0;
int state[4]={0,0,0,0};
void loop(){
for(int ch=0;ch<4;ch++){
bool inner=analogRead(irPins[ch][0])<500;
bool outer=analogRead(irPins[ch][1])<500;
if(state[ch]==0){ if(inner&&!outer) state[ch]=1; if(outer&&!inner) state[ch]=2; }
else if(state[ch]==1&&outer){ beesIn++; state[ch]=0; }
else if(state[ch]==2&&inner){ beesOut++; state[ch]=0; }
else if(!inner&&!outer) state[ch]=0;
}
delay(5);
}
Interpreting Activity Data
Healthy colony: smooth bell curve peaking midday. Pre-swarm: 3-5 days increasing then massive 5,000+ exit. Pesticide exposure: normal departure, fewer returns. Queen loss: gradual decline over 2-3 weeks.
Integration with Hive Monitoring
Combine with hive scale (honey production tracking) and multiple temperature probes at brood, super, and ambient levels for complete colony health picture.
Recommended Components
Ready to Build Your Agriculture Tech Project?
Browse our complete range of sensors and modules for smart farming at Zbotic.in. Fast shipping across India with technical support.
Frequently Asked Questions
IR counter accuracy?
85-92% individual bees. 8mm channels force single-file, improving to 90%+.
Works for Apis cerana?
Yes. Use 7mm channels. Adjust thresholds as cerana colonies are smaller (5-15K vs 30-60K bees).
Power consumption?
100-150mA at 5V. 10,000mAh power bank = 3-4 days. 6V 5W solar + 6000mAh = indefinite.
{“@context”: “https://schema.org”, “@type”: “FAQPage”, “mainEntity”: [{“@type”: “Question”, “name”: “IR counter accuracy?”, “acceptedAnswer”: {“@type”: “Answer”, “text”: “85-92% individual bees. 8mm channels force single-file, improving to 90%+.”}}, {“@type”: “Question”, “name”: “Works for Apis cerana?”, “acceptedAnswer”: {“@type”: “Answer”, “text”: “Yes. Use 7mm channels. Adjust thresholds as cerana colonies are smaller (5-15K vs 30-60K bees).”}}, {“@type”: “Question”, “name”: “Power consumption?”, “acceptedAnswer”: {“@type”: “Answer”, “text”: “100-150mA at 5V. 10,000mAh power bank = 3-4 days. 6V 5W solar + 6000mAh = indefinite.”}}]}
Add comment