TOP Contributors

  1. MIKROE (2784 codes)
  2. Alcides Ramos (387 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (120 codes)
  5. Bugz Bensce (97 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 (140162 times)
  2. FAT32 Library (72618 times)
  3. Network Ethernet Library (57641 times)
  4. USB Device Library (47953 times)
  5. Network WiFi Library (43552 times)
  6. FT800 Library (42941 times)
  7. GSM click (30140 times)
  8. mikroSDK (28668 times)
  9. PID Library (27053 times)
  10. microSD click (26552 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

Air Quality 12 Click

Rating:

0

Author: MIKROE

Last Updated: 2024-12-31

Package Version: 2.1.0.1

mikroSDK Library: 2.0.0.0

Category: Gas

Downloaded: 23 times

Not followed.

License: MIT license  

Air Quality 12 Click is a compact add-on board for monitoring indoor air quality. This board features the RRH46410, a digital gas sensor module from Renesas, which integrates advanced sensing technology for precise detection of total volatile organic compounds (TVOC), indoor air quality (IAQ), and estimated carbon dioxide levels (eCO2). This module features a MEMS gas sensing element with a metal oxide (MOx) chemiresistor, a CMOS signal conditioning IC, and an onboard MCU, offering a complete, self-contained solution with low power consumption and support for both UART and I2C communication.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "Air Quality 12 Click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "Air Quality 12 Click" changes.

Do you want to report abuse regarding "Air Quality 12 Click".

  • Information
  • Comments (0)

mikroSDK Library Blog


Air Quality 12 Click

Air Quality 12 Click is a compact add-on board for monitoring indoor air quality. This board features the RRH46410, a digital gas sensor module from Renesas, which integrates advanced sensing technology for precise detection of total volatile organic compounds (TVOC), indoor air quality (IAQ), and estimated carbon dioxide levels (eCO2). This module features a MEMS gas sensing element with a metal oxide (MOx) chemiresistor, a CMOS signal conditioning IC, and an onboard MCU, offering a complete, self-contained solution with low power consumption and support for both UART and I2C communication.

airquality12_click.png

Click Product page


Click library

  • Author : Stefan Filipovic
  • Date : Aug 2024.
  • Type : I2C/UART type

Software Support

We provide a library for the Air Quality 12 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 from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.

Library Description

This library contains API for Air Quality 12 Click driver.

Standard key functions :

  • airquality12_cfg_setup Config Object Initialization function.

    void airquality12_cfg_setup ( airquality12_cfg_t *cfg );
  • airquality12_init Initialization function.

    err_t airquality12_init ( airquality12_t *ctx, airquality12_cfg_t *cfg );
  • airquality12_default_cfg Click Default Configuration function.

    err_t airquality12_default_cfg ( airquality12_t *ctx );

Example key functions :

  • airquality12_get_sensor_info This function reads the device product ID, firmware version, and tracking number.

    err_t airquality12_get_sensor_info ( airquality12_t *ctx, airquality12_info_t *info );
  • airquality12_get_int_pin This function returns the INT pin logic state.

    uint8_t airquality12_get_int_pin ( airquality12_t *ctx );
  • airquality12_get_measurement This function reads the sensor measurement results.

    err_t airquality12_get_measurement ( airquality12_t *ctx, airquality12_results_t *results );

Example Description

This example demonstrates the use of Air Quality 12 Click board by reading the IAQ 2nd Gen measurements and displays the results on the USB UART.

The demo application is composed of two sections :

Application Init

Initializes the driver and configures the Click board to the default configuration. Then it reads the sensor product ID, firmware version, and the 48-bit tracking number.


void application_init ( void )
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    airquality12_cfg_t airquality12_cfg;  /**< Click config object. */

    /** 
     * 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.
    airquality12_cfg_setup( &airquality12_cfg );
    AIRQUALITY12_MAP_MIKROBUS( airquality12_cfg, MIKROBUS_1 );
    if ( AIRQUALITY12_OK != airquality12_init( &airquality12, &airquality12_cfg ) )
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }

    if ( AIRQUALITY12_ERROR == airquality12_default_cfg ( &airquality12 ) )
    {
        log_error( &logger, " Default configuration." );
        for ( ; ; );
    }

    airquality12_info_t info;
    if ( AIRQUALITY12_OK == airquality12_get_sensor_info ( &airquality12, &info ) )
    {
        log_printf( &logger, " ---- Sensor info ----\r\n" );
        log_printf( &logger, " Product ID: 0x%.4X\r\n", info.product_id );
        log_printf( &logger, " FW version: %u.%u.%u\r\n", ( uint16_t ) info.fw_ver_major, 
                                                          ( uint16_t ) info.fw_ver_minor, 
                                                          ( uint16_t ) info.fw_ver_patch );
        log_printf( &logger, " Tracking number: 0x%.2X%.2X%.2X%.2X%.2X%.2X\r\n", 
                    ( uint16_t ) info.tracking_num[ 5 ], ( uint16_t ) info.tracking_num[ 4 ], 
                    ( uint16_t ) info.tracking_num[ 3 ], ( uint16_t ) info.tracking_num[ 2 ], 
                    ( uint16_t ) info.tracking_num[ 1 ], ( uint16_t ) info.tracking_num[ 0 ] );
        log_printf( &logger, " ---------------------\r\n" );
    }

    log_info( &logger, " Application Task " );
}

Application Task

Checks the data ready interrupt pin and then reads the IAQ 2nd Gen measurements and displays the results on the USB UART. The GP1 LED turns ON during the data reading. The data sample rate is set to 3 seconds for the IAQ 2nd Gen operating mode, and the first 100 samples upon startup should be ignored since the sensor is in the warm-up phase.

void application_task ( void )
{
    airquality12_results_t results = { 0 };

    if ( airquality12_get_int_pin ( &airquality12 ) )
    {
        airquality12_set_gp1_pin ( &airquality12, 1 );
        if ( AIRQUALITY12_OK == airquality12_get_measurement ( &airquality12, &results ) )
        {
            log_printf ( &logger, " Sample number: %u\r\n", ( uint16_t ) results.sample_num );
            log_printf ( &logger, " IAQ: %.1f\r\n", results.iaq );
            log_printf ( &logger, " TVOC: %.2f mg/m^3\r\n", results.tvoc );
            log_printf ( &logger, " ETOH: %.2f ppm\r\n", results.etoh );
            log_printf ( &logger, " ECO2: %u ppm\r\n", results.eco2 );
            log_printf ( &logger, " rel_IAQ: %u\r\n\n", results.rel_iaq );
        }
        airquality12_set_gp1_pin ( &airquality12, 0 );
    }
}

The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.

Other Mikroe Libraries used in the example:

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.AirQuality12

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. UART terminal is available in all MikroElektronika compilers.


ALSO FROM THIS AUTHOR

ECG 4 click

5

ECG 4 Click is a complete solution for the development of ECG and Heart-Rate (HR) applications, based on the BMD101, a specialized bio-signal sensing System-on-Chip (SoC).

[Learn More]

DIGI POT 12 Click

0

DIGI POT 12 Click is a compact add-on board that contains a digitally controlled potentiometer. This board features the AD5142A, a dual-channel, 256-position nonvolatile digital potentiometer from Analog Devices. On this Click board™, two digitally I2C-controlled potentiometers are realized with end-to-end resistance of 10KΩ and wiper resistance of only 40Ω. The DIGI POT 12 Click can be used in potentiometer and linear gain modes.

[Learn More]

Accel 20 Click

0

Accel 20 Click is a compact add-on board that contains an acceleration sensor. This board features the KX134-1211, a digital output 3-axis accelerometer optimized for machine condition monitoring from Rohm Semiconductor. It allows selectable full-scale acceleration measurements in ranges of ±8g, ±16g, ±32g, or ±64g in three axes with a configurable host interface that supports both SPI and I2C serial communication. It also features an Advanced Data Path (ADP) technology which allows noise filtering and sensor signal processing, usually carried out by the MCU, to be performed by the accelerometer. They contribute to reducing MCU load and power consumption together with improved application performance.

[Learn More]