ECEZO Class
- 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.
Item Index
Methods
ECEZO
-
bus
-
addrBaud
-
isI2C
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
NumberSpecify which uart or I2C bus to use
-
addrBaud
NumberSpecify the baudrate if using UART, or the I2C address of the device if using I2C.
-
isI2C
Booleantrue if using I2C, false if using a UART
Returns:
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
NumberThe 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
NumberThe K value of the probe
setSleep
-
enable
Enable or disable Sleep mode.
Parameters:
-
enable
BooleanTrue 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:
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:
TDS value
getSalinity
()
Number
Retrieve the last measured Salinity value. update() must have been called before calling this function.
Returns:
Salinity value
getSG
()
Number
Retrieve the last measured Specific Gravity (SG) value. update() must have been called before calling this function.
Returns:
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_TOne of the ECEZO_CALIBRATION_T values
-
ec
NumberThe EC value of the calibration fluid. This parameter is ignored when cal is either ECEZO_CALIBRATE_CLEAR or ECEZO_CALIBRATE_DRY.