Software apps and online services
Hand tools and fabrication machines
Bees have an essential role in ecosystems. We must preserve them from different attacks they undergo (by other species such as hornets and by us, humans and global warming resulting from our way of lives).
To allow beekeeper take care of their hives, we have developed L'abeille Vie. It is an autonomous wirelessbeehive monitoring system.
With this, beekeepers can see their hives' behavior evolutions :
- Indoor & outdoor temperature & humidity
- Air quality based on pollution measures
- 4 bees behavior :
- Hornets attack
- Queen presence
This system is a box put under a beehive. It contains the Microcontroller, the battery and some of the sensors. The others will be Inside the hive.
This system development requires you to have some knowledge in electronics, in computer science and in PCB making.
Here are our accuracies:
- Inside temperature +- 0.2°C
- Outside temperature +- 1°C
- -20°C < Temperatures < 60°C
- Humidities & air quality +- 1%
- Weight +- 100g
This system is composed of 2 PCBs : one with the Microcontroller and the sensors and one for the power management.
The attached files for making PCBs by a PCB maker in the schematics and circuit diagram part.
On the picture below you can see all the components that will be on this PCB.
Weld all the sensors and the Microcontroller as shown on the picture below.
The picture will come soon...
We've developed a source code for the system on Mbed. The code :
- Initializes all sensors' registers
- Measures all components
- Do a treatment on them to get understandable values
- Sends all datas to Sigfox backend.
- Continue analyzing sounds while other sensors are not use for a defined time
As we are limited in terms of bytes on Sigfox send datas, let explain how do we send datas via Sigfox.
Inside temperature : (temperature + 20)* 10 to store the data as an unsigned short (2 bytes) instead of a float (4 bytes), respecting the accuracy defined previously
Battery level : as we measure temperatures between -20°C and 60°C, with the process presented above, we will send a value between 0 and 800. As an unsigned short max value is 65, 535, we decided to integrate the battery level value in the Inside temperature value with (battery level / 2)* 1, 000. With this process we fully optimize sended datas. We have a 2% battery level accuracy and in the temperature sended value we have from 0 to 800 the (temperature + 20)* 10 and from 1, 000 to 50, 000 we have the battery (pourcentage / 2)*1, 000.
Outside temperature : temperature + 20. As we measure températures between -20°C and 60°C, we will send a value between 0 and 80 in order to send an unsigned char.
Weight : weight * 10 to send a value as an unsigned short (2 bytes) instead of a float (4 bytes) respecting the accuracy defined previously.
Behaviours, humidities and air quality are send through char (1 byte).
Let explain how do we analyse sounds to deduct bees' behavior.
Bees sounds are at very specific frequencies depending on their behavior. Bees buzzing is around 190Hz and 200 Hz.
To announce swarming, the queen sound is at 473Hz and 1, 422 Hz.
Hornet's presence help us to deduct attacks : 90Hz
Queen frequency :
Bees stress :
As a consequence, we have to analyse sounds from 90Hz to 1, 422 Hz. So, we decided to do this through a FFT algorithm.
First we take 1024 sounds samples each 250us (at 4, 000Hz frequency to respect Shannon theorem). With the Microcontroller we have, we can't take more samples. With these parameters we do a 3.9Hz accuracy FFT.
After the FFT, we have a 512 workable frequency datas (1, 024 / 2 = 512 because of Shannon theorem). Then we identify the amplitude at our specific frequencies and compare them to the last amplitude previously measured. If there is a strong amplitude change, we can deduct one behaviour corresponding to one frequency.
For example, before swarming the queen does tooting. If at the 135th case of the amplitude array we observe a 1, 500 relative amplitude change, we can deduct that it surely announce swarming.
The source code is in the code part of this article
Put the code into the microcontroller. Then desolder the following Solder Bridge (SB) and LEDs circled on the 2 pictures below.
It is important to do this in order to save Energy.
- SB2 & SB3 : unlink the ST-Link, then it will be impossible to reprogram the microcontroller as long as these SB is desolder
It's time to link your Sigfox module to Sigfox backend and the last to ubidots.
- First, activate your module on Sigfox activate website (the device ID and PAC id are located on the Sigfox module packaging).
- Then create a ubidots account and a device (follow the steps shown on the pictures below).
- Next remember ubidots' token.
- Afterwards sign in to Sigfox backend (id : firstname.lastname@example.org). And follow the steps shown on the pictures below.
The Sigfox callback body content :
As presented in the Microcontroller monitoring part, we modified datas when they are send in order to respect Sigfox send bytes limitation. As a consequence, you have to put datas to their original form on Ubidots.
To do this, you need to create new variables for the indoor temperature, the outdoor temperature, the battery leve and the weight.
Add Variable and on
Then enter the formulas below.
It will allow to have for example.
Then you can create the Dashboard you want on ubidots. Be careful to use good variables !
The last thing about ubidots, we decided to use an Indicator for bees behavior. With this widget, you can fix different colores depending on datas values. As a consequence we defined difference values for behaviors as we can't define a color per Indicator because it only depend on global values :
- Attack : 0 - no ; 1 - yes
- Queen present : 2 - yes ; 3 - no
- Excited : 4 - no ; 5 - yes
- Swarming : 6 - no ; 7 - yes
Here is our dashboard.
This part will come soon...