pyupm_ecezo module

class pyupm_ecezo.ECEZO(bus=0, addrBaud=9600, isI2C=False)[source]

Bases: object

API for the EC-EZO EC Sensor.

ID: ecezo

Name: Electrical Conductivity (EC) Circuit

Category: liquid

Manufacturer: sparkfun

Connection: uart i2c

Link:https://www.sparkfun.com/products/12908 This driver was tested with the Atlas Scientific Electrical Conductivity kit.

This device can operate in either UART or I2C modes.

C++ includes: ecezo.hpp

calibrate(cal, ec)[source]

void calibrate(ECEZO_CALIBRATION_T cal, float 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:

CLEAR the calibration data

with a dry probe, set the DRY point.

with the probe immersed in a standardized solution, set the ONE parameter to the solution’s known EC value in microsiemens.

A two point calibration might work as follows:

CLEAR the calibration data

with a dry probe, set the DRY point.

with the probe immersed in the lowest EC standardized solution, set the LOW parameter to the solution’s known EC value in microsiemens.

with the probe immersed in the highest EC standardized solution, set the HIGH parameter to the solution’s known EC value in microsiemens.

cal: One of the ECEZO_CALIBRATION_T values

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

getEC()[source]

float getEC()

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

EC value in microsiemens

getSG()[source]

float getSG()

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

SG value

getSalinity()[source]

float getSalinity()

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

Salinity value

getTDS()[source]

float getTDS()

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

TDS value

setKValue(k)[source]

void setKValue(float 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.

k: The K value of the probe

setSleep(enable)[source]

void setSleep(bool enable)

Enable or disable Sleep mode.

enable: True to enable sleep mode, false to wake up

setTemperature(temp)[source]

void setTemperature(float 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.

temp: The temperature of the liquid being measured

UPM result

update()[source]

void 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().