Development

Sensors / Smart Water:

» SW 02: ORP Sensor Reading

Turn on the Smart Water Board and reads the ORP sensor extracting the value from the calibration values and temperature compensation

Required Materials

1 x Waspmote
1 x Battery
1 x Smart Water Sensor Board
1 x Oxidation-Reduction potential Sensor
1 x ORP Calibration kit

Notes

The calibration offset value selected in the code is an example for a specific sensor, each unit will require its own calibration parameter.
Introduce a '0' for the offset if calibration is not to be performed.
If the sensor has been kept stored for long it may take longer to reach a steady output.

Code

/*  
 *  ------ [SW_02] - ORP sensor Reading for Smart Water-------- 
 *  
 *  Explanation: Turn on the Smart Water Board and reads the ORP sensor
 *  extracting the value from the calibration values and temperature
 *  compensation
 *  
 *  Copyright (C) 2014 Libelium Comunicaciones Distribuidas S.L. 
 *  http://www.libelium.com 
 *  
 *  This program is free software: you can redistribute it and/or modify 
 *  it under the terms of the GNU General Public License as published by 
 *  the Free Software Foundation, either version 3 of the License, or 
 *  (at your option) any later version. 
 *  
 *  This program is distributed in the hope that it will be useful, 
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
 *  GNU General Public License for more details. 
 *  
 *  You should have received a copy of the GNU General Public License 
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>. 
 *  
 *  Version:           2.0
 *  Design:            David Gascón 
 *  Implementation:    Ahmad Saad
 */

#include <WaspSensorSW.h>

float value_orp;
float value_calculated;

// Offset obtained from sensor calibration
#define calibration_offset 0.0

ORPClass ORPSensor;

void setup()
{
  // Turn on the Smart Water sensor board and start the USB
  SensorSW.ON();
  USB.ON();  
}

void loop()
{
  // Reading of the ORP sensor
  value_orp = ORPSensor.readORP();

  // Apply the calibration offset
  value_calculated = value_orp - calibration_offset;

  // Print of the results
  USB.print(F(" ORP Estimated: "));
  USB.print(value_calculated);
  USB.println(F(" volts"));  
}

Output

D#
ORP Estimated: 0.2316429853 volts
ORP Estimated: 0.2380407094 volts
ORP Estimated: 0.2388026952 volts
ORP Estimated: 0.2366409540 volts
ORP Estimated: 0.2252402544 volts
ORP Estimated: 0.2246790170 volts
ORP Estimated: 0.2245602846 volts
ORP Estimated: 0.2245052099 volts
ORP Estimated: 0.2245924711 volts
ORP Estimated: 0.2246036767 volts
ORP Estimated: 0.2245290517 volts
ORP Estimated: 0.2245228528 volts
ORP Estimated: 0.2246909379 volts
ORP Estimated: 0.2246682882 volts
ORP Estimated: 0.2246353864 volts
ORP Estimated: 0.2246213197 volts

Quick Publish: