TOP Contributors

  1. MIKROE (2653 codes)
  2. Alcides Ramos (351 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (136652 times)
  2. FAT32 Library (69871 times)
  3. Network Ethernet Library (55903 times)
  4. USB Device Library (46245 times)
  5. Network WiFi Library (41873 times)
  6. FT800 Library (41115 times)
  7. GSM click (28968 times)
  8. PID Library (26403 times)
  9. mikroSDK (26332 times)
  10. microSD click (25345 times)
Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

< Back
mikroSDK Library

CO 2 click

Rating:

5

Author: MIKROE

Last Updated: 2018-10-12

Package Version: 1.0.0.0

mikroSDK Library: 1.0.0.0

Category: Gas

Downloaded: 3247 times

Not followed.

License: MIT license  

CO 2 click is a very accurate, carbon-monoxide-gas-sensor Click board, equipped with the SPEC amperometric, 3SP CO 1000 gas sensor which electrochemically reacts with the carbon monoxide (CO).

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "CO 2 click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "CO 2 click" changes.

Do you want to report abuse regarding "CO 2 click".

  • mikroSDK Library 2.0.0.0
  • Comments (0)
DOWNLOAD LINK RELATED COMPILER CONTAINS
mikroBasic PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc

mikroSDK Library Blog

CO 2 click

CO 2 click

Native view of the CO 2 click board.

View full image
CO 2 click

CO 2 click

Front and back view of the CO 2 click board.

View full image

Library Description

Library offers a choice to communicate with the CO 2 Click board by writting to the registers and by reading from the registers via I2C interface. Library consists of functions which can read CO measured and converted data from the 12-bit AD converter. Library also can calculate CO digital value to the ppm value. For more details check documentation.

Key functions:

  • uint8_t co2_writeReg( uint8_t register_address, uint8_t transfer_data ) - Function writes one byte to the register.
  • uint8_t co2_readReg( uint8_t register_address, uint8_t *dataOut ) - Function reads one byte from the register.
  • void co2_readADC( uint16_t *dataOut ) - Function reads converted data (CO) from the 12-bit AD converter.
  • void co2_getCOppm( float *coData ) - Function reads CO converted data and calculates this value to the ppm.

Example description

The application is composed of three sections :

  • System Initialization - Initializes peripherals and pins.
  • Application Initialization - Initializes I2C interface and performs the device configuration for properly working.
  • Application Task - (code snippet) - Gets CO (Carbon Monoxide) data as ppm value every 300 miliseconds. Results will be logged on UART. The CO value range is from 0 to 1000 ppm.
void applicationTask()
{
 co2_waitI2CReady();

 co2_getCOppm( &coValue );

 FloatToStr( coValue, text );
 cutFloat();
 mikrobus_logWrite( "CO : ", _LOG_TEXT );
 mikrobus_logWrite( text, _LOG_TEXT );
 mikrobus_logWrite( " ppm", _LOG_LINE );

 Delay_ms( 300 );
}


Additional Functions :

  • void cutFloat() - This function is used to round up the value to two decimal places.


Other mikroE Libraries used in the example:

  • I2C
  • Conversions
  • UART

Additional notes and information

Depending on the development board you are using, you may need USB UART clickUSB 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.

ALSO FROM THIS AUTHOR

OLED W click

0

OLED W click carries a 96 x 39px white monochrome passive matrix OLED display. The display is bright, has a wide viewing angle and low power consumption.

[Learn More]

Temp-Log click

0

Temp-Log click is a precise ambient temperature measurement device, equipped with 8Kbit (1024 bytes) of EEPROM memory, which can be used to permanently store system configuration or log application specific or user preference data. This click covers a range of temperatures from -55°C to +125°C with the highest accuracy of ±0.5°C, in the range of 0°C to 85°C. The device can also send an ALERT signal to the INT pin of the mikroBUS™ every time programmed temperature thresholds are reached.

[Learn More]

BUCK 6 click

0

BUCK 6 click is an advanced synchronous DC-DC step down (buck) converter, with a very wide input voltage range and reasonably high output current.

[Learn More]