Agriculture Sensor Board 2.0
Agriculture Sensor Board 2.0
Agriculture Sensor Board 2.0
0
Technical Guide
Index
INDEX
1. General.................................................................................................................................................. 5
1.1. General and safety information...............................................................................................................................................5
1.2. Conditions of use..........................................................................................................................................................................5
3. Hardware............................................................................................................................................. 15
3.1. General Description.................................................................................................................................................................. 15
3.2. Specifications.............................................................................................................................................................................. 15
3.3. Electrical Characteristics.......................................................................................................................................................... 15
3.4. Agriculture 2.0 Board Versions.............................................................................................................................................. 16
4. Sensors................................................................................................................................................ 17
4.1. Atmospheric Pressure Sensor (MPX4115A)...................................................................................................................... 17
4.1.1. Specifications................................................................................................................................................................17
4.1.2. Measurement Process...............................................................................................................................................17
4.1.3. Socket..............................................................................................................................................................................18
4.2. Leaf Wetness Sensor (LWS)..................................................................................................................................................... 18
4.2.1. Specifications................................................................................................................................................................18
4.2.2. Measurement Process...............................................................................................................................................19
4.2.3. Socket..............................................................................................................................................................................19
4.3. Humidity Sensor (808H5V5)................................................................................................................................................... 20
4.3.1. Specifications................................................................................................................................................................20
4.3.2. Measurement Process...............................................................................................................................................20
4.3.3. Socket..............................................................................................................................................................................21
-2- v5.0
Index
-3- v5.0
Index
6. API Changelog.................................................................................................................................... 51
7. Consumption...................................................................................................................................... 52
7.1. Power control.............................................................................................................................................................................. 52
7.2. Tables of consumption............................................................................................................................................................. 53
7.3. Low consumption mode......................................................................................................................................................... 53
8. Documentation changelog................................................................................................................ 54
9. Maintenance....................................................................................................................................... 55
-4- v5.0
General
1. General
1.1. General and safety information
•• In this section, the term “Waspmote” encompasses both the Waspmote device itself and its modules and sensor boards.
•• Read through the document “General Conditions of Libelium Sale and Use”.
•• Do not allow contact of metallic objects with the electronic part to avoid injuries and burns.
•• NEVER submerge the device in any liquid.
•• Keep the device in a dry place and away from any liquid which may spill.
•• Waspmote consists of highly sensitive electronics which is accessible to the exterior, handle with great care and avoid
bangs or hard brushing against surfaces.
•• Check the product specifications section for the maximum allowed power voltage and amperage range and consequently
always use a current transformer and a battery which works within that range. Libelium is only responsible for the correct
operation of the device with the batteries, power supplies and chargers which it supplies.
•• Keep the device within the specified range of temperatures in the specifications section.
•• Do not connect or power the device with damaged cables or batteries.
•• Place the device in a place only accessible to maintenance personnel (a restricted area).
•• Keep children away from the device in all circumstances.
•• If there is an electrical failure, disconnect the main switch immediately and disconnect that battery or any other power
supply that is being used.
•• If using a car lighter as a power supply, be sure to respect the voltage and current data specified in the “Power Supplies”
section.
•• If using a battery in combination or not with a solar panel as a power supply, be sure to use the voltage and current data
specified in the “Power supplies” section.
•• If a software or hardware failure occurs, consult the Libelium Web Development section.
•• Check that the frequency and power of the communication radio modules together with the integrated antennas are
allowed in the area where you want to use the device.
•• Waspmote is a device to be integrated in a casing so that it is protected from environmental conditions such as light, dust,
humidity or sudden changes in temperature. The board supplied “as is” is not recommended for a final installation as the
electronic components are open to the air and may be damaged.
The “General Conditions of Libelium Sale and Use” document can be found at:
http://www.libelium.com/development/waspmote/technical_service
-5- v5.0
Waspmote Plug & Sense!
Note: For a complete reference guide download the “Waspmote Plug & Sense! Technical Guide” in the Development section of
the Libelium website.
2.1. Features
•• Robust waterproof IP65 enclosure
•• Add or change a sensor probe in seconds
•• Solar powered with internal and external panel options
•• Radios available: ZigBee, 802.15.4, WiFi, 868MHz, 900MHz, LoRaWAN, LoRa, Sigfox, 3G/GPRS and Bluetooth Low Energy
•• Over the air programming (OTAP) of multiple nodes at once
•• Special holders and brackets ready for installation in street lights and building fronts
•• Graphical and intuitive programming interface
•• External, contactless reset with magnet
•• External SIM connector for GPRS or 3G models
-6- v5.0
Waspmote Plug & Sense!
For the internal option, the solar panel is embedded on the front of the enclosure, perfect for use where space is a major
challenge.
-7- v5.0
Waspmote Plug & Sense!
The basic programming is done from the USB port. Just connect the USB to the specific external socket and then to the computer
to upload the new firmware.
-8- v5.0
Waspmote Plug & Sense!
Over the Air Programming is also possible once the node has been installed. With this technique you can reprogram wirelessly
one or more Waspmote sensor nodes at the same time by using a laptop and the Waspmote Gateway.
-9- v5.0
Waspmote Plug & Sense!
http://www.libelium.com/development/plug_&_sense/sdk_and_applications/code_generator
Thanks to Meshlium’s new feature, the Sensor Parser, now it is easier to receive any frame, parse it and store the data into a local
or external Data Base.
Figure : Meshlium
-10- v5.0
Waspmote Plug & Sense!
-11- v5.0
Waspmote Plug & Sense!
2.10. Models
There are some defined configurations of Waspmote Plug & Sense! depending on which sensors are going to be used. Waspmote
Plug & Sense! configurations allow to connect up to six sensor probes at the same time.
Each model takes a different conditioning circuit to enable the sensor integration. For this reason each model allows to connect
just its specific sensors.
This section describes each model configuration in detail, showing the sensors which can be used in each case and how to
connect them to Waspmote. In many cases, the sensor sockets accept the connection of more than one sensor probe. See the
compatibility table for each model configuration to choose the best probe combination for the application.
It is very important to remark that each socket is designed only for one specific sensor, so they are not interchangeable.
Always be sure you connected probes in the right socket, otherwise they can be damaged.
-12- v5.0
Waspmote Plug & Sense!
The main applications for this Waspmote Plug & Sense! model are precision agriculture, irrigation systems, greenhouses, weather
stations, etc. Refer to Libelium website for more information.
Two variants are possible for this model, normal and PRO. Next section describes each configuration in detail.
-13- v5.0
Waspmote Plug & Sense!
Normal
Sensor sockets are configured as shown in the figure below.
Note: For more technical information about each sensor probe go to the Development section in Libelium website.
PRO
Sensor sockets are configured as shown in the figure below.
Note: For more technical information about each sensor probe go to the Development section in Libelium website.
-14- v5.0
Hardware
3. Hardware
3.1. General Description
The Waspmote Agriculture 2.0 Board allows to monitor multiple environmental parameters involving a wide range of
applications, from growing development analysis to weather observation. For this, it has been provided with sensors for air and
soil temperature and humidity, luminosity, solar visible radiation, wind speed and direction, rainfall, atmospheric pressure, leaf
wetness and fruit or trunk diameter (dendrometer). Up to 15 sensors can be connected at the same time. With the objective
of extending the durability of the device after the deployment, the board is endowed with a solid state switches system that
facilitates a precise regulation of its power, prolonging the life of the battery.
3.2. Specifications
Weight: 20gr
Dimensions: 73.5 x 51 x 1.3 mm
Temperature Range: [-20ºC, 65ºC]
-15- v5.0
Hardware
-16- v5.0
Sensors
4. Sensors
4.1. Atmospheric Pressure Sensor (MPX4115A)
4.1.1. Specifications
Measurement range: 15 ~ 115kPa
Output signal: 0.2 ~ 4.8V (0 ~ 85ºC)
Sensitivity: 46mV/kPa
Accuracy: <±1.5%V (0 ~ 85ºC)
Typical consumption: 7mA
Maximum consumption: 10mA
Supply voltage: 4.85 ~ 5.35V
Operation temperature: -40 ~ +125ºC
Storage temperature: -40 ~ +125ºC
Response time: 20ms Figure : MPX4115A Sensor
To read the sensor it is sufficient to capture the analog value in its input (ANALOG3) via the corresponding command. The function
of the library readValue() returns the atmospheric pressure value in kilopascals (kPa). The 5V power supply of the sensor may
be connected or disconnected through a switch by activating or deactivating the digital pin DIGITAL7. It is highly recommended
to switch off this sensor in order to minimize the global consumption of the board (you can find more information about the
consumption of the board and how to handle it in chapter “Board configuration and programming”).
Figure : Graph of the MPX4115A sensor’s output voltage with regard to pressure taken from the Freescale sensor’s data sheet
-17- v5.0
Sensors
Reading Code:
{
float value_pressure = 0;
SensorAgrv20.ON();
SensorAgrv20.setSensorMode(SENS_ON, SENS_AGR_PRESSURE);
delay(100); //waiting for the stabilization of the power supply
value_pressure = SensorAgrv20.readValue(SENS_AGR_PRESSURE);
}
You can find a complete example code for reading the atmospheric pressure sensor in the following link:
http://www.libelium.com/development/waspmote/examples/ag-3-pressure-sensor-reading
4.1.3. Socket
A socket consisting of a 6 female pins, 2.54mm pitch strip has been added for the atmospheric pressure sensor. More information
about the sockets for casing applications can be found in section “Sockets for Casing”.
-18- v5.0
Sensors
Reading code:
{
float value_lw = 0;
SensorAgrv20.ON();
SensorAgrv20.setSensorMode(SENS_ON, SENS_AGR_LEAF_WETNESS);
delay(100); //waiting for the stabilization of the power supply
value_lw = SensorAgrv20.readValue(SENS_AGR_LEAF_WETNESS);
}
You can find a complete example code for reading the leaf wetness sensor in the following link:
http://www.libelium.com/development/waspmote/examples/ag-5-leaf-wetness-sensor-reading
4.2.3. Socket
In the image above we can see highlighted the two pins of the terminal block where the sensor must be connected to the board.
-19- v5.0
Sensors
The reading of the sensor is carried out at the analog input pin ANALOG2. The function of the library readValue() returns the
humidity value in relative humidity percentage (%RH). Like the output of the Leaf Wetness Sensor, the output of the 808H5V5 is
connected, along with the output of one of the Watermark sensors, to a multiplexer that allows the connection of both sensors
at the same time. The output of this multiplexer can be selected using the digital pin DIGITAL3, while the 5V power of the sensor
is regulated through a switch activated by the digital pin DIGITAL5, that controls the power of the solar radiation, temperature,
humidity, dendrometer, leaf wetness and temperature plus humidity sensors simultaneously. It is highly recommended to
switch off this sensor in order to minimize the global consumption of the board (you can find more information about the
consumption of the board and how to handle it in chapter “Board configuration and programming”).
Reading code:
{
float value_humidity = 0;
SensorAgrv20.ON();
SensorAgrv20.setSensorMode(SENS_ON, SENS_AGR_HUMIDITY);
delay(15000); //waiting for the sensor response time
value_humidity = SensorAgrv20.readValue(SENS_AGR_HUMIDITY);
}
You can find a complete example code for reading the humidity sensor in the following link:
http://www.libelium.com/development/waspmote/examples/ag-2-humidity-sensor-reading
-20- v5.0
Sensors
Figure : 808H5V5 humidity sensor output taken from the Sencera Co. Ltd sensor data sheet
4.3.3. Socket
In the figure above we have an image of the socket for the 808H5V5 sensor with the pins corresponding to the ones marked in
the chip. More information about the sockets for casing applications can be found in section “Sockets for Casing”.
-21- v5.0
Sensors
Reading code:
{
float value_temperature = 0;
SensorAgrv20.ON();
SensorAgrv20.setSensorMode(SENS_ON, SENS_AGR_TEMPERATURE);
delay(100); //waiting for the sensor’s response time
value_temperature = SensorAgrv20.readValue(SENS_AGR_TEMPERATURE);
}
You can find a complete example code for reading the temperature sensor in the following link:
http://www.libelium.com/development/waspmote/examples/ag-1-temperature-sensor-reading
Figure : Graph of the MCP9700A sensor output voltage with respect to temperature, taken from the Microchip sensor’s data sheet
-22- v5.0
Sensors
4.4.3. Socket
The socket for the MCP9700A sensor is basically composed of a three female pins, 2.54mm pitch strip which provides ground,
5V power supply and signal connection to the sensor. In the image in the figure above we can see marked the pins of the
socket that correspond to those of the chip. More information about the sockets for casing applications can be found in section
“Sockets for Casing”.
The measurable spectral range (400nm – 700nm) coincides with the human visible spectrum so it can be used to detect light/
darkness in the same way that a human eye would detect it.
-23- v5.0
Sensors
Below, a small sample of code for reading the output value of the sensor is shown:
{
float value_ldr = 0;
SensorAgrv20.ON();
SensorAgrv20.setSensorMode(SENS_ON, SENS_AGR_LDR);
delay(100); //waiting for the stabilization of the power supply
value_ldr = SensorAgrv20.readValue(SENS_AGR_LDR);
}
You can find a complete example code for reading the luminosity sensor in the following link:
http://www.libelium.com/development/waspmote/examples/ag-4-ldr-sensor-reading
4.5.3. Socket
In the figure below we can see highlighted the socket upon which the LDR sensor must be placed. Since this sensor behaves as
a simple resistor, polarity should not be taken into account when connecting it. More information about the sockets for casing
applications can be found in section “Sockets for Casing”.
-24- v5.0
Sensors
Temperature:
Humidity:
Figure : Graph of the SHT75 sensor output with respect to relative humidity, taken from the Sensirion sensor’s data sheet
-25- v5.0
Sensors
Reading code:
{
float value_temperature = 0;
float value_humidity = 0;
SensorAgrv20.ON();
SensorAgrv20.setSensorMode(SENS_ON, SENS_AGR_SENSIRION);
delay(10000); //waiting for the sensor’s response time
value_temperature = SensorAgrv20.readValue(SENS_AGR_SENSIRION, SENSIRION_TEMP);
delay(100); //the sensor sleeps until the next measurement
value_humidity = SensorAgrv20.readValue(SENS_AGR_SENSIRION, SENSIRION_HUM);
}
You can find a complete example code for reading the humidity and temperature sensor in the following link:
http://www.libelium.com/development/waspmote/examples/ag-6-digital-temperature-and-humidity-sensor-reading
4.6.3. Socket
The socket consists of a four female pin, 1.27mm pitch strip that connects the sensor to its digital outputs (DIGITAL8 and
DIGITAL6 of Waspmote) ground and 3.3V power supply, regulated through a digital switch controlled by the DIGITAL5 pin of
the mote. More information about the sockets for casing applications can be found in section “Sockets for Casing”.
-26- v5.0
Sensors
Figure : Output frequency of the Watermark sensor circuit with respect to the resistance of the sensor
-27- v5.0
Sensors
Reading Code:
{
float value_soil_humidity_1 = 0;
float value_soil_humidity_2 = 0;
float value_soil_humidity_3 = 0;
SensorAgrv20.ON();
SensorAgrv20.setSensorMode(SENS_ON, SENS_AGR_WATERMARK_1);
delay(100); //waiting for the stabilization of the power supply
value_soil_humidity_1 = SensorAgrv20.readValue(SENS_AGR_WATERMARK_1);
value_soil_humidity_2 = SensorAgrv20.readValue(SENS_AGR_WATERMARK_2);
value_soil_humidity_3 = SensorAgrv20.readValue(SENS_AGR_WATERMARK_3);
}
You can find a complete example code for reading the Watermark sensor (Watermark 1 in this case) in the following link:
http://www.libelium.com/development/waspmote/examples/ag-11-watermark-sensor-reading
4.7.3. Socket
-28- v5.0
Sensors
Three sockets for Watermark sensors have been placed in the agriculture board (marked in the image in the figure above) and
the electronics necessary for powering and signal conditioning, so that the soil moisture can be measured at three different
depths. Each of this outputs is carried to the input of a multiplexer controlled by the digital output DIGITAL3. These multiplexers
permit the selection of two groups of sensors, the three Watermarks or the humidity, temperature and leaf wetness sensors,
when reading the analog inputs ANALOG2, ANALOG4 and ANALOG6 of the Waspmote.
-29- v5.0
Sensors
Reading code:
{
float value_PT1000 = 0;
SensorAgrv20.ON();
SensorAgrv20.setSensorMode(SENS_ON, SENS_AGR_PT1000);
delay(100); //waiting for the stabilization of the power supply
value_PT1000 = SensorAgrv20.readValue(SENS_AGR_PT1000);
}
You can find a complete example code for reading the PT1000 sensor in the following link:
http://www.libelium.com/development/waspmote/examples/ag-10-pt1000-sensor-reading
-30- v5.0
Sensors
4.8.3. Socket
The sensor must be connected to its adaptation stage through a 2,54mm pitch. We can see an image with the two pins of this
socket corresponding to the sensor in the previous figure.
Tree Diameter (cm) Measuring Range in Circumference (mm) Measuring Range in Diameter (mm)
10 31.25 9.94
40 22.99 7.31
100 16.58 5.27
-31- v5.0
Sensors
Reading code:
{
float value_dendrometer = 0;
SensorAgrv20.ON();
SensorAgrv20.setSensorMode(SENS_ON, SENS_AGR_DENDROMETER);
delay(100); //waiting for the stabilization of the power supply
value_dendrometer = SensorAgrv20.readValue(SENS_AGR_DENDROMETER);
}
You can find a complete example code for reading the dendrometer sensor in the following link:
http://www.libelium.com/development/waspmote/examples/ag-9-dendrometer-sensor-reading
4.9.3. Socket
Any of the three dendrometers available may be connected to Waspmote through the two 2.54mm pitch terminal blocks
marked in the image in the figure above. The pins corresponding to the sensor in this terminal block (highlighted in the figure)
provide the sensor with connection to ground, power supply and to the analog-to-digital converter differential input.
-32- v5.0
Sensors
Reading code:
{
float value_dendrometer = 0;
SensorAgrv20.ON();
SensorAgrv20.setSensorMode(SENS_ON, SENS_AGR_DENDROMETER);
delay(100); //waiting for the stabilization of the power supply
value_dendrometer = SensorAgrv20.readValue(SENS_AGR_DENDROMETER);
}
You can find a complete example code for reading the dendrometer sensor in the following link:
http://www.libelium.com/development/waspmote/examples/ag-9-dendrometer-sensor-reading
-33- v5.0
Sensors
4.10.3. Socket
Any of the three dendrometers available may be connected to Waspmote through the two 2.54mm pitch terminal blocks
marked in the image in the figure above. The pins corresponding to the sensor in this terminal block (highlighted in the figure)
provide the sensor with connection to ground, power supply and to the analog-to-digital converter differential input.
-34- v5.0
Sensors
Reading code:
{
float value_dendrometer = 0;
SensorAgrv20.ON();
SensorAgrv20.setSensorMode(SENS_ON, SENS_AGR_DENDROMETER);
delay(100); //waiting for the stabilization of the power supply
value_dendrometer = SensorAgrv20.readValue(SENS_AGR_DENDROMETER);
}
You can find a complete example code for reading the dendrometer sensor in the following link:
http://www.libelium.com/development/waspmote/examples/ag-9-dendrometer-sensor-reading
4.11.3. Socket
Any of the three dendrometers available may be connected to Waspmote through the two 2.54mm pitch terminal blocks
marked in the image in the figure above. The pins corresponding to the sensor in this terminal block (highlighted in the figure)
provide the sensor with connection to ground, power supply and to the analog-to-digital converter differential input.
-35- v5.0
Sensors
Figure : Graph of the spectral response of the SQ-110 sensor compared to the photosynthetic response of a plant
Reading code:
{
float value_radiation = 0;
SensorAgrv20.ON();
SensorAgrv20.setSensorMode(SENS_ON, SENS_AGR_RADIATION);
delay(100); //waiting for the stabilization of the power supply
value_radiation = SensorAgrv20.readValue(SENS_AGR_RADIATION);
//Conversion into μmol·m-2s-1
value_radiation = value_radiation / 0.0002;
}
You can find a complete example code for reading the SQ-110 sensor in the following link:
http://www.libelium.com/development/waspmote/examples/ag-8-photosynthetic-solar-radiation-sensor-reading
-36- v5.0
Sensors
4.12.3. Socket
This sensor is connected to the analog-to-digital converter through the three pins of the 2.54mm pitch terminal block marked
in the image in the figure above.
-37- v5.0
Sensors
Figure : Graph of the spectral response of the SU-100 sensor compared to the photosynthetic response of a plant
Reading code
{
float value_radiation = 0;
SensorAgrv20.ON();
SensorAgrv20.setSensorMode(SENS_AGR_RADIATION, SENS_ON);
delay(100); //waiting for the stabilization of the power supply
value_radiation = SensorAgrv20.readValue(SENS_AGR_RADIATION);
//Conversion into μmol·m-2s-1
value_radiation = value_radiation / 0.0002;
}
You can find a complete example code for reading the SU-100 sensor in the following link:
http://www.libelium.com/development/waspmote/examples/ag-7-ultraviolet-solar-radiation-sensor-reading
-38- v5.0
Sensors
4.13.3. Socket
This sensor is connected to the analog-to-digital converter through the three pins of the 2.54mm pitch terminal block marked
in the image in the figure above.
-39- v5.0
Sensors
4.14.1. Anemometer
4.14.1.1. Specifications
Sensitivity: 2.4km/h / turn
Wind Speed Range: 0 ~ 240km/h
Height: 7.1 cm
Arm length: 8.9 cm
Connector: RJ11
Figure : Anemometer
Reading code:
{
float value_anemometer = 0;
SensorAgrv2.ON();
SensorAgrv20.setSensorMode(SENS_ON, SENS_AGR_ANEMOMETER);
delay(100); //waiting for the stabilization of the power supply
value_anemometer = SensorAgrv20.readValue(SENS_AGR_ANEMOMETER);
}
You can find a complete example code for reading the whole Weather Station WS-3000 data sensor in the following link:
http://www.libelium.com/development/waspmote/examples/ag-12-weather-station-sensor-reading
4.14.1.3. Socket
The way to connect the anemometer to the Agriculture 2.0 Board is through the vane: the anemometer’s cable must be plugged
into the socket that can be found on the base of the vane.
-40- v5.0
Sensors
4.14.2.1. Specifications
Height: 8.9 cm
Length: 17.8 cm
Maximum accuracy: 22.5º
Resistance range: 688Ω ~ 120kΩ
Below, a table with the different values that the equivalent resistance of the wind vane may take is shown, along with the
direction corresponding to each value:
0 33 2.53 SENS_AGR_VANE_N
22.5 6.57 1.31 SENS_AGR_VANE_NNE
45 8.2 1.49 SENS_AGR_VANE_NE
90 1 0.3 SENS_AGR_VANE_E
112.5 0.688 0.21 SENS_AGR_VANE_ESE
135 2.2 0.59 SENS_AGR_VANE_SE
157.5 1.41 0.41 SENS_AGR_VANE_SSE
180 3.9 0.92 SENS_AGR_VANE_S
202.5 3.14 0.79 SENS_AGR_VANE_SSW
225 16 2.03 SENS_AGR_VANE_SW
247.5 14.12 1.93 SENS_AGR_VANE_WSW
270 120 3.05 SENS_AGR_VANE_W
292.5 42.12 2.67 SENS_AGR_VANE_WNW
315 64.9 2.86 SENS_AGR_VANE_NW
337.5 21.88 2.26 SENS_AGR_VANE_NNW
-41- v5.0
Sensors
Reading code:
{
float value_vane = 0;
SensorAgrv20.ON();
SensorAgrv20.setSensorMode(SENS_ON, SENS_AGR_VANE);
delay(100); //waiting for the stabilization of the power supply
value_vane = SensorAgrv20.readValue(SENS_AGR_VANE);
}
You can find a complete example code for reading the whole Weather Station WS-3000 data sensor in the following link:
http://www.libelium.com/development/waspmote/examples/ag-12-weather-station-sensor-reading
Besides, it is recommended to use the function getVaneFiltered() in order to perform a mean filtered measurement during
a specified period of time. Thus, mechanical fluctuations will be avoided and a more accurate measurement will be done. See
example here:
http://www.libelium.com/development/waspmote/examples/ag-12b-wind-vane-filtered
4.14.2.3. Socket
The wind vane is connected to the board through four pins of a terminal block whose correspondence with the sensor’s wire is
shown in the figure above.
4.14.3. Pluviometer
4.14.3.1. Specifications
Height: 9.05 cm
Length: 23 cm
Bucket capacity: 0.28 mm of rain
Figure : Pluviometer
-42- v5.0
Sensors
The library defines several functions to measure from the pluviometer. An inner structure is being used in order to store the
number of pluviometer interruptions that took place for the last 24 hours (regarding the RTC settings). The function used for
storing a new pulse is called storePulse() and it should be called every time a new pluviometer interruption is generated. On
the other hand, it is possible to know three different values given by the following functions:
readPluviometerCurrent() calculates the precipitations in mm for the current period. For example, it is 10:42 am, so this
function returns the mm of rainfall that took place in the last 42 minutes.
readPluviometerHour() calculates the precipitations in the previous one-hour period. For example, it is 10:42 am, so this
function returns the mm of rainfall between 9 am and 10 am.
Tip: the user can apply a little of paraffin on the pluviometer’s upper surface in order to help the rain drops to flow down to the
inside of the sensor.
You can find a complete example code for reading the whole Weather Station WS-3000 data sensor in the following link:
http://www.libelium.com/development/waspmote/examples/ag-12-weather-station-sensor-reading
There is an example of how to use the pluviometer sensor separately from the Weather Station:
www.libelium.com/development/waspmote/examples/ag-13-pluviometer-interruption-reading
4.14.3.3. Socket
In the image in the figure above we can see marked the two pins in the terminal block that correspond to the pluviometer (no
polarity is required).
-43- v5.0
Sensors
These sockets (PTSM from Phoenix Contact) allow to assemble the wires of the probe simply by pressing them into it. To remove
the wire press the slot above the input pin and pull off the wire softly.
Figure : Diagram of a socket extracted from the Phoenix Contact data sheet
In the figure below an image of the board with the sockets in it and the correspondence between its inputs and the sensor’s
pins is shown.
-44- v5.0
Sensors
Figure : Image of the pin correspondence between the sockets and the sensors
Figure : Image of the pin correspondence between the sockets and the sensors
-45- v5.0
Sensors
-46- v5.0
Board configuration and programming
5.2. API
A library for the Agriculture 2.0 Board has been programmed, that added to the Waspmote IDE allows to manage in an easy way
the resources of the board, the power supply, the start-up and reading of the sensors and the interruptions.
When using the Agriculture Sensor Board v20 on Waspmote PRO, remember it is mandatory to include the SensorAgrv20 library
by introducing the next line at the beginning of the code:
#include <WaspSensorAgriculture_v20.h>
Next, the different functions that make up the library are described:
SensorAgrv20.ON()
Turns on the sensor board by activating the 3.3V and 5V supply lines.
SensorAgrv20.OFF()
Turns off the sensor board by cutting the 3.3V and 5V supply lines.
SensorAgrV20.setBoardMode(MODE)
This function is used to manage the power applied to the board. Assigning the value SENS_ON to the variable MODE activates
the board’s switches which allow the passage of the 3.3V and 5V supplies, while assigning the value SENS_OFF disconnects
both switches cutting the power.
SensorAgrV20.setSensorMode(MODE, TYPE)
This function allows activation or deactivation of each of the sensors by assigning to the variable MODE the values SENS_ON (for
turning the sensor on) or SENS_OFF (for turning the sensor off). The sensor to be managed is pointed through the variable TYPE.
-47- v5.0
Board configuration and programming
When turning on and off each of the sensors, take into account that many of them are grouped under the same solid state
switch, so when you modify the state of any sensor of the group you will be also acting on all the other sensors associated to its
control switch. You can find more information on how the sensors are grouped in chapter “Power control”.
SensorAgrv20.readValue(SENSOR, TYPE)
The instruction readValue() captures the output value of the sensor and stores it in floating point format in the variable
to which it has been assigned. The sensor whose output we want to read is defined by the variable SENSOR, which can take
the same values enumerated in the section about the setSensorMode() function. The captured value is converted into the
units corresponding to the sensor that has been read. The parameter TYPE is only necessary when the sensor to be read is the
temperature and humidity SHT75 by Sensirion, for which it is required to point which of the two measurements is going to be
made (SENSIRION_TEMP for temperature and SENSIRION_HUM for humidity).
SensorAgrv20.attachPluvioInt(SENSOR)
The attachPluvioInt() function enables the interruptions generated by the pluviometer. Take into account that this sensor
is permanently powered all the time the board is on so it will keep on triggering interruptions as long as they are enabled.
SensorAgrv20.detachPluvioInt()
Complementing the previous function, the aim of detachPluvioInt() is to deactivate the interruptions generated by
the pluviometer. After its execution the microcontroller will ignore any interruption which arrives from this sensor until the
attachPluvioInt() instruction is called again.
The function sleepAgr() is an adaptation of the function deepSleep() in the library WaspPWR.cpp that allows to put the
Waspmote to sleep turning the power of the board completely off or keeping the pluviometer circuits on if the interruptions
of this sensor are going to be used to wake up the microcontroller. The parameters TIME, OFFSET, MODE and OPTION allow to
define the time the mote will be in deep sleep mode before waking up with an RTC interruption and the modules that will be
inactive during this time, like in the original function (look at the Waspmote technical guide and programming guide for more
information). To activate the pluviometer interruptions the parameter AGR_INTERRUPTION must be assigned with the value
SENS_AGR_PLUVIOMETER (remember not to deactivate the sensor board when defining the parameter OPTION for a correct
operation of the interruptions).
A basic program to detect events from the board will present a similar structure to the following, subject to changes in
dependence of the application:
5. When the mote wakes up, disable interruptions from the board using function SensorAgrv20.detachPluvioInt.
-48- v5.0
Board configuration and programming
Below you can see a sample of code in which the board is activated and put to sleep for ten minutes with the interruptions of
rainfall activated. When an interruption from the RTC or the sensor board comes in, the mote wakes up and the pluviometer,
dendrometer, anemometer and temperature sensor are read in function of the kind of interruption arrived. The measurements
taken are transmitted via XBee.
www.Libelium.com
*/
//Variable definition
float value_temperature = 0;
float value_dendrometer = 0;
float value_anemometer = 0;
float value_pluviometer = 0;
void setup()
{
// Turn on the Agriculture 2.0 Sensor Board
SensorAgrv20.ON();
// Init the RTC
RTC.ON();
delay(100);
}
void loop()
{
// Put the mote to sleep with pluviometer interruptions enabled
SensorAgrv20.sleepAgr(“00:00:10:00”, RTC_OFFSET, RTC_ALM1_MODE1,
SOCKET0_OFF, SENS_AGR_PLUVIOMETER);
// Detach pluviometer interruptions
SensorAgrv20.detachPluvioInt();
-49- v5.0
Board configuration and programming
// Init XBee
xbee802.ON();
// Set parameters to packet:
packet=(packetXBee*) calloc(1,sizeof(packetXBee));
packet->mode=BROADCAST;
-50- v5.0
API Changelog
6. API Changelog
Keep track of the software changes on this link:
www.libelium.com/development/waspmote/documentation/changelog/#Agriculture
-51- v5.0
Consumption
7. Consumption
7.1. Power control
The electronics of the Agriculture 2.0 Board requires the 3.3V power supply from the Waspmote regulator and the 5V
power supply from the DC-DC converter, both can be controlled from the microcontroller of the mote using the function
setBoardMode() of the API for turning it completely on or off.
Inside the board itself, the power of the sensors may be managed separately using the digital solid state switches system like
in other sensor boards for the Waspmote platform, allowing to keep the board on with a minimum consumption of 106μA. This
way, the 15 sensors that, as a maximum, can be connected simultaneously to the Agriculture 2.0 Board have been put together
into four different groups following two criteria: the consumption of the sensors and the job their perform. The API functions
that control the activation of the sensors, as the rest of the functions specifically created for this board, can be found in the
library SensorAgr20, explained in chapter “API”.
Watermark Group: The first of this groups is formed by the three Watermark sensors for soil humidity and electronic adaptation
stages described in chapter “Socket” of the Watermark sensor section. The 3.3V power supply is connected to the sensors and
the rest of the electronics through switch 2, that can be manipulated through the digital pin DIGITAL1.
Meteorology Group: The second group is formed by the wind vane and the anemometer of the Weather Station WS-3000
described in sections “Weather Station (WS-3000)”. Again, these sensors only need the 3.3V power supply, controlled by the pin
ANALOG1 (configured as a digital output pin) by the switch 4.
Low Consumption Group: The third group is formed by all the low consumptions sensors: the dendrometer, the temperature
sensor, the humidity sensor, the luminosity sensor, the leaf wetness sensor, the soil temperature sensor, the solar radiation sensor
and the humidity plus temperature sensor. The regulation of the power of these sensors requires three different integrated
circuits (switches 1, 2 and 3), all of them controlled through the same digital pin (DIGITAL5). This group of sensors needs both
the 5V and the 3.3V power supplies.
At last, the atmospheric pressure sensor MPX4115A is powered independently of the rest of the sensors owing to its large
consumption. Its power supply (5V) is controlled also through the switch 3, but in this case its activation and deactivation is
carried out by the digital pin DIGITAL7.
The pluviometer is kept powered all the time at 3.3V, except when the whole board is turned off from the Waspmote. The
convenience of monitoring the rainfall all the time once the mote has been deployed in determined applications is the main
reason for it, along with the fact that the consumption of this sensor in absence of rain is almost null.
-52- v5.0
Consumption
Remember that the board’s power can be completely disconnected, reducing the consumption to zero, using the 3.3V and the
5V main switches disconnection command included in the library.
Consumption
Minimum (Constant) 0μA
Weather Station WS-3000 group 0μA
Watermark Sensors group 1.4mA
Low Consumption group 1.8mA
Atmospheric Pressure sensor 112μA
Watermark (1 sensor) <0.8mA
Watermark (2 sensors) <1.5mA
Watermark (3 sensors) <2.2mA
Anemometer <400μA
Wind Vane <300μA
Pluviometer 0μA (330μA in ON Pulse -10ms approximately-)
Humidity (808H5V5) 0.7mA
Temperature (MCP9700A) 6μA
Luminosity (LDR) <360μA
SHT75 <1μA
Atmospheric Pressure (Sensor) 7mA
Solar Radiation sensor - PAR (SQ-110) 0μA
PT1000 1.5mA
Dendrometers 160μA
Leaf Wetness Sensor <240μA
-53- v5.0
Documentation changelog
8. Documentation changelog
From v4.9 to v5.0
•• References to the new LoRaWAN module
-54- v5.0
Maintenance
9. Maintenance
•• In this section, the term “Waspmote” encompasses both the Waspmote device itself as well as its modules and sensor boards.
•• Take care with the handling of Waspmote, do not drop it, bang it or move it sharply.
•• Avoid putting the devices in areas of high temperatures since the electronic components may be damaged.
•• The antennas are lightly threaded to the connector; do not force them as this could damage the connectors.
•• Do not use any type of paint for the device, which may damage the functioning of the connections and closure mechanisms.
-55- v5.0
Disposal and recycling
-56- v5.0
Appendix 1: Watermark sensor’s interpretation reference
Figure : Table 1. Resistance values of the sensor in function of the soil water tension
From the real values and the approximation we obtain the next graph of the sensor resistance versus the soil water tension.
-57- v5.0
Appendix 1: Watermark sensor’s interpretation reference
In the next figure we can see the frequency of the output of the adaptation circuit for the sensor, for the real resistance values
and for the linearly approximated resistance values.
Figure : Output frequency of the adaptation circuit in function of the soil water tension.
The formula used to draw this graph, from the sensor resistance, is shown bellow:
Equation 2:
If we substitute Equation 1 in Equation 2, we get the output frequency in function of the soil water tension:
Equation 3:
Equation 4:
We can see that the frequency output for the working range is between 300Hz (corresponding to the 200cbar of maximum
soil water tension) and 7600Hz approximately for 0cbar measurement. It has been empirically checked that for very wet soils,
bellow 10cbar, the behavior of different sensors is very variable, so calibration is highly recommended if accuracy under these
conditions is needed.
To obtain the response of the sensor beyond this range, over the 200cbar, we must extrapolate those soil water tension values
from the linear approximation obtained in equation 1. These sensors are not prepared for working under those conditions, so
these graph must be only taken as a reference.
-58- v5.0
Appendix 1: Watermark sensor’s interpretation reference
Figure : Soil water tension in function of the output frequency of the circuit.
Figure : Soil water tension (in logarithmic scale) in function of the output frequency of the circuit.
-59- v5.0