Discover the versatility of barometers in diverse fields, from agriculture to aviation, as they contribute to efficiency and precision in a wide range of applications
A
A
Hardware Overview
How does it work?
Barometer 4 Click is based on the ICP-10111, an ultra-low power, low noise, digital output barometric pressure and temperature sensor from TDK InvenSense. It is based on an innovative MEMS capacitive pressure sensor technology that can measure pressure from 30kPa up to 110kPa with an accuracy of ±1Pa over a wide operating temperature range at the industry’s lowest power. This high-accuracy MEMS capacitive pressure sensor can also measure altitude differentials down to 8.5cm without the penalty of increased power consumption or reduced sensor throughput. The ICP-10111 also offers industry-leading temperature stability of the pressure sensor with a temperature coefficient offset of
±0.5Pa/°C. The high accuracy, temperature stability, and low power consumption offered by ICP-10111 make it ideally suited for applications such as drone flight control and stabilization, indoor/outdoor navigation, sports and fitness activity monitoring, and battery-powered IoT. The ICP-10111 also requires a supply voltage of 1.8V to work regularly. Therefore, a small LDO regulator, BH18PB1WHFV from Rohm Semiconductor, provides 1.8V out of mikroBUS™ power rails. This LDO cuts power consumption by lowering its current consumption to approximately 2μA when the application operates in the Standby state. Barometer 4 Click communicates with MCU using a standard I2C 2-Wire interface that supports
400kHz Fast Mode operation. Since the sensor for operation requires a 1.8V logic voltage level only, this Click board™ also features the PCA9306 voltage-level translator from Texas Instruments. The I2C interface bus lines are routed to the dual bidirectional voltage-level translator, allowing this Click board™ to work properly with both 3.3V and 5V MCUs. This Click board™ can operate with either 3.3V or 5V logic voltage levels selected via the VCC SEL jumper. This way, both 3.3V and 5V capable MCUs can use the communication lines properly. Also, this Click board™ comes equipped with a library containing easy-to-use functions and an example code that can be used as a reference for further development.
Features overview
Development board
Clicker 2 for PIC18FJ is a compact starter development board that brings the flexibility of add-on Click boards™ to your favorite microcontroller, making it a perfect starter kit for implementing your ideas. It comes with an onboard 8-bit PIC microcontroller, the PIC18F87J50 from Microchip, two mikroBUS™ sockets for Click board™connectivity, a USB connector, LED indicators, buttons, a mikroProg connector, and two 26-pin headers for interfacing with external electronics. Its compact design with clear and easily recognizable silkscreen markings allows you to build gadgets with unique functionalities and features quickly. Each part of the Clicker 2 for
PIC18FJ development kit contains the components necessary for the most efficient operation of the same board. In addition to the possibility of choosing the Clicker 2 for PIC18FJ programming method: using USB HID mikroBootloader, an external mikroProg connector for PIC18FJ programmer, or through an external ICD3/3 programmer, the Clicker 2 board also includes a clean and regulated power supply module for the development kit. It provides two ways of board-powering; through the USB Mini-B cable, where onboard voltage regulators provide the appropriate voltage levels to each component on the board or using a Li-Polymer battery via an onboard battery
connector. All communication methods that mikroBUS™ itself supports are on this board, including the well-established mikroBUS™ socket, reset button, and several user-configurable buttons and LED indicators. Clicker 2 for PIC18FJ 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

Architecture
PIC
MCU Memory (KB)
128
Silicon Vendor
Microchip
Pin count
80
RAM (Bytes)
3904
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
This Click board can be interfaced and monitored in two ways:
Application Output
- Use the "Application Output" window in Debug mode for real-time data monitoring. Set it up properly by following this tutorial.
UART Terminal
- Monitor data via the UART Terminal using a USB to UART converter. For detailed instructions, check out this tutorial.
Software Support
Library Description
This library contains API for Barometer 4 Click driver.
Key functions:
barometer4_get_pressure_and_temperature
- Barometer 4 get pressure and temperature functionbarometer4_get_raw_data
- Barometer 4 get RAW data functionbarometer4_soft_reset
- Barometer 4 software reset function
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 Barometer4 Click example
*
* # Description
* This library contains API for the Barometer 4 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.
*
* ## Application Task
* This is an example that shows the use of a Barometer 4 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.
*
* @author Nenad Filipovic
*
*/
#include "board.h"
#include "log.h"
#include "barometer4.h"
static barometer4_t barometer4;
static log_t logger;
void application_init ( void )
{
log_cfg_t log_cfg; /**< Logger config object. */
barometer4_cfg_t barometer4_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.
barometer4_cfg_setup( &barometer4_cfg );
BAROMETER4_MAP_MIKROBUS( barometer4_cfg, MIKROBUS_1 );
err_t init_flag = barometer4_init( &barometer4, &barometer4_cfg );
if ( I2C_MASTER_ERROR == init_flag )
{
log_error( &logger, " Application Init Error. " );
log_info( &logger, " Please, run program again... " );
for ( ; ; );
}
barometer4_default_cfg ( &barometer4 );
log_info( &logger, " Application Task " );
log_printf( &logger, "----------------------------\r\n" );
Delay_ms( 100 );
static uint16_t device_id;
err_t err_flag = barometer4_get_device_id( &barometer4, &device_id );
if ( BAROMETER4_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 );
}
void application_task ( void )
{
static float pressure;
static float temperature;
barometer4_get_pressure_and_temperature( &barometer4, &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 );
}
void main ( void )
{
application_init( );
for ( ; ; )
{
application_task( );
}
}
// ------------------------------------------------------------------------ END