Atlas EZO-pH topic

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

Sensor Constructors

AtlasScientificpH::AtlasScientificpH(int8_t powerPin, uint8_t i2cAddressHex = 0x63, 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::AtlasScientificpH(TwoWire* theI2C, int8_t powerPin, uint8_t i2cAddressHex = 0x63, 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.


Example Code

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

1#include <sensors/AtlasScientificpH.h>
2
3// NOTE: Use -1 for any pins that don't apply or aren't being used.
4const int8_t AtlaspHPower = sensorPowerPin; // Power pin
5uint8_t AtlaspHi2c_addr = 0x63; // Default for pH is 0x63 (99)
6// All Atlas sensors have different default I2C addresses, but any of them can
7// be re-addressed to any 8 bit number. If using the default address for any
8// Atlas Scientific sensor, you may omit this argument.
9
10// Create an Atlas Scientific pH sensor object
11// AtlasScientificpH atlaspH(AtlaspHPower, AtlaspHi2c_addr);
12AtlasScientificpH atlaspH(AtlaspHPower);
13
14// Create a pH variable pointer for the pH sensor
15Variable* atlaspHpH =
16 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.

Sensor Variable Counts

The number of variables that can be returned by the Atlas pH sensor

#define ATLAS_PH_NUM_VARIABLES = 1
Sensor::_numReturnedValues; the Atlas EZO pH circuit can report 1 value.
#define ATLAS_PH_INC_CALC_VARIABLES = 0
Sensor::_incCalcValues; we don't calculate any additional values.

Configuration Defines

Defines to configure and set the address of the Atlas pH sensor

#define ATLAS_PH_I2C_ADDR = 0x63
The default I2C address of the Atlas pH sensor is 0x63 (99)

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.
#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_pH(AtlasScientificpH* parentSense, const char* uuid = "", const char* varCode = "AtlaspH") 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".

Define documentation

#define ATLAS_PH_NUM_VARIABLES = 1

Sensor::_numReturnedValues; the Atlas EZO pH circuit can report 1 value.


#define ATLAS_PH_INC_CALC_VARIABLES = 0

Sensor::_incCalcValues; we don't calculate any additional values.


#define ATLAS_PH_I2C_ADDR = 0x63

The default I2C address of the Atlas pH sensor is 0x63 (99)


#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.


#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_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".