Comment on page
Board configuration and programming
The Plug & Sense! Smart Water Xtreme model does not require special handling of the hardware by the user, except for placing the sensors in their corresponding socket. In the previous sections each sensor connection has been described.
It is important to remark that Smart Water Xtreme model is only available in the Waspmote Plug & Sense! Line. It is not available for Waspmote OEM line.
When using the Plug & Sense! Smart Water Xtreme model, remember that it is mandatory to include the
WaspSensorXtrlibrary by introducing the next line at the beginning:
The library manages the power supply and communication lines between Waspmote and the sockets. Prior to read the sensor probes, the user must declare an object of the corresponding sensor class, specifying the socket where the sensor is placed. The next table enumerates each sensor class.
Each sensor class manages the Smart Water Xtreme sensor board according to its needs, so there is no need to turn on or off the whole board, as is often needed with other Libelium sensor boards. After declaring the object, the sensor can be turned on or off independently from each other. Incidentally, do not forget turning off the sensors to save battery when they are no longer needed.
The next snippet shows how to declare an object for the sensor PHEHT and then how to turn on, read and turn off the sensor:
// 1. Declare an object for the sensor
// 2. Turn ON the sensor
// 3. Read the sensor. Values stored in class variables
// Check complete code example for details
// 4. Turn off the sensor
read()function stores the sensor values in a public object. It does not return the values directly. The user can refer to the dedicated sensor example to see how the sensor values can be accessed. In the case of the PHEHT sensor, values will be printed by USB with the following snippet.
// 4. Print information
USB.println(F(\" degrees Celsius\"));
The Temperature, humidity and pressure, the Ultrasound and the Luminosity sensors have their own reading functions in contrast to the rest of the Smart Water Xtreme sensors. This is due to these sensors can be used in other Plug & Sense! models and they share the same functions into the Waspmote API. Refer to the dedicated sensor example for further details.
Owing to the large amount of parameters that can be read by the Plug & Sense! Smart Water Xtreme model, a special frame type must be used with the Frame class in order to send the values correctly.
// It is mandatory to specify the Smart Water Xtreme type
A complete example code for using the frame class can be found in the following link:
Refer to the Data Frame Guide for more information: