-
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.
- IoT Sensing SDK (ISSDK) v1.8 offered as middleware in MCUXpresso SDK for supported platforms (https://nxp.com/iot-sensing-sdk)
- MCUXpresso SDK v2.13.1 for MCX-N9XX-EVK (https://mcuxpresso.nxp.com/en/select)
- MCUXpresso IDE v11.9.0
- Git v2.39.0
- Teraterm (https://osdn.net/projects/ttssh2/releases/) or RealTerm (https://sourceforge.net/projects/realterm/)
- FRDM-MCXN947 MCU board
- FRDMSTBC-P3115 sensor board (https://www.nxp.com/part/FRDMSTBC-P3115) Or
- Accel&Pressure click board (https://www.mikroe.com/accelpressure-click)
- Personal Computer
- Mini/micro C USB cable
- 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)
- Clone this repository to get the example projects:
- Change directory to cloned project folder:
cd *dm-mpl3115-pressure-altimeter-examples
- 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.
- 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.
-
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 modeAltitude = 383 Meters
Temerature = 21 degCAltitude = 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 modePressure = 96806 Pa
Temerature = 21 degCPressure = 96801 Pa
Temerature = 21 degC
- Reach out to NXP Sensors Community page for more support - NXP Community
- Learn more about MPL3115 pressure/altimeter sensor, refer to - NMPL3115 DS
- Accelerate your sensors development using Sensor ToolBox, refer to - Sensors Development Ecosystem
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
Version | Description / Update | Date |
---|---|---|
1.0 | Initial release on Application Code Hub | February 10th 2024 |