Smart Beehive Monitoring System
An ESP32-based IoT system designed to monitor beehive health by tracking environmental conditions, bee activity, and hive weight. It features solar power management and real-time data synchronization with Firebase for remote access via a web dashboard.
Overview
The Smart Beehive Monitoring System is a comprehensive IoT solution designed to help beekeepers monitor the health and productivity of their colonies remotely. Built on the ESP32 platform, the system collects a wide range of data—from internal hive temperature and humidity to bee traffic and total hive weight—and transmits it to a Firebase Realtime Database. This allows for continuous tracking of hive conditions without the need for frequent manual inspections, which can stress the bees.
Hardware and Sensing Capabilities
The heart of the system is an ESP32-WROOM-32U development board, chosen for its integrated WiFi and Bluetooth capabilities. The project integrates several specialized sensors to provide a holistic view of the hive:
- Environmental Monitoring: A BME680 sensor tracks temperature, humidity, and air pressure. It also includes a VOC (Volatile Organic Compound) sensor to assess air quality within the hive.
- Bee Activity Tracking: Dual TCRT5000 IR sensor arrays are used at the hive entrance to detect movement, allowing the system to estimate colony activity levels and recognize patterns or anomalies in bee traffic.
- Weight Monitoring: A 100kg load cell paired with an HX711 amplifier provides precise measurements of the hive’s weight. This is critical for monitoring honey production and identifying when a hive might be preparing to swarm.
- Security and Location: A NEO-6M GPS module provides anti-theft tracking, while an HC-SR501 PIR motion sensor detects potential predators near the hive entrance.
Power Management
Designed for long-term outdoor deployment, the system features a robust solar power management circuit. It utilizes two 18650 lithium-ion batteries charged by a 5W solar panel via a TP4056 charging module. An MT3608 DC-DC step-up converter ensures a stable 5V supply to the ESP32 and its peripherals, enabling autonomous operation in remote apiaries.
Software Architecture and Data Flow
The firmware is developed using the Arduino framework within the PlatformIO ecosystem. It leverages the FirebaseClient library for asynchronous data transmission, ensuring that sensor readings are uploaded to the cloud without blocking the main execution loop.
The data is structured in Firebase to support both real-time status updates and historical trend analysis. The system tracks:
- Environment: Current and historical atmospheric data.
- Bee Activity: Hourly and daily counts of entrance/exit events.
- Weight: Calibration factors and weight measurements for honey yield estimation.
- System Status: Battery voltage, WiFi strength, and sensor health diagnostics.
Getting Started
To deploy the system, developers need to configure their WiFi and Firebase credentials within the src/main.cpp file. The project includes a comprehensive calibration routine for the load cell and IR sensors, accessible via a serial interface.
// Example Firebase configuration in main.cpp
#define API_KEY "YourAPIKey"
#define DATABASE_URL "YourDBURL"
#define WIFI_SSID "YourSSID"
#define WIFI_PASSWORD "YourPassword"
Once the hardware is assembled and the firmware is uploaded, the system automatically initializes the sensors and begins the data logging cycle. A companion web dashboard is available in a separate repository to visualize the collected data through interactive charts and real-time alerts.