Sensors / Smart Water:

» SW 04: Dissolved Oxygen Sensor Reading

Turn on the Smart Water Board and reads the Dissolved Oxygen sensor printing the result through the USB

Required Materials

1 x Waspmote
1 x Battery
1 x Smart Water Sensor Board
1 x Dissolved Oxygen Sensor
1 x Dissolved Oxygen Calibration kit (optional)


The calibration air and zero values selected in the code are an example for a specific sensor, each unit will require its own calibration parameters.
A single point calibration with only calibration in air will be sufficient for most applications, in that case introduce a '0' as zero point calibration.


 *  ------ [SW_04] - Dissolved Oxygen sensor Reading for Smart Water-------- 
 *  Explanation: Turn on the Smart Water Board and reads the Dissolved Oxygen
 *  sensor printing the result through the USB
 *  Copyright (C) 2014 Libelium Comunicaciones Distribuidas S.L. 
 *  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 
 *  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 <>. 
 *  Version:           2.0
 *  Design:            David Gascón 
 *  Implementation:    Ahmad Saad

#include <WaspSensorSW.h>

float value_do;
float value_calculated;

// Calibration of the sensor in normal air
#define air_calibration 2.65
// Calibration of the sensor under 0% solution
#define zero_calibration 0.0

DOClass DOSensor;

void setup()
  // Turn ON the Smart Water sensor board and start the USB
  // Configure the calibration values
  DOSensor.setCalibrationPoints(air_calibration, zero_calibration);

void loop()
  // Reading of the ORP sensor
  value_do = DOSensor.readDO();

  // Print of the results
  USB.print(F("DO Output Voltage: "));

  // Conversion from volts into dissolved oxygen percentage
  value_calculated = DOSensor.DOConversion(value_do);

  // Print of the results
  USB.print(F(" DO Percentage: "));


DO Output Voltage: 2.4906055927 DO Percentage: 95.4660186767
DO Output Voltage: 2.3786778450 DO Percentage: 91.1357879638
DO Output Voltage: 2.2717800140 DO Percentage: 87.0001525878
DO Output Voltage: 2.1696863174 DO Percentage: 83.0503845214
DO Output Voltage: 2.0721805095 DO Percentage: 79.2781066894
DO Output Voltage: 1.9790567398 DO Percentage: 75.6753616333
DO Output Voltage: 1.8901178359 DO Percentage: 72.2345199584
DO Output Voltage: 1.8051759719 DO Percentage: 68.9483184814
DO Output Voltage: 1.7240514755 DO Percentage: 65.8097915649
DO Output Voltage: 1.6465725898 DO Percentage: 62.8123092651

Quick Publish: