Hand tools and fabrication machines
We want the values captured by our sensors to be displayed in a dashboard with an interval of about 10 minutes.
- Sensors code :
We have 4 sensors :
DS18B20 used to measure soil temperature
- used library : DS1820
Gravity SEN0193 used to measure soil moisture
- No library needed
- click on this tutorial to calibrate the sensor
DHT22 used to measure air humidity and air temperature
- used library : DHT
TCS34725 used to measure light spectrum and brightness
- used library : TCS34725
Here is the mbed code link : https://os.mbed.com/users/ran_ghe/code/AgroTech/
- Sending to Sigfox
We are sending 12 bytes every 10 minutes. With these sensors, 12 bytes are enough to send all values at the same time :
- brightness = 3 bytes
- light spectrum = 1 byte per primary color (RGB)
- temperature = 2 bytes for air temperature and 2 bytes for soil temperature
- humidity = 1 byte for air humidity and 1 byte for soil humidity
In the Sigfox backend, we can see our values but as you can see it’s not very readable. That’s why we will have to do a callback to a dashboard.
- Callback to Ubidots
Now we will configure a callback to receive the rights values in our dashboard (here we choose ubidots because it’s very simple to configure)
The custom payload config is directly dependant on how we send values to Sigfox :
luminosite::uint:24 red::uint:8 green::uint:8 blue::uint:8 tempSol::uint:16 humSol::uint:8 tempAir::uint:16 humAir::uint:8
This means our first 24 bits are dedicated to the brightness, the next 8 bits are for the red value etc...
- Lower consumption
Now, we want lower the consumption to make it more autonomous in terms of energy supply. As we use our microcontroller only one time per 10 minutes, we can use the deep sleep mode for 90% of the time ! For that, we use the WakeUp library.