/dm-mpl3115-pressure-altimeter-examples

This example demo describes how to configure absolute pressure sensor MPL3115 for pressure and altimeter mode. This sensor can find use in many industrial, medical applications.

Primary LanguageCOtherNOASSERTION

NXP Application Code Hub

Pressure and Altimeter Examples using MPL3115 Sensor

  • This example demo describes how to configure absolute pressure sensor MPL3115 for pressure and altimeter mode. This sensor can find use in many industrial, medical applications.

  • Please refer to MPL3115 Sensor Datasheet for more information.
    https://www.nxp.com/docs/en/data-sheet/MPL3115A2S.pdf

  • The MPL3115A2S is a compact, piezoresistive, absolute pressure sensor with an I2C digital interface. MPL3115A2S has a wide operating range of 20 kPa to 110 kPa, a range that covers all surface elevations on earth.

  • The MPL3115A2S advanced ASIC has multiple user programmable modes such as power saving, interrupt and autonomous data acquisition modes, including programmed acquisition cycle timing, and poll-only modes

  • Applications include High-precision altimetry and barometry, wearable devices, medical devices like inhalers, GPS devices, weather station equipments.

  • The image below shows the MPL3115 pressure/altimeter sensor block diagram.

  • Boards: FRDM-MCXN947

  • Accessories: nxp_frdmstbc_p3115, mikroe_accel_pressure_click

  • Categories: Low Power, Sensor

  • Peripherals: I2C, UART

  • Toolchains: MCUXpresso IDE

Table of Contents

  1. Software
  2. Hardware
  3. Setup
  4. Results
  5. Support

1. Software

2. Hardware

3. Setup

3.1 Step 1: Download and Install required Software(s)

  • Install MCUXpresso IDE 2.19.0
  • Download and Install MCXUpresso SDK 2.13.1 for MCX
  • Install Git v2.39.0 (for cloning and running west commands)
  • RealTerm (for checking examples output)

3.2 Step 2: Clone the APP-CODE-HUB/dm-mpl3115-pressure-altimeter-examples

  • Clone this repository to get the example projects:
  • Change directory to cloned project folder:
    cd *dm-mpl3115-pressure-altimeter-examples

3.3 Step 3: Build example projects

  • Open MCUXpresso IDE and select a directory to create your workspace.
  • Install MCXUpresso SDK 2.13.1 for MCX (drag and drop SDK zip into "Installed SDK" view) into MCUXpresso IDE.
  • Go to "Quickstart Panel" and click on "Import Project(s) from file system",
  • Select "Project directory (unpacked)" and browse to the cloned project folder.
  • Select example projects that you want to open and run.
  • Right click on project and select build to start building the project.

3.4 Step 4: Run example projects

  • Connect the chosen example project HW: FRDM-MCXN947 with FRDMSTBC-P3115 or Accel&Pressure click board.
  • Right click on project and select "Debug As". Select MCUXpresso IDE LinkServer (inc. CMSIS DAP) probes.
  • Connect a USB cable between the host PC and the MCU-Link USB port on the target board.
  • Open a serial terminal (RealTerm) with the following settings:
    • 115200 baud rate
    • 8 data bits
    • No parity
    • One stop bit
    • No flow control
  • Download the program to the target board.
  • Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

4. Results

  • Show the on the board up to detect motion event. Refer to example project doc/readme.txt for more details.

  • When the altimeter demo runs successfully, you can see the altitide measured values (in meters) printed to the terminal.

    ISSDK MPL3115 sensor driver example demonstration with Altitude mode
    Successfully Initialized Sensor
    Successfully Applied MPL3115 Configuration for Altimeter mode

    Altitude = 383 Meters
    Temerature = 21 degC

    Altitude = 383 Meters
    Temerature = 21 degC

  • When the pressure demo runs successfully, you can see the pressure measured values (in Pa) printed to the terminal.

    ISSDK MPL3115 sensor driver example demonstration with Pressure mode
    Successfully Initialized Sensor
    Successfully Applied MPL3115 Configuration for Pressure mode

    Pressure = 96806 Pa
    Temerature = 21 degC

    Pressure = 96801 Pa
    Temerature = 21 degC

5. Support

Project Metadata

Board badge

Category badge Category badge

Peripheral badge Peripheral badge Peripheral badge

Toolchain badge

Questions regarding the content/correctness of this example can be entered as Issues within this GitHub repository.

Warning: For more general technical questions regarding NXP Microcontrollers and the difference in expected funcionality, enter your questions on the NXP Community Forum

Follow us on Youtube Follow us on LinkedIn Follow us on Facebook Follow us on Twitter

7. Release Notes

Version Description / Update Date
1.0 Initial release on Application Code Hub February 10th 2024

dm-mpl3115-pressure-altimeter-examples