UPM

The UPM API is a high level sensor library for IoT devices using MRAA. See examples here. Back to index page.
SparkFun sensor images provided under CC BY-NC-SA-3.0.

ECEZO Class

Module: ecezo

This driver was tested with the Atlas Scientific Electrical Conductivity kit.
This device can operate in either UART or I2C modes.

Methods

ECEZO

(
  • bus
  • addrBaud
  • isI2C
)
Number

ECEZO object constructor. This can use either UART (default) or I2C communications. For UART, specify the uart number as the bus parameter, the baudrate as the addrBaud parameter, and false for the isI2C parameter.
For I2C, specify the bus parameter, the I2C address as the addrBaud parameter, and true for the isI2C parameter.

Parameters:

  • bus Number

    Specify which uart or I2C bus to use

  • addrBaud Number

    Specify the baudrate if using UART, or the I2C address of the device if using I2C.

  • isI2C Boolean

    true if using I2C, false if using a UART

Returns:

Number:

update

()

Query the device for a reading, parse the response, and store the read values into the device context. This function must be called prior to calling any function that returns the data, like getEC() .

setTemperature

(
  • temp
)

For accurate readings, the temperature of the liquid being measured should be known. This function allows you to specify the liquid's temperature (in Celsius) so that proper compensation can take place. How you measure this temperature is up to you. By default, the device will assume a temperature of 25C.

Parameters:

  • temp Number

    The temperature of the liquid being measured

setKValue

(
  • k
)

Set the K value of the probe being used. By default, this is 1.0. Valid values are between 0.1 and 10.0.

Parameters:

  • k Number

    The K value of the probe

setSleep

(
  • enable
)

Enable or disable Sleep mode.

Parameters:

  • enable Boolean

    True to enable sleep mode, false to wake up

getEC

() Number

Retrieve the last measured Electrical Conductivity (EC) value in microsiemens. update() must have been called before calling this function.

Returns:

Number:

EC value in microsiemens

getTDS

() Number

Retrieve the last measured Total Dissolved solids (TDS) value. update() must have been called before calling this function.

Returns:

Number:

TDS value

getSalinity

() Number

Retrieve the last measured Salinity value. update() must have been called before calling this function.

Returns:

Number:

Salinity value

getSG

() Number

Retrieve the last measured Specific Gravity (SG) value. update() must have been called before calling this function.

Returns:

Number:

SG value

calibrate

(
  • cal
  • ec
)

Specify calibration data for calibrating the device. See the datasheet for details on how calibration is performed. This function provides a mechanism for clearing out, and setting calibration data.
A simple one point calibration might work as follows:

A two point calibration might work as follows:

Parameters:

  • cal ECEZO_CALIBRATION_T

    One of the ECEZO_CALIBRATION_T values

  • ec Number

    The EC value of the calibration fluid. This parameter is ignored when cal is either ECEZO_CALIBRATE_CLEAR or ECEZO_CALIBRATE_DRY.