Home Code Arduino and LPS25H piezoresistive pressure sensor example

Arduino and LPS25H piezoresistive pressure sensor example

by shedboy71

In this article we look at a pressure sensor – this time its the LPS25H

The LPS25H is an ultra-compact absolute piezoresistive pressure sensor. It includes a monolithic sensing element and an IC interface able to take the information from the sensing element and to provide a digital signal to the external world.

The sensing element consists of a suspended membrane realized inside a single mono-silicon substrate. It is capable of detecting pressure and is manufactured using a dedicated process developed by ST.
The membrane is very small compared to the traditionally built silicon micromachined membranes. Membrane breakage is prevented by an intrinsic mechanical stopper.
The IC interface is manufactured using a standard CMOS process that allows a high level of integration to design a dedicated circuit which is trimmed to better match the sensing element characteristics.
The LPS25H is available in a cavity holed LGA package (HLGA). It is guaranteed to operate over a temperature range extending from -30 °C to +105 °C. The package is holed to allow external pressure to reach the sensing element.


260 to 1260 mbar absolute pressure range
High-resolution mode: 1 Pa RMS
Low power consumption
Low-resolution mode: 4 μA
High-resolution mode: 25 μA
High overpressure capability: 20x full scale
Embedded temperature compensation
Embedded 24-bit ADC
Selectable ODR from 1 Hz to 25 Hz
SPI and I²C interfaces
Supply voltage: 1.7 to 3.6 V
High shock survivability: 10,000 g


Parts Required


Name Link
Arduino Uno UNO R3 CH340G/ATmega328P, compatible for Arduino UNO
LPS25H Diybigworld LPS25HTR ST CJMCU-25 Miniature high Precision Pressure Sensor Temperature Compensation
Connecting wire Free shipping Dupont line 120pcs 20cm male to male + male to female and female to female jumper wire
sensor shield Expansion IO Board Sensor Shield



arduino and LPS25H

arduino and LPS25H


Code Example

This uses the library from https://github.com/pololu/lps-arduino

#include <Wire.h>
#include <LPS.h>
LPS ps;
void setup()
if (!ps.init())
Serial.println("Failed to autodetect pressure sensor!");
while (1);
void loop()
float pressure = ps.readPressureMillibars();
float altitude = ps.pressureToAltitudeMeters(pressure);
float temperature = ps.readTemperatureC();
Serial.print("p: ");
Serial.print(" mbar\ta: ");
Serial.print(" m\tt: ");
Serial.println(" deg C");



Open the serial monitor and you should see something like this

p: 987.37 mbar a: 217.67 m t: 22.88 deg C
p: 987.19 mbar a: 219.24 m t: 23.07 deg C
p: 987.31 mbar a: 218.22 m t: 23.26 deg C
p: 986.94 mbar a: 221.34 m t: 23.45 deg C
p: 986.80 mbar a: 222.55 m t: 23.79 deg C
p: 986.75 mbar a: 222.95 m t: 23.95 deg C
p: 986.67 mbar a: 223.69 m t: 24.11 deg C
p: 986.59 mbar a: 224.32 m t: 24.40 deg C
p: 986.55 mbar a: 224.63 m t: 24.54 deg C
p: 986.43 mbar a: 225.68 m t: 24.68 deg C
p: 986.39 mbar a: 226.02 m t: 24.95 deg C
p: 986.51 mbar a: 225.01 m t: 25.07 deg C
p: 986.47 mbar a: 225.35 m t: 25.20 deg C



Click to access lps25h.pdf


You may also like

Leave a Comment