Class T67XX
Class for T67XX CO2 sensor communication.
#include <T67XX.h>
Public Types
| Type | Name |
|---|---|
| union | StatusRegister Each bit represents the status of a device function or error. |
Public Functions
| Type | Name |
|---|---|
| T67XX (TwoWire * pWire=&Wire, uint8_t deviceAddress=T67XX_DEFAULT_I2C_ADDR) T67XX class constructor. |
|
| bool | begin (void) Initializes I2C communication. |
| bool | beginCalibration (bool waitForCompletion=false) Starts the single point calibration routine. |
| void | disableABCMode (void) Disable ABC autocalibration. |
| void | enableABCMode (void) Enable ABC autocalibration. |
| void | endCalibration (void) Stops the single point calibration routine. |
| void | flashUpdate (void) Saves configuration to flash. |
| uint16_t | getFirmwareVersion (void) Gets the sensor firmware version. |
| uint16_t | getStatus (void) Gets the current sensor status and stores it in the internal variable. |
| String | getStatusMsg (void) Genera un mensaje con el estado actual del sensor. |
| uint16_t | readPPM (void) Gets the current CO2 value from the sensor in PPM. |
| void | reset (void) Resets the sensor. |
| uint8_t | setSlaveAddress (uint8_t newAddress) Modifies the sensor's internal I2C address. |
| ~T67XX () T67XX class destructor. |
Public Types Documentation
union StatusRegister
Each bit represents the status of a device function or error.
Allows verification of device status and the different errors that can occur.
Under error conditions, a "1" indicates an error; a "0" indicates no error. A Flash error is fatal (i.e., no recovery). Calibration errors can be cleared by running the calibration procedure again with correct results.
Under calibration conditions, a "1" indicates that the calibration cycle is in progress. No other calibration cycle can be started while one is in progress and the Modbus response will report an error to the new calibration request.
If the warmup bit (WARMUP) is active, the sensor is in a mode where internal registers and gas data (ppm) are being initialized and are not necessarily correct.
Public Functions Documentation
function T67XX
T67XX class constructor.
Parameters:
pWirePeripheral used for I2C communication.deviceAddressI2C address of the sensor used.
function begin
Initializes I2C communication.
Returns:
True if communication with the module is successful, false if it fails.
function beginCalibration
Starts the single point calibration routine.
The single point calibration routine is generally performed at room temperature (~500 ppm, 25 °C) and takes several minutes to complete after starting (approximately 6 minutes). During this time, the sensor status and current ppm gas readings can be queried. The user can check the calibration status by reading the status register and noting if the single point calibration bit is active. Calibration can be stopped before it finishes.
Parameters:
waitForCompletionOptional: Wait for calibration to finish (disabled by default).
Returns:
True if calibration has finished.
function disableABCMode
Disable ABC autocalibration.
See also: enableABCMode()
function enableABCMode
Enable ABC autocalibration.
Automatic Background Logic (ABC) is a patented autocalibration technique designed for use in applications where concentrations drop to outdoor ambient conditions (400 ppm) at least once (15 minutes) in a 7-day period, which typically occurs during unoccupied periods.
Full accuracy is achieved using ABC Logic. With ABC Logic enabled, the sensor generally reaches its operational accuracy after 25 hours of continuous operation, provided it has been exposed to reference ambient air levels of 400 ppm ±10ppm CO2. The sensor will maintain accuracy specifications with ABC Logic enabled, as long as it is exposed to the reference value at least once every 7 days, and this reference value is the lowest concentration to which the sensor is exposed.
Note:
ABC Logic requires continuous sensor operation in increments of at least 4 hours each.
Warning:
Not recommended for applications where the sensor is not regularly exposed to fresh air (400 ppm CO2).
function endCalibration
Stops the single point calibration routine.
function flashUpdate
Saves configuration to flash.
function getFirmwareVersion
Gets the sensor firmware version.
Returns:
Firmware version.
function getStatus
Gets the current sensor status and stores it in the internal variable.
Returns:
Current sensor status.
function getStatusMsg
Genera un mensaje con el estado actual del sensor.
Returns:
Cadena con el estado actual del sensor.
function readPPM
Gets the current CO2 value from the sensor in PPM.
Returns:
CO2 value in PPM.
function reset
Resets the sensor.
function setSlaveAddress
Modifies the sensor's internal I2C address.
Configures a new sensor I2C address and resets it to apply the changes.
Parameters:
newAddressNew sensor I2C address
Returns:
True if communication with the module at the new address is successful, false if it fails.
Warning:
This change is permanent when the sensor is reset.
function ~T67XX
T67XX class destructor.
The documentation for this class was generated from the following file firmware/T67XX.h