How does it work?
Altitude Click, as its foundation, uses the MPL3115A2, a low-power, high-accuracy digital output altimeter, barometer, and thermometer from NXP Semiconductors. A high-resolution 24-bit ADC digitizes the MPL3115A2 outputs; it provides 20-bit pressure/altitude and 12-bit temperature data with an altitude resolution of 30cm. Pressure output can be resolved with output in fractions of a Pascal and altitude in fractions of a meter. The high stability of both pressure and temperature signals makes it suitable for accurate altimetry in various applications.
The MPL3115A2 contains automatic internal data processing with data acquisition and compensation, which removes compensation tasks from the host MCU, and a 32-sample FIFO buffer to minimize the overhead of collecting multiple data samples. Numerous user-programmable, power-saving, and interrupt modes are available, including programmed acquisition cycle timing and poll-only modes. It can also autonomously collect data at programmed intervals and store it for up to 12 days, depending on the data acquisition rate (1 second – 9 hours).
This Click board™ communicates with MCU using the standard I2C 2-Wire interface with a maximum clock frequency of 400kHz. The MPL3115A2 also features two independently programmable interrupt signals, IT1 and IT2, routed to the INT and CS pins on the mikroBUS™ socket, entirely programmed by the user through the I2C interface (functions, threshold, and the timing of the interrupt pins). These can be set to generate an interrupt signal when a new set of pressure/altitude and temperature data is available, simplifying data acquisition for the host MCU. It can also be configured to generate interrupts when a user-programmed set of conditions are met, such as when a single new data acquisition is ready, when a desired number of samples are stored within the internal FIFO or when a change of pressure/altitude or temperature is detected.
This Click board™ can be operated only 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.
Specifications
Type
Altitude,Pressure
Applications
Can be used for high accuracy altimetry, map assist and navigation, weather station equipment, and more
On-board modules
MPL3115A2 – digital output altimeter, barometer, and thermometer from NXP Semiconductors
Key Features
Low power consumption, high precision and resolution, fully compensated internally, integrated digital pressure sensor (24 bit ΔΣ ADC), excellent long-term stability, programmable events, autonomous data acquisition, I2C interface, and more
Interface
GPIO,I2C
Feature
No ClickID
Compatibility
mikroBUS™
Click board size
S (28.6 x 25.4 mm)
Input Voltage
3.3V
Pinout diagram
This table shows how the pinout on Altitude Click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Onboard settings and indicators
Label | Name | Default | Description |
---|---|---|---|
LD1 | PWR | – | Power LED Indicator |
Altitude Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | – | 3.3 | – | V |
Operating Range | 50 | – | 110 | kPa |
Altitude Resolution | – | – | 30 | cm |
ADC Resolution | – | 24 | – | bit |
Operating Temperature Range | -40 | +25 | +85 | °C |
Software Support
We provide a library for the Altitude 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 Altitude Click driver.
Key functions
-
Generic Single Write function.
-
Generic Multiple Read function.
-
Altitude Get function.
Example Description
This is a example which demonstrates the use of Altitude Click board. This demo example offers the altitude [m], pressure [mbar] and temperature [deg C] measurements from sensor.
void application_task( void )
{
float altitude_result;
float pressure_result;
float temperature_result;
// Altimeter sensor mode for altitude data reading.
altitude_set_sensor_mode( &altitude, ALTITUDE_SENSMOD_ALTIMETER );
Delay_ms( 100 );
while ( 0 == altitude_get_drdy_status( &altitude, ALTITUDE_STATUS_FLAG_PDR ) );
altitude_result = altitude_get_altitude( &altitude );
// Barometer sensor mode for pressure data reading.
altitude_set_sensor_mode( &altitude, ALTITUDE_SENSMOD_BAROMETER );
Delay_ms( 100 );
while ( 0 == altitude_get_drdy_status( &altitude, ALTITUDE_STATUS_FLAG_PDR ) );
pressure_result = altitude_get_pressure( &altitude );
temperature_result = altitude_get_temperature( &altitude );
log_printf( &console, "** Altitude is %.2f mrn", altitude_result );
log_printf( &console, "** Pressure is %.2f mbarrn", pressure_result );
log_printf( &console, "** Temperature is %.2f Celsiusrn", temperature_result );
log_printf( &console, "**************************************rn" );
}
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.Altitude
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.
mikroSDK
This Click board™ is supported with mikroSDK – MikroElektronika Software Development Kit. To ensure proper operation of mikroSDK compliant Click board™ demo applications, mikroSDK should be downloaded from the LibStock and installed for the compiler you are using.
For more information about mikroSDK, visit the official page.