Atlas EZO-CO2 topic

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/

Sensor Constructors

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


Example Code

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

1#include <sensors/AtlasScientificCO2.h>
2
3// NOTE: Use -1 for any pins that don't apply or aren't being used.
4const int8_t AtlasCO2Power = sensorPowerPin; // Power pin
5uint8_t AtlasCO2i2c_addr = 0x69; // Default for CO2-EZO is 0x69 (105)
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 CO2 sensor object
11// AtlasScientificCO2 atlasCO2(AtlasCO2Power, AtlasCO2i2c_addr);
12AtlasScientificCO2 atlasCO2(AtlasCO2Power);
13
14// Create concentration and temperature variable pointers for the EZO-CO2
15Variable* atlasCO2CO2 = new AtlasScientificCO2_CO2(
16 &atlasCO2, "12345678-abcd-1234-ef00-1234567890ab");
17Variable* atlasCO2Temp = new AtlasScientificCO2_Temp(
18 &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.

Sensor Variable Counts

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

#define ATLAS_CO2_NUM_VARIABLES = 2
Sensor::_numReturnedValues; the Atlas CO2 sensor can report 2 values.
#define ATLAS_CO2_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 CO2 sensor

#define ATLAS_CO2_I2C_ADDR = 0x69
The default I2C address of the Atlas CO2 sensor is 0x69 (105)

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_CO2(AtlasScientificCO2* parentSense, const char* uuid = "", const char* varCode = "AtlasCO2ppm") 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_Temp(AtlasScientificCO2* parentSense, const char* uuid = "", const char* varCode = "AtlasCO2Temp") 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".

Define documentation

#define ATLAS_CO2_NUM_VARIABLES = 2

Sensor::_numReturnedValues; the Atlas CO2 sensor can report 2 values.


#define ATLAS_CO2_INC_CALC_VARIABLES = 0

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


#define ATLAS_CO2_I2C_ADDR = 0x69

The default I2C address of the Atlas CO2 sensor is 0x69 (105)


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


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


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