Our team is composed of 4 trainees. We are studying electronics and industrial computing at Polytech Sorbonne. We are in the 4th year of the engineering cycle.In order to allow students to acquire a wide experience in new technologies, the school offers us the opportunity to work on many projects autonomously.We have chosen the plant monitoring project. This project was submitted to us by a teacher from another specialty of the school: the AGRAL specialty. The AGRAL specialty provides the necessary knowledge in biochemistry and microbiology. It focuses on the control of processing processes specific to the agri-food industries and on food quality and health quality management. The objective of the project is to develop a system for the parameters (soil and air temperature and humidity, luminosity) influencing the evolution of plants. This system will be used by AGRAL students. The measured parameters will be displayed on a screen and sent via the Sigfox network to the online server Ubidots for education. All the steps of our project are available below so that everyone can carry it out easily and at a lower cost.
Air temperature and moisture monitoringThe first parameter that we want to monitor is the temperature and humidity of the air. For this purpose, we have chosen the DHT22 sensor.
The DHT22 temperature and humidity sensor communicates with a microcontroller via a serial port. The sensor is calibrated and does not require any additional components to be used.
Specifications
Power supply: 3.3 to 6 VdcMax.
Consumption: 1.5 mA
Standby consumption: 50 µA
Measuring range:
- temperature: -40 to +80 °C
- humidity: 0 to 100%
RHPrecision:
- temperature: ± 0.5 °C
- humidity: ± 2%
RHDimensions: 25 x 15 x 15 x 9 mm
In the DTH22 attachment, you will find the sensor library and the.cpp file :
DHT22.h
Soil temperature and moisture monitoringThe second parameter to monitor is the temperature and humidity of the soil. For this purpose, we chose the SEN0227 probe.
This is a SHT20 I2C temperature & humidity sensor with waterproof probe. It comes with the 4C CMOSensor SHT20 temperature & humidity sensor chip, and the probe has gone through dual waterproof protection. The SHT20 I2C temperature & humidity sensor adopt Sensirion new technique. It can measure surrounding environment temperature and relative air humidity precisely.
Specifications
Operating Voltage: 3.3V/5V
Communication Interface: I2C / IIC
Protection Class: waterproof anti-condensation
RH Response Time: 8s (tau63%)
Accuracy: ±3% RH / ±0.3 ℃
Measuring Range: 0-100% RH / -40-125 ℃
Dimension: 73mm * 17mm / 2.87 * 0.67 inches
Weight: 44g
In the STH20 attachment, you will find the sensor library and the.cpp file :
SHT21_nlceee.h
SHT21_nlceee.cpp
LUX monitoringThe third parameter to monitor is the LUX. For this purpose, we chose the TSL2561 sensor.
The TSL2561 luminosity sensor allows to measure a luminosity from 0.1 to 40000 Lux. It communicates with a microcontroller via the I2C bus. Its sensor covers visible light and infrared with several diodes. This means that you can measure infrared light, visible light or the full spectrum separately.
Specifications
Power supply: 2.7 to 3.6 VDC
I2C interface
Measuring range: 0.1 to 40000 Lux
Serve at: -30 to +80 °C
In the Lux Sensor TSL2561 attachment, you will find the sensor library and the.cpp file :
TSL2561.h
RGB monitoringFor the RGB monitoring, we chose the TCS34725 sensor.
The TCS34725 has RGB and Clear light sensing elements. An IR blocking filter, integrated on-chip and localized to the color sensing photodiodes, minimizes the IR spectral component of the incoming light and allows color measurements to be made accurately. The filter means you'll get much truer color than most sensors, since humans don't see IR. This sensor has a 3.3V regulator so we can power the breakout with 3-5 VDC safely and level shifting for the I2C pins so they can be used with 3.3V or 5V logic. The LED can be easily turned on or off by any logic level output.
Specifications
Weight: 3.23g
Dimensions: 20.44mm / 0.8" x 20.28mm / 0.79"
This board/chip uses I2C 7-bit address 0x29.
In the RGB sensor attachment, you will find the sensor library and the.cpp file :
Adafruit_TCS34725.cpp
Adafruit_TCS34725.h
Display of data on the screenTo display our data, we chose the Monochrome 1.3" 128x64 OLED graphic display.
This display is small, only about 1.3" diagonal, but very readable due to the high contrast of an OLED display. This display is made of 128x64 individual white OLED pixels, each one is turned on or off by the controller chip. Because the display makes its own light, no backlight is required. This reduces the power required to run the OLED.The driver chip, SSD1306 can communicate in I2C. The OLED itself require a 3.3V power supply and 3.3V logic levels for communication.The power requirements depend on how much of the display is lit but on average the display uses about 40mA from the 3.3V supply.
Specifications
Breakout Board Dimensions:
PCB: 35mm x 35mm x 5mm / 1.4" x 1.4" x 0.2"
Mounting Hole Dimensions: 29.5mm x 29mm / 1.16" x 1.14"
Mounting Hole Diameter: 2.5mm / 0.1"
Screen: 23mm x 35mm / 0.9" x 1.4"
Weight: 8.5g
This board/chip uses I2C 7-bit address between 0x3C-0x3D, selectable with jumpers
OLED Display Details:
Diagonal Screen Size:1.30"
Number of Pixels:128 × 64
Color Depth:Monochrome (White)
Module Construction:COG
Module Size (mm):34.50 x 35.00
Panel Size (mm):34.50 x 23.00 x 1.45
Active Area (mm):29.420 x 14.70
Pixel Pitch (mm):0.23 x 0.23
Pixel Size (mm):0.21 x 0.21
Weight (g):2.18
Duty:1/64
Brightness ( cd/m2):100 (Typ) @ 12V
Display current draw is completely dependent on your usage: each OLED LED draws current when on so the more pixels you have lit, the more current is used. They tend to draw ~25mA or so in practice but for precise numbers you must measure the current in your usage circuit.
In the Display attachment, you will find the display libraries and the.cpp files :
ssd1306.h
standard_font.h
Online data recovery and storageTo collect the data from our sensors and store them online, we chose the Sigfox network. Sigfox is the very first IoT network to have been set up. Sigfox's service is revolutionizing the world of M2M (Machine to Machine communication) with its cellular connectivity offer, entirely dedicated to low speed communications. Sigfox reinvents information transmission by significantly reducing the power consumption of connected devices and their price. Sigfox has created a long-range, low-speed network that allows small amounts of data to be communicated between connected devices without using a mobile phone.
The BRKWS01 board
The Sigfox transmitter/receiver module measures 13 x 15 x 2.21 mm for 0.85g. It is powered by 3.3V, for a consumption of about 50 mA in transmission and 15 mA in reception. In standby mode, the consumption of this module is 2 μA. This off-communication module is very energy efficient. In our project it will be activated every 10 minutes which allows a reduced use of the battery.
The BRKWS01 board requires at least +3.3v, ground and Tx Rx connections. LEDs can be added to the board using the LEDTX and LEDRX port to indicate a reception or transmission. We will not use these ports in our project because we want to be the most energy-efficient.
Here is the wiring diagram of the BRKWS01 board :
Testing the card via PUTTY
In order to test the proper functioning of the card it is necessary to connect the antenna and to supply the card with 3.3V. The card will be connected in direct serial link with a PC.
Then open PUTTY, configure it in Serial mode while choosing the right PORT with a speed of 9600 bauds.Then enter "AT" in the Putty command window, if the system is correctly wired, Sigfox will answer "OK".
Registration on the Sigfox Website
In order to activate Sigfox the first thing to do is to go to this link and click on Activate.
Please follow the following instructions to properly activate your Sigfox:
- Choose your country and click on Next
- Then enter the Device ID and PAC, the latter will be in the box of your Sigfox
- Then create a Sigfox account (Use a valid email address and you will then have to confirm this email)
Your registration is complete. All you have to do is validate your account by following the link you received on the email address you provided.You now have access to your Sigfox device, via backend Sifox page you can configure your Sigfox and also see your messages.
Sending data via Sigfox
To access the messages click on "ID" then "Messages".Manual modeStill with Putty, make an AT command to see if the card responds. Once the OK has been received, enter the command to send a message: AT$SF= (followed by a maximum of 12 bytes in decimal) here AT$SF=02. A few seconds later you will be able to see your first Sigfox message!
Automatic mode
We will now implement a code to do this automatically. After connecting the Sigfox to ports D0 and D1, implement the following code
main.cpp file:
#include "mbed.h"
#include "mapping.h"
Serial Sigfox(SigfoxTX, SigfoxRX);
DigitalOut myled(LED1);
void ClignotementLED(int duree){
myled = !myled;
wait_ms(duree);
myled = !myled;
wait_ms(duree);
myled = !myled;
wait_ms(duree);
myled = !myled;
wait_ms(duree);
}
int main(){
Sigfox.printf("AT$SF=99\n\r");
ClignotementLED(80); //when the message is sent with Sigfox
wait(DelaiEnvoi);
}
mapping.h file:
#ifndef __MAPPING_H__
#define __MAPPING_H__
//Sigfox
#define SigfoxTX PA_9 //D1
#define SigfoxRX PA_10 //D0
#endif
Compile and then after a few minutes you will receive the message on Sigfox:
In order to store our data and display them in graphical form, we chose Ubidots for Eduction.
The first step is to create your account. Then, we need to configure callbacks in Sigfox.
Login to your Sigfox account thru this page : https://backend.sigfox.com/auth/login
In the Device tab, click on the name of your Device type :
Then, go to the Callback tab :
Next, click on Edit :
The following page opens :
You need to configure the page.
Type : DATA UPLINK
Channel : URL
Custom payload config : TemperatureAir::int:8 HumiditeAir::uint:8 Lux::uint:8:little-endian TemperatureSol::int:8 HumiditeSol::uint:8 RedValue::uint:8 GreenValue::uint:8 BlueValue::uint:8
URL pattern : https://things.ubidots.com/api/v1.6/devices/{device}/?token=APIKEY
You need to replace APIKEY with your API Key. To do this, connect yourself to Ubidots for Education and get the API link as desribed below.
In your account parameters, in the API Keys tab, copy the API Key an d paste it in backend Sigfox.
Use HTTP method : POST
content type : application/json
Body :
{
"TemperatureAir" : "{customData#TemperatureAir}",
"HumiditeAir" : "{customData#HumiditeAir}",
"Lux" : "{customData#Lux}",
"TemperatureSol" : "{customData#TemperatureSol}",
"HumiditeSol" : "{customData#HumiditeSol}",
"RedValue" : "{customData#RedValue}",
"GreenValue" : "{customData#GreenValue}",
"BlueValue" : "{customData#BlueValue}"
}
In
your Ubidots for Education interface, a device will be created. Here we are 8 variables corresponding to each parameter that we want to follow : TemperatureAir, HumiditeAir, Lux, TemperatureSol, HumiditeSol, RedValue, GreenValue and BlueValue.
For the design of the project's electronic board, we chose EasyEDA. It is a site that allows you to make diagrams, simulations and printed circuits online. This new way of doing circuits does not require any installation on computers. We have created a free account and all our achievements have been securely registered on the online server allowing us to access anywhere in the world.First of all, we started with the design of the schematic. It is composed of the Nucleo STM32, RGB, SEN0227, TSL2561, DHT22, the display and then the Sigfox module. All components have been supplied with 3V3. Then we assigned for each of the components an imprint (the physical form of the component), then we checked the schema specifically the connections between the components to avoid obvious errors and the next step was the generation of the Netliste file.
In the Main attachment, you will find the.cpp file :
In the Mapping attachment, you will find the mapping library :
Mapping.h
Here is our final diagram:
Once the final schematic was ready, we routed the board, i.e. contouring the board, placing all the components on the board, routing the tracks and setting up the ground plan, checking the routing to make sure it respected the manufacturing rules and finally generating the Gerber file which had all the information we sent to the PCB manufacturer.
After printing the PCB, we soldered the components to the board and performed the electrical tests using the multimeter to validate the proper functioning of the board.
Creation of the boxThe last step of the project was to place our board and sensors in a box so that they could be transported. For this, we used a box provided by one of our teachers. This box is hermetic.
We had to make holes on the box in order to get our temperature and humidity sensor and solar panel out of the ground. Indeed, our project must be energy self-sufficient. For this purpose, we have chosen to use a Seeedstudio card. It allows use to supply our project with 5 VDC from a LiPo battery. The battery can be charged via mini-USB or via a solar cell.
Specifications :
Output (on USB connector): 5 VDC/1 A max.
Load indication LEDs Battery and cell connectors: 2 pins type JST Accumulator (not included): LiPo Solar cell input voltage: 5 V
Dimensions: 68 x 50 x 50 x 10 mm
We chose to charge our battery via the folowing solar cell.
Specifications :
Voltage: 3.7 VDC
Intensity: 1050 mAh
Connector: 2 pins type JST
Dimensions: 47 x 43 x 4 mm
Weight: 20 g
This 2 Watt Solar Cell delivers a voltage of 5.5 VDC at 360 mA. A thin layer of resin allows for outdoor use.
Specifications :
Voltage: 5.5 VDC/360 mA
Connector: 2 pins type JST
Max. open circuit voltage: 8.2 V
Monocrystalline silicon.
Dimensions: 180 x 80 x 80 x 3 mm
Comments
Please log in or sign up to comment.