6. Board configuration and programming
6.1. Hardware configuration
The Smart Cities PRO board does not require of any handling of the hardware by the user except for placing the
sensors in their corresponding position. In the section dedicated to each connector we can see an image of the
connections between the socket and its corresponding sensor.
6.2. API
6.2.1. Before starting to program
When using the Smart Cities PRO Sensor Board on Waspmote, remember it is mandatory to include the
WaspSensorCities_Pro library by introducing the next line at the beginning of the code:
#include <WaspSensorCities_PRO.h>
The library manages the power supply and communication lines between Waspmote and the sockets. To manage
each sensor the user must use the specific library and guide for each sensor.
6.2.2. Gases sensors
In order to manage a gas sensor, the user must define a "Gas" library object. The user must also indicate the
socket used in the class constructor. The available sockets for gases sensors are: sockets 1, 3 and 5 for the OEM
line; and sockets B, C and F for the Plug and Sense! line. For instance:
Gas gas_sensor(SOCKET_B);
The electrochemical sensors must be switched on at the beginning of the code in order to get the best
measurements. On the other hand, NDIR and Pellistor sensors should be switched on for a couple of minutes
prior getting the measurement because they imply a higher power consumption. The gas sensor is switched on
as follows:
gas_sensor.ON();
For sensor measurement, the user must call the proper function which returns a value in ppm units:
gas_sensor.getConc();
In the case of using a BME280, luxes or ultrasound sensor, the user must switch off all gases sensors prior using
them in order to work properly with the Smart Cities PRO board. Therefore, after getting the measurement from
the BME280/luxes/ultrasound sensor, all electrochemical gas sensor should be powered on again. The gas sensor
is switched off calling the next function:
gas_sensor.OFF();
You can find a complete example code for reading electrochemical sensors in the following link:
http://www.libelium.com/development/waspmote/examples/gp-v30-01-electrochemical-gas-sensors
Board configuration and programming
-83-
v7.3
Need help?
Do you have a question about the Smart Cities PRO and is the answer not in the manual?