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

Atlas EZO-pH module

Classes for the Atlas Scientific EZO-pH circuit and probe.

Sensor Datasheet

Documentation on the probe and measurement circuit are found here: https://www.atlas-scientific.com/ph.html

Build flags

Sensor Constructors

AtlasScientificpH(int8_t powerPin, uint8_t i2cAddressHex = ATLAS_PH_I2C_ADDR, uint8_t measurementsToAverage = 1) explicit

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

Parameters
powerPin

The pin on the mcu controlling powering to the Atlas pH 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 0x63.
measurementsToAverage The number of measurements to take and average before giving a "final" result from the sensor; optional with a default value of 1.

AtlasScientificpH(TwoWire* theI2C, int8_t powerPin, uint8_t i2cAddressHex = ATLAS_PH_I2C_ADDR, uint8_t measurementsToAverage = 1)

Construct a new Atlas Scientific pH 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 pH 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 0x63.
measurementsToAverage The number of measurements to take and average before giving a "final" result from the sensor; optional with a default value of 1.

AtlasScientificpH(SoftwareWire* theI2C, int8_t powerPin, uint8_t i2cAddressHex = ATLAS_PH_I2C_ADDR, uint8_t measurementsToAverage = 1)

Construct a new Atlas Scientific pH 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 pH 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 0x63.
measurementsToAverage The number of measurements to take and average before giving a "final" result from the sensor; optional with a default value of 1.

AtlasScientificpH(int8_t powerPin, int8_t dataPin, int8_t clockPin, uint8_t i2cAddressHex = ATLAS_PH_I2C_ADDR, uint8_t measurementsToAverage = 1)

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

Parameters
powerPin

The pin on the mcu controlling powering to the Atlas pH 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 0x63.
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 pH sensor is used in the menu a la carte example.

#include <sensors/AtlasScientificpH.h>

const int8_t AtlaspHPower    = sensorPowerPin;  // Power pin (-1 if unconnected)
uint8_t      AtlaspHi2c_addr = 0x63;            // Default for pH is 0x63 (99)
// 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 pH sensor object
#ifdef MS_ATLAS_SOFTWAREWIRE
AtlasScientificpH atlaspH(&softI2C, AtlaspHPower, AtlaspHi2c_addr);
// AtlasScientificpH atlaspH(AtlaspHPower, softwareSDA, softwareSCL,
//                           AtlaspHi2c_addr);
#else
// AtlasScientificpH atlaspH(AtlaspHPower, AtlaspHi2c_addr);
AtlasScientificpH atlaspH(AtlaspHPower);
#endif

// Create a pH variable pointer for the pH sensor
Variable* atlaspHpH =
    new AtlasScientificpH_pH(&atlaspH, "12345678-abcd-1234-ef00-1234567890ab");

Classes

class AtlasScientificpH
The Sensor sub-class for the Atlas Scientific pH sensor.
class AtlasScientificpH_pH
The Variable sub-class used for the pH output from an Atlas Scientific EZO pH circuit.

Defines

#define ATLAS_PH_I2C_ADDR = 0x63
Default I2C address is 0x63 (99)
#define ATLAS_PH_NUM_VARIABLES = 1
Sensor::_numReturnedValues; the Atlas EZO pH circuit can report 1 value.

Sensor Timing

The sensor timing for an Atlas pH sensor

#define ATLAS_PH_WARM_UP_TIME_MS = 850
Sensor::_warmUpTime_ms; the Atlas EZO pH circuit warms up in 850ms.

846 in SRGD Tests

#define ATLAS_PH_STABILIZATION_TIME_MS = 0
Sensor::_stabilizationTime_ms; the Atlas EZO pH circuit is stable 0ms after warm-up (stable at completion of warm up).
#define ATLAS_PH_MEASUREMENT_TIME_MS = 1660
Sensor::_measurementTime_ms; the Atlas EZO pH circuit takes 1660ms to complete a measurement.

pH

The pH variable from an Atlas pH sensor

  • Accuracy is ± 0.002
  • Range is 0.001 − 14.000 (ATLAS_PH_RESOLUTION = 3)
  • Reported as dimensionless pH units

AtlasScientificpH_pH(AtlasScientificpH* parentSense, const char* uuid = "", const char* varCode = ATLAS_PH_DEFAULT_CODE) explicit

Construct a new AtlasScientificpH_pH object.

Parameters
parentSense The parent AtlasScientificpH 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 "AtlaspH".

#define ATLAS_PH_RESOLUTION = 3
Decimals places in string representation; pH should have 3 - resolution is 0.001.
#define ATLAS_PH_VAR_NUM = 0
Sensor variable number; pH is stored in sensorValues[0].
#define ATLAS_PH_VAR_NAME = "pH"
Variable name in ODM2 controlled vocabulary; "pH".
#define ATLAS_PH_UNIT_NAME = "pH"
Variable unit name in ODM2 controlled vocabulary; "pH" (dimensionless pH units)
#define ATLAS_PH_DEFAULT_CODE = "AtlaspH"
Default variable short code; "AtlaspH".