For the last ten years, the bee population has been decreasing very sharply, with a total disappearance in certain areas. The CCD (colony collapse disorder) suddenly causes the disappearance of bees in the hives without any dead bodies being found nearby.
To fight against this phenomenon, we have worked on a connected hive, which allows easier monitoring of the bees and time saving for the beekeeper. It also allows a reduction in the mortality rate of bees and optimization of the yield of the hives.
We have developed an embedded system to measure several physical quantities and make them available to the beekeeper on a web application.
Thus, we decided to monitor :
- The inside temperature of each frame of the hive
- The outside temperature
- The inside humidity of the hive
- The light received
- Its weight
Measuring the temperature on each frame makes it possible to determine the approximate number of bees in the colony.
The measurement of the external temperature makes it possible to check whether the insulation of the hive is functional.
Measuring the humidity in the hive helps to prevent the onset of certain diseases (in particular Nosema, which seals the fate of the hive as it is incurable) if the hive is too wet.
The luminosity helps the beekeeper to place the hive.
The weight measurement allows the beekeeper to visualize the honey flow or to notify the beekeeper of abnormal weight drops.
Project planning- Description of the general system
To have a permanent follow-up of the state of its hive, the various sensors installed on the BEE HAPPY hive are:
- Inside the hive:
- 3 Groove DS18B20 temperature sensors are arranged as follows: one at each end of the hive and one in the center
- 1 DHT22 humidity sensor in the center of the hive
- Outside the hive:
- 1 weight sensor
- 1 DHT22 temperature and humidity sensor
- 1 solar cell with a photoresist
- Final schematic with PCB (printed circuit board)
We have designed the PCB in Kicad:
This schematic represents the first step of the PCB design.
In this schematic, you can see all the components used and to be included in the PCB. The schematic is divided into several blocks and we opted for labels to make our schematic clearer.
You can see our Arduino nano board, our two DHT22, the three external temperature sensors, the weight sensor, the Wisol module, the photoresistor, the led, and finally the power supply block.
Once printed, we start by soldering the cms and the LDO (Low-dropout regulator), before adding the resistors and the various connectors (grove and others).
NOTE: We put an LDO that is to say a voltage regulator which allows us to regulate the output voltage to 3.3V. Indeed, using an LDO allows avoiding the double conversion 5V =>3.3V and thus consuming less energy. To use this LDO, we cut the 3.3 line of the card and place the two jumpers which allow the card to operate in 3.3Vand which consume much less energy.
Finally, when everything is well soldered, we get to the end of the PCB design, and it's time to connect all our sensors and test the system:
Here is our final system:
- The Sigfox module
We used a kit with a Sigfox telecommunication module and a Lora and Sigfox antenna. In the same way, as for a classical operator, we need to take out a subscription. The kit offers a 1-year subscription with which you can, per day :
- send 140 messages,
- receive 4 messages.
A message is 12 bytes maximum.
To be able to send messages, we need to activate the Wisol module. To do this, we must go to the Sigfox activation page: https://buy.sigfox.com/activate.
You will be asked, among other things, to fill in the following information successively:
- your country, the unique identifier (ID) and the PAC code specified on the module's packaging, an email address and a password.
If it is not included, you will have to take out an annual subscription to send at least 100 variables per day (11 euros HTC). Once the activation is complete, your sent messages will be viewable on the Sigfox backend: https://backend.sigfox.com/auth/login
- Ubidots platform:
To see the latest data from your hive, log in to Ubidots via the following link: https://stem.ubidots.com/accounts/signin/ with :
a username and a password:
you should arrive on this interface:
Then click on Data =>Dasboard.
At this point you should be on the dashboard and viewing the following page:
On this page, you will be able to view all your data and follow their evolution over time, including indoor and outdoor temperatures on the same graph, indoor and outdoor humidity, hive weight, battery percentage, and luminosity.
- Project code
The final code can be found in the files provided at the end of this article. Our code is organized in small functions in which, using the library made available through the Arduino IDE, we retrieve the various data measured by the different sensors.
In the void setup() function, the code is organized as follows:
We initialize the different elements we need in our void loop() function. The dhts, the scale ( and its settings), as well as the pins for the LEDs and the button are thus declared.
Here we test the state taken by the pin to which the button/switch is connected. If the pin is high (i.e. equal to 1), the button is on and the system is therefore in a working state. The green LED is then lit to let the user know if the system is switched on.
Declaration of the variables that will be used in the various function calls.
Initialization of the weight table and the frame table. Concerning the weight, we decided to take 10 successive measurements of the weight and to average them to have a more precise value and less fluctuation from one callback to another. We initialize the frame table to 0 so that the cells do not contain unknown values.
Calling the different functions to fill the previously declared variables with the measurements made by the different sensors.
Here we fill the different cells of the frames with our different variables. frame[3] being an array of int each cell has a size of 32 bits. Therefore, we fill it accordingly and by shifting. For more information, you can refer to the representation of our frames provided below.
We display the frames, this print allows us to control the frames sent to Sigfox. Then, thanks to the command "AT$SF=" we send the frames to Sigfox.
After that you can see a calling up the sleep and wake-up function, detailed in the following article. Setting up a delay to put the system to sleep.
- Project code and code optimization to reduce power consumption
The measurement of the system's power consumption was carried out with the Otii development tool.
To optimize the system we decided to turn off some components of our system during the delay set in our code.
In this optimization function called "sleep", we turned off the scale, turned off the pull-up resistors, and the I2C port useless here, we also decided to turn off sensors and the green LED. In the "wake up" function, we wake up the scale, so that the sensors can perform their measurement.
The average consumption of the system after optimization is 3.427 mAh which gives a system autonomy of about 13 days.
- Recharge of the system
For the system to be autonomous, we have coupled a battery and a photovoltaic panel, in particular through the use of the lipo rider pro module. This ensures the autonomous operation of our system.
- Microcontroller (programming language Arduino)
- Electronics (Numeric & Analogic)
- PCB
- Computer scienceIt took us 4 months to almost complete this project.
Comments
Please log in or sign up to comment.