Alphasense IRC-A1 CO2 topic
- Introduction
- Sensor Datasheet
- Build flags
- Sensor Constructor
- Example Code
- Reference
- Detailed Descriptions
Classes for the Alphasense IRC-A1 Nondispersive Infrared (NDIR) Carbon Dioxide (CO2) sensor.
Introduction
The Alphasense IRC-A1 Nondispersive Infrared (NDIR) Carbon Dioxide (CO2) sensor The CO2 sensor requires a 2-5 V DC power source with a current draw of 20 to 60 mA. The power supply to the sensor can be stopped between measurements.
To convert the sensor's analog 4-20 mA signal to a high resolution digital signal, the sensor must be attached to an analog-to-digital converter with an resistor in series. Furthermore, https:/
See the ADS1115 for details on the ADC conversion.
Sensor Datasheet
Build flags
-D MS_USE_ADS1015
- switches from the 16-bit ADS1115 to the 12 bit ADS1015
-D ALPHASENSE_CO2_CALIBRATION_FACTOR=x
- Changes the calibration factor from 1 to x
Sensor Constructor
Construct a new Alphasense IRC-A1 CO2 object - need the power pin and the on the ADS1x15. Designed to read differential voltage between ads channels 2 and 3. The pin on the mcu controlling power to the Alphasense CO2 sensor. Use -1 if it is continuously powered.
AlphasenseCO2::
Parameters
powerPin
adsDiffMux
Which two pins on the TI ADS1115 that will measure differential voltage. See aco2_
i2cAddress
The I2C address of the ADS 1x15, default is 0x48 (ADDR = GND)
measurementsToAverage
The number of measurements to take and average before giving a "final" result from the sensor; optional with a default value of 7 [seconds], which is one period of the cycle.
Example Code
The Alphasense CO2 sensor is used in the menu a la carte example.
Classes
- class AlphasenseCO2
- The Sensor sub-class for the [Alphasense IRC-A1 CO2](Alphasense IRC-A1 CO2) sensor.
- class AlphasenseCO2_CO2
- The Variable sub-class used for the carbon dioxide (CO2) output from an Alphasense IRC-A1 CO2.
- class AlphasenseCO2_Voltage
- The Variable sub-class used for the raw voltage output from an Alphasense IRC-A1 CO2.
Configuration Defines
Defines to set the calibration of the Alphasense CO2 sensor and the address of the ADD.
- enum aco2_adsDiffMux_t: uint16_t { DIFF_MUX_0_1, DIFF_MUX_0_3, DIFF_MUX_1_3, DIFF_MUX_2_3 }
- Enum for the pins used for differential voltages.
- #define ALPHASENSE_CO2_CALIBRATION_FACTOR = 1
- The calibration factor between output in volts and CO2 (microeinsteinPerSquareMeterPerSecond) 1 µmol mˉ² sˉ¹ per mV (reciprocal of sensitivity)
- #define ADS1115_ADDRESS = 0x48
- The assumed address of the ADS1115, 1001 000 (ADDR = GND)
Sensor Variable Counts
The number of variables that can be returned by the Apogee SQ-212
- #define ALPHASENSE_CO2_NUM_VARIABLES = 2
- Sensor::
_numReturnedValues; the Alphasense CO2 sensor can report 2 values, raw voltage and calculated CO2. - #define ALPHASENSE_CO2_INC_CALC_VARIABLES = 1
- Sensor::
_incCalcValues; CO2 is calculated from the raw voltage.
Sensor Timing
The sensor timing for an Alphasense IRC-A1 CO2
- #define ALPHASENSE_CO2_WARM_UP_TIME_MS = 200
- Sensor::
_warmUpTime_ms; The TI ADS1x15 to warm up time is 2 ms, and we get Alphasense CO2 sensor readings in <200 ms second. - #define ALPHASENSE_CO2_STABILIZATION_TIME_MS = 35000
- Sensor::
_stabilizationTime_ms; The manufacturer provides the following stablization times: - #define ALPHASENSE_CO2_MEASUREMENT_TIME_MS = 1000
- Sensor::
_measurementTime_ms; The Alphasense IRC-A1 CO2 sensor will return a new number every 200 ms, but there appears to be a cyclic response with a ~7 sec period, so we recommend averaging 1 s measurements over 28 seconds (3 periods)
CO2 Concentration
The CO2 variable from an Alphasense IRC-A1 CO2
- Accuracy is ± 1FS or ± 50 ppm (for IAQ type)
- Range is 0 − 5000 ppm (for IAQ type)
- Resolution: < 1 ppm
- 16-bit ADC (ADS1115): < 1 ppm (5 significant figures)
- 12-bit ADC (ADS1015): worse
{{ AlphasenseCO2_
- #define ALPHASENSE_CO2_VAR_NUM = 0
- Variable number; CO2 is stored in sensorValues[0].
- #define ALPHASENSE_CO2_VAR_NAME = "carbonDioxide"
- Variable name in ODM2 controlled vocabulary; "carbonDioxide".
- #define ALPHASENSE_CO2_UNIT_NAME = "partPerMillion"
- Variable unit name in ODM2 controlled vocabulary; "partPerMillion" (ppm)
- #define ALPHASENSE_CO2_DEFAULT_CODE = "AlphasenseCO2ppm"
- Default variable short code; "AlphasenseCO2ppm".
- #define ALPHASENSE_CO2_RESOLUTION = 4
- Decimals places in string representation; CO2 should have 4 when using an ADS1115.
Voltage
The voltage variable from an Alphasense IRC-A1 CO2
- Range is 0 to 3.6V [when ADC is powered at 3.3V]
- Accuracy is ± 0.5%
- 16-bit ADC (ADS1115): < 0.25% (gain error), <0.25 LSB (offset error)
- 12-bit ADC (ADS1015, using build flag
MS_USE_ADS1015
): < 0.15% (gain error), <3 LSB (offset error)
- Resolution [assuming the ADC is powered at 3.3V with inbuilt gain set to 1 (0-4.096V)]:
- 16-bit ADC (ADS1115): 0.125 mV (ADS1115)
- 12-bit ADC (ADS1015, using build flag
MS_USE_ADS1015
): 2 mV (ADS1015)
{{ AlphasenseCO2_
- #define ALPHASENSE_CO2_VOLTAGE_VAR_NUM = 1
- Variable number; voltage is stored in sensorValues[1].
- #define ALPHASENSE_CO2_VOLTAGE_VAR_NAME = "voltage"
- Variable name in ODM2 controlled vocabulary; "voltage".
- #define ALPHASENSE_CO2_VOLTAGE_UNIT_NAME = "volt"
- Variable unit name in ODM2 controlled vocabulary; "volt" (V)
- #define ALPHASENSE_CO2_VOLTAGE_DEFAULT_CODE = "AlphasenseCO2Voltage"
- Default variable short code; "AlphasenseCO2Voltage".
- #define ALPHASENSE_CO2_VOLTAGE_RESOLUTION = 4
- Decimals places in string representation; voltage should have 4 when used with an ADS1115.
Enum documentation
enum aco2_adsDiffMux_t: uint16_t
#include <src/sensors/AlphasenseCO2.h>
Enum for the pins used for differential voltages.
Enumerators | |
---|---|
DIFF_MUX_0_1 |
differential across pins 0 and 1 |
DIFF_MUX_0_3 |
differential across pins 0 and 3 |
DIFF_MUX_1_3 |
differential across pins 1 and 3 |
DIFF_MUX_2_3 |
differential across pins 2 and 3 |
Define documentation
#define ALPHASENSE_CO2_CALIBRATION_FACTOR = 1
#include <src/sensors/AlphasenseCO2.h>
The calibration factor between output in volts and CO2 (microeinsteinPerSquareMeterPerSecond) 1 µmol mˉ² sˉ¹ per mV (reciprocal of sensitivity)
#define ADS1115_ADDRESS = 0x48
#include <src/sensors/AlphasenseCO2.h>
The assumed address of the ADS1115, 1001 000 (ADDR = GND)
#define ALPHASENSE_CO2_NUM_VARIABLES = 2
#include <src/sensors/AlphasenseCO2.h>
Sensor::
#define ALPHASENSE_CO2_INC_CALC_VARIABLES = 1
#include <src/sensors/AlphasenseCO2.h>
Sensor::
#define ALPHASENSE_CO2_WARM_UP_TIME_MS = 200
#include <src/sensors/AlphasenseCO2.h>
Sensor::
#define ALPHASENSE_CO2_STABILIZATION_TIME_MS = 35000
#include <src/sensors/AlphasenseCO2.h>
Sensor::
- To final zero ± 100ppm: < 30 s @ 20°C
- To specification: < 30 minutes @ 20°C We found that values leveled off after ~35 s. See: https:/
/ github.com/ bellahenkel/ Soil-Sensing-Device/ tree/ main/ examples/ getValuesCO2
#define ALPHASENSE_CO2_MEASUREMENT_TIME_MS = 1000
#include <src/sensors/AlphasenseCO2.h>
Sensor::
#define ALPHASENSE_CO2_VAR_NUM = 0
#include <src/sensors/AlphasenseCO2.h>
Variable number; CO2 is stored in sensorValues[0].
#define ALPHASENSE_CO2_VAR_NAME = "carbonDioxide"
#include <src/sensors/AlphasenseCO2.h>
Variable name in ODM2 controlled vocabulary; "carbonDioxide".
#define ALPHASENSE_CO2_UNIT_NAME = "partPerMillion"
#include <src/sensors/AlphasenseCO2.h>
Variable unit name in ODM2 controlled vocabulary; "partPerMillion" (ppm)
#define ALPHASENSE_CO2_DEFAULT_CODE = "AlphasenseCO2ppm"
#include <src/sensors/AlphasenseCO2.h>
Default variable short code; "AlphasenseCO2ppm".
#define ALPHASENSE_CO2_RESOLUTION = 4
#include <src/sensors/AlphasenseCO2.h>
Decimals places in string representation; CO2 should have 4 when using an ADS1115.
#define ALPHASENSE_CO2_VOLTAGE_VAR_NUM = 1
#include <src/sensors/AlphasenseCO2.h>
Variable number; voltage is stored in sensorValues[1].
#define ALPHASENSE_CO2_VOLTAGE_VAR_NAME = "voltage"
#include <src/sensors/AlphasenseCO2.h>
Variable name in ODM2 controlled vocabulary; "voltage".
#define ALPHASENSE_CO2_VOLTAGE_UNIT_NAME = "volt"
#include <src/sensors/AlphasenseCO2.h>
Variable unit name in ODM2 controlled vocabulary; "volt" (V)
#define ALPHASENSE_CO2_VOLTAGE_DEFAULT_CODE = "AlphasenseCO2Voltage"
#include <src/sensors/AlphasenseCO2.h>
Default variable short code; "AlphasenseCO2Voltage".
#define ALPHASENSE_CO2_VOLTAGE_RESOLUTION = 4
#include <src/sensors/AlphasenseCO2.h>
Decimals places in string representation; voltage should have 4 when used with an ADS1115.