TOP Contributors

  1. MIKROE (2663 codes)
  2. Alcides Ramos (358 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 (137087 times)
  2. FAT32 Library (70232 times)
  3. Network Ethernet Library (56097 times)
  4. USB Device Library (46434 times)
  5. Network WiFi Library (42052 times)
  6. FT800 Library (41383 times)
  7. GSM click (29110 times)
  8. mikroSDK (26559 times)
  9. PID Library (26487 times)
  10. microSD click (25486 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: 3317 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

AudioAmp 3 click

5

AudioAmp 3 Click is a stereo audio amplifier, capable of delivering up to 79W per channel with the 4Ω load. It is based on the TAS5414, a class-D integrated amplifier, which utilizes a highly efficient switching scheme.

[Learn More]

iButton click

0

iButton click - is an iButton™ probe Click board™. The iButton is a Analog Devices technology based on Analog's 1-Wire® communication protocol, and a chip usually packed in a robust stainless steel casing. The button-shaped iButton device has two contacts - the lid and the base. These contacts carry the necessary connections down to a sensitive silicone chip, embedded inside the metal button. When the iButton touches the reader probe on the Click board™, it establishes the communication with the host MCU, via the 1-Wire® interface. The communication is almost instant, so it is enough to press the iButton lightly to the probe contacts.

[Learn More]

Ambient 5 click

0

Ambient 5 click can sense the intensity of the ambient light, providing measurement data in a digital format, over the I2C interface. It utilizes the VEML6030, a miniature ambient light sensor (ALS) which occupies only 2x2 mm of space.

[Learn More]