Project descriptionThe aim of the Open Ruche project is to develop a monitoring system for beehives. Thanks to different sensors (weight, humidity, temperature), an Arduino Nano 33 BLE microcontroller, and a Wisol module (which sends data to the cloud platform Ubidots) it will be possible to oversee the state of the hive at any time.
Need and purposeBees are important actors in the environment as they play an important role in the pollination of crops and the preservation of floral biodiversity [1]. On the other hand, the products of honeybees, aside from honey which can be consumed as is, are used in various industries such as the pharmaceutical and cosmetic one, giving them an economical value [2]. Monitoring hives gives us the possibility to have a quick look at bee’s health and comfort. Thus, we will put our best effort in order to make our system the least intrusive possible for the bees.
Group presentationFour students majoring in Electrical engineering and Embedded systems at Polytech Sorbonne gathered to achieve this project.
The Arduino Nano 33 BLEFor this project, we used the Arduino Nano 33 BLE board which operates at 3.3V. [3] It is based on the nRF52840 microcontroller from Nordic Semiconductors, a 32-bit ARM® Cortex™-M4 CPU running at 64 MHz. In the rest of this article, we simply refer to it as the Arduino board.
Sensors and retrieving their data
- Scale (strain gauge + HX711) (weight)To obtain the measurement for the beehive weight we used a strain gauge which we connected to the Arduino board through an HX711 Analog to Digital Converter (ADC).We tared the scale to zero and retrieved the offset variable value. In addition, we have set the scale using a known weight of 25 kg and retrieved the scale variable value for the upcoming measurements using the <HX711.h> Arduino library by Rob Tilaart.The PSCK pin of the HX711 is connected to the D9 digital pin of the Arduino board and the DOUT pin to the D10 digital pin.
- DS18B20 (internal temperature)We used three (03) waterproof probes based on the DS18B20 temperature sensor to measure the internal temperature of the beehive. One probe is placed on the central frame of the hive and the two others are placed on each side frame: one on the left frame and the other on the right frame. Thanks to the <MaximWire.h> Arduino library by Xeno we were able to connect two sensors to a single digital pin (pin D4) and the remaining sensor is connected to the D8 digital pin.
- DHT22 (external temperature and humidity)The system embarks two (02) DHT22 temperature and humidity sensors for two different purposes. The first one is placed inside the hive to obtain the measurement for the internal humidity and connected to the D digital pin, whereas the second is placed on the side of the box for retrieving the external temperature and humidity values and connected to the D digital pin using the <DHT.h> Arduino library by Adafruit.
Communication
- LPWAN network, Wisol device, and Sigfox backendSending data to the cloud is made by the Wisol module which is a low power consumption module. It uses Low Power Area Networks LPWAN. In the breadboard prototype, we used a 50-ohm SMA RF antenna.
- Data formatting (data frame and corresponding code)Only 12 bytes of data can be sent at once to the Sigfox backend in one message. To fit all the information obtained from the sensors within these 12 bytes, we have designed a data frame in which each sensor data is encoded using a given number of bits within three (03) 4-byte (32-bit) integer variables as shown in the table below. Besides, the least significant byte of integer 2 and the two least significant bytes of integer 3 were not assigned and are reserved for later eventual additional data. Moreover, the data contained within the frame of the message isn’t the raw values obtained from the sensor but a modified version obtained to adapt it to the number of bits assigned to each sensor value.
- Callback configurationOnce sent to the Sigfox backend, the data is transferred to the Ubidots STEM platform using a callback. To retrieve the correct data in the Ubidots platform, the callback is configured according to the data frame of the message as follows.
poid:0:uint:10::7 humext:1:uint:6::5 battery:2:uint:7::7 temp_ext:2:uint:9::0 hum_int:4:uint:6::7 temp_int:4:uint:9::1 temp_int2:5:uint:9::0 temp_int3:8:uint:9::7 lux:9:uint:7::6.
- Ubidots dashboard and alertsThe variables obtained through the callback are decoded to retrieve the original sensor values using synthetic variables.We have designed two dashboards on the Ubidots platform. The first one displays the real-time values of the synthetic variables. On the other hand, the second dashboard contains five (05) graphs that represent the evolution of the sensor values over a given period: the external and three internal temperature vs. time, battery level vs. time, internal and external humidity vs. time, brightness level vs. time and weight vs. time. In addition, we have set several alerts to warn the user of particular situations. Thus the following alerts were added:.
- Theft alert when the weight of the hive goes below a given threshold.
- Internal temperature alerts when the temperature inside the hive goes below 33°C or above 38°C.
- Internal humidity alert when the humidity inside the hive goes below 50% or above 70%.
- Low battery alert when the battery level goes below a given threshold (arbitrarily 50%).
System power
- Battery consumption and level readingThe power consumption of the prototype was measured using the Otii tool by Qoitech.
The initial power consumption of the prototype without any optimization and by sending one message per ten minutes was measured at 40 mAh.The battery level is obtained using a voltage divider bridge as shown in the schematic below.
The Lvl port is connected to the A4 analog pin of the Arduino board and the level is computed using the ADC associated with the pin.
- Solar Cell and LiPo Rider deviceIn order to ensure the power autonomy of our system, we used a 2W solar cell to recharge the 1050 mAh battery during daylight hours.The solar cell is interfaced with the battery using the LiPo Rider Pro device which contains a DC to DC voltage converter that provides a 5V tension at the USB port used to supply the breadboard prototype.
PCB design
- Schematic, footprint assignment, and final layoutAfter finalizing the breadboard prototype, we have designed a Printed Circuit Board that would contain the internal connection necessary to our system. The following schematic diagram shows the connections contained in the PCB.
Most of the sensors (scale, temperature sensors, and the battery) are connected to the PCB using Grove connectors, the Wisol device and the Arduino board are connected using custom connectors. Additionally, The voltage divider bridges for reading the battery and brightness levels are directly implemented on the board as surface-mounted devices (SMD). Moreover, the LED and switch connectors use pin headers of size 2.00mm. Furthermore, all the ground pins are connected using a ground plane. Thus, the final PCB layout of our system is the following as seen from the bottom.
- LDO converter and 3.3V power modeOne of the most energy-consuming components of the breadboard prototype was the 5V DC-to-DC step-up converter of the LiPo Rider Pro device and the 3.3V DC-to-DC step-down converter of the Arduino board. In order to save energy and reduce power consumption, we implemented a low-dropout (LDO) regulator that directly converts the battery voltage to 3.3V which is then used to supply the Arduino board. As for the capacitors required for the LDO, they were placed as SMDs.
Final system
- Improvements
- Consumption (Sleep mode)In order to improve the autonomy of our system, we optimized its power consumption using the following solutions:+ Using the sleep() methods in the <HX711.h> library which allows us to power down the module when it’s not used and power it up again when we need data. This technique is efficient since the scale is the module with the highest power consumption.+ Turning off all the LEDs on the Arduino board.
- Brightness level (photoresistor)In the final prototype using the PCB, we added a photoresistor to the existing sensors of the breadboard prototype, in order to measure the brightness level. This photoresistor is placed next to the solar panel on a custom-made board which is placed on top of the hive to allow full exposure to sunlight. Similarly to the battery level, the brightness level is obtained using a voltage divider bridge as shown in the schematic below.
The Light port is connected to the A0 analog pin of the Arduino board and the brightness level is computed using the ADC associated with the pin.
- Callback to the Beep platform and dashboardIn order to centralize data of all hives, we use the Beep platform [4]. It allows sending data from the system to Ubidots and Beep through an HTTP REST POST call. To do that, we need to configure another callback in the Sigfox backend with unique key values for each data as follows: t, t_0, t_1, and t_2 for temperatures, h for humidity, bv for the battery level, l for the luminosity, and weight_kg. Then, the data will be collected by Beep after being decoded and modified in Beep itself. A dashboard is already set in the Beep platform, and each created variable will be added automatically to the dashboard.
Assembly
- Additional peripherals: switch and LEDIn the perspective of making the final prototype more user-friendly, we have added a switch which we placed between the 3V3 pin of the Arduino board and the VCC network and connected to the PCB using pin headers to turn the device on and off. Additionally, we have included a yellow LED that turns on for 20 seconds when the device is powered up to make sure the device is functioning well.
- Box building: drilling, soldering, and wire sheathingThe device being destined to be placed outside of the beehive, we had to increase its robustness to the environmental conditions. We achieved this goal using different procedures. First, we have placed the PCB, the LiPo Rider, the battery, and the HX711 device on a cardboard cutout to later put in a case. After that, we have drilled the above-mentioned case to insert the connecting wires of the different sensors through waterproof connectors. In addition, we set the DHT22 used for the measurement of the external humidity and temperature inside a custom-made protective case. Finally, we gathered the scattered wires using heat-shrink sleeves.
ConclusionFinally, we were able to design and build an autonomous beehive monitoring system which measures the weight of the hive, its internal temperature in three different positions (central frame, left and right side frames) and internal humidity, the external temperature and humidity and the level of brightness powered using a Li-On battery that is charged by means of a 2W solar cell. The system sends the measurements to the Sigfox backend using the Wisol device through the LPWAN network and consequently to the Ubidots and Beep platforms for a better visualization of the data and analysis over given periods of time. Moreover, special alerts can be sent by the system in case of some special events.
The system can still be improved in different ways. Thus, we could eventually pre-process the measurements of the sensors before sending them to the Sigfox backend by performing differential computations and analyzing the rate of change of the data. Additionally, we could also consider the addition of a microphone whose data will be analyzed either using an FFT to determine the frequency of the buzzing sound of the bees which can provide information about their health [5] or using Machine Learning.
References[1] P. Catania and M. Vallon, “Application of A Precision Apiculture System to Monitor Honey Daily Production” in Sensors, vol. 20, Apr. 2020.
[2] M.Kandepi, “Beehive temperature and sound monitor”, Master’s Degree Design Project Report, Cornell University, Ithaca, May 2015.
[3] Arduino Store, “Arduino 33 BLE”. [Online]. Available: https://store.arduino.cc/products/arduino-nano-33-ble[Accessed: 17-Jan-2022].
[4] Beep, “Home page”, [Online]. Available : https://beep.nl/index.php/home-english[Accessed: 17-Jan-2022].
[5] A. Robles-Guerrero, T. Saucedo-Anaya, E. González-Ramérez, et al., “Frequency Analysis of Honey Bee Buzz for Automatic Recognition of Health Status: A Preliminary Study” in Research in Computing Science, vol.147, pp. 89-98, 2017.
Comments