TOP Contributors

  1. MIKROE (2784 codes)
  2. Alcides Ramos (385 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 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 (139847 times)
  2. FAT32 Library (72210 times)
  3. Network Ethernet Library (57392 times)
  4. USB Device Library (47740 times)
  5. Network WiFi Library (43364 times)
  6. FT800 Library (42700 times)
  7. GSM click (29980 times)
  8. mikroSDK (28440 times)
  9. PID Library (26989 times)
  10. microSD click (26398 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

HVAC Click

Rating:

0

Author: MIKROE

Last Updated: 2024-10-31

Package Version: 2.1.0.10

mikroSDK Library: 2.0.0.0

Category: Environmental

Downloaded: 213 times

Not followed.

License: MIT license  

HVAC Click is a compact add-on board that contains Sensirion’s next-generation miniature CO2 sensor. This board features the SCD41, a carbon dioxide sensor build on the photoacoustic sensing principle, and Sensirion’s patented PASens® and CMOSens® technology to offer high accuracy at a minor form factor.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "HVAC Click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "HVAC Click" changes.

Do you want to report abuse regarding "HVAC Click".

  • mikroSDK Library 1.0.0.0
  • Comments (0)

mikroSDK Library Blog


HVAC Click

HVAC Click is a compact add-on board that contains Sensirion’s next-generation miniature CO2 sensor. This board features the SCD41, a carbon dioxide sensor build on the photoacoustic sensing principle, and Sensirion’s patented PASens® and CMOSens® technology to offer high accuracy at a minor form factor.

hvac_click.png

Click Product page


Click library

  • Author : Stefan Ilic
  • Date : Oct 2021.
  • Type : I2C type

Software Support

We provide a library for the Hvac 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 Hvac Click driver.

Standard key functions :

  • hvac_cfg_setup Config Object Initialization function.

    void hvac_cfg_setup ( hvac_cfg_t *cfg );
  • hvac_init Initialization function.

    err_t hvac_init ( hvac_t *ctx, hvac_cfg_t *cfg );

Example key functions :

  • hvac_sps30_start_measurement SPS30 start measurement command function.

    void hvac_sps30_start_measurement ( hvac_t *ctx );
  • hvac_sps30_get_ready_flag SPS30 get ready flag function.

    uint8_t hvac_sps30_get_ready_flag ( hvac_t *ctx );
  • hvac_sps30_read_measured_data SPS30 read measured data function.

    void hvac_sps30_read_measured_data ( hvac_t *ctx, mass_and_num_cnt_data_t *m_n_c_data );

Example Description

This is an example that demonstrates the use of the HVAC Click board.

The demo application is composed of two sections :

Application Init

Initialization driver enables - I2C, SCD40: perform factory reset, serial number, features, product type platform type, product version and SPS30: perform start measurement mode, also write log.


void application_init ( void ) 
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    hvac_cfg_t hvac_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.
    hvac_cfg_setup( &hvac_cfg );
    HVAC_MAP_MIKROBUS( hvac_cfg, MIKROBUS_1 );
    if ( I2C_MASTER_ERROR == hvac_init( &hvac, &hvac_cfg ) ) 
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }

    log_info( &logger, " Application Task " );
    Delay_ms ( 1000 );
    hvac_scd40_send_cmd( &hvac, HVAC_PERFORM_FACTORY_RESET );
    log_printf( &logger, "  Perform Factory Reset   \r\n" );
    log_printf( &logger, "--------------------------\r\n" );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );

    hvac_scd40_get_serial_number ( &hvac, ser_num );
    log_printf( &logger, "   SCD40 - Serial Number : %.4d-%.4d-%.4d \r\n", 
                ( uint16_t ) ser_num[ 0 ], ( uint16_t ) ser_num[ 1 ], ( uint16_t ) ser_num[ 2 ] );
    log_printf( &logger, "--------------------------\r\n" );
    Delay_ms ( 100 );
    hvac_scd40_get_feature_set_version( &hvac, &version_data );
    log_printf( &logger, "     SCD40 - Features     \r\n" );
    log_printf( &logger, " Product Type    : %d \r\n", ( uint16_t ) version_data.product_type );
    log_printf( &logger, " Platform Type   : %d \r\n", ( uint16_t ) version_data.platform_type );
    log_printf( &logger, " Product Version : %d.%d \r\n", 
                ( uint16_t ) version_data.product_major_version, 
                ( uint16_t ) version_data.product_minor_version );
    log_printf( &logger, "--------------------------\r\n" );
    Delay_ms ( 100 );

    hvac_sps30_start_measurement ( &hvac );
    Delay_ms ( 100 );
}

Application Task

This is an example which demonstrates the use of HVAC Click board. HVAC Click board can be used to measure : Concentration of CO2 in air, Temperature ( degree Celsius ), Relative Humidity ( % ), Mass Concentration of PM1.0, PM2.5, PM4.0, PM10 and Number Concentration of PM0.5, PM1.0, PM2.5, PM4.0 and PM10. All data logs write on USB uart changes.


void application_task ( void ) 
{
    hvac_scd40_send_cmd( &hvac, HVAC_MEASURE_SINGLE_SHOT );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );

    hvac_scd40_read_measurement( &hvac, &hvac_data );
    Delay_ms ( 100 );

    log_printf( &logger, " CO2 Concent = %d \r\n ", hvac_data.co2_concent );

    log_printf( &logger, " Temperature = %.2f C \r\n", hvac_data.temperature );

    log_printf( &logger, " R. Humidity = %.2f %% \r\n", hvac_data.r_humidity );
    log_printf( &logger, "- - - - - - - - - - - - -  \r\n" );

    while ( HVAC_SPS30_NEW_DATA_IS_READY != hvac_sps30_get_ready_flag( &hvac ) );


    log_printf( &logger, "   Mass Concentration :   \r\n" );
    hvac_sps30_read_measured_data( &hvac, &sps30_data );
    Delay_ms ( 100 );

    log_printf( &logger, " PM 1.0 = %.2f ug/m3 \r\n", sps30_data.mass_pm_1_0 );
    log_printf( &logger, " PM 2.5 = %.2f ug/m3 \r\n", sps30_data.mass_pm_2_5 );
    log_printf( &logger, " PM 4.0 = %.2f ug/m3 \r\n", sps30_data.mass_pm_4_0 );
    log_printf( &logger, " PM 10  = %.2f ug/m3 \r\n", sps30_data.mass_pm_10 );
    log_printf( &logger, "-   -   -   -   -   -   - \r\n" );

    log_printf( &logger, "  Number Concentration :  \r\n" );
    log_printf( &logger, " PM 0.5 = %.2f n/cm3 \r\n", sps30_data.num_pm_0_5 );
    log_printf( &logger, " PM 1.0 = %.2f n/cm3 \r\n", sps30_data.num_pm_1_0 );
    log_printf( &logger, " PM 2.5 = %.2f n/cm3 \r\n", sps30_data.num_pm_2_5 );
    log_printf( &logger, " PM 4.0 = %.2f n/cm3 \r\n", sps30_data.num_pm_4_0 );
    log_printf( &logger, " PM 10  = %.2f n/cm3 \r\n", sps30_data.num_pm_10 );
    log_printf( &logger, "--------------------------\r\n" );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
}

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

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

EnOcean 4 click

5

EnOcean 4 Click carries a ultra-low power TCM515U transceiver gateway module which operates at 902MHz radio band, perfectly suited for the realization of transceiver gateways, actuators and controllers for systems communicating based on the EnOcean radio standard.

[Learn More]

TouchKey 2 click

1

TouchKey 2 click has four capacitive pads powered by ATtiny817 which has an integrated touch QTouch® controller. The click is designed to run on a 3.3V power supply. The four LEDs onboard the click indicate the Key (Pad) is pressed. TouchKey 2 click communicates with the target microcontroller over UART and SPI interface.

[Learn More]

UWB click

5

UWB Click is an Ultra-Wideband transceiver Click board that can be used in 2-way ranging or TDOA location systems to locate assets to a precision of 10 cm and supports data rates of up to 6.8 Mbps. This board features the DWM1000 module based on Decawave's DW1000 Ultra-Wideband (UWB) transceiver from Decawave Limited.

[Learn More]