INTRODUCTION
During our 4th year at Polytech-Sorbonne in Electronics-Industrial Computing speciality, we realized a project which consists in recovering data from the hive in an autonomous way.
Indeed, the objective is to help the beekeepers by providing them information on the hive (temperature, humidity, weight of the hive).
WITH WHAT ?
For that we had several sensors at our disposal to meet the expectations of the project, which can be found below:
Hardware components
- Solar Panel 2.5W
- LiPo Rider Pro
- Arduino MKR FOX 1200 board
- Sigfox Modul
- Rechargeable Battery, 3.7 V 1050 mAh
Sensors :
- Weight sensor x 1
- DHT22 Temperature Sensor x2
- DS18B20 Digital temperature sensors x4
- Photo-resistance
HOW DOES IT WORK ?
In a first step, we realized the project on labdec plate by implementing the different sensors to test them, see their thresholds and their limits.
In a second time, when the prototyping was functional we realized a PCB whose drawing is below:
As a result, the project has become a real embedded system, in fact, it can run autonomously thanks to the solar panel that charges the battery, which therefore gives energy to the card to send the various data.
Weight sensor: strain gauge and HX711 (low noise analog to digital converter)
Operating principle: (Force => Resistance)
When a load is applied to the sensor body, the elastic metal element of the sensor deflects and creates a deformation at these locations, as a result, two of the strain gauges are in compression and the other two are in tension. The weight or the strain is converted into an analog electrical signal by the strain gauges.
The 4 strain gauges are configured with 4 resistors in a Wheatstone bridge configuration. A Wheatstone bridge will convert this strain/resistance change into a voltage proportional to the load.
At equilibrium and with no load applied, the output voltage is close to 0. When the metallic element to which the strain gauges are attached is stressed due to the application of a force, this will cause a change in resistor in one or more resistors. This change in resistance results in a change in voltage. a slight voltage change about 20 mV in response to full load. It is here that we observe the role of the integrated amplifier which has just amplified this voltage change (low level analog signal) to be able to use it by our arduino board MKR FOX 1200 thereafter.
The 3.7V 1050mAh Li-Ion battery
The battery delivers a maximum voltage of 4.20 V and a minimum of 3.3V. The MKR FOX 1200 card accepts a maximum voltage of 3.3 V. To make the connection with the card, a voltage divider bridge is placed between the two.
In order to charge the battery, we use a solar panel that we connect to the Lipo Lidar card, the same for the battery. The panel and the battery are plugged into the PSR with a JST 2-PH connector to be able to link them both to the Lipo Lidar board and also to the MKR FOX 1200 board. The light captured by the solar panel will be transmitted as energy to the battery in order to charge it. The battery then powers the MKR FOX 1200 card.
A bit of theoretical calculation :
100% = 4.2V
75% = 3.975V
50% = 3.75V
25% = 3.525V
0% = 3.3V
At the output of the ADC we multiply by a factor of 0.78 due to the voltage divider bridge
Example : The value at 25% is therefore (3,525V * 0,78 = 2,769V
Current consumption by the system after the card and the weight sensor have been put on standby
➢ Before the standby of the weight sensor, we measure a current of 12.9 mA. After the standby we are at 2.61 mA (gain of 10.29 mA).
➢ Before the card goes into standby, a current of 26.2 mA is measured.
In sleeping mode:
Iavg = 2.61 mA
Before sending (retrieving sensors data):
Iavg = 18.1 mA
After sending the data:
Iavg= 49.4 mA
Appendices
Calculation of resistance values :
Battery case:
Vin = 4.2V, Va = 3.3V :
We take R1 = 100 KΩ so R2 = 330 KΩ. This generates us an output voltage of 3.24V (< 3.3V).
Solar panel case:
Vin = 5V, Va = 3.3V :
(R1+R2)/R2 we take R1 = 56 KΩ so R2 = 100 KΩ. This generates us an output voltage of 3.24V (< 3.3 V).
Determining the lifespan of the battery :
JOURNEY OF THE DATA FROM SENSORS TO UBIDOTS
FROM THE SENSORS TO UBIDOTS
To transmit our data measured to a cloud, we chose to use the Sigfox network, a Low Power Wide Area Network. This technology allows us to send messages through cloud with our Arduino board equipped with an antenna and a Sigfox module.
Nevertheless, using this technology will bring some constraints : Sigfox allows 140 messages per day and each message can’t exceed 12 bytes of data. We had 11 measurements to transmit with our sensors, that means that we had to think on a way to optimize each data on a certain bit size to remain in the 12 bytes limitation. Besides, we had to respect the 140 messages per day limitation. To do this, we put our Arduino board in sleep mode during 12 minutes between 2 messages.
In order to keep the right precision and minimize our bytes consumption, we established the following size for each data : each temperature multiplied by 10 on 9 bits (0°C to 51.1°C), weight multiplied by 10 on 11 bits (0kg to 204,7kg), battery percentage , luminosity percentage and each humidity percentage on 7bits (0% to 100%). With these sizes, we used 93 out of our 96 bits available but we kept a good precision for each measurement.
DATA RECEIVED BY SIGFOX
Here is how Sigfox receive our data from the Arduino board : it receives the 12 bytes data and, with a configuration on the Sigfox platform, we can process this data to separate each value and send them to Ubidots with a callback :
DATA RECEIVING AND DISPLAYING ON UBIDOTS
Once Ubidots is linked to Sigfox, we receive every attributes that Sigfox sends, and we have to process them to get the right value before our multiplication to get the precision.
Once we divided the value received, we obtain our elements to display to the beekeeper on our ubidots dashboard. We can choose several ways to display data, we chose the one for each data that we found the more appropriate
Scripts
During our project development, we changed many times our variables, or even our variable size. Changing these aspects often led to a rewriting of our code concerning data assignation and of our Sigfox payloads. To ensure that these modifications would be easy to make without taking much time to rewrite code, we wrote 2 scripts : one for the code writing part, and another for the Sigfox payload part. Both scripts just take a file containing all variables and their size in bits and give us back our code or payload according to these data. Both scripts are written in Java, so they can be used on Windows or Unix.
















Comments