ModularSensors > Classes > Sensor > AtlasParent > AtlasScientificCO2
ModularSensors > Modules > Atlas EZO-CO2 > AtlasScientificCO2


AtlasScientificCO2 class

The Sensor sub-class for the Atlas Scientific gaseous CO2 and temperature sensor.

Base classes

class AtlasParent
A parent class for Atlas EZO circuits and sensors.

Constructors, destructors, conversion operators

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.
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.
~AtlasScientificCO2()
Destroy the Atlas Scientific CO2 object. Also destroy the software I2C instance if one was created.

Public functions

bool setup(void ) override
Do any one-time preparations needed before the sensor will be able to take readings.

Function documentation

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

boolsetup(void ) override

Do any one-time preparations needed before the sensor will be able to take readings.

Returns bool True if the setup was successful.

This begins the Wire library (sets pin modes for I2C), tells the CO2 circuit to report all possible measurement parameters, and sets the status bit if successful. The circuit must be powered for setup.