ModularSensors > Modules > Supported Sensors > Atlas Scientific EZO Circuits > Atlas EZO-EC

Atlas EZO-EC module

Classes for the Atlas Scientific EZO-EC conductivity circuit and probes.

The Atlas Scientifc Conductivity sensor outputs raw conductivity, TDS, salinity, and specific gravity

  • Accuracy is ± 2%
  • Range is 0.07 − 500,000+ μS/cm
  • Resolution is 3 decimal places

Sensor Datasheet

Build flags

Sensor Constructors

AtlasScientificEC(int8_t powerPin, uint8_t i2cAddressHex = ATLAS_COND_I2C_ADDR, uint8_t measurementsToAverage = 1) explicit

Construct a new Atlas Scientific EC object using the primary hardware I2C instance.

Parameters
powerPin

The pin on the mcu controlling powering to the Atlas EC circuit. Use -1 if it is continuously powered.

  • Requires a 3.3V and 5V power supply
i2cAddressHex The I2C address of the Atlas circuit; optional with the Atlas-supplied default address of 0x64.
measurementsToAverage The number of measurements to take and average before giving a "final" result from the sensor; optional with a default value of 1.

AtlasScientificEC(TwoWire* theI2C, int8_t powerPin, uint8_t i2cAddressHex = ATLAS_COND_I2C_ADDR, uint8_t measurementsToAverage = 1)

Construct a new Atlas Scientific EC object using a secondary hardware I2C instance.

Parameters
theI2C A TwoWire instance for I2C communication. Due to the limitations of the Arduino core, only a hardware I2C instance can be used. For an AVR board, there is only one I2C instance possible and this form of the constructor should not be used. For a SAMD board, this can be used if a secondary I2C port is created on one of the extra SERCOMs.
powerPin

The pin on the mcu controlling powering to the Atlas EC circuit. Use -1 if it is continuously powered.

  • Requires a 3.3V and 5V power supply
i2cAddressHex The I2C address of the Atlas circuit; optional with the Atlas-supplied default address of 0x64.
measurementsToAverage The number of measurements to take and average before giving a "final" result from the sensor; optional with a default value of 1.

AtlasScientificEC(SoftwareWire* theI2C, int8_t powerPin, uint8_t i2cAddressHex = ATLAS_COND_I2C_ADDR, uint8_t measurementsToAverage = 1)

Construct a new Atlas Scientific EC object using a software I2C instance.

Parameters
theI2C A SoftwareWire instance for I2C communication.
powerPin

The pin on the mcu controlling powering to the Atlas EC circuit. Use -1 if it is continuously powered.

  • Requires a 3.3V and 5V power supply
i2cAddressHex The I2C address of the Atlas circuit; optional with the Atlas-supplied default address of 0x64.
measurementsToAverage The number of measurements to take and average before giving a "final" result from the sensor; optional with a default value of 1.

AtlasScientificEC(int8_t powerPin, int8_t dataPin, int8_t clockPin, uint8_t i2cAddressHex = ATLAS_COND_I2C_ADDR, uint8_t measurementsToAverage = 1)

Construct a new Atlas Scientific EC object, also creating a SoftwareWire I2C instance for communication with that object.

Parameters
powerPin

The pin on the mcu controlling powering to the Atlas EC circuit. Use -1 if it is continuously powered.

  • Requires a 3.3V and 5V power supply
dataPin The pin on the mcu that will be used for I2C data (SDA). Must be a valid pin number.
clockPin The pin on the mcu that will be used for the I2C clock (SCL). Must be a valid pin number.
i2cAddressHex The I2C address of the Atlas circuit; optional with the Atlas-supplied default address of 0x64.
measurementsToAverage The number of measurements to take and average before giving a "final" result from the sensor; optional with a default value of 1.

Currently only Testato's SoftwareWire is supported.



Example Code

The Atlas conductivity sensor is used in the menu a la carte example.

#include <sensors/AtlasScientificEC.h>

const int8_t AtlasECPower    = sensorPowerPin;  // Power pin (-1 if unconnected)
uint8_t      AtlasECi2c_addr = 0x64;            // Default for EC is 0x64 (100)
// All Atlas sensors have different default I2C addresses, but any of them can
// be re-addressed to any 8 bit number.  If using the default address for any
// Atlas Scientific sensor, you may omit this argument.

// Create an Atlas Scientific Conductivity sensor object
#ifdef MS_ATLAS_SOFTWAREWIRE
// AtlasScientificEC atlasEC(AtlasECPower, softwareSDA, softwareSCL,
//                           AtlasECi2c_addr);
AtlasScientificEC atlasEC(&softI2C, AtlasECPower, AtlasECi2c_addr);
#else
// AtlasScientificEC atlasEC(AtlasECPower, AtlasECi2c_addr);
AtlasScientificEC atlasEC(AtlasECPower);
#endif

// Create four variable pointers for the EZO-ES
Variable* atlasCond = new AtlasScientificEC_Cond(
    &atlasEC, "12345678-abcd-1234-ef00-1234567890ab");
Variable* atlasTDS =
    new AtlasScientificEC_TDS(&atlasEC, "12345678-abcd-1234-ef00-1234567890ab");
Variable* atlasSal = new AtlasScientificEC_Salinity(
    &atlasEC, "12345678-abcd-1234-ef00-1234567890ab");
Variable* atlasGrav = new AtlasScientificEC_SpecificGravity(
    &atlasEC, "12345678-abcd-1234-ef00-1234567890ab");

// Create a calculated variable for the temperature compensated conductivity
// (that is, the specific conductance).  For this example, we will use the
// temperature measured by the Atlas RTD above this.  You could use the
// temperature returned by any other water temperature sensor if desired.
// **DO NOT** use your logger board temperature (ie, from the DS3231) to
// calculate specific conductance!
float calculateAtlasSpCond(void) {
    float spCond    = -9999;  // Always safest to start with a bad value
    float waterTemp = atlasTemp->getValue();
    float rawCond   = atlasCond->getValue();
    // ^^ Linearized temperature correction coefficient per degrees Celsius.
    // The value of 0.019 comes from measurements reported here:
    // Hayashi M. Temperature-electrical conductivity relation of water for
    // environmental monitoring and geophysical data inversion. Environ Monit
    // Assess. 2004 Aug-Sep;96(1-3):119-28.
    // doi: 10.1023/b:emas.0000031719.83065.68. PMID: 15327152.
    if (waterTemp != -9999 && rawCond != -9999) {
        // make sure both inputs are good
        float temperatureCoef = 0.019;
        spCond = rawCond / (1 + temperatureCoef * (waterTemp - 25.0));
    }
    return spCond;
}

// Properties of the calculated variable
// The number of digits after the decimal place
const uint8_t atlasSpCondResolution = 0;
// This must be a value from http://vocabulary.odm2.org/variablename/
const char* atlasSpCondName = "specificConductance";
// This must be a value from http://vocabulary.odm2.org/units/
const char* atlasSpCondUnit = "microsiemenPerCentimeter";
// A short code for the variable
const char* atlasSpCondCode = "atlasSpCond";
// The (optional) universallly unique identifier
const char* atlasSpCondUUID = "12345678-abcd-1234-ef00-1234567890ab";

// Finally, create the specific conductance variable and return a pointer to it
Variable* atlasSpCond =
    new Variable(calculateAtlasSpCond, atlasSpCondResolution, atlasSpCondName,
                 atlasSpCondUnit, atlasSpCondCode, atlasSpCondUUID);

Classes

class AtlasScientificEC
The Sensor sub-class for the Atlas Scientific conductivity circuit and sensor.
class AtlasScientificEC_Cond
The Variable sub-class used for the conductivity output from an Atlas Scientific EC EZO circuit.
class AtlasScientificEC_TDS
The Variable sub-class used for the total dissolved solids output from an Atlas Scientific EC EZO circuit.
class AtlasScientificEC_Salinity
The Variable sub-class used for the salinity output from an Atlas Scientific EC EZO circuit.
class AtlasScientificEC_SpecificGravity
The Variable sub-class used for the specific gravity output from an Atlas Scientific EC EZO circuit.

Defines

#define ATLAS_COND_I2C_ADDR = 0x64
Default I2C address is 0x64 (100)
#define ATLAS_COND_NUM_VARIABLES = 4
Sensor::_numReturnedValues; Atlas EZO conductivity circuit can report 4 values.

Sensor Timing

The sensor timing for an Atlas EC (conducticity) sensor

#define ATLAS_COND_WARM_UP_TIME_MS = 745
Sensor::_warmUpTime_ms; Atlas EZO conductivity circuit warms up in 745ms.

739-740 in tests

#define ATLAS_COND_STABILIZATION_TIME_MS = 0
Sensor::_stabilizationTime_ms; Atlas EZO conductivity circuit is stable 0ms after warm-up. (stable at completion of warm up)
#define ATLAS_COND_MEASUREMENT_TIME_MS = 600
Sensor::_measurementTime_ms; Atlas EZO conductivity circuit takes 600ms to complete a measurement.

only ~555 measurement time in tests, but keep the 600 recommended by manual

Conductivity

The conductivity variable from an Atlas EC (conducticity) sensor

  • Accuracy is ± 2%
  • Range is 0.07 − 500,000+ μS/cm

AtlasScientificEC_Cond(AtlasScientificEC* parentSense, const char* uuid = "", const char* varCode = ATLAS_COND_DEFAULT_CODE) explicit

Construct a new AtlasScientificEC_Cond object.

Parameters
parentSense The parent AtlasScientificEC providing the result values.
uuid A universally unique identifier (UUID or GUID) for the variable; optional with the default value of an empty string.
varCode A short code to help identify the variable in files; optional with a default value of "AtlasCond".

#define ATLAS_COND_RESOLUTION = 3
Decimals places in string representation; conductivity should have 3.
#define ATLAS_COND_VAR_NUM = 0
Sensor variable number; conductivity is stored in sensorValues[0].
#define ATLAS_COND_VAR_NAME = "electricalConductivity"
Variable name in ODM2 controlled vocabulary; "electricalConductivity".
#define ATLAS_COND_UNIT_NAME = "microsiemenPerCentimeter"
Variable unit name in ODM2 controlled vocabulary; "microsiemenPerCentimeter" (µS/cm)
#define ATLAS_COND_DEFAULT_CODE = "AtlasCond"
Default variable short code; "AtlasCond".

Total Dissolved Solids

The TDS variable from an Atlas EC (conducticity) sensor

  • Accuracy is ± 2%
  • Range is 0.07 − 500,000+ μS/cm

AtlasScientificEC_TDS(AtlasScientificEC* parentSense, const char* uuid = "", const char* varCode = ATLAS_TDS_DEFAULT_CODE) explicit

Construct a new AtlasScientificEC_TDS object.

Parameters
parentSense The parent AtlasScientificEC providing the result values.
uuid A universally unique identifier (UUID or GUID) for the variable; optional with the default value of an empty string.
varCode A short code to help identify the variable in files; optional with a default value of "AtlasTDS".

#define ATLAS_TDS_RESOLUTION = 3
Decimals places in string representation; TDS should have 3.
#define ATLAS_TDS_VAR_NUM = 1
Sensor variable number; TDS is stored in sensorValues[1].
#define ATLAS_TDS_VAR_NAME = "solidsTotalDissolved"
Variable name in ODM2 controlled vocabulary; "solidsTotalDissolved".
#define ATLAS_TDS_UNIT_NAME = "partPerMillion"
Variable unit name in ODM2 controlled vocabulary; "partPerMillion" (ppm)
#define ATLAS_TDS_DEFAULT_CODE = "AtlasTDS"
Default variable short code; "AtlasTDS".

Salinity

The salinity variable from an Atlas EC (conducticity) sensor

  • Accuracy is ± 2%
  • Range is 0.07 − 500,000+ μS/cm

AtlasScientificEC_Salinity(AtlasScientificEC* parentSense, const char* uuid = "", const char* varCode = ATLAS_SALINITY_DEFAULT_CODE) explicit

Construct a new AtlasScientificEC_Salinity object.

Parameters
parentSense The parent AtlasScientificEC providing the result values.
uuid A universally unique identifier (UUID or GUID) for the variable; optional with the default value of an empty string.
varCode A short code to help identify the variable in files; optional with a default value of "AtlasSalinity".

#define ATLAS_SALINITY_RESOLUTION = 3
Decimals places in string representation; salinity should have 3.
#define ATLAS_SALINITY_VAR_NUM = 2
Sensor variable number; salinity is stored in sensorValues[2].
#define ATLAS_SALINITY_VAR_NAME = "salinity"
Variable name in ODM2 controlled vocabulary; "salinity".
#define ATLAS_SALINITY_UNIT_NAME = "practicalSalinityUnit"
Variable unit name in ODM2 controlled vocabulary; "practicalSalinityUnit".
#define ATLAS_SALINITY_DEFAULT_CODE = "AtlasSalinity"
Default variable short code; "AtlasSalinity".

Specific Gravity

The specific gravity variable from an Atlas EC (conducticity) sensor

  • Accuracy is ± 2%
  • Range is 0.07 − 500,000+ μS/cm

AtlasScientificEC_SpecificGravity(AtlasScientificEC* parentSense, const char* uuid = "", const char* varCode = ATLAS_SG_DEFAULT_CODE) explicit

Construct a new AtlasScientificEC_SpecificGravity object.

Parameters
parentSense The parent AtlasScientificEC providing the result values.
uuid A universally unique identifier (UUID or GUID) for the variable; optional with the default value of an empty string.
varCode A short code to help identify the variable in files; optional with a default value of "AtlasSpecGravity".

#define ATLAS_SG_RESOLUTION = 3
Decimals places in string representation; specific gravity should have 3.
#define ATLAS_SG_VAR_NUM = 3
Sensor variable number; specific gravity is stored in sensorValues[3].
#define ATLAS_SG_VAR_NAME = "specificGravity"
Variable name in ODM2 controlled vocabulary; "specificGravity".
#define ATLAS_SG_UNIT_NAME = "dimensionless"
Variable unit name in ODM2 controlled vocabulary; "dimensionless".
#define ATLAS_SG_DEFAULT_CODE = "AtlasSpecGravity"
Default variable short code; "AtlasSpecGravity".