Barometric pressure data logger for every application
A
A
Hardware Overview
How does it work?
Pressure 18 Click is based on the BMP384, a high accuracy, low-power, and low noise 24-bit absolute barometric pressure sensor from Bosch Sensortec. The BMP384 comprises a piezo-resistive pressure sensing element and a mixed-signal ASIC that performs A/D conversions and provides the conversion results alongside sensor-specific compensation data through a digital interface. It also provides the highest flexibility and can be adapted to the requirements regarding accuracy, measurement time, and power consumption by selecting many possible combinations of sensor settings. The BMP384 is very accurate, covering a wide measurement pressure range from 300hPa to 1250hPa, alongside a relative accuracy of ±9Pa (equivalent to ±75cm difference in altitude), the typical absolute accuracy of ±50Pa, and a temperature coefficient offset of ±1Pa/K. This feature makes it suitable for water-level
detection and differential barometric pressure measurements. This sensor operates in three power modes: Sleep, Normal, and Forced Mode. The Normal Mode comprises automated perpetual cycling between an active measurement period and an inactive Standby period. In Sleep Mode, no measurements are being performed, while in Forced Mode, a single measurement performs. When a measurement is finished, the BMP384 returns to Sleep Mode. Also, oversampling settings are available, ranging from ultra-low power to the highest resolution set to adapt the Click board™ to the target application. Pressure 18 Click allows using both I2C and SPI interfaces with a maximum frequency of 3.4MHz for I2C and 10MHz for SPI communication. The selection can be made by positioning SMD jumpers labeled as COMM SEL in an appropriate position. Note that all the jumpers'
positions must be on the same side, or the Click board™ may become unresponsive. While the I2C interface is selected, the BMP384 allows choosing the least significant bit (LSB) of its I2C slave address using the SMD jumper labeled ADDR SEL. This Click board™ also possesses an additional interrupt pin, routed to the INT pin on the mikroBUS™ socket, indicating when a specific interrupt event occurs, such as FIFO overflow, data-ready, and more. This Click board™ can only be operated with a 3.3V logic voltage level. The board must perform appropriate logic voltage level conversion before using MCUs with different logic levels. However, the Click board™ comes equipped with a library containing functions and an example code that can be used as a reference for further development.



Features overview
Development board
UNI Clicker is a compact development board designed as a complete solution that brings the flexibility of add-on Click boards™ to your favorite microcontroller, making it a perfect starter kit for implementing your ideas. It supports a wide range of microcontrollers, such as different ARM, PIC32, dsPIC, PIC, and AVR from various vendors like Microchip, ST, NXP, and TI (regardless of their number of pins), four mikroBUS™ sockets for Click board™ connectivity, a USB connector, LED indicators, buttons, a debugger/programmer connector, and two 26-pin headers for interfacing with external electronics. Thanks to innovative manufacturing technology, it allows you to build
gadgets with unique functionalities and features quickly. Each part of the UNI Clicker development kit contains the components necessary for the most efficient operation of the same board. In addition to the possibility of choosing the UNI Clicker programming method, using a third-party programmer or CODEGRIP/mikroProg connected to onboard JTAG/SWD header, the UNI Clicker board also includes a clean and regulated power supply module for the development kit. It provides two ways of board-powering; through the USB Type-C (USB-C) connector, where onboard voltage regulators provide the appropriate voltage levels to each component on the board, or using a Li-Po/Li
Ion battery via an onboard battery connector. All communication methods that mikroBUS™ itself supports are on this board (plus USB HOST/DEVICE), including the well-established mikroBUS™ socket, a standardized socket for the MCU card (SiBRAIN standard), and several user-configurable buttons and LED indicators. UNI Clicker is an integral part of the Mikroe ecosystem, allowing you to create a new application in minutes. Natively supported by Mikroe software tools, it covers many aspects of prototyping thanks to a considerable number of different Click boards™ (over a thousand boards), the number of which is growing every day.
Microcontroller Overview
MCU Card / MCU

Type
8th Generation
Architecture
ARM Cortex-M4
MCU Memory (KB)
1536
Silicon Vendor
STMicroelectronics
Pin count
64
RAM (Bytes)
327680
Used MCU Pins
mikroBUS™ mapper
Take a closer look
Click board™ Schematic

Step by step
Project assembly
Track your results in real time
Application Output
1. Application Output - In Debug mode, the 'Application Output' window enables real-time data monitoring, offering direct insight into execution results. Ensure proper data display by configuring the environment correctly using the provided tutorial.

2. UART Terminal - Use the UART Terminal to monitor data transmission via a USB to UART converter, allowing direct communication between the Click board™ and your development system. Configure the baud rate and other serial settings according to your project's requirements to ensure proper functionality. For step-by-step setup instructions, refer to the provided tutorial.

3. Plot Output - The Plot feature offers a powerful way to visualize real-time sensor data, enabling trend analysis, debugging, and comparison of multiple data points. To set it up correctly, follow the provided tutorial, which includes a step-by-step example of using the Plot feature to display Click board™ readings. To use the Plot feature in your code, use the function: plot(*insert_graph_name*, variable_name);. This is a general format, and it is up to the user to replace 'insert_graph_name' with the actual graph name and 'variable_name' with the parameter to be displayed.

Software Support
Library Description
This library contains API for Pressure 18 Click driver.
Key functions:
pressure18_get_int_pin
This function returns the INT pin logic state.pressure18_read_data
This function reads the sensor measurements data: pressure in Pascals and temperature in Celsius.pressure18_soft_reset
This function performs the software reset feature.
Open Source
Code example
The complete application code and a ready-to-use project are available through the NECTO Studio Package Manager for direct installation in the NECTO Studio. The application code can also be found on the MIKROE GitHub account.
/*!
* @file main.c
* @brief Pressure 18 Click example
*
* # Description
* This example demonstrates the use of Pressure 18 click board by reading and displaying
* the pressure and temperature measurements.
*
* The demo application is composed of two sections :
*
* ## Application Init
* Initializes the driver and performs the click default configuration.
*
* ## Application Task
* Waits for the data ready interrupt and then reads the pressure and temperature data
* and displays them on the USB UART every 320ms approximately.
*
* @author Stefan Filipovic
*
*/
#include "board.h"
#include "log.h"
#include "pressure18.h"
static pressure18_t pressure18;
static log_t logger;
void application_init ( void )
{
log_cfg_t log_cfg; /**< Logger config object. */
pressure18_cfg_t pressure18_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.
pressure18_cfg_setup( &pressure18_cfg );
PRESSURE18_MAP_MIKROBUS( pressure18_cfg, MIKROBUS_1 );
err_t init_flag = pressure18_init( &pressure18, &pressure18_cfg );
if ( ( I2C_MASTER_ERROR == init_flag ) || ( SPI_MASTER_ERROR == init_flag ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
if ( PRESSURE18_ERROR == pressure18_default_cfg ( &pressure18 ) )
{
log_error( &logger, " Default configuration." );
for ( ; ; );
}
log_info( &logger, " Application Task " );
}
void application_task ( void )
{
if ( pressure18_get_int_pin ( &pressure18 ) )
{
float pressure, temperature;
if ( PRESSURE18_OK == pressure18_read_data ( &pressure18, &pressure, &temperature ) )
{
log_printf ( &logger, " Pressure: %.1f mBar\r\n", pressure * PRESSURE18_PA_TO_MBAR );
log_printf ( &logger, " Temperature: %.2f C\r\n\n", temperature );
}
}
}
void main ( void )
{
application_init( );
for ( ; ; )
{
application_task( );
}
}
// ------------------------------------------------------------------------ END