Informationalized Beehives
![Capture.PNG](/proxy/?url=https://content.instructables.com/F5P/A8EU/K5H5FNUV/F5PA8EUK5H5FNUV.png&filename=Capture.PNG)
Honey is a sweet, viscous food substance made by bees and some related insects. Today, most of the honey is collected from domesticated beehives, and for beekeepers, assessing the health of bees is therefore indirectly analyzing the quality of the hives.
Here we will introduce how to build an informationalized beehive with a Sigfox communication module.
The informationalized beehive is a tool for real-time monitoring of bee colonies. The data recorded by these equipped hives can generate alerts when an abnormal change occurs, for example, if the temperature of the hive drops significantly or if the hive loses weight. The project, therefore, consists of equipping a beehive with the addition of sensors to allow it to obtain different information such as interior temperature, humidity, and weight.
This equipment is nothing hinder the beekeeper in his work and the bees, and it can be self-sufficient in energy for a long time.
Design Your Structure
![3.PNG](/proxy/?url=https://content.instructables.com/F4G/0TF4/K5H5IRUU/F4G0TF4K5H5IRUU.png&filename=3.PNG)
Before we started this project, the first thing is to seriously think about how to design our system.
So, after having determined our design, we created a schema of this system.
Choose Your Electronic Components
![2.PNG](/proxy/?url=https://content.instructables.com/FB9/VG1P/K5H5FOGU/FB9VG1PK5H5FOGU.png&filename=2.PNG)
In the second step, you need to choose your components.
In this project, you need a microcontroller, a force sensor, a sound sensor, a temperature sensor, a humidity sensor, a probe, and a voltage amplifier.
Here are all electronic components which we used:
STM32 Nucleo-L432KC: Microcontroller
CZL635-50: Force sensor 50 kg
HX711: Voltage amplifier
Grove 101020063: Sound sensor
DHT22: Temperature and humidity sensor
DS18B20: Probe
Read Datasheets
When we determined our components, we read carefully the Datasheets and found their key information.
DHT22: Temperature and humidity sensor
-Voltage :+3.3V
-Operating Current: 1.5mA
-Operating Temperature: -20℃-80℃
-Precision of temperature measurement: ±0.5℃
-Range of humidity measurement: 0-100%RH
-Humidity deviation: ±2%RH
-Resolution: 0.1%RH
DS18B20: Probe
-Voltage: +5V
-Operating Current: 1.5mA
-Operating Temperature: -55°C to +125°C
-Precision of temperature measurement: ±0.5°C Accuracy from -10°C to +85°C
CZL635-50: Force sensor 50 kg
-Voltage: 5 Vcc
-Rang of masse measurement: 0 à 50 kg
-Precision of masse measurement: ±0,05 %
HX711: Voltage amplifier
-Voltage: 2,7 to 5 Vcc
-Consumption: 1uA to 1.5mA
-Precision: 24 bits ADC
Grove 101020063: Sound sensor
-Voltage: 3.5~10 VDC
-Working Frequency: 50~2000 Hz
-Sensitivity: -48~66 dB
-Signal-to-noise Ratio: >58 dB
-Output Signal range: Analog Signal (0-1023)
Ubidots IoT Platform
In this project, we chose UBIDOTS as our IoT Platform.
From UBIDOT, we could find all the variables which we have declared.
Following these steps to create your page:
1 - Creating a new account
2 - Creating a new Dashboard
3 - Creating the Sigfox Device
4 - Creation of variables in Ubidots
5 - Creating Humidity and Temperature Widgets
To configure your Ubidots platform you can use this tutorial :
Write a Programe for Nucleo STM32 Board
Now, we need to write a program for our Nucleo STM32 board.
In this project, you don't need to download any compiler, just like us, we use Mbed online compiler to create this C++ program.
You can find a C++ program, this is for the temperature and humidity sensor DHT22, it can read the sensor's information.
Downloads
Explication of Nucleo STM32 Board Program
![1.PNG](/proxy/?url=https://content.instructables.com/F4V/H1MQ/K5M99DLM/F4VH1MQK5M99DLM.png&filename=1.PNG)
![2.PNG](/proxy/?url=https://content.instructables.com/FLF/W5Y6/K5M99DLP/FLFW5Y6K5M99DLP.png&filename=2.PNG)
![3.PNG](/proxy/?url=https://content.instructables.com/FHJ/RRKE/K5M99DLQ/FHJRRKEK5M99DLQ.png&filename=3.PNG)
![4.PNG](/proxy/?url=https://content.instructables.com/FEK/VTGL/K5M99DMF/FEKVTGLK5M99DMF.png&filename=4.PNG)
![5.PNG](/proxy/?url=https://content.instructables.com/FG7/E4WP/K5M99DMG/FG7E4WPK5M99DMG.png&filename=5.PNG)
![6.PNG](/proxy/?url=https://content.instructables.com/FM4/TKXC/K5M99DMH/FM4TKXCK5M99DMH.png&filename=6.PNG)
![7.PNG](/proxy/?url=https://content.instructables.com/FNL/P9PE/K5M99DMV/FNLP9PEK5M99DMV.png&filename=7.PNG)
![8.PNG](/proxy/?url=https://content.instructables.com/FPZ/XKDD/K5M99DLL/FPZXKDDK5M99DLL.png&filename=8.PNG)
First, you need to import the necessary libraries. Then, we must define ports for our sensors and our transmission modules (SigFox & USB).
Second, we declare the variables we will use in the function main. Then we calibrate the balance by taking a first weight value.
You must implement the code below to operate the probe.
We code all the measures in a “while (1)” loop. We test the sensor (Temperature & Humidity) if we read a value then it works and we can retrieve the desired value thanks to the functions "ReadTemperature ()" and "ReadHumidity ()".
We recover the value of the balance which we convert to grams (weight = ((double) value- (double) valueTare) / 11500; Then it’s displayed.
The temperature is also measured via the probe. To have the temperature inside the hive.
And then, we have to recover the value of the microphone. We recover its value and multiply it by 1023. Then we convert this data into dB.
Finally, all that remains is to send the data via SigFox. For this, we will use the AT $ SF command. It is important to pay attention to the number of bytes sent because you can send 12 bytes per message and 140 messages per day.
Use of the Sigfox Module to Send Data
![a1.PNG](/proxy/?url=https://content.instructables.com/F0G/4ZQN/K5M99HV7/F0G4ZQNK5M99HV7.png&filename=a1.PNG)
![a2.PNG](/proxy/?url=https://content.instructables.com/FPL/UGDC/K5M99HW8/FPLUGDCK5M99HW8.png&filename=a2.PNG)
![a3.PNG](/proxy/?url=https://content.instructables.com/F5I/TXB0/K5M99HW9/F5ITXB0K5M99HW9.png&filename=a3.PNG)
![a4.PNG](/proxy/?url=https://content.instructables.com/FA4/2XYE/K5M99HWA/FA42XYEK5M99HWA.png&filename=a4.PNG)
Each module has a unique identifier (ID) and a PAC code which is used to activate the module. These numbers are specified in the module packaging. To connect to the backend of Sigfox, you need to log in to your account.
We connect the RX and TX of the module on a microcontroller like the Nucleo, we will send AT commands from the Nucleo via the serial connection: we must use the serial port Serial1 RX and TX. (D1 and D0). We send the DHT11 data to Sigfox, we send 2 bytes for humidity and then 2 bytes for temperature. We receive the expected values on the Sigfox network. We configure a callback on the backend of Sigfox in order to visualize this data on a platform that allows displaying the data in graphical form like Ubidots. To configure the callback, go to device type then callback. Finally, we must inform the variables as well as their format (int, float…). Finally, we enter the Ubidots token on the pattern URL, this token can be found on Ubidots in API Credential.
Final Result and Observation
![result.PNG](/proxy/?url=https://content.instructables.com/FTJ/W6SM/K5M99EA6/FTJW6SMK5M99EA6.png&filename=result.PNG)
From platform UBIDOTS, we can monitor the process of our informationalized beehive.
In the magic page, it shows the actual values of all sensors, then when there is something unusual, it will send us an alert.
We can also find some line charts which shows the evaluation of the data during a certain period, like 1 day, 1 week, 1 month, etc.
Then in another page, we can find how long the battery can support the whole system, and it can send us an alert when the battery is almost dead.
Conclusion
This system is just a solution to make beekeepers’ work much easier, it collects data every hour and shows it on a website. This is a real-time system that can find abnormal inside the hive in time and send alerts. The information collection offers a possibility to quickly know the state of colony health and anticipating any anomaly.