Development

Sensors / Smart Water:

» SW 02: ORP sensor

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.
- This example is valid for Waspmote v12 and Waspmote v15

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) 2016 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:           3.0
 *  Design:            David Gascón 
 *  Implementation:    Ahmad Saad
 */

#include <WaspSensorSW.h>

float ORPValue;

// Offset obtained from sensor calibration
#define calibration_offset 0.0

ORPClass ORPSensor;

void setup()
{
  USB.ON();
  USB.println(F("ORP example for Smart Water..."));

  ///////////////////////////////////////////
  // 1. Turn ON the Smart Water sensor board 
  ///////////////////////////////////////////  
  Water.ON(); 
}

void loop()
{
  ///////////////////////////////////////////
  // 2. read the sensors
  ///////////////////////////////////////////   
  
  // Reading of the ORP sensor
  ORPValue = ORPSensor.readORP();
  // Apply the calibration offset
  ORPValue = ORPValue - calibration_offset;

  ///////////////////////////////////////////
  // 3. Print the output values
  ///////////////////////////////////////////

  USB.print(F("ORP Estimated: "));
  USB.print(ORPValue);
  USB.println(F(" volts"));  


  delay(1000);
}

Output

H#
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: