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.

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

Parameters

The function can be overloaded with the following parameters:

  • temperature the temperature of the solution.
  • temp_constant the temperature to adjust the EC reading to.

Usage

uFire_EC::measureEC();
uFire_EC::measureEC(float temperature);
uFire_EC::measureEC(float temperature, float temperature_constant);
// take a temperature measurement without temperature compensation
uFire_EC::measureEC()

// take a temperature measurement with temperature compensation using the passed temperature
uFire_EC::measureEC(20.1)

// take a temperature measurement with temperature compensation using the passed temperature
// and also set the temperature to adjust to (this defaults to 25C)
uFire_EC::measureEC(20.1, 20)

Example

#include <uFire_EC.h>
uFire_EC ec;

float mS = ec.measureEC();

Related

Returns

EC in mS/cm, -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

Usage

uFire_EC::calibrateProbe(float solutionEC);

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.

When there are high and low calibration points, the device will automatically use them to adjust readings. To disable dual-point adjustment, call reset to remove all calibration data.

Parameters

  • solutionEC the EC of the calibration solution in mS/cm

Usage

uFire_EC::calibrateProbeLow(float solutionEC);

Example

#include <uFire_EC.h>
uFire_EC ec;

ec.calibrateProbeLow(0.7);

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.

When there are high and low calibration points, the device will automatically use them to adjust readings. To disable dual-point adjustment, call reset to remove all calibration data.

Parameters

  • solutionEC the EC of the calibration solution in mS/cm

Usage

uFire_EC::calibrateProbeHigh(float solutionEC);

Example

#include <uFire_EC.h>
uFire_EC ec;

ec.calibrateProbeHigh(12.88);

Related

Returns

none

setI2CAddress

Changes the default I2C address. It must be between 1 and 127 (decimal).

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);

Returns

none

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

setTempCoefficient

Configures device to use the provided temperature coefficient. The default value is set to 0.019, the generally accepted value for freshwater.

Parameters

  • temp_coefficient the temperature coefficient factor to use

Usage

uFire_EC::setTempCoefficient(float temp_coefficient);

Example

#include <uFire_EC.h>
uFire_EC ec;

ec.setTempCoefficient(0.019);

Related

Returns

none

getTempCoefficient

Retrieves the temperature coefficient.

Usage

uFire_EC::getTempCoefficient();

Example

#include <uFire_EC.h>
uFire_EC ec;

float tempCoef = ec.getTempCoefficient();

Related

Returns

the temperature coefficient

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

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