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 (137116 times)
  2. FAT32 Library (70239 times)
  3. Network Ethernet Library (56131 times)
  4. USB Device Library (46445 times)
  5. Network WiFi Library (42094 times)
  6. FT800 Library (41408 times)
  7. GSM click (29124 times)
  8. mikroSDK (26567 times)
  9. PID Library (26509 times)
  10. microSD click (25491 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 Flow click

Rating:

0

Author: MIKROE

Last Updated: 2024-04-03

Package Version: 2.1.0.12

mikroSDK Library: 2.0.0.0

Category: Pressure

Downloaded: 99 times

Not followed.

License: MIT license  

Air Flow Click is a compact add-on board that contains a flow-based 2-in-1 differential pressure sensor. This board features the LHDULTRAM012UB3, LHD ULTRA series micro-flow differential pressure sensor from TE Connectivity Measurement Specialties.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "Air Flow click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "Air Flow click" changes.

Do you want to report abuse regarding "Air Flow click".

  • Information
  • Comments (0)

mikroSDK Library Blog


Air Flow click

Air Flow Click is a compact add-on board that contains a flow-based 2-in-1 differential pressure sensor. This board features the LHDULTRAM012UB3, LHD ULTRA series micro-flow differential pressure sensor from TE Connectivity Measurement Specialties.

air_flow_click.png

click Product page


Click library

  • Author : Luka Filipovic
  • Date : May 2021.
  • Type : I2C/SPI type

Software Support

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

Standard key functions :

  • airflow_cfg_setup Config Object Initialization function.

    void airflow_cfg_setup ( airflow_cfg_t *cfg );
  • airflow_init Initialization function.

    err_t airflow_init ( airflow_t *ctx, airflow_cfg_t *cfg );
  • airflow_default_cfg Click Default Configuration function.

    err_t airflow_default_cfg ( airflow_t *ctx );

Example key functions :

  • airflow_reset_device Reset device.

    void airflow_reset_device ( airflow_t *ctx )
  • airflow_get_differential_pressure Reads differential pressure.

    err_t airflow_get_differential_pressure ( airflow_t *ctx, float *pressure )
  • airflow_get_atmospheric_pressure Reads atmospheric pressure and temperature.

    err_t airflow_get_atmospheric_pressure ( airflow_t *ctx, float *pressure, float *temperature );

Example Description

This example showcases ability for device to read differential pressure, atmospheric pressure and ambient temperature.

The demo application is composed of two sections :

Application Init

Initialize host communication modules (UART, I2C/SPI). Read electric signature data from device and logs it to terminal.


void application_init ( void ) 
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    airflow_cfg_t airflow_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 );
    Delay_ms ( 100 );
    log_info( &logger, " Application Init " );

    // Click initialization.
    airflow_cfg_setup( &airflow_cfg );
    AIRFLOW_MAP_MIKROBUS( airflow_cfg, MIKROBUS_1 );
    err_t init_flag  = airflow_init( &airflow, &airflow_cfg );
    if ( ( init_flag == I2C_MASTER_ERROR ) || ( init_flag == SPI_MASTER_ERROR ) ) 
    {
        log_error( &logger, " Application Init Error. " );
        log_info( &logger, " Please, run program again... " );

        for ( ; ; );
    }

    airflow_reset_device( &airflow );

    if ( airflow_default_cfg ( &airflow ) < 0 )
    {
        log_error( &logger, " Read" );
        log_info( &logger, " Please, run program again... " );
        for ( ; ; );
    }
    else
    {
        log_printf( &logger, "Firmware version: %d.%d\r\n", ( int16_t )airflow.major_fw_ver, ( int16_t )airflow.minor_fw_ver );
        //part number
        log_printf( &logger, "Part number: " );
        for ( uint8_t pn = 0; pn < 11; pn++ )
            log_printf( &logger, "%c", airflow.part_number[ pn ] );
        log_printf( &logger, "\r\n" );
        //lot number
        log_printf( &logger, "Lot number: " );
        for ( uint8_t pn = 0; pn < 7; pn++ )
            log_printf( &logger, "%c", airflow.lot_number[ pn ] );
        log_printf( &logger, "\r\n" );
        //pressure range
        log_printf( &logger, "Pressure range: %d\r\n", airflow.pressure_range );
        //output type
        log_printf( &logger, "Output type: %c\r\n", airflow.output_type );
        //scale factor
        log_printf( &logger, "Scale factor: %d\r\n", airflow.scale_factor );
        //calibration id
        log_printf( &logger, "Calibration ID: %s\r\n", airflow.calibration_id );
        //week
        log_printf( &logger, "Week: %d\r\n", ( int16_t )airflow.week );
        //year
        log_printf( &logger, "Year: %d\r\n", ( int16_t )airflow.year );
        //sequence number
        log_printf( &logger, "Sequence number: %d\r\n", airflow.sequence_number );
    }
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    log_info( &logger, " Application Task " );
}

Application Task

Reads differential pressure in Pa, atmospheric pressure in mBar and ambient temperature in C every 500ms and logs read data.


void application_task ( void ) 
{    
    float pressure_data, temperature_data;

    airflow_get_differential_pressure( &airflow, &pressure_data );
    log_printf( &logger, "Differential pressure[Pa]: %.2f\r\n", pressure_data );
    airflow_get_atmospheric_pressure( &airflow, &pressure_data, &temperature_data );
    log_printf( &logger, "Atmospheric pressure[mBar]: %.2f\r\nTemperature[degC]: %.2f\r\n", pressure_data, temperature_data );
    log_printf( &logger, "***********************************************************\r\n" );
    Delay_ms ( 500 );
}

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

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

NTAG 5 Link click

0

NTAG 5 Link Click is a compact add-on board that acts as a bridge between an NFC-enabled device and any I2C slave, such as a sensor or external memory. This board features the NTA5332, a highly integrated NFC IC which creates a secure standard-based link from the device to the cloud from NXP Semiconductors. Based on the NTAG 5 switch and operating at 13.56MHz, the NTA5332 represents an NFC Forum-compliant contactless tag that can be read and written by an NFC-enabled device at close range and by an ISO/IEC 15693-enabled industrial reader over a more extended range. It also incorporates an I2C interface with an I2C master features and AES mutual authentication, SRAM memory, and energy harvesting possibility, which means it can supply power to other components in the system.

[Learn More]

TempHum 7 click

0

Temp&Hum 7 click is a Click board™ which is perfectly suited for measuring the relative humidity (RH) and temperature.

[Learn More]

Thermo 16 click

0

Thermo 16 Click is a Click board equipped with the sensor IC, which can measure temperature measurements between -40°C and +150°C so that the temperature measurement data can be processed by the host MCU.

[Learn More]