Gases Sensor Board 2.0
Gases 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.......................................................................................................................................................... 16
4. Sensors................................................................................................................................................ 17
4.1. General considerations in the use of the sensors........................................................................................................... 17
4.2. Starting with the gas sensors................................................................................................................................................ 18
4.2.1. Sensor calibration.......................................................................................................................................................18
4.2.2. Gain and load resistor configuration...................................................................................................................18
4.2.3. Converting the read data.........................................................................................................................................19
4.2.4. Calibrated sensors performance............................................................................................................................19
4.3. Humidity Sensor 808H5V5.................................................................................................................................................. 20
4.3.1. Specifications................................................................................................................................................................20
4.3.2. Measurement Process...............................................................................................................................................20
4.4. Temperature Sensor MCP9700A....................................................................................................................................... 21
4.4.1. Specifications................................................................................................................................................................21
4.4.2. Measurement Process...............................................................................................................................................21
4.5. Atmospheric Pressure Sensor - MPX4115A...................................................................................................................... 23
4.5.1. Specifications................................................................................................................................................................23
4.5.2. Measurement Process...............................................................................................................................................23
-2- v4.8
Index
-3- v4.8
Index
6. Consumption...................................................................................................................................... 55
6.1. Power control.............................................................................................................................................................................. 55
6.2. Consumption table................................................................................................................................................................... 55
6.3. Low Consumption Mode......................................................................................................................................................... 55
7. API Changelog.................................................................................................................................... 56
8. Documentation changelog................................................................................................................ 57
9. Maintenance....................................................................................................................................... 58
-4- v4.8
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- v4.8
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, LoRa, 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- v4.8
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- v4.8
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- v4.8
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- v4.8
Waspmote Plug & Sense!
http://www.libelium.com/development/plug_&_sense/sdk_and_applications/code_generator
Thanks to Meshliums 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- v4.8
Waspmote Plug & Sense!
-11- v4.8
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- v4.8
Waspmote Plug & Sense!
-13- v4.8
Waspmote Plug & Sense!
Temperature 9203
Humidity 9204
B
Atmospheric pressure 9250
Oxygen - O2 9231
Note: For more technical information about each sensor probe go to the Development section in Libelium website.
-14- v4.8
Hardware
3. Hardware
3.1. General Description
The Waspmote Gases 2.0 board has been designed to monitor environmental parameters such as temperature, humidity,
atmospheric pressure and 14 different types of gases. It allows the inclusion of 7 gases sensors at the same time, the regulation
of their power through a system of solid state switches and the amplification of the output signal of each one of them through
a non-inverting amplification stage of a maximum gain of 101 controlled by a digital potentiometer configurable through the
Inter-Integrated Circuit Bus, I2C).
Carbon Monoxide CO
Carbon Dioxide CO2
Molecular Oxygen O2
Methane CH4
Molecular Hydrogen H2
Ammonia NH3
Isobutane C4H10
Ethanol CH3CH2OH
Toluene C6H5CH3
Hydrogen Sulphide H2S
Nitrogen Dioxide NO2
Ozone O3
Volatile Organic Compounds (VOCs)
Hydrocarbons
3.2. Specifications
Weight: 20gr
Dimensions: 73.5 x 51 x 1.3 mm
Temperature Range: [-20C, 65C]
-15- v4.8
Hardware
Sensors compatibility:
- temperature
- humidity
- air pressure
- CO2 (socket 1A)
- O2 (socket 1B)
Sockets 2A, 3 and 4 are available for the rest of the sensors.
-16- v4.8
Sensors
4. Sensors
4.1. General considerations in the use of the sensors
A very similar structure has been installed for all the connectors for the gas sensors: a load resistance at the output of each
sensor, except in connectors 1A and 1B where it is not necessary, combined with an amplification stage of maximum gain 101.
Connectors 1A and 1B, 2A and 2B and 3A and 3B share the same amplification stage and the same output to the microprocessor.
For more details on the connectors, see the Design and connections section in this manual.
The choice of amplification stage gain and of the sensors load resistance can be carried out according to two parameters: the
specific sensor available, since there may be significant variations between two different sensors of the same model, and the
value and range of concentrations of gas to be monitored.
Important: when selecting load resistance and amplification it must be remembered that, although the sensors must be
powered by a voltage of 5V to function appropriately, the Waspmote allows input between 0 and 3.3V, so it will be necessary to
calculate the resistance, load and gain values to adapt the measurement range of the sensor to the Waspmote input.
The amplification stage gain and load resistance of a connector can be configured through a simple group of commands
available in the SensorGasv20 library, created to facilitate handling of the board from the Waspmote mote. For more information
on the library instructions and steps to follow for the configuration of the sensors, consult the API section of this manual.
The accuracy which can be obtained in the sensors output value will be dependent on the way in which it is supplied. This way,
the longer the power time or duty cycle, as appropriate, the better accuracy will be obtained. The disadvantage of prolonged
power is an increase in the motes consumption, with the consequent decrease of the batterys life, so adjusting the power of
each sensor to the requirements of the specific application being developed is recommended to optimize the equipments
performance.
The calculation of the sensors resistance, from which the concentration of gas value can be obtained using the graphs included
in this manual and in the sensors data sheets, can be made using the following equation:
RS = ( Vc * Rl ) / V out - Rl
In which RS is the sensors output resistance, VC its power (5V for any sensor except socket 3B for the NO2, which is powered at
1.8V, and socket 2B for VOC and O3 sensors, which is powered at 2.5V), VOUT is the output voltage measurement and Rl the load
resistance which has been defined.
When a sensor remains without power for a prolonged period it is possible that it shows an unstable output.
This stability is regained after spending time switched on or after many consecutive cycles of power supply.
Sensitivity of the sensor may vary when the device is subjected to large variations in temperature or humidity, for example in
outdoor conditions. To compensate for these variations, use the tables and graphs used in the sensors data sheets.
-17- v4.8
Sensors
Take into account that developing a robust application for gases detection or measurement may take an important effort of
testing and knowing the sensors.
Note: The calibrated gas sensor line launched in 2014 was discontinued.
When dealing with most of the sensors used in the Gases 2.0 board it is highly recommended to calibrate the sensor in order
to get an accurate value, since, as explained in section General considerations in the use of the sensors, its normal resistance
and sensitivity may vary from one unit to another in a wide range. This calibration may not be necessary in all applications,
for example if the sensor is going to be used in a gas detection, where monitoring the variation of the sensor output may be
enough to have it working properly, and the normal operation conditions may be replicated without an specific equipment.
The calibration procedure requires the capture of the sensor response under different concentrations of gas in the target
operation range (that should be comprised in the operation range of the sensor), and, depending on the conditions of the
application to be implemented, under controlled temperature and humidity. The larger the number of calibration points in that
range the more accurate the calibration will be, a logarithmic approximation to the response of the sensor for the intermediate
values should be applied (in one or two axis, depending on the sensors, as shown in their respective response graphs). Take into
account that gas sensors are sensitive, in different degree, to several target gases, which may affect the measurement both in
the field and in the laboratory. The recreation of these conditions may require of specific equipment, so it may be necessary the
help of a specialized laboratory.
The most adequate way of configuring the adaptation stage is by determining the load resistance and gain necessary from the
calibration data and the application requirements and test it, adjusting the definitive values with the results obtained. In other
cases, in which these parameters cannot be that clearly defined owing to the lack of calibration or to the indeterminacy of the
application conditions, for example when handling the sensors for the first time, you can follow the advice provided below:
As a general rule, gain will be fixed at 1 in almost every application, only in very specific situations, such as operation in the limits
of the sensor range, it will be necessary a different value. There are two exceptions to this rule, that are sensors for CO2 (TGS4161)
and O2 (SK-25) which output a voltage that has to be amplified to adjust it to the Waspmotes analog-to-digital converter. In the
case of the O2 sensor the extremely low voltage advises a gain of 100, whilst for the CO2 sensor, with a higher (and more variable)
output, a gain between 7 and 10 will be adequate.
In the case of the load resistor it is not that simple, since, as said before, it will be different from one sensor to another. If
calibration has not been performed it will be necessary a wide testing based on trial and error to achieve the correct resistance
value. It is recommended in this case to start with the lowest value indicated as initial sensor resistance in the documentation,
and adjust it to get the desired output voltage (usually 1.6V, the middle of the analog-to-digital converter range, if it is not
specified by another restriction). When carrying out this adjustment beware not to configure a resistance below the minimum
load resistance indicated in the corresponding section of the documentation, since it could damage the sensor.
-18- v4.8
Sensors
As indicated in section General considerations in the use of the sensors, beware when operating with sensors that have not
been used for a long time, since they may require of some time to get to work properly. Applying a burning process, having
them on with a continuous reading for at least about 12 hours, is highly recommended before starting using the sensors.
Again, the most accurate response will be obtained if sensors are calibrated previously to their introduction in the definitive
application. Constructing a conversion function or graph out of the calibration results and translating the read values into it will
lead to the best performance.
In case the calibration process cannot be performed, the concentration may be estimated using the provided output graphs,
which correspond to the typical response of the sensors. Even though, it will be necessary to calculate the initial resistance of
the sensor, whose range is given in the specifications section of the sensor. In some cases it may be determined from a normal
environment measurement, since information may be obtained from other sources such as detectors or studies about the gas
presence in the operation environment. Anyway, take into account that the data obtained following this method will be highly
inaccurate.
Finally, it is necessary to keep in mind that in the case of some sensors and applications the extraction of the concentration value
may not be that straightforward, since other parameters may interfere in the behavior of the sensor. In some sensors other gases
different from the target can cause a significant change in the resistance value, so it will be necessary a high knowledge of the
application conditions to be able to determine precisely the gas concentration. The combination of several sensors is a suitable
option to avoid this situations. Also, in applications in which high variations of temperature and humidity are present it may be
required to perform a compensation. For this, a temperature and a humidity sensor have been integrated in the Gases Sensor
boards, so all the necessary information can be obtained. Please refer to the sensors data sheet and application notes for more
information about the temperature and humidity compensation of the sensors.
Instead of using this function it can be applied a more simple linear approximation between each of the points. This method
will generally be more accurate when the output is very close to a calibration point since the curve resulting from the fitting
may not be adjusted to pass by that exact point, but it will lead to more inaccurate results for points in the middle of the range.
First of all, as mentioned before, the accuracy will be highly dependent on the heating time applied to the sensor. For proper
operation sensors must be powered until they reach their operating temperature, which may take several minutes depending
on the sensor, the environmental temperature and the duty cycle of the application. If a completely stable measurement has
not been achieved an additional error to that of the sensor and the electronics itself will be added.
Secondly, the environmental temperature will also affect the behavior of the sensor, being necessary a temperature correction
to achieve the maximum accuracy. This correction should be performed from the temperature dependence graphs and tables
provided by the manufacturer of the sensor in its data sheet or application note.
The last problem encountered with these sensors (which generally affects all chemical sensors) is recalibration. After some
operation time, the wear of the sensing layer owing to different effects will lower the accuracy of the sensor, so it will
have to be replaced with a new calibrated probe. The more accuracy required or the more harass environment sensors will
operate in, the more frequent replacement will be required, but as a general rule probes should be always replaced every
six months.
-19- v4.8
Sensors
The sensor remains powered provided that the boards 5V supply is switched on, so that for its reading it is only necessary to
execute the capture command of the analog value of the pin to which the sensor is connected (ANALOG4).
Reading code:
{
SensorGasv20.ON();
delay(15000);
float value;
value = SensorGasv20.readValue(SENS_HUMIDITY);
}
Figure : 808H5V5 Humidity sensor output taken from the Sencera Co. Ltd sensor data sheet
-20- v4.8
Sensors
You can find a complete example code for reading the humidity sensor in the following link:
http://www.libelium.com/development/waspmote/examples/ga-2-humidity-sensor-reading
This sensor has its own connector on the Waspmote Gases 2.0 board:
Figure : Image of the sensor connector on the Waspmote Gases 2.0 board
The output can thus be read directly from Waspmote through the capture command of the pins analog value to which it is
connected (ANALOG1).
Reading code:
{
SensorGasv20.ON();
delay(100);
float value;
value = SensorGasv20.readValue(SENS_TEMPERATURE);
}
-21- v4.8
Sensors
Figure : Graph of the MCP9700A sensor output voltage with respect to temperature, taken from the Microchip sensors data sheet
This sensor has its own connector on the Waspmote Gases 2.0 board:
You can find a complete example code for reading the temperature sensor in the following link:
http://www.libelium.com/development/waspmote/examples/ga-1-temperature-sensor-reading
Figure : Image of the temperature sensor connector of the Waspmote Gases 2.0 board
-22- v4.8
Sensors
To read the sensor it is sufficient to capture the analog value in its input (ANALOG5) via the corresponding command.
Reading Code:
{
SensorGasv20.ON();
SensorGasv20.setSensorMode(SENS_ON, SENS_PRESSURE);
delay(30);
float value;
value = SensorGasv20.readValue(SENS_PRESSURE);
}
Figure : Graph of the MPX4115A sensors output voltage with regard to pressure taken from the Freescale sensors data sheet
You can find a complete example code for reading the atmospheric pressure sensor in the following link:
http://www.libelium.com/development/waspmote/examples/ga-3-atmospheric-pressure-sensor-reading
-23- v4.8
Sensors
This sensor has its own connector on the Waspmote Gases 2.0 board:
Reading this sensor requires a cycle of one second throughout which two power supply pulses are generated on heat resistance
and sensor resistance of 14ms and 5ms each (average consumption throughout the power supply cycle is 3mA). The execution
of this cycle and the reading of the sensor can be done automatically using the functions of the SensorGasv20 library.
Reading code:
{
SensorGasv20.ON();
SensorGasv20.configureSensor(SENSOR, GAIN, RESISTOR);
float value;
value = SensorGasv20.readValue(SENSOR);
}
-24- v4.8
Sensors
SENSOR indicates the socket into which it is to be inserted, for this sensor: SENS_SOCKET3CO or SENS_SOCKET4CO
GAIN indicates the chosen gain for the sensor.
RESISTOR indicates the load resistance to be introduced
You can find a complete example code for reading the TGS2442 sensor placed on socket 4 in the following link:
http://www.libelium.com/development/waspmote/examples/ga-11-co-sensor-on-socket4-reading
Figure : Graph of the sensitivity of the TGS2442 taken from the Figaro sensors data sheet
-25- v4.8
Sensors
The accuracy that this sensor can offer will vary depending on the time it has remained powered before being measured. A time
of 30 seconds is sufficient to detect significant changes in concentration, while a high accuracy measurement will require at
least 10 minutes of power.
This sensor must be placed only in connector 1A as indicated in the figure which appears in section Connector 1. To access the
sensors output value it is enough t o execute the SensorGasv20 library command which captures the sensors analog value in
its input pin (ANALOG3).
Reading code:
{
SensorGasv20.ON();
SensorGasv20.configureSensor(SENS_CO2, GAIN);
SensorGasv20.setSensorMode(SENS_ON, SENS_CO2);
delay(TIME);
float value;
value = SensorGasv20.readValue(SENS_CO2);
}
You can find a complete example code for reading the TGS4161 sensor in the following link:
http://www.libelium.com/development/waspmote/examples/ga-4-co2-sensor-reading
Figure : Graph of sensitivity of the TGS4161 sensor taken from the Figaro sensors data sheet
-26- v4.8
Sensors
Reading code:
{
SensorGasv20.ON();
delay(10);
SensorGasv20.configureSensor(SENS_O2, GAIN);
float value;
value = SensorGasv20.readValue(SENS_O2);
}
You can find a complete example code for reading the SK25 sensor in the following link:
http://www.libelium.com/development/waspmote/examples/ga-5-o2-sensor-reading
Figure : Graph of the sensitivity of the SK-25 extracted from the Figaro sensors data sheet
-27- v4.8
Sensors
The calibration process for this sensor can be performed by the customer very easily, if we consider a couple of facts:
This sensor must be connected in socket 3B of the board (its position is indicated in section Connector 3), and its output can
be read through the capture commands of the SensorGasv20 library.
Reading code:
{
SensorGasv20.ON();
SensorGasv20.configureSensor(SENS_SOCKET3B, GAIN, RESISTOR);
SensorGasv20.setSensorMode(SENS_ON, SENS_SOCKET3B);
delay(TIME);
float value;
value = SensorGasv20.readValue(SENS_SOCKET3B);
}
You can find a complete example code for reading the MiCS-2710 sensor in the following link:
http://www.libelium.com/development/waspmote/examples/ga-9-socket3b-sensor-reading
-28- v4.8
Sensors
Figure : Graph of the sensitivity of the MiCS-2710 taken from the e2vs sensor data
Gases: NO2
Measurement range: 0.05 ~ 5ppm
Air resistance: 0.8 ~ 8k (typically 2.2k)
Sensitivity: 6 ~ 100 (typically 55, ratio between the resistance at 0.25ppm and in air)
Supply voltage: 1.7 ~ 2.5V DC
Operating temperature: -30 ~ +85C
Response time: 30 seconds
Average consumption: 26mA (throughout the complete power supply cycle in one second)
This sensor must be connected in socket 3B of the board (its position is indicated in section Connector 3), and its output can
be read through the capture commands of the SensorGasv20 library.
-29- v4.8
Sensors
Reading code:
{
SensorGasv20.ON();
SensorGasv20.configureSensor(SENS_SOCKET3B, GAIN, RESISTOR);
SensorGasv20.setSensorMode(SENS_ON, SENS_SOCKET3B);
delay(TIME);
float value;
value = SensorGasv20.readValue(SENS_SOCKET3B);
}
You can find a complete example code for reading the MiCS-2714 sensor in the following link:
www.libelium.com/development/waspmote/examples/ga-9-socket3b-sensor-reading
Figure : Graph of the sensitivity of the MiCS-2714 taken from the e2vs sensor data.
-30- v4.8
Sensors
This sensor can be placed on connectors 3A and 4 following the direction indicated in sections Connector 3 and Connector 4.
To read it, the necessary instructions are in the SensorGasv20 library:
Reading code:
{
SensorGasv20.ON();
SensorGasv20.configureSensor(SENSOR, GAIN, RESISTOR);
float value;
value = SensorGasv20.readValue(SENSOR);
}
SENSOR indicates the socket into which it is to be inserted, for this sensor: SENS_SOCKET3NH3 or SENS_SOCKET4NH3
GAIN indicates the chosen gain for the sensor.
RESISTOR indicates the load resistance chosen for the sensor
You can find a complete example code for reading the TGS2444 sensor placed on socket 3 in the following link:
http://www.libelium.com/development/waspmote/examples/ga-12-nh3-sensor-on-socket3-reading
Figure : Graph of the sensitivity of the TGS2444 taken from the Figaro sensor data sheet
-31- v4.8
Sensors
This sensor can be used from connectors 2A, 3A and 4, placing it in the position referred to in sections Connector 2, Connector 3 and
Connector 4 and its output value can be read using the corresponding function in the SensorGasv20 library:
Reading code:
{
SensorGasv20.ON();
SensorGasv20.configureSensor(SENSOR, GAIN, RESISTOR);
SensorGasv20.setSensorMode(SENS_ON, SENSOR);
delay(TIME);
float value;
value = SensorGasv20.readValue(SENSOR);
}
SENSOR indicates the socket into which it is to be inserted, for this sensor:
SENS_SOCKET2A, SENS_SOCKET3A or SENS_SOCKET4A
GAIN indicates the chosen gain for the sensor.
RESISTOR indicates the load resistance chosen for the sensor
TIME is the time in milliseconds that the sensor remains switched on before taking the measurement (minimum: 30000)
-32- v4.8
Sensors
Figure : Graph of sensitivity of the TGS2611 taken from the Figaro sensors data sheet
This sensor can be inserted in connectors 2A, 3A and 4, and must be placed in the position indicated in sections Connector 2,
Connector 3 and Connector 4. The sensors output value can be read using the corresponding commands in the SensorGasv20
library:
Reading code:
{
SensorGasv20.ON();
SensorGasv20.configureSensor(SENSOR, GAIN, RESISTOR);
SensorGasv20.setSensorMode(SENS_ON, SENSOR);
delay(TIME);
float value;
value = SensorGasv20.readValue(SENSOR);
}
-33- v4.8
Sensors
SENSOR indicates the socket into which it is to be inserted, for this sensor:
SENS_SOCKET2A, SENS_SOCKET3A or SENS_SOCKET4A
GAIN indicates the chosen gain for the sensor.
RESISTOR indicates the load resistance chosen for the sensor
TIME is the time in milliseconds that the sensor remains on before taking the measurement (minimum: 30000)
Figure : Graph of the sensitivity of the TGS2610 taken from the Figaro sensors data sheet
This sensor can be placed on connectors 2A, 3A and 4 following the direction indicated in sections Connector 2, Connector
3 and Connector 4 of this manual. To capture this output voltage value, specific instructions are in the SensorGasv20 library.
-34- v4.8
Sensors
Reading code:
{
SensorGasv20.ON();
SensorGasv20.configureSensor(SENSOR, GAIN, RESISTOR);
SensorGasv20.setSensorMode(SENS_ON, SENSOR);
delay(TIME);
float value;
value = SensorGasv20.readValue(SENSOR);
}
SENSOR indicates the socket into which it is to be inserted, for this sensor:
SENS_SOCKET2A, SENS_SOCKET3A or SENS_SOCKET4A
GAIN indicates the chosen gain for the sensor.
RESISTOR indicates the load resistance chosen for the sensor
TIME is the time in milliseconds that the sensor remains on before taking the measurement (minimum: 30000)
Figure : Graph of the sensitivity of the TGS2600 taken from the Figaro sensors data sheet
-35- v4.8
Sensors
The TGS2602 sensor can be placed in sockets 2A, 3A and 4 in accordance with the indications shown in sections Connector
2, Connector 3 and Connector 4. The output voltage values of these connectors can be read using the instructions in the
SensorGasv20 library:
Reading code:
{
SensorGasv20.ON();
SensorGasv20.configureSensor(SENSOR, GAIN, RESISTOR);
SensorGasv20.setSensorMode(SENS_ON, SENSOR);
delay(TIME);
float value;
value = SensorGasv20.readValue(SENSOR);
}
SENSOR indicates the socket into which it is to be inserted, for this sensor:
SENS_SOCKET2A, SENS_SOCKET3A or SENS_SOCKET4A
GAIN indicates the chosen gain for the sensor.
RESISTOR indicates the load resistance chosen for the sensor
TIME is the time in milliseconds that the sensor remains on before taking the measurement (minimum: 30000)
-36- v4.8
Sensors
Figure : Graph of the sensitivity of the TGS2602 taken from the Figaro sensors data sheet
The sensor can be connected to the board through sockets 2A, 3A and 4, provided that their direction is as that shown in
sections Connector 2, Connector 3 and Connector 4. The necessary instructions for the reading of the sensors output is in
the SensorGasv20 library.
-37- v4.8
Sensors
Reading code:
{
SensorGasv20.ON();
SensorGasv20.configureSensor(SENSOR, GAIN, RESISTOR);
SensorGasv20.setSensorMode(SENS_ON, SENSOR);
delay(TIME);
float value;
value = SensorGasv20.readValue(SENSOR);
}
SENSOR indicates the socket into which it is to be inserted, for this sensor:
SENS_SOCKET2A, SENS_SOCKET3A or SENS_SOCKET4A
GAIN indicates the chosen gain for the sensor.
RESISTOR indicates the load resistance chosen for it
TIME is the time in milliseconds that the sensor remains on before taking the measurement (minimum: 30000)
Figure : Graph of the sensitivity of the TGS2620 taken from the Figaro sensors data sheet
-38- v4.8
Sensors
This sensor must be connected in socket 2B of the board (its position is indicated in section Connector 2), and its output can
be read through the capture commands of the SensorGasv20 library:
Reading code:
{
SensorGasv20.ON();
SensorGasv20.configureSensor(SENS_SOCKET2B, GAIN, RESISTOR);
SensorGasv20.setSensorMode(SENS_ON, SENS_SOCKET2B);
delay(TIME);
float value;
value = SensorGasv20.readValue(SENS_SOCKET2B);
}
Figure : Graph of the sensitivity of the MiCS-2610 taken from the e2vs sensor data
-39- v4.8
Sensors
Gases: O3
Measurement range: 10 ~ 1000ppb
Air resistance: 3 ~ 60k (typically 11k)
Sensitivity: 2 ~ 4 (typically 1.5, ratio between the resistance at 100ppb and at 50ppb)
Supply voltage: 1.95 ~ 5V DC
Operating temperature: -30 ~ +85C
Response time: 30 seconds
Average consumption: 34mA Figure : Image of the MiCS-2614 sensor
This sensor must be connected in socket 2B of the board (its position is indicated in section Connector 2), and its output can
be read through the capture commands of the SensorGasv20 library:
Reading code:
{
SensorGasv20.ON();
SensorGasv20.configureSensor(SENS_SOCKET2B, GAIN, RESISTOR);
SensorGasv20.setSensorMode(SENS_ON, SENS_SOCKET2B);
delay(TIME);
float value;
value = SensorGasv20.readValue(SENS_SOCKET2B);
}
-40- v4.8
Sensors
Figure : Graph of the sensitivity of the MiCS-2614 taken from the e2vs sensor data
(*) Chlorinated hydrocarbons, aromatic hydrocarbons, aromatic alcohols, aliphatic alcohols, terpenes, glycols, aldehydes, esters and acids. Detailed list can be found at
http://www.libelium.com/downloads/voc-sensors.xls
This sensor must be connected in socket 2B of the board (its position is indicated in section Connector 2), and its output can
be read through the capture commands of the SensorGasv20 library.
-41- v4.8
Sensors
Reading code:
{
SensorGasv20.ON();
SensorGasv20.configureSensor(SENS_SOCKET2B, GAIN, RESISTOR);
SensorGasv20.setSensorMode(SENS_ON, SENS_SOCKET2B);
delay(TIME);
float value;
value = SensorGasv20.readValue(SENS_SOCKET2B);
}
Figure : Graph of the sensitivity of the MiCS-5521 taken from the e2vs sensor data
(*) Chlorinated hydrocarbons, aromatic hydrocarbons, aromatic alcohols, aliphatic alcohols, terpenes, glycols, aldehydes, esters and
acids. Detailed list can be found at http://www.libelium.com/downloads/voc-sensors.xls
-42- v4.8
Sensors
This sensor must be connected in socket 2B of the board (its position is indicated in section Connector 2), and its output can
be read through the capture commands of the SensorGasv20 library.
Reading code:
{
SensorGasv20.ON();
SensorGasv20.configureSensor(SENS_SOCKET2B, GAIN, RESISTOR);
SensorGasv20.setSensorMode(SENS_ON, SENS_SOCKET2B);
delay(TIME);
float value;
value = SensorGasv20.readValue(SENS_SOCKET2B);
}
TIME is the time in milliseconds that the sensor remains on before taking the measurement (minimum: 30000)
Figure : Graph of the sensitivity of the MiCS-5524 taken from the e2vs sensor data
-43- v4.8
Sensors
Firstly, the three connectors for analog sensors, initially those for temperature, humidity and atmospheric pressure sensors
(see components diagram in section Hardware. Specifications). These three connectors have only one strip of three pins
which provide connection to ground, to 5V supply and to one of the microprocessors analog inputs (ANALOG1, ANALOG4 and
ANALOG5 respectively). In the case of the humidity and atmospheric pressure sensors output, a voltage divider of resistances
of 3.3K and 2.2K has been placed between these and the microprocessors analog input ANALOG4 and ANALOG5 to adapt the
sensors output range (between 0 and 4.5V to that available in the Waspmote input (between 0 and 3.3V).
Next the rest of the connectors used for gas sensors are described:
4.21.1. Connector 1
Connector 1 (see the components diagram in section Hardware. Specifications) has been designed to connect 2 different
sensors in the board simultaneously: TGS4161 (CO2) and SK-25 (O2), although its reading and powering is not permitted at
the same time. In this way, the connection designed for the CO2 sensor (which is named connector 1A) has two strips of three
2.54mm pitch female pins, of which two are without connection (the two in the center), one drives the sensor output to the
amplification stage, the other the 5V supply controlled by a switch and two are for the circuits connection to ground; while three
isolated pins have been assigned to the O2 sensor (connector 1B), one connected to ground, another to the sensors output
(accessing the same amplification stage as connector 1A) and another without connections assigned to the sensors reference
pin. The amplification stage of the connectors consists of a voltage follower followed by a non-inverting amplifier, whose gain
is controlled through a 100K digital potentiometer, which can be programmed by the user, up to a maximum value of 101. We
can see an image with connector 1A and the connected CO2 sensor, with reference to the placement highlighted in red, in the
figure below.
In the following links you can find two example codes for reading the CO2 and O2 sensors, that can be placed in sockets 1A and
1B respectively:
http://www.libelium.com/development/waspmote/examples/ga-4-co2-sensor-reading
http://www.libelium.com/development/waspmote/examples/ga-5-o2-sensor-reading
-44- v4.8
Sensors
4.21.2. Connector 2
As with connector 1, connector 2 (which will be divided into connector 2A and connector 2B) has been designed to support
connection of two different sensors at the same time but without allowing simultaneous reading or powering. In this case,
the aim of this structure is to allow coexistence on the board of the MiCS-2610 or MiCS-2614 sensors for O3 and the MiCS-
5521 or MiCS-5524 sensors for VOCs (connector 2B) and the TGS2611 resistive sensors for CH4, TGS2600 and TGS2602 for air
contaminants, TGS2610 for LPG gases and TGS2620 for solvent vapors (connector 2A). The difference between the last sensors
and the TGS2442 for CO and TGS2444 for NH3, not compatible with this connector, is that the latter require the independent
excitation of the heater supply voltage and of the sensor resistance supply voltage. Given that this connectors power is regulated
by a single switch, these two last sensors cannot be inserted into this connector without risk of breakdown.
Thus, for connector 2B there are four isolated pins which provide two connections to the 2.5V power (taken from a regulator which
receives the 5V power at its input), a connection to ground and another to a load resistance (100K digital potentiometer) at
the input of a non-inverting amplification stage with a maximum gain of 101 controlled through a 100K digital potentiometer.
Connector 2A has two strips of 2.54mm pitch female pins which provide the sensor with two connections to 5V supply,
controlled by a switch, a connection to ground and another to output, at the same load resistance and amplification stage
described previously. The two central pins of both strips, not used, remain without connection. An image of connector 2A can
be seen in the figure below with a connected sensor and its reference for placement highlighted, and an image of connector 2B
with a connected O3 sensor and its reference highlighted can be seen in the second figure below.
In the following links you can find two example codes for reading the sensors placed on sockets 2A and 2B respectively:
http://www.libelium.com/development/waspmote/examples/ga-6-socket2a-sensor-reading
http://www.libelium.com/development/waspmote/examples/ga-7-socket2b-sensor-reading
-45- v4.8
Sensors
4.21.3. Connector 3
Connector 3 shows the same structure as connector 2: a socket (3A) composed of two strips of three 2.54mm pitch female pins
(whose central pins are not connected to any signal) which provide two connections to 5V power supply and one connection
to ground; and a connector (3B) of four pins whose supply voltage is regulated down to 1.8V. Both connectors share the same
load resistor, configurable through a 100k digital potentiometer, followed by an amplification stage with a maximum gain of
101 controlled through another digital potentiometer and whose output is connected to the microcontrollers analog input
ANALOG7.
This connector presents two differences respect the former one: first of all, power supply and ground connections in socket
3A are controlled through two switches, activating separately the sensors heating resistor and the measurement load resistor
power circuits, thus allowing to connect sensors TGS2442 for CO and TGS2444 for NH3, as well as any of the sensors admitted
by socket 2A (TGS2611 for CH4, TGS2600 and TGS2602 for air contaminants, TGS2610 for LPG gases and TGS2620 for solvent
vapors). Secondly, connector 3B is endowed with a 1.8V regulator instead of the 2.5V of socket 2B in order to provide connection
to the MiCS-2710 or MiCS-2714 sensors for NO2 instead of the MiCS-2610, MiCS-2614, MiCS-5524 and MiCS-5521 sensors.
Since three different signals are used to control the activation of the sensors on both 3A and 3B sockets, they can be maintained
powered at the same time, though to read the sensor on socket 3A it will be necessary to disconnect briefly sensors MiCS-2710
or MiCS-2714 (this process lasts a few milliseconds and is automatically carried out by the readValue function of the boards
API).
In the next 2 figures we have two images of both connectors with the sensors reference pin highlighted.
Figure : Image of socket 3B with the MiCS-2710 sensor connected (new version)
-46- v4.8
Sensors
In the following links you can find two example codes for reading the NH3 sensor placed on socket 3A, the remaining sensors
that can be placed on that socket and the NO2 sensor on socket 3B respectively:
http://www.libelium.com/development/waspmote/examples/ga-12-nh3-sensor-on-socket3-reading
http://www.libelium.com/development/waspmote/examples/ga-8-socket3a-sensor-reading
http://www.libelium.com/development/waspmote/examples/ga-9-socket3b-sensor-reading
4.21.4. Connector 4
Socket 4 is the only one of those for gas sensors whose adaptation electronics is not shared by two different sockets. It is
composed of two strips of three 2.54mm pitch female pins that connect the sensor to power supply, ground and output to a
100k load variable resistor followed by an amplification stage of maximum gain 101, both controlled by a digital potentiometer.
Like connector 3A, power supply circuits for heating and measurement sensor resistances are independently controlled, so the
same sensors can be connected (TGS2442 for CO, TGS2444 for NH3, TGS2611 for CH4, TGS2600 and TGS2602 for air contaminants,
TGS2610 for LPG gases and TGS2620 for solvent vapors).
In the figure below we have an image of a sensor placed on the socket with the reference pin highlighted.
In the following link you have two example codes for reading the CO sensor on socket 4 and the remaining sensors placed on
that sockets respectively:
http://www.libelium.com/development/waspmote/examples/ga-11-co-sensor-on-socket4-reading
http://www.libelium.com/development/waspmote/examples/ga-10-socket4-sensor-reading
-47- v4.8
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
-48- v4.8
Sensors
In the figure below an image of the board with the sockets in it and the correspondence between its inputs and the sensors
pins is shown.
Figure : Image of the pin correspondence between the sockets and the sensors
Figure : Image of the pin correspondence between the sockets and the sensors
-49- v4.8
Sensors
-50- v4.8
Board configuration and programming
5.2. API
The Gases 2.0 board for Waspmote has its own library which contains the set of necessary instructions to easily and intuitively
configure and read each one of the sensors which connect to the board. Next each one of the functions is described and the
process of configuration detailed for each sensor. The specific configuration which must be applied to each one of the sensors
is explained in the specific sensors section.
When using the Gases Sensor Board v20 on Waspmote PRO, remember it is mandatory to include the SensorGasv20 library by
introducing the next line at the beginning of the code:
#include <WaspSensorGas_v20.h>
Next, the different functions that make up the library are described:
SensorGasv20.ON()
Turns on the sensor board by activating the 3.3V and 5V supply lines.
SensorGasv20.OFF()
Turns off the sensor board by cutting the 3.3V and 5V supply lines.
SensorGasv20.setBoardMode(MODE)
This function is used to switch the sensor board power on and off. The variable MODE can take values SENS_ON, to switch on the
board, and SENS_OFF, to switch it off.
The value SENSOR indicates the connector on which the sensor has been placed. There are 7 possible connectors to choose,
three of which are shared by a number of sensors while the three remaining are exclusive for a specific sensor.
SENS_CO2, which represents connector 1A, to which only the CO2 sensor can be connected.
SENS_O2, which represents connector 1B, to which only the O2 sensor can be connected.
SENS_SOCKET3B, which represents connector 3B, to which only the NO2 sensor can be connected.
-51- v4.8
Board configuration and programming
The variable GAIN represents the gain chosen for the amplification stage which is accessed from the sensors output. Integer
values can be set between 1 and 101.
The variable RESISTOR determines the load resistance on which the sensor acts before the amplification stage, expressed in
kiloohms. Values between 0 and 100k can be taken (provided that the minimum load resistance shown in the specifications
of each sensor is respected). In the case of the O2 and CO2 sensors, which do not require load resistance, this parameter may
be omitted.
SensorGasv20.setSensorMode(MODE, SENSOR)
This function, analog to setBoardMode, allows independent configuration of the power supply of each sensor.
The variable MODE defines the status in which the sensor should be set, which can take the values SENS_ON, to connect the
power, and SENS_OFF to disconnect it.
The variable SENSOR represents the connector on which the sensor is placed and the type of sensor used, which is able to take
the following values:
SENS_CO2, to control the CO2 sensors power and enable its output.
SENS_O2 to enable the O2 sensors output.
SENS_PRESSURE, to control the atmospheric pressure sensors power.
SENS_SOCKET3B, to control the power of the NO2 sensor and enable its output.
SENS_SOCKET2A, to control the power of the sensor placed in connector 2A and enable its output.
SENS_SOCKET2B, to control the power of the sensor placed in connector 2B and enable its output.
SENS_SOCKET3A, to control the power of the sensor placed in connector 3 when one of the CH4, LPG, solvent vapors and
both air contaminants sensors are connected to it (CAUTION: do not use this command when the CO or NH3 sensors are
placed in this connector, these sensors must not be permanently powered).
SENS_SOCKET4A, to control the power of the sensor placed in connector 4 when one of the CH4, LPG, solvent vapors and
both air contaminant sensors are connected to it (CAUTION: do not use this command when the CO or NH3 sensors are
placed in this connector, these sensors must not be permanently powered).
SensorGasv20.readValue(SENSOR)
The function readValue allows capture of the output value of each one of the boards sensors, returning the voltage value in a
floating point (float) 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 following values:
The values of the variable SENSOR for the reading of the NH3 and CO sensors are the following:
-52- v4.8
Board configuration and programming
The reason for reading these two sensors in a different way is that they do not normally remain powered, but must be powered
by two small pulses of voltage when capturing the output data to avoid them being damaged. The function readValue
provides these power supply pulses and automatically reads the sensors when one of the previous values is provided in its input
variable.
SensorGasv20.calculateResistance(SENSOR,VALUE,GAIN,LOAD)
This function has been implemented to facilitate the calculation of the output of the resistive sensors attached to the board,
enabling a direct conversion from the value measured in volts in function of the configuration parameters of the sensor.
The value returned is the resistance of the sensor, expressed in kiloohms, and given in a floating point format. The parameters
required by this function are the following:
SENSOR: Through this parameter the socket upon which the sensor has been placed is specified. It may take the same values
than for function readValue.
VALUE: Here it is introduced the output voltage obtained from function readValue.
GAIN: This parameter indicates the gain set for the amplification stage. It must be the same value used in function
configureSensor.
LOAD: It refers to the load resistor configured for the sensor voltage divider. It must be the same value used in function
configureSensor.
The structure in which the code to read a sensor must be presented is the following:
Below, an example code to read the Air Pollutants 2 sensor (TGS2600) placed on socket 2A is shown
www.Libelium.com
*/
// Heating time
#define TIME 30000
-53- v4.8
Board configuration and programming
// Load resistor
#define RESISTOR 50
// Gain
#define GAIN 1
float value;
float resistance;
void setup()
{
// Switch on the gases sensor board
SensorGasv20.setBoardMode(SENS_ON);
delay(100);
// Init RTC
RTC.ON();
delay(100);
SensorGasv20.setSensorMode(SENS_ON,SENS_SOCKET2A);
USB.println(Heating Sensor);
delay(TIME);
}
void loop()
{
value = SensorGasv20.readValue(SENS_SOCKET2A);
resistance = SensorGasv20.calculateResistance(SENS_SOCKET2A, value, GAIN, RESISTOR);
// Add the value and the resistance calculated read to the frame composition
frame.addSensor(SENSOR_AP2, value);
frame.addSensor(SENSOR_STR, resistance);
// Init XBee
xbee802.ON();
// Set parameters to packet:
packet=(packetXBee*) calloc(1,sizeof(packetXBee));
packet->mode=BROADCAST;
-54- v4.8
Consumption
6. Consumption
6.1. Power control
On one side, the control of the Gases 2.0 board power can be carried out using the Waspmotes general on/off system for the
3.3V and 5V supply lines, which allows the board to be totally switched on and off (0uA).
On the other hand, specific control mechanisms have been installed inside the sensor board using a system of solid state
switches, allowing the independent digital control of each sensor power without the need to physically access the circuit,
except for the humidity and temperature sensors, which are powered always the board is on. This way, activation and reading
of each sensor can be programmed at the same main code, controlled by the microcontroller. In section API where the API
libraries related to this board are presented and the use of each of these switches is clearly and precisely described, as well as
the correct way to read each sensor.
To find out the total consumption of the board with sensors integrated to the consumption of each connector, the consumption
of each chosen sensor must be added together. This consumption can be consulted in the section for the sensor itself when all
its characteristics are described.
Optimize the time the sensors are switched on depending on your application
The accuracy of each sensors measurement which can be obtained will vary depending on the time that it remains
switched on or on the power supply cycles which are continually applied, depending on the type of sensor. Knowing
the time required to take a measurement in a determined application will allow saving of consumption without losing
resolution in the sampled value.
-55- v4.8
API Changelog
7. API Changelog
Keep track of the software changes on this link:
www.libelium.com/development/waspmote/documentation/changelog/#Gases
-56- v4.8
Documentation changelog
8. Documentation changelog
Added MiCS-2714 NO2 sensor, MiCS-2614 O3 sensor and MiCS-5524 VOCs sensor (new versions)
Connector 2 and connector 3 for design and connection section updated
Sockets for casing table updated
Added section New line of Calibrated Gas Sensors and the API function calculateConcentration
API changelog updated to API v006
-57- v4.8
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.
-58- v4.8
Disposal and Recycle
-59- v4.8