TOP Contributors

  1. MIKROE (2659 codes)
  2. Alcides Ramos (356 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 (137002 times)
  2. FAT32 Library (70121 times)
  3. Network Ethernet Library (56027 times)
  4. USB Device Library (46348 times)
  5. Network WiFi Library (41966 times)
  6. FT800 Library (41286 times)
  7. GSM click (29055 times)
  8. mikroSDK (26489 times)
  9. PID Library (26451 times)
  10. microSD click (25413 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:

0

Author: MIKROE

Last Updated: 2024-04-03

Package Version: 2.1.0.16

mikroSDK Library: 2.0.0.0

Category: Gas

Downloaded: 84 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 1.0.0.0
  • Comments (0)

mikroSDK Library Blog


CO 2 click

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).

co2_click.png

click Product page


Click library

  • Author : MikroE Team
  • Date : Dec 2019.
  • Type : I2C type

Software Support

We provide a library for the CO2 Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.

Package can be downloaded/installed directly form compilers IDE(recommended way), or downloaded from our LibStock, or found on mikroE github account.

Library Description

This library contains API for CO2 Click driver.

Standard key functions :

  • Config Object Initialization function.

    void co2_cfg_setup ( co2_cfg_t *cfg );

  • Initialization function.

    CO2_RETVAL co2_init ( co2_t ctx, co2_cfg_t cfg );

Example key functions :

  • Function reads the converted data (CO) from the 12-bit AD converter.

    void co2_read_adc( co2_t ctx, uint16_t data_out );

  • Function puts the device to enabled or to disabled state.

    void co2_enable( co2_t *ctx, uint8_t state );

  • Function reads the CO converted data and calculates this value to the ppm.

    co2_get_co2_ppm( co2_t ctx, float co2_data );

Examples Description

This application enables usage of very accurate CO sensor.

The demo application is composed of two sections :

Application Init

Initializes I2C interface and performs the device configuration for properly working.


void application_init ( void )
{
    log_cfg_t log_cfg;
    co2_cfg_t cfg;
    uint8_t temp_w;

    /** 
     * Logger initialization.
     * Default baud rate: 115200
     * Default log level: LOG_LEVEL_DEBUG
     * @note If USB_UART_RX and USB_UART_TX 
     * are defined as HAL_PIN_NC, you will 
     * need to define them manually for log to work. 
     * See @b LOG_MAP_USB_UART macro definition for detailed explanation.
     */
    LOG_MAP_USB_UART( log_cfg );
    log_init( &logger, &log_cfg );
    log_info( &logger, "---- Application Init ----" );

    //  Click initialization.

    co2_cfg_setup( &cfg );
    CO2_MAP_MIKROBUS( cfg, MIKROBUS_1 );
    co2_init( &co2, &cfg );

    Delay_ms ( 500 );

    //co2_default_cfg( &co2 );

    temp_w = CO2_WRITE_MODE;
    co2_generic_write( &co2, CO2_LOCK_REG, &temp_w, 1 );
    temp_w = CO2_STANDBY_MODE;
    co2_generic_write( &co2, CO2_MODECN_REG, &temp_w, 1 );
    temp_w = CO2_3500_OHM_TIA_RES | CO2_100_OHM_LOAD_RES;
    co2_generic_write( &co2, CO2_TIACN_REG, &temp_w, 1 );
    temp_w = CO2_VREF_EXT | CO2_50_PERCENTS_INT_ZERO | CO2_BIAS_POL_NEGATIVE | CO2_0_PERCENTS_BIAS;
    co2_generic_write( &co2, CO2_REFCN_REG, &temp_w, 1 );

    log_printf( &logger, "CO 2 is initialized\r\n\r\n" );
    Delay_ms ( 1000 );
}

Application Task

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 application_task ( void )
{
    float co2_value;

    co2_wait_i2c_ready( &co2 );
    co2_get_co2_ppm( &co2, &co2_value );

    log_printf( &logger, "CO : %.2f ppm\r\n", co2_value );
    Delay_ms ( 300 );
}

The full application code, and ready to use projects can be installed directly form compilers IDE(recommneded) or found on LibStock page or mikroE GitHub accaunt.

Other mikroE Libraries used in the example:

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.CO2

Additional notes and informations

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


ALSO FROM THIS AUTHOR

Diff Press 4 click

0

Diff Press 4 Click is a compact add-on board that can measure differential pressure. This board features the SM9336-BCE-S-250-000, a digital pressure and altimeter sensor module from TE Connectivity. The SM9336-BCE-S-250-000 has a configurable host interface that supports I2C serial communication and measures pressure in a wide range with an accuracy of 3%. It comes as calibrated and temperature-compensated with high reliability/long-term stability. It operates in a compensated temperature range of -20°C to 85°C, ensuring stable operation under extreme conditions.

[Learn More]

IrThermo 2 click

0

IrThermo 2 click is a non-contact temperature measurement solution. The click board carries the TMP007 infrared thermopile sensor with an integrated math engine.

[Learn More]

7seg click

0

7seg Click is an accessory board in mikroBus form factor. It features two 74HC595 8-bit serial-in, parallel-out shift register modules as well as two seven-segment displays. 7seg Click communicates with target board via SPI interface. The board is designed to use 3.3V and 5V power supply.

[Learn More]