Development

» Sw xtr 18: C4E conductivity calibration

MENU ASSISTED CALIBRATION PROCESS for conductivity of C4E sensor

Required Materials

- 1 Waspmote Plug & Sense! Smart Water Xtreme
- 1 C4E sensor

Notes

- This example is only valid for Waspmote v15

Code

/*
    ----------- [Sw_xtr_18] - C4E Conductivity calibration --------------------

    Explanation: MENU ASSISTED CALIBRATION PROCESS for conductivity of
    C4E sensor

    Copyright (C) 2018 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:    J.Siscart, V.Boria
*/
#include <WaspSensorXtr.h>

/*
  SELECT THE RIGHT SOCKET FOR EACH SENSOR.

  Possible sockets for this sensor are:
  - XTR_SOCKET_E (Only valid socket for init() or calibrating)
                           _________
                          |---------|
                          | A  B  C |
                          |_D__E__F_|


  Refer to the technical guide for information about possible combinations.
  www.libelium.com/downloads/documentation/smart_agriculture_xtreme_sensor_board.pdf
*/

//Uncomment the sensor that you want to read the serial number
Aqualabo_C4E mySensor(XTR_SOCKET_E);

uint8_t response = 0;


void setup()
{
  //Turn on the sensor
  mySensor.ON();

  response = mySensor.init();
  if (response)
  {
    USB.println(F("Error initializing the sensor. \r\nCheck the sensor is in Socket E and restart the code."));
    while (1);
  }
  
  //Run menu assisted calibration process via monitor serial
  mySensor.calibrationProcess(CONDUCTIVITY);
  
  //Turn off the sensor
  mySensor.OFF();
}

void loop()
{
  // Turn ON the sensor
  mySensor.ON();

  // Read the sensor
  /*
    Note: read() function does not directly return sensor values.
    They are stored in the class vector variables defined for that purpose.
    Values are available as a float value
  */
  mySensor.read();

  // Turn off the sensor
  mySensor.OFF();

  // 7. Print information
  USB.println(F("---------------------------"));
  USB.println(F("C4E"));
  USB.print(F("Temperature: "));
  USB.printFloat(mySensor.sensorC4E.temperature, 2);
  USB.println(F(" degrees Celsius"));
  USB.print(F("Conductivity: "));
  USB.printFloat(mySensor.sensorC4E.conductivity, 2);
  USB.println(F(" uS/cm"));
  USB.print(F("Salinity: "));
  USB.printFloat(mySensor.sensorC4E.salinity, 2);
  USB.println(F(" ppt"));
  USB.print(F("Total dissolved solids: "));
  USB.printFloat(mySensor.sensorC4E.totalDissolvedSolids, 2);
  USB.println(F(" ppm"));
  USB.println(F("---------------------------"));

  delay(5000);
}

Output

J#

*********************************************

MENU ASSISTED CALIBRATION PROCESS
C4E sensor
Conductivity parameter

*********************************************

0. Introduction:

This is a two-point calibration method. At the end of the process the results
of the calibration will be stored in the FLASH memory of the sensor for
future uses.

The sensor is calibrated ex works, meaning that no calibration is required
before initial startup. During operation the sensor should be calibrated if the
measured values begin to drift.

Rinse the sensor in clean water and dry it with a soft cloth or an absorbent
paper before each calibration.

With this process only one range will be calibrated, if desired, carry out
this process for each range to be calibrated a maximum of 4 times.

To exit the calibration without considering anything please insert 'Q' to Quit
and press Enter.

****************

1. Insert the range to be calibrated from the 4 available ranges and press Enter:
1 for Range 1 (0 / 200 uS/cm)
2 for Range 2 (0 / 2000 uS/cm)
3 for Range 3 (0 / 20 mS/cm)
4 for Range 4 (0 / 200 mS/cm)
Example: 2
> 1

****************

2. Insert the first calibration standart value you will use (offset) and press Enter.
0 uS/cm is recommended (sensor exposed to the air)
Example: 0
> 0

****************

3. Immerse the sensor in a solution at your selected offset: 0.0000 uS/cm.
Wait some minutes until the measure stabilizes..
Observing the offset in this step will help you assess whether calibration
is necessary or not, depending on the precision required in your application.
Then insert 'N' for Next step and press Enter.

0.00 uS/cm
>
0.00 uS/cm
> N

****************

4. Insert the second calibration standart value (slope) and press Enter.
A solution recommended for your selected range is 84 uS/cm.
Example: 1413
> 1413

****************

5. Immerse the sensor in a solution at your selected slope: 1413.0000 uS/cm.
Wait some minutes until the measure stabilizes..
Then insert 'N' for Next step and press Enter.

1410.82 uS/cm
>
1410.82 uS/cm
> N

****************

6. In order to validate the calibration some data is required.
Please insert operator's name (up to 16 letters) and press Enter.
> LIBELIUM

****************

7.Please insert calibration date.
Insert year [yy] and press Enter.
> 18
Insert month [mm] and press Enter.
> 11
Insert day [dd] and press Enter.
> 6
Insert Hour [HH] and press Enter.
> 9
Insert minute [MM] and press Enter.
> 55

****************

Calibration successfully finished!

****************

End of calibration process

*********************************************

---------------------------
C4E
Temperature: 23.24 degrees Celsius
Conductivity: 0.00 uS/cm
Salinity: 0.00 ppt
Total dissolved solids: 0.18 ppm
---------------------------

Quick Publish: