Class Members

public float S

EC in Siemens per centimeter

public float mS

EC in milli-Siemens per centimeter

public float uS

EC in micro-Siemens per centimeter

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 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 (uFire_EC::tempCoefEC) or 0.021 for saline water (uFire_EC::tempCoefSalinity).

uS, mS, S, PPM_500, PPM_640, PPM_700, salinityPSU are updated.

Parameters

  • tempCoef the coefficient used to compensate for temperature. uFire_EC::tempCoefEC, uFire_EC::tempCoefSalinity, or any other appropriate value.
  • newTemp boolean to take a new temperature measurement.

Usage

uFire_EC::measureEC(float tempCoef, bool newTemp);

If called without parameters, the temperature coefficient used is for freshwater (uFire_EC::tempCoefEC), and a new temperature is taken only if useTemperatureCompensation is true.

// use uFire_EC::tempCoefEC and take a temperature measurement if using temperature compensation
uFire_EC::measureEC();

// use uFire_EC::tempCoefEC and don't take a temperature measurement
uFire_EC::measureEC(uFire_EC::tempCoefEC, false)

// use a custom temperature coeffiecient and take a new temperature measurement
uFire_EC::measureEC(0.05, true)


Example

#include <uFire_EC.h>
uFire_EC ec;

float mS = ec.measureEC();

Related

Returns

EC in mS/cm, -1 on error

measureSalinity

Starts a salinity measurement. The temperature coefficient for saline water is generally accepted to be 0.021 (uFire_EC::tempCoefSalinity) and is used for this measurement.

salinityPSU, salinityPPT and salinityPPM are updated.

Usage

uFire_EC::measureSalinity();

Example

#include <uFire_EC.h>
uFire_EC ec;

float sal = ec.measureSalinity();

Related

Returns

salinity in PSU, -1 on error

measureTemp

Starts a temperature measurement.

Usage

uFire_EC::measureTemp();

Example

#include <uFire_EC.h>
uFire_EC ec;

float C = ec.measureTemp();

Related

Returns

temperature in C

ALSO...

Class variables tempC and tempF are updated.

WARNING

A value of -127 means the temperature sensor is not connected.

calibrateProbe

Calibrates the connected probe. The value will be saved in the device's EEPROM and used automatically thereafter.

Parameters

  • solutionEC the EC of the calibration solution in mS/cm
  • tempCoef the coefficient used to calibrate the probe. uFire_EC::tempCoefEC, uFire_EC::tempCoefSalinity, or any other appropriate value.

Usage

uFire_EC::calibrateProbe(float solutionEC, float tempCoef);

Example

#include <uFire_EC.h>
uFire_EC ec;

ec.calibrateProbe(2.0);

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 mS/cm
  • tempCoef the coefficient used to calibrate the probe. uFire_EC::tempCoefEC, uFire_EC::tempCoefSalinity, or any other appropriate value.

Usage

uFire_EC::calibrateProbeLow(float solutionEC, float tempCoef);

Example

#include <uFire_EC.h>
uFire_EC ec;

ec.calibrateProbeLow(0.7, uFire_EC::tempCoefEC);
ec.calibrateProbeHigh(1.0, uFire_EC::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 mS/cm
  • tempCoef the coefficient used to calibrate the probe. uFire_EC::tempCoefEC, uFire_EC::tempCoefSalinity, or any other appropriate value.

Usage

uFire_EC::calibrateProbeHigh(float solutionEC, float tempCoef);

Example

#include <uFire_EC.h>
uFire_EC ec;

ec.calibrateProbeLow(0.7, uFire_EC::tempCoefEC);
ec.calibrateProbeHigh(1.0, uFire_EC::tempCoefEC);

Related

Returns

none

setI2CAddress

Changes the default I2C address.

Usage

uFire_EC::setI2CAddress(59);

Example

#include <uFire_EC.h>
uFire_EC ec;

ec.setI2CAddress(59);

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 point
  • refHigh the reference high point
  • readLow the measured low point in mS/cm
  • readHigh the measured high point in mS/cm

Usage

uFire_EC::setDualPointCalibration(float refLow, float refHigh, float readLow, float readHigh);

Example

#include <uFire_EC.h>
uFire_EC ec;

ec.setDualPointCalibration(0.7, 1.0, 0.9, 2.2);

Related

Returns

none

useDualPoint

Configures device to use dual-point calibration.

Parameters

  • bool true/false

Usage

uFire_EC::useDualPoint(bool);

Example

#include <uFire_EC.h>
uFire_EC ec;

ec.useDualPoint(true);

Related

Returns

none

usingDualPoint

Determines if dual point calibration is being used.

Usage

uFire_EC::usingDualPoint();

Example

#include <uFire_EC.h>
uFire_EC ec;

bool useDP = ec.usingDualPoint();

Related

Returns

true if using compensation, false otherwise

getCalibrateHighReference

Returns the dual-point calibration high-reference value.

Usage

uFire_EC::getCalibrateHighReference();

Example

#include <uFire_EC.h>
uFire_EC ec;

float refHigh = ec.getCalibrateHighReference();

Related

Returns

the dual-point calibration high-reference value

getCalibrateLowReference

Returns the dual-point calibration low-reference value.

Usage

uFire_EC::getCalibrateLowReference();

Example

#include <uFire_EC.h>
uFire_EC ec;

float lowRef = ec.getCalibrateLowReference();

Related

Returns

the dual-point calibration low-reference value

getCalibrateHighReading

Returns the dual-point calibration high-reading value.

Usage

uFire_EC::getCalibrateHighReading();

Example

#include <uFire_EC.h>
uFire_EC ec;

float highRef = ec.getCalibrateHighReading();

Related

Returns

the dual-point calibration high-reading value

getCalibrateLowReading

Returns the dual-point calibration low-reading value.

Usage

uFire_EC::getCalibrateLowReading();

Example

#include <uFire_EC.h>
uFire_EC ec;

float lowRead = ec.getCalibrateLowReading();

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 combination.

Parameters

  • offset single point offset value

Usage

uFire_EC::setCalibrateOffset(float offset);

Example

#include <uFire_EC.h>
uFire_EC ec;

ec.setCalibrateOffset(0.13);

Related

Returns

none

getCalibrateOffset

Retrieves the single point offset value.

Usage

uFire_EC::getCalibrateOffset();

Example

#include <uFire_EC.h>
uFire_EC ec;

float offset = ec.getCalibrateOffset();

Related

Returns

single point offset value

reset

Resets all the stored calibration information.

Usage

uFire_EC::reset();

Example

#include <uFire_EC.h>
uFire_EC ec;

ec.reset();

Related

Returns

none

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

uFire_EC::setTempConstant(uint8_t temp_constant);

Example

#include <uFire_EC.h>
uFire_EC ec;

ec.setTempConstant(25);
ec.measureEC(false);

Related

Returns

none

getTempConstant

Retrieves the temperature constant.

Usage

uFire_EC::getTempConstant();

Example

#include <uFire_EC.h>
uFire_EC ec;

float tempConst = ec.getTempConstant();

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

uFire_EC::setTemp(tempC);

Example

#include <uFire_EC.h>
uFire_EC ec;

ec.setTemp(20.2);

Related

Returns

none

useTemperatureCompensation

Configures device to use temperature compensation.

This should be set to false when calibrating the probe.

Parameters

  • bool true/false

Usage

uFire_EC::useTemperatureCompensation(bool);

Example

#include <uFire_EC.h>
uFire_EC ec;

ec.useTemperatureCompensation(true);

Related

Returns

none

usingTemperatureCompensation

Returns true if temperature compensation is being used.

Usage

uFire_EC::usingTemperatureCompensation();

Example

#include <uFire_EC.h>
uFire_EC ec;

bool useTC = ec.usingTemperatureCompensation();

Related

Returns

none

getVersion

Retrieves the hardware version of the device.

Usage

uFire_EC::getVersion();

Example

#include <uFire_EC.h>
uFire_EC ec;

uint8_t version = ec.getVersion();

Related

Returns

version of firmware

getFirmware

Retrieves the firmware version of the device.

Usage

uFire_EC::getFirmware();

Example

#include <uFire_EC.h>
uFire_EC ec;

uint8_t version = ec.getFirmware();

Related

Returns

version of firmware