Board configuration and programming

Hardware configuration

The Smart Water sensor board does not require any other manipulation than the sensor connection to its corresponding socket. There are two kinds of connectors on the Smart Water board:

First of all, the temperature sensor probe and the Turbidity sensor are connected through PTSM connectors, which allow to easily assemble the wire by pressing it into the pin. To remove the wires press the slot above the input pin while pulling off the wire softly.

Secondly, SMA-RP connectors have been used for the other four kinds of sensors. Since the sensors are supplied with a BNC connector, it is necessary to connect a pigtail in between. In case several sensors are connected at the same time, beware that the BNC shells are not in contact when the board is in operation.

Library

All the software functions necessary to operate the Smart Water sensor board have been compiled in a library added to the Waspmote API, so the supply of the board and its components and the reading of the sensors can be easily managed.

When using the Smart Water sensor board, remember it is mandatory to include the SensorSW library by introducing the next line at the beginning of the code:

#include <WaspSensorSW.h>

Next, the different functions that make up the library are described:

Power control functions

Turns on the sensor board by activating the 3.3 V and 5 V supply voltage lines from Waspmote:

Water.ON()

Turns off the sensor board by cutting the 3.3 V and 5 V supply voltage lines from Waspmote:

Water.OFF()

Read sensor functions

Returns the temperature value from Pt-1000:

float readTemperature(void)

Returns the pH value:

float readpH(void)

Returns the value of the oxidation-reduction potential:

float readORP(void)

Returns the value of the dissolved oxygen:

float readDO(void)

Returns the value of the conductivity:

float readConductivity(void)

Conversion functions

Converts from volts to pH value with no temperature compensation:

float pHConversion(float input)

Converts from volts to pH value with temperature compensation:

float pHConversion(float input, float temp)

Converts from resistance to conductivity (ms/cm):

float conductivityConversion(float input)

Converts the DO voltage into a percentage of concentration:

Calibration configuration functions

Configures the calibration points of the pH sensor:

setCalibrationPoints(float _cal_point_10, float _cal_point_7, float _cal_point_4, float _cal_temperature)

Configure the calibration points of the conductivity sensor:

setCalibrationPoints(float _point_1_cond,
    float _point_1_cal,
    float _point_2_cond,
    float _point_2_cal)

Configure the calibration points of the DO sensor:

setCalibrationPoints(float _air_calibration, float _zero_calibration)

The files related to this sensor board are: WaspSensorSW.cpp, WaspSensorSW.h

They can be downloaded from:

Last updated