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

Atlas EZO-CO2 module

Classes for the Atlas Scientific EZO-CO2 embedded NDIR CO2 circuit and sensor.

Sensor Datasheet

Documentation on the CO2 circuit and probe is available here: https://www.atlas-scientific.com/probes/ezo-co2-carbon-dioxide-sensor/

Build flags

Sensor Constructors

AtlasScientificCO2(int8_t powerPin, uint8_t i2cAddressHex = ATLAS_CO2_I2C_ADDR, uint8_t measurementsToAverage = 1) explicit

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

Parameters
powerPin

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

AtlasScientificCO2(TwoWire* theI2C, int8_t powerPin, uint8_t i2cAddressHex = ATLAS_CO2_I2C_ADDR, uint8_t measurementsToAverage = 1)

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

AtlasScientificCO2(SoftwareWire* theI2C, int8_t powerPin, uint8_t i2cAddressHex = ATLAS_CO2_I2C_ADDR, uint8_t measurementsToAverage = 1)

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

AtlasScientificCO2(int8_t powerPin, int8_t dataPin, int8_t clockPin, uint8_t i2cAddressHex = ATLAS_CO2_I2C_ADDR, uint8_t measurementsToAverage = 1)

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

Parameters
powerPin

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

#include <sensors/AtlasScientificCO2.h>

const int8_t AtlasCO2Power = sensorPowerPin;  // Power pin (-1 if unconnected)
uint8_t      AtlasCO2i2c_addr = 0x69;  // Default for CO2-EZO is 0x69 (105)
// 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 CO2 sensor object
#ifdef MS_ATLAS_SOFTWAREWIRE
// AtlasScientificCO2 atlasCO2(AtlasCO2Power, softwareSDA, softwareSCL,
//                             AtlasCO2i2c_addr);
AtlasScientificCO2 atlasCO2(&softI2C, AtlasCO2Power, AtlasCO2i2c_addr);
#else
// AtlasScientificCO2 atlasCO2(AtlasCO2Power, AtlasCO2i2c_addr);
AtlasScientificCO2 atlasCO2(AtlasCO2Power);
#endif

// Create concentration and temperature variable pointers for the EZO-CO2
Variable* atlasCO2CO2 = new AtlasScientificCO2_CO2(
    &atlasCO2, "12345678-abcd-1234-ef00-1234567890ab");
Variable* atlasCO2Temp = new AtlasScientificCO2_Temp(
    &atlasCO2, "12345678-abcd-1234-ef00-1234567890ab");

Classes

class AtlasScientificCO2
The Sensor sub-class for the Atlas Scientific gaseous CO2 and temperature sensor.
class AtlasScientificCO2_CO2
The Variable sub-class used for the CO2 concentration output from an Atlas Scientific CO2 circuit.
class AtlasScientificCO2_Temp
The Variable sub-class used for the temperature output from an Atlas Scientific CO2 circuit.

Defines

#define ATLAS_CO2_I2C_ADDR = 0x69
Default I2C address is 0x69 (105)
#define ATLAS_CO2_NUM_VARIABLES = 2
Sensor::_numReturnedValues; the Atlas CO2 sensor can report 2 values.

Sensor Timing

#define ATLAS_CO2_WARM_UP_TIME_MS = 850
Sensor::_warmUpTime_ms; the Atlas CO2 sensor warms up in 850ms.
#define ATLAS_CO2_STABILIZATION_TIME_MS = 10000
Sensor::_stabilizationTime_ms; the Atlas CO2 sensor is not stable until 10s (10000ms) after warm-up.
#define ATLAS_CO2_MEASUREMENT_TIME_MS = 900
Sensor::_measurementTime_ms; the Atlas CO2 sensor takes 900ms to complete a measurement.

CO2 Concentration

The CO2 variable from an Atlas CO2 sensor

  • Accuracy is ± 3% or ± 30 ppm
  • Range is 0 − 10000 ppm

AtlasScientificCO2_CO2(AtlasScientificCO2* parentSense, const char* uuid = "", const char* varCode = ATLAS_CO2_DEFAULT_CODE) explicit

Construct a new AtlasScientificCO2_CO2 object.

Parameters
parentSense The parent AtlasScientificCO2 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 "AtlasCO2ppm".

#define ATLAS_CO2_RESOLUTION = 1
Decimals places in string representation; CO2 should have 1 - resolution is 1 ppm.
#define ATLAS_CO2_VAR_NUM = 0
Sensor variable number; CO2 is stored in sensorValues[0].
#define ATLAS_CO2_VAR_NAME = "carbonDioxide"
Variable name in ODM2 controlled vocabulary; "carbonDioxide".
#define ATLAS_CO2_UNIT_NAME = "partPerMillion"
Variable unit name in ODM2 controlled vocabulary; "partPerMillion" (ppm)
#define ATLAS_CO2_DEFAULT_CODE = "AtlasCO2ppm"
Default variable short code; "AtlasCO2ppm".

Temperature

The temperature variable from an Atlas CO2 sensor

  • Accuracy is not reported on the sensor datasheet
  • Range is -20°C to +50°C

AtlasScientificCO2_Temp(AtlasScientificCO2* parentSense, const char* uuid = "", const char* varCode = ATLAS_CO2TEMP_DEFAULT_CODE) explicit

Construct a new AtlasScientificCO2_Temp object.

Parameters
parentSense The parent AtlasScientificCO2 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 "AtlasCO2Temp".

#define ATLAS_CO2TEMP_RESOLUTION = 0
Decimals places in string representation; CO2TEMP should have 0 - resolution is 1°C.
#define ATLAS_CO2TEMP_VAR_NUM = 1
Sensor variable number; CO2TEMP is stored in sensorValues[1].
#define ATLAS_CO2TEMP_VAR_NAME = "temperature"
Variable name in ODM2 controlled vocabulary; "temperature".
#define ATLAS_CO2TEMP_UNIT_NAME = "degreeCelsius"
Variable unit name in ODM2 controlled vocabulary; "degreeCelsius" (°C)
#define ATLAS_CO2TEMP_DEFAULT_CODE = "AtlasCO2Temp"
Default variable short code; "AtlasCO2Temp".