TOP Contributors

  1. MIKROE (2779 codes)
  2. Alcides Ramos (376 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 (139566 times)
  2. FAT32 Library (72041 times)
  3. Network Ethernet Library (57255 times)
  4. USB Device Library (47615 times)
  5. Network WiFi Library (43219 times)
  6. FT800 Library (42566 times)
  7. GSM click (29930 times)
  8. mikroSDK (28292 times)
  9. PID Library (26933 times)
  10. microSD click (26309 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

Ultra-Low Press Click

Rating:

0

Author: MIKROE

Last Updated: 2024-10-31

Package Version: 2.1.0.16

mikroSDK Library: 2.0.0.0

Category: Pressure

Downloaded: 183 times

Not followed.

License: MIT license  

Ultra-Low Press Click is a compact add-on board containing a mountable gage pressure sensor for pneumatic pressure measurements.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "Ultra-Low Press Click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "Ultra-Low Press Click" changes.

Do you want to report abuse regarding "Ultra-Low Press Click".

  • Information
  • Comments (0)

mikroSDK Library Blog


Ultra-Low Press Click

Ultra-Low Press Click is a compact add-on board containing a mountable gage pressure sensor for pneumatic pressure measurements.

ultra_low_press_click.png

Click Product page


Click library

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

Software Support

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

Standard key functions :

  • ultralowpress_cfg_setup Config Object Initialization function.

    void ultralowpress_cfg_setup ( ultralowpress_cfg_t *cfg );
  • ultralowpress_init Initialization function.

    err_t ultralowpress_init ( ultralowpress_t *ctx, ultralowpress_cfg_t *cfg );

Example key functions :

  • ultralowpress_ready_to_read Ready to read.

    uint8_t ultralowpress_ready_to_read ( ultralowpress_t *ctx )
  • ultralowpress_get_press Read pressure.

    float ultralowpress_get_press ( ultralowpress_t *ctx )
  • ultralowpress_get_temp Read temperature.

    float ultralowpress_get_temp ( ultralowpress_t *ctx )

Example Description

This application reads the serial number of the sensor. If there were no errors it continues reading temperature and pressure data from the sensor.

The demo application is composed of two sections :

Application Init

Initializes host communication(UART and I2C). Reads devices serial number and logs it.


void application_init ( void ) 
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    ultralowpress_cfg_t ultralowpress_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.
    ultralowpress_cfg_setup( &ultralowpress_cfg );
    ULTRALOWPRESS_MAP_MIKROBUS( ultralowpress_cfg, MIKROBUS_1 );
    err_t init_flag = ultralowpress_init( &ultralowpress, &ultralowpress_cfg );
    if ( init_flag == I2C_MASTER_ERROR ) 
    {
        log_error( &logger, " Application Init Error. " );
        log_info( &logger, " Please, run program again... " );

        for ( ; ; );
    }
    //Serial number of sensor read
    uint16_t temp_read = 0;
    uint32_t serial_read = 0;
    init_flag = ultralowpress_generic_read( &ultralowpress, ULTRALOWPRESS_REG_SERIAL_NUM_H, &temp_read );
    serial_read = temp_read;
    serial_read <<= 16;
    init_flag |= ultralowpress_generic_read( &ultralowpress, ULTRALOWPRESS_REG_SERIAL_NUM_L, &temp_read );
    serial_read |= temp_read;

    if ( init_flag < 0 )
    {
        log_error( &logger, " Read" );
        for ( ; ; );
    }
    else
    {
        log_printf( &logger, " > Serial number: 0x%.8LX\r\n", serial_read );
    }

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

Application Task

Checks if data is available. When it's available it reads the temperature and pressure data from the sensor and logs it.


void application_task ( void ) 
{
    if ( ultralowpress_ready_to_read( &ultralowpress ) )
    {
        ultralowpress_clear_status( &ultralowpress );
        float temp = ultralowpress_get_temp( &ultralowpress );
        float press = ultralowpress_get_press( &ultralowpress );
        log_printf( &logger, " > Temperature[ C ]: %.2f\r\n > Pressure[ Pa ]: %.2f\r\n", temp, press );
    }
    Delay_ms ( 100 );
}

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

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

SWI EEPROM Click

0

SWI EEPROM Click is a compact add-on board that provides a highly reliable memory solution. This board features the AT21CS01, a single-wire serial EEPROM with a unique, factory-programmed 64-bit serial number from Microchip Technology. The AT21CS01 has an ultra-high write endurance capability allowing more than one million cycles for each memory location to meet the requirements for today's high-write endurance applications. It is internally as 128 words of 8 bits each with achieved communication through a single I/O pin with Standard-Speed and High-Speed mode options. Also, it offers a security register with a factory-programmed serial number, which makes it the easiest way to add identification to various accessories and consumables.

[Learn More]

Flash Click

0

Flash Click is 8,388,608 bits (8 Mbit) on a Click board, organized into 1,048,576 bytes (1 MB). In other words, this Click board is a Flash memory medium with the capacity of 1 MB. The used Flash module has very good endurance and it can withstand up to 100,000 write cycles, with the data retention period of about 20 years.

[Learn More]

Thermo 21 Click

0

Thermo 21 Click is a compact add-on board that provides an accurate temperature measurement. This board features the ADT7301, a high-precision digital temperature sensor from Analog Devices. The ADT7301 houses an on-chip temperature sensor, a 13-bit A/D converter, a reference circuit, and serial interface logic functions in one package. Characterized by its high accuracy (up to ±0.5°C typical) and high resolution of 0.03125°C, this temperature sensor provides temperature data to the host controller with a configurable SPI interface. This Click board™ is appropriate for process control, environmental monitoring, domestic appliances, electronic test equipment, or other temperature measurement applications.

[Learn More]