Component guide · Beginner · 3 min read
ST LPS22HB, LPS22HH, LPS28, LPS33HW and LPS27HHW Pressure Sensors

Wiring and Code
By Geekobot Learning Team · Updated 29 Oct 2026
On this page
ST's LPS sensors are small MEMS barometers that report absolute air pressure and temperature over I2C or SPI. The LPS22HB and LPS22HH cover 260 to 1260 hPa for weather and altitude, the LPS28DFW extends to 4060 hPa, and the LPS33HW and LPS27HHW have a gel-filled port that survives water. The Adafruit STEMMA QT boards plug in with a Qwiic cable and work at 3.3 or 5 V.
Key specs at a glance
- LPS22HB / LPS22HH
- 260 to 1260 hPa, about 0.1 hPa accuracy (HH lower noise)
- LPS28DFW
- Dual full scale up to 4060 hPa, water resistant
- LPS33HW / LPS27HHW
- 260 to 1260 hPa, water resistant with gel port
- Interface
- I2C (0x5C or 0x5D) or SPI; I3C on LPS28
- Supply
- 1.7 to 3.6 V chip; Adafruit boards accept 3.3 to 5 V
- Output rate
- Up to 200 Hz
Models in this guide
These are alternatives. Pick the one that fits your project; you only need one.
Option 1Adafruit LPS22 Pressure Sensor – STEMMA QT / Qwiic – LPS22HB₹1,103
Option 2Adafruit LPS28 (LPS28DFW) Pressure Sensor Module – I2C/MIPI I3CSM Interface₹1,989
Option 3Adafruit LPS33HW Water Resistant Pressure Sensor – STEMMA QT₹1,729
Option 4STMicroelectronics LPS22HBTR MEMS Piezoresistive Digital Pressure Sensor, 26-126 kPa, I2C/SPI, HLGA-10₹204
Option 5STMicroelectronics LPS22HHTR MEMS Absolute Pressure Sensor, 26-126 kPa, I2C/SPI, HLGA-10₹379
Option 6STMicroelectronics LPS27HHW Pressure Sensor, 260-1260 hPa, Waterproof, 24-bit, 0.5 hPa Accuracy, I²C/SPI, LGA-10₹379
What the ST LPS22 and LPS28 pressure sensor is
These sensors measure absolute pressure, so they show weather changes and altitude. Sea-level pressure is about 1013 hPa and pressure falls roughly 0.12 hPa per metre near the ground.
The water-resistant versions can sit behind a vent or in a wet enclosure and are used in wearables and rain-exposed weather stations. The bare chips (LPS22HBTR, LPS22HHTR, LPS27HHW) are LGA parts for your own PCB.
ST LPS22 and LPS28 pressure sensor pinout
The pins on the ST LPS22 and LPS28 pressure sensor and what each one does.
| Pin | Function |
|---|---|
| VIN / VDD | Supply (3.3 V; 5 V on Adafruit boards) |
| GND | Ground |
| SCL / SCK | I2C or SPI clock |
| SDA / SDI | I2C data or SPI data in |
| SDO / SA0 | Address select or SPI data out |
| CS | High for I2C, low for SPI |
| INT / DRDY | Data ready or threshold interrupt |
- VIN / VDD
- Supply (3.3 V; 5 V on Adafruit boards)
- GND
- Ground
- SCL / SCK
- I2C or SPI clock
- SDA / SDI
- I2C data or SPI data in
- SDO / SA0
- Address select or SPI data out
- CS
- High for I2C, low for SPI
- INT / DRDY
- Data ready or threshold interrupt
Wiring the ST LPS22 and LPS28 pressure sensor
Adafruit STEMMA QT boards connect with a Qwiic cable and have level shifting. Bare chips are 3.3 V only and need a careful LGA layout.
| ST LPS22 and LPS28 pressure sensor pin | Arduino Uno | ESP32 |
|---|---|---|
| VCC / VIN | 3.3V (5V only if the board has a regulator) | 3V3 |
| GND | GND | GND |
| SDA | A4 (through a level shifter on bare 3.3 V boards) | GPIO 21 |
| SCL | A5 | GPIO 22 |
- VCC / VIN
- Arduino Uno:
- 3.3V (5V only if the board has a regulator)
- ESP32:
- 3V3
- GND
- Arduino Uno:
- GND
- ESP32:
- GND
- SDA
- Arduino Uno:
- A4 (through a level shifter on bare 3.3 V boards)
- ESP32:
- GPIO 21
- SCL
- Arduino Uno:
- A5
- ESP32:
- GPIO 22
Example code
Use Adafruit_LPS33 or Adafruit_LPS35HW for the LPS33HW, and Adafruit_LPS28 for the LPS28DFW. Replace 1013.25 with your local sea-level pressure for accurate altitude.
#include <Adafruit_LPS2X.h>
Adafruit_LPS22 lps;
void setup() {
Serial.begin(115200);
if (!lps.begin_I2C()) { Serial.println("LPS22 not found"); while (1) delay(10); }
lps.setDataRate(LPS22_RATE_10_HZ);
}
void loop() {
sensors_event_t p, t;
lps.getEvent(&p, &t);
float alt = 44330.0 * (1.0 - pow(p.pressure / 1013.25, 0.1903));
Serial.printf("%.2f hPa %.2f C %.1f m\n", p.pressure, t.temperature, alt);
delay(1000);
}Setup and tuning
SDO/SA0 low gives 0x5C, high gives 0x5D.
relative height changes are far more accurate than absolute altitude.
log pressure every 10 minutes; a fall of 3 hPa in 3 hours hints at bad weather.
keep it away from fans and direct sun, which cause pressure and heat errors.
What you need
Shop this list11 of 12 found in our store · ₹6,448
Adafruit LPS22 Pressure Sensor – STEMMA QT / Qwiic – LPS22HB: the part this guide coversAdafruit LPS22 Pressure Sensor – STEMMA QT / Qwiic – LPS22HB₹1,103
Adafruit LPS28 (LPS28DFW) Pressure Sensor Module – I2C/MIPI I3CSM Interface: another version this guide coversAdafruit LPS28 (LPS28DFW) Pressure Sensor Module – I2C/MIPI I3CSM Interface₹1,989
Adafruit LPS33HW Water Resistant Pressure Sensor – STEMMA QT: another version this guide coversAdafruit LPS33HW Water Resistant Pressure Sensor – STEMMA QT₹1,729
STMicroelectronics LPS22HBTR MEMS Piezoresistive Digital Pressure Sensor, 26-126 kPa, I2C/SPI, HLGA-10: another version this guide coversSTMicroelectronics LPS22HBTR MEMS Piezoresistive Digital Pressure Sensor, 26-126 kPa, I2C/SPI, HLGA-10₹204
STMicroelectronics LPS22HHTR MEMS Absolute Pressure Sensor, 26-126 kPa, I2C/SPI, HLGA-10: another version this guide coversSTMicroelectronics LPS22HHTR MEMS Absolute Pressure Sensor, 26-126 kPa, I2C/SPI, HLGA-10₹379
STMicroelectronics LPS27HHW Pressure Sensor, 260-1260 hPa, Waterproof, 24-bit, 0.5 hPa Accuracy, I²C/SPI, LGA-10: another version this guide coversSTMicroelectronics LPS27HHW Pressure Sensor, 260-1260 hPa, Waterproof, 24-bit, 0.5 hPa Accuracy, I²C/SPI, LGA-10₹379
ESP32-WROOM-32 38-pin development board: for Wi-Fi logging and dashboardsESP32-WROOM-32 38-Pin Development Board₹389- Uno R3 development board: the controller used in the wiring tableFind this part
0.96 inch OLED display 128x64: to show readings without a computer0.96" OLED Display 128x64₹139Closest match, check the specs
4-channel logic level converter (BSS138): to connect 5 V and 3.3 V signals safely4-Channel Logic Level Converter (BSS138)₹20
Solderless breadboard: to build without solderingSolderless Breadboard₹68
Dupont jumper wires: for the connectionsDupont Jumper Wires (40 pcs)₹49Closest match, check the specs
Alternatives and when to choose them
- BME280 and BMP280: Bosch barometers, with humidity on the BME280.
- BMP390 and BMP581: lower noise for altitude.
- MS5803: for water depth and higher pressures.
Common mistakes to avoid
- Using an LPS22 library on an LPS33 without checking the chip ID.
- Expecting gauge pressure readings.
- Mounting in sunlight or next to a fan.
- 5 V on a bare 3.3 V chip.
Frequently asked questions
LPS22HB or LPS22HH?
The HH is newer with lower noise and current; code is very similar.
Can it go underwater?
LPS33HW, LPS27HHW and LPS28DFW are water resistant; check the depth rating.
Does it measure humidity?
No, only pressure and temperature.
How accurate is altitude?
About 1 m for changes, worse for absolute altitude.
Can it run from a coin cell?
Yes, it draws a few microamps at low output rates.
Parts for this guide
- ₹1,103View
- ₹1,989View
- ₹1,729View
STMicroelectronics LPS22HBTR MEMS Piezoresistive Digital Pressure Sensor, 26-126 kPa, I2C/SPI, HLGA-10₹204View- ₹379View
STMicroelectronics LPS27HHW Pressure Sensor, 260-1260 hPa, Waterproof, 24-bit, 0.5 hPa Accuracy, I²C/SPI, LGA-10₹379View- ₹389View
- ₹359View
- ₹139View
- ₹20View
- ₹68View
- ₹49View
Keep learning
Sources
- STMicroelectronics LPS22HB, LPS22HH, LPS33HW and LPS28DFW datasheets
- Adafruit LPS2X and LPS28 library documentation
Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.

