Class Members
public float S
EC in Siemens
public float mS
EC in milli-Siemens
public float uS
EC in micro-Siemens
public long PPM_500
Parts per million using 500 as a multiplier
public long PPM_640
Parts per million using 640 as a multiplier
public long PPM_700
Parts per million using 700 as a multiplier
public float salinityPSU
Salinity measured practical salinity units
public float salinityPPT
Salinity measured parts per thousand
public float salinityPPM
Salinity measured parts per million
public float tempC
Temperature in C
public float tempF
Temperature in F
Class Functions
measureEC
Starts an EC measurement.
The temperature coefficient is generally accepted to be 0.019 for freshwater (EC_Salinity::tempCoefEC) or 0.021 for saline water (EC_Salinity::tempCoefSalinity).
uS, mS, S, PPM_500, PPM_640, PPM_700, salinityPSU, salinityPPT and salinityPPM are updated.
Parameters
tempCoef
the coefficient used to compensate for temperature.EC_Salinity::tempCoefEC
,EC_Salinity::tempCoefSalinity
, or any other appropriate value.newTemp
boolean to take a new temperature measurement.
Usage
If called without parameters, the temperature coefficient used is for freshwater (EC_Salinity::tempCoefEC), and a new temperature is taken only if useTemperatureCompensation is true.
Example
Related
Returns
EC in mS, -1 on error
WARNING
PPM is not valid if salinity is being measured, use salinityPPT and salinityPPM.
K
must be set before taking a reading.
measureSalinity
Starts a salinity measurement. The temperature coefficient for saline water is generally accepted to be 0.021 (EC_Salinity::tempCoefSalinity) and is used for this measurement.
salinityPSU, salinityPPT and salinityPPM are updated.
Usage
Example
Related
Returns
salinity in PSU, -1 on error
WARNING
The PSU must be between 2 and 42; a value not within bounds will return -1. The temperature must be within -2 to 35.
K
must be set before taking a reading.
measureTemp
Starts a temperature measurement.
Usage
Example
Related
Returns
temperature in C
WARNING
A value of -127 means the temperature sensor is not connected.
calibrateProbe
Calibrates the connected probe and saves the result in EEPROM. The offset will be saved in the device's EEPROM and used automatically thereafter.
Parameters
solutionEC
the EC of the calibration solution in mStempCoef
the coefficient used to calibrate the probe.EC_Salinity::tempCoefEC
,EC_Salinity::tempCoefSalinity
, or any other appropriate value.
Usage
Example
Related
Returns
none
calibrateProbeLow
Calibrates the dual-point values for the low reading and saves them in the devices's EEPROM.
Dual point uses two measures for low and high points. It needs the measured value (reading value) and the known value (reference value). Calling calibrateProbeLow saves both the reading and reference value.
Parameters
solutionEC
the EC of the calibration solution in mStempCoef
the coefficient used to calibrate the probe.EC_Salinity::tempCoefEC
,EC_Salinity::tempCoefSalinity
, or any other appropriate value.
Usage
Example
#include <ECSalinity.h>
EC_Salinity ec;
ec.setK(10.0);
ec.calibrateProbeLow(0.7, EC_Salinity::tempCoefEC);
ec.calibrateProbeHigh(1.0, EC_Salinity::tempCoefEC);
Related
Returns
none
calibrateProbeHigh
Calibrates the dual-point values for the high reading and saves them in the devices's EEPROM.
Dual point uses two measures for low and high points. It needs the measured value (reading value) and the known value (reference value). Calling calibrateProbeLow saves both the reading and reference value.
Parameters
solutionEC
the EC of the calibration solution in mStempCoef
the coefficient used to calibrate the probe.EC_Salinity::tempCoefEC
,EC_Salinity::tempCoefSalinity
, or any other appropriate value.
Usage
Example
#include <ECSalinity.h>
EC_Salinity ec;
ec.setK(10.0);
ec.calibrateProbeLow(0.7, EC_Salinity::tempCoefEC);
ec.calibrateProbeHigh(1.0, EC_Salinity::tempCoefEC);
Related
Returns
none
calibrateDry
Determines the dry reading of the probe and saves the result in EEPROM. If subsequent measurements are taken that are less than the dry value, a -1 will be returned. This can be used to determine if the probe is not connected as well.
Usage
Example
Related
Returns
none
setDualPointCalibration
Sets all the values for dual point calibration and saves them in the devices's EEPROM. The reference values will come from the known solution, the reading values will come from the actual probe to be calibrated taking a reading in the reference solution. Each probe and each device will be different.
Parameters
refLow
the reference low pointrefHigh
the reference high pointreadLow
the measured low point in mSreadHigh
the measured high point in mS
Usage
EC_Salinity::setDualPointCalibration(float refLow, float refHigh, float readLow, float readHigh);
Example
Related
Returns
none
setI2CAddress
setK
Updates the device with a new cell constant, referred to as K, and saves it in EEPROM. The K-value is typically either generally 1.0 or 10.0, or labeled on the probe with it's exact value.
Parameters
getK
getCalibrateDry
Retrieves the dry reading of the probe.
Usage
Example
Related
Returns
The reading, in mS, that the device will consider as a dry/unconnected probe reading
reset
setTempConstant
Configures device to use the provided temperature constant. The effect of using temperature compensation, will apply a formula that attempts to estimate what the reading would be at another temperature, referred to as the temperature constant.
Parameters
temp_constant
the temperature to use for compensation
Usage
Example
Related
Returns
none
getTempConstant
Retrieves the temperature constant.
Usage
Example
Related
Returns
the temperature used for compensation
setTemp
Sets the temperature used by the device without using the attached temperature sensor.
Parameters
float
tempC
Usage
Example
Related
Returns
none
useTemperatureCompensation
Configures device to use temperature compensation.
Parameters
usingTemperatureCompensation
useDualPoint
Configures device to use dual-point calibration.
Parameters
bool
true/false
Usage
Example
Related
Returns
none
usingDualPoint
getCalibrateHighReference
Returns the dual-point calibration high-reference value.
Usage
Example
Related
Returns
the dual-point calibration high-reference value
getCalibrateLowReference
Returns the dual-point calibration low-reference value.
Usage
Example
Related
Returns
the dual-point calibration low-reference value
getCalibrateHighReading
Returns the dual-point calibration high-reading value.
Usage
Example
Related
Returns
the dual-point calibration high-reading value
getCalibrateLowReading
Returns the dual-point calibration low-reading value.
Usage
Example
Related
Returns
the dual-point calibration low-reading value
setCalibrateOffset
Sets the single point offset value rather than having the device determine it using calibrateProbe. This value would be previously determined and is different for each probe and device.
Parameters
offset
single point offset value
Usage
Example
Related
Returns
none
getCalibrateOffset
getVersion
Retrieves the firmware version of the device.
Usage
Example
Related
Returns
version of firmware