Have you ever wondered what happens inside a beehive when the beekeeper is away? Climate change, diseases, swarming, and even theft are growing threats to bee colonies worldwide. What if you could monitor the health of your bees, track honey production in real-time, and secure your apiary from anywhere in the world without ever opening the lid? Meet MAYA, the ultimate LoRaWAN-connected smart beehive that brings traditional beekeeping into the IoT era.
Project map :I - Introduction & Story
II - Hardware: The Senses of the Hive
III - Network & Software Architecture
IV - The User Interface (Dashboard)
V - 3D Conception / Design
VI - Challenges & Conclusion
Bees are crucial to our ecosystem, but managing an apiary requires constant physical checks. Opening a hive stresses the colony, drops the internal temperature, and consumes a lot of the beekeeper's time—especially if the hives are located in remote areas.
The main goal of our project, MAYA, is to create a non-intrusive, automated monitoring system for beehives. With MAYA, the beekeeper can track the internal climate of the hive, estimate honey production, monitor external activity, and even trigger security measures remotely.
Developed as part of our IoT Project (at UniLaSalle Amiens), this project challenged us to build a complete end-to-end architecture: from wiring physical sensors on an Arduino-based board to managing low-power long-range communication (LoRaWAN), all the way to deploying a custom web dashboard (with a database etc...).
Thanks to this project, we won the "jury's favourite" price at the "Project Day" organized by our school UniLaSalle !
To gather accurate data without disturbing the bees, we equipped our hive with a carefully selected array of sensors and actuators:
- DHT11 (Temperature & Humidity Sensor): Placed inside the hive, it ensures the colony maintains the optimal temperature for brood rearing (around 34-36°C) and detects dangerous humidity levels that could lead to fungal diseases.
- HX711 & Load Cells (Weight Scale): This is the ultimate tool for a beekeeper. By continuously weighing the hive, we can track the honey flow (weight increase), monitor winter food consumption (slow decrease), or instantly detect if a swarm has left the hive (sudden weight drop of 2 to 4 kg).
- LDR Type Sensor (Luminosity): Placed outside, it helps correlate bee activity with the day/night cycle and weather conditions.
- HC-SR501 (PIR Motion Sensor): Acts as our security guard. It detects physical movement around the hive, alerting the beekeeper of potential predators or vandals.
- Actuators (Buzzer YL-44 & SG90 Servo Motor): The buzzer serves as a local dissuasion alarm, while the servo motor allows the remote opening or closing of the hive's entrance trapdoor.
We put all these sensors on our Arduino SODAQ ExPloRer Board, and it looked like this :
Because beehives are usually located in remote agricultural areas without Wi-Fi or power outlets, we relied on the LoRaWAN protocol for its low power consumption and long-range capabilities.
The Uplink Flow (Sensors to Dashboard):
- Data Collection: The Arduino board wakes up, reads all the sensor values, and compresses them into a tiny 7-byte payload to save bandwidth and battery.
- LoRa Transmission: The data is broadcasted via the LoRa module to our school's local LoRa Gateway.
- The Things Network (TTN): The gateway forwards the encrypted packets to TTN, which acts as our network server.
- The Payload Formatters: On TTN, we configured a Payload Formatter. As soon as a new payload arrives, TTN pushes an HTTP POST request containing the decoded JSON data to our remote web server.
function decodeUplink(input) {
var bytes = input.bytes;
// 1. Récupération de la température (gère les températures négatives l'hiver)
var temp = bytes[0];
if (temp > 127) {
temp = temp - 256;
}
// 2. Capteurs basiques
var hum = bytes[1];
var lum = bytes[2];
var pir = bytes[3] === 1; // Convertit 1/0 en True/False
var touch = bytes[4] === 1; // Convertit 1/0 en True/False
// 3. Reconstruction du poids
// On recolle les deux morceaux (octets 5 et 6) et on redivise par 10
var poidsBrut = (bytes[5] << 8) | bytes[6];
var poidsFinal = poidsBrut / 1000.0;
// On génère le JSON final pour ton application Web
return {
data: {
temperature_celsius: temp,
humidite_pourcent: hum,
luminosite_pourcent: lum,
presence_detectee: pir,
tactile_actif: touch,
poids_kg: poidsFinal
},
warnings: [],
errors: []
};
}- Web Server & Database: A custom Python & MQTT script catches this Webhook, extracts the metrics, and securely stores them in a MySQL database.
The Downlink Flow (Dashboard to Actuators):
We didn't just want to read data; we wanted to act. Through our custom PHP web interface, the user can click a button to "Sound the Alarm" or "Open/Close the Trapdoor".
When triggered, our web server makes an API call to the TTN API, placing a specific Downlink payload (e.g., 0x01 for the buzzer, 0x02 to open the door, 0x03 to close it) in the queue. The next time the hive wakes up to send its data, it receives this queued order and executes the physical action immediately.
To make the data accessible and actionable, we designed a responsive custom Web Dashboard using HTML/CSS/PHP, usable on PC and Smartphone.
https://projet-maya.rioc.fr/maya-v3/index.php
Watch this presentation video : LoRa Connected Beehive - YouTube
It features:
- Real-time Metrics: Clear visual cards displaying current weight, temperature, humidity, and security alerts.
- Historical Charts: Powered by Chart.js, allowing the beekeeper to visualize the evolution of the colony over the last 24 hours, 7 days, or 30 days.
- Weather API Integration: Cross-referencing local weather forecasts with hive activity to predict foraging days.
- Control Center: Dedicated buttons to trigger the buzzer or operate the servo motor trapdoor remotely.
- Responsive App on Mobile :
An IoT project isn't just about code and wires; it’s also about packaging everything into a functional and aesthetic structure. Since we needed specific dimensions to house the electronics and the weighing scale securely under the hive, we turned to digital fabrication.
Using "Boxes.py" (https://boxes.hackerspace-bamberg.de/), an open-source parametric box generator, we designed custom enclosures tailored precisely to our components.
For the hive itself, we sourced a realistic 3D model that we adapted to our needs (https://3axis.co/download/lopqxjz7/)
The entire physical structure was then brought to life using a laser cutter, cutting the components out of 3mm plywood. This approach allowed for rapid prototyping, precise interlocking joints without messy glue, and a clean, professional finish that keeps the fragile electronics protected from the bees and the elements.
Building MAYA was a fantastic journey, but it came with its set of challenges.
One of the biggest hurdles was managing the asynchronous nature of LoRaWAN. Unlike Wi-Fi, the board is mostly asleep to save energy. We had to implement a strict logic where the web dashboard queues the commands, and the user must wait for the next uplink cycle for the downlink command (like opening the servo door) to be executed by the Arduino. Furthermore, calibrating the HX711 scale to be accurate despite outdoor temperature variations required rigorous testing.Then, we had a lot of issues with the use ouf our Servo-motor SG90, this motor isn't enough powerful to open the door.
In conclusion, this project allowed us to successfully bridge the gap between physical hardware, low-power networks, and cloud computing. The MAYA smart hive proves that IoT can be a powerful, sustainable ally for modern agriculture and environmental preservation. Future improvements could include a solar panel for complete energy autonomy and machine learning to analyze the hive's weight curves automatically!
(You can create an account on the Dashboard WebSite : https://projet-maya.rioc.fr/maya-v3/index.php)














Comments