Skip to content

jvtoppa/detectabee

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DetectaBee

A computer vision-based bee monitoring system using ArUco markers and Raspberry Pi (also, check out the Dashboard!)

Python License Research Project

A detected tagged bee

Overview

Detect-a-bee (or, in portuguese, Detecta-Bee) is an automated hive monitoring system that combines computer vision, environmental sensors, and embedded visualization to track bee activity and environmental conditions in real-time. Developed as part of a research project at NEEPC-UFSCar, this system uses ArUco marker detection to identify and monitor individual bees within a hive.

Hardware Requirements

  • Raspberry Pi 4 (2GB RAM minimum, 4GB+ recommended)
  • PiCamera2 or compatible camera module
  • OLED Display (SSD1306, 128x64 resolution)

Sensors (Connected via I2C)

Sensor Function I2C Address
CCS811 Air quality & CO₂ equivalent 0x5A
BMP280 Temperature & barometric pressure 0x76
MPU9250 3-axis accelerometer 0x68

Wiring

I2C Bus (GPIO 2 & 3):
  - CCS811 (Air Quality)
  - BMP280 (Temperature/Pressure)
  - MPU9250 (Accelerometer)
  
Camera:
  - CSI ribbon cable (auto-detected)
  
OLED Display:
  - I2C bus (same as sensors)

Software Requirements

# Core packages
- Python 3.9+
- pip (Python package manager)
- git

# System libraries (install on Raspberry Pi OS)
sudo apt-get update
sudo apt-get install -y python3-dev python3-pip libatlas-base-dev libjasper-dev

Python Dependencies

See requirements.txt for complete list:

  • opencv-python - Computer vision and ArUco marker detection
  • numpy - Numerical computing
  • picamera2 - Raspberry Pi camera interface
  • adafruit-circuitpython-ccs811 - Air quality sensor driver
  • adafruit-circuitpython-bmp280 - Temperature/pressure sensor driver
  • adafruit-circuitpython-ssd1306 - OLED display driver
  • Pillow - Image processing
  • smbus2 - I2C communication
  • Additional: board, busio, RPi.GPIO, RPi.bmp280, board

Installation

1. Clone the Repository

git clone https://github.com/jvtoppa/detectabee.git
cd detectabee

2. Enable Required Interfaces on Raspberry Pi

sudo raspi-config
# Enable: I2C, Camera, SPI
# Then reboot: sudo reboot

3. Install Python Dependencies

pip install -r requirements.txt

4. Verify Hardware Connection

# Check I2C devices
i2cdetect -y 1

# Test camera
libcamera-hello --list-cameras

5. Run the Application

chmod +x ./run.sh
./run.sh

Or directly:

python3 main.py

Usage

Starting the Monitor

python3 main.py

The system will:

  1. Initialize all sensors
  2. Start the camera feed
  3. Display readings on the OLED screen
  4. Log all measurements to database files

Real-Time Data Visualization

  • Environmental readings (temperature, pressure, CO₂) appear on the OLED display
  • Detected bee markers are highlighted in the camera feed
  • Data is continuously written to data/ directory

Stopping the Application

Press Ctrl+C to gracefully shutdown the system.

Troubleshooting

Camera Issues

# Verify camera is detected
libcamera-hello --list-cameras

# Test camera feed
libcamera-jpeg -o test.jpg

# Solution: Ensure ribbon cable is firmly connected, enable camera in raspi-config

I2C Sensor Not Found

# List connected I2C devices
i2cdetect -y 1

# If devices missing:
# 1. Check power (3.3V) to sensors
# 2. Take off probes and put them back. CCS811 has a particular nasty problem with connecting to Raspberry pis (WIP).

Research & References

Detect-a-bee

This project is part of ongoing research at NEEPC-UFSCar. This project is licensed under the MIT License. The author of this codepiece would like to acknowledge:

  • NEEPC-UFSCar - Research center providing project support
  • OpenCV Community - ArUco marker detection library
  • Adafruit - Sensor driver libraries
  • Raspberry Pi Foundation - Hardware and documentation

Citation

If you use DetectaBee in your research, please cite:

@software{detectabee2026,
  title={DetectaBee: Automated Hive Monitoring with ArUco Markers},
  author={Toppa, J. V.},
  year={2026},
  url={https://github.com/jvtoppa/detectabee},
  organization={NEEPC-UFSCar}
}

Contact & Support

For issues, questions, or collaboration:


Made with 🐝 and ❤️ at UFSCar

About

detect-a-bee is a computer vision-based work that features ArUco markers as a strategy for automated bee monitoring. This software is part of a research project originated in NEEPC-UFSCar

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors