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

Barometer 12 Click

Rating:

0

Author: MIKROE

Last Updated: 2024-10-31

Package Version: 2.1.0.8

mikroSDK Library: 2.0.0.0

Category: Pressure

Downloaded: 158 times

Not followed.

License: MIT license  

Barometer 12 Click is a compact add-on board that measures air pressure in a specific environment. This board features the ICP-10125, a high-accuracy, low-power, 10-atm waterproof barometric pressure and temperature sensor from TDK InvenSense.

No Abuse Reported

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

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

Do you want to report abuse regarding "Barometer 12 Click".

  • Information
  • Comments (0)

mikroSDK Library Blog


Barometer 12 Click

Barometer 12 Click is a compact add-on board that measures air pressure in a specific environment. This board features the ICP-10125, a high-accuracy, low-power, 10-atm waterproof barometric pressure and temperature sensor from TDK InvenSense.

barometer12_click.png

Click Product page


Click library

  • Author : Stefan Ilic
  • Date : May 2023.
  • Type : I2C type

Software Support

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

Standard key functions :

  • barometer12_cfg_setup Config Object Initialization function.

    void barometer12_cfg_setup ( barometer12_cfg_t *cfg );
  • barometer12_init Initialization function.

    err_t barometer12_init ( barometer12_t *ctx, barometer12_cfg_t *cfg );
  • barometer12_default_cfg Click Default Configuration function.

    err_t barometer12_default_cfg ( barometer12_t *ctx );

Example key functions :

  • barometer12_inv_invpres_calib Barometer 12 inverse process data function.

    err_t barometer12_inv_invpres_calib ( barometer12_t *ctx, barometer12_invpres_t *cfg_data );
  • barometer12_get_raw_data Barometer 12 get RAW data function.

    err_t barometer12_get_raw_data ( barometer12_t *ctx, uint16_t measurement_comd, uint32_t *pressure, uint16_t *temperature );
  • barometer12_get_press_and_temp Barometer 12 get pressure and temperature function.

    err_t barometer12_get_press_and_temp ( barometer12_t *ctx,  float *pressure, float *temperature );

Example Description

This library contains API for the Barometer 12 Click driver. The library initializes and defines the I2C bus drivers to write and read data from registers. This demo application shows an example of atmospheric pressure and temperature measurement.

The demo application is composed of two sections :

Application Init

The initialization of the I2C module and log UART. After driver initialization and default settings, the app display device ID.


void application_init ( void ) 
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    barometer12_cfg_t barometer12_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.
    barometer12_cfg_setup( &barometer12_cfg );
    BAROMETER12_MAP_MIKROBUS( barometer12_cfg, MIKROBUS_1 );
    if ( I2C_MASTER_ERROR == barometer12_init( &barometer12, &barometer12_cfg ) ) 
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }

    if ( BAROMETER12_ERROR == barometer12_default_cfg ( &barometer12 ) )
    {
        log_error( &logger, " Default configuration." );
        for ( ; ; );
    }

    static uint16_t device_id;
    err_t err_flag = barometer12_get_device_id( &barometer12, &device_id );
    if ( BAROMETER12_ERROR == err_flag ) 
    {
        log_error( &logger, " Communication Error. " );
        log_info( &logger, " Please, run program again... " );

        for ( ; ; );
    }
    log_printf( &logger, " Device ID   : 0x%.4X \r\n", device_id );
    log_printf( &logger, "----------------------------\r\n" );
    Delay_ms ( 1000 );

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

Application Task

This is an example that shows the use of a Barometer 12 Click board™. Logs the atmospheric pressure [ Pa ] and temperature [ degree Celsius ] data. Results are being sent to the Usart Terminal where you can track their changes.

void application_task ( void ) 
{
    float pressure;
    float temperature;

    barometer12_get_press_and_temp( &barometer12, &pressure, &temperature );
    log_printf( &logger, " Pressure    : %.2f Pa\r\n", pressure );
    log_printf( &logger, " Temperature : %.2f C\r\n", temperature );
    log_printf( &logger, "----------------------------\r\n" );
    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.Barometer12

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

Secure 5 click

0

Secure 5 Click carries the ATECC508A cryptographic coprocessor with secure hardware-based key storage, from Microchip. The ATECC508A includes an EEPROM array which can be used for storage of up to 16 keys, certificates, miscellaneous read/write, read-only or secret data, consumption logging, and security configurations.

[Learn More]

Proximity 11 Click

0

Proximity 11 Click is a close-range proximity sensing Click board™, equipped with the RPR-0521RS, a very accurate and power-efficient proximity and ambient Light Sensor with IrLED.

[Learn More]

FTDI Click

0

FTDI Click is a compact add-on board that provides a high-speed USB to a serial interface converter. This board features the FT2232H, a 5th-generation high-speed USB 2.0 to a serial UART/I2C/SPI interface converter from FTDI. The entire USB protocol is handled on the chip (FTDI USB drivers required), making this board ideal for various USB applications. Besides a selectable interface and a standalone operation possibility, it also includes an EEPROM which contains the USB configuration descriptors for the FT2232H and one DA converter for additional reference in user-configurable applications.

[Learn More]