NDIR CO2 Click Board
NDIR CO2 Click Board
The NDIR CO2 Click Board™ is an advanced integrated carbon dioxide gas sensor system, which is able to measure an absolute CO2 concentration, by utilizing the CDM7160 integrated sensor. This sensor is based on the non-dispersive infrared sensing principle (NDIR), with two detection elements: one is used for detecting the wavelength of the IR light spectrum, affected by the CO2 gas, while the other detects the wavelength of the IR light spectrum not affected by the CO2 gas.
The integrated MCU processes the readings and outputs the absolute CO2 gas concentration value through UART or I2C interface. The dual-wavelength sensing method allows not only accurate absolute readings, but also provides immunity against dust pollution, providing consistent readings in corrosive atmosphere, variable ambient temperature, and over longer periods of time.
Software Support
We provide a demo application for the NDIR CO2 Click Board™ on our Libstock page, as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Library Description
Library initializes and defines I2C driver and performs writing to registers and reading from registers. Also has the ability to measure CO2 concentration in ppm unit. For more details check the documentation.
Key Functions
uint8_t ndirco2_writeReg( uint8_t register_address, uint8_t transfer_data )
- The function writes one byte of data to register.uint8_t ndirco2_readReg( uint8_t register_address, uint16_t *dataOut )
- The function reads data from a register.void ndirco2_readCO2( uint8_t setCheckMode, uint16_t *outputData )
- The function reads 15-bit CO2 concentration data from data registers, only when data is ready for reading after each measurement, or after the number of consecutive measurements determined by the AVE register + 1 is exceeded.
Example Description
The application is composed of three sections:
- System Initialization - Initializes peripherals and pins.
- Application Initialization - Initializes I2C driver and performs driver reset and determines
a number of averaging measurements. - Application Task - (code snippet) - Reads CO2 concentration data in ppm unit after each completed measurement. One measurement is finished after 300 ms, and the period between the two measurements is 2 seconds. Results of measurements logs on USBUART.void applicationTask()
void applicationTask() { ndirco2_readCO2( _NDIRCO2_CHECK_EACH_MEASURE, &co2Data ); WordToStr( co2Data, text ); mikrobus_logWrite( "CO2 concentration is: ", _LOG_TEXT ); mikrobus_logWrite( text, _LOG_TEXT ); mikrobus_logWrite( "ppm", _LOG_LINE ); }
The full application code, and ready to use projects can be found on our Libstock page.
Other MikroElektronika libraries used in the example:
- Conversions
- I2C
- UART
ADDITIONAL NOTES AND INFORMATION
Depending on the development board you are using, you may need a USB UART click, USB UART 2 click or RS232 click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.
MIKROSDK
The NDIR CO2 Click Board™ is supported with mikroSDK - MikroElektronika Software Development Kit. To ensure proper operation of mikroSDK compliant click board demo applications, mikroSDK should be downloaded from the LibStock and installed for the compiler you are using.
NDIR CO2 Click Board
Frequently Asked Questions
Have a Question?
Be the first to ask a question about this.