

The Adafruit LPS28 Pressure Sensor (Manufacturer Part ID: 6067) is a high-accuracy digital barometric pressure sensor designed to measure atmospheric pressure and temperature. It features low power consumption, making it ideal for battery-powered applications. This sensor is commonly used in weather monitoring, altitude measurement, and environmental sensing projects. Its compact design and I2C/SPI communication interfaces make it easy to integrate into a wide range of systems.








The Adafruit LPS28 Pressure Sensor offers the following key technical details:
| Parameter | Value |
|---|---|
| Operating Voltage | 1.7V to 3.6V |
| Communication Interface | I2C (up to 400 kHz) / SPI (10 MHz) |
| Pressure Range | 260 hPa to 1260 hPa |
| Pressure Accuracy | ±0.5 hPa |
| Temperature Range | -40°C to +85°C |
| Temperature Accuracy | ±0.8°C |
| Current Consumption | 4 µA (low-power mode) |
| Dimensions | 2.0 mm x 2.0 mm x 0.76 mm |
The LPS28 sensor is typically available on a breakout board from Adafruit, which includes the following pins:
| Pin Name | Description |
|---|---|
| VIN | Power input (3.3V or 5V compatible) |
| GND | Ground connection |
| SCL | I2C clock line (or SPI clock line in SPI mode) |
| SDA | I2C data line (or SPI MOSI line in SPI mode) |
| CS | Chip Select (used in SPI mode; tie to GND for I2C mode) |
| INT | Interrupt pin (optional, used for event-driven applications) |
The Adafruit LPS28 Pressure Sensor is compatible with Arduino boards. Follow these steps to get started:
Install the Library:
Sketch > Include Library > Manage Libraries.Example Code: Use the following example code to read pressure and temperature data:
#include <Wire.h>
#include <Adafruit_LPS2X.h>
// Create an instance of the LPS28 sensor
Adafruit_LPS2X lps;
void setup() {
Serial.begin(115200);
while (!Serial) delay(10); // Wait for Serial Monitor to open
// Initialize the sensor
if (!lps.begin_I2C()) {
Serial.println("Failed to find LPS28 sensor!");
while (1) delay(10);
}
Serial.println("LPS28 sensor initialized!");
}
void loop() {
// Read pressure in hPa
float pressure = lps.readPressure();
// Read temperature in °C
float temperature = lps.readTemperature();
// Print the readings to the Serial Monitor
Serial.print("Pressure: ");
Serial.print(pressure);
Serial.println(" hPa");
Serial.print("Temperature: ");
Serial.print(temperature);
Serial.println(" °C");
delay(1000); // Wait 1 second before the next reading
}
Sensor Not Detected:
Incorrect Readings:
Communication Errors:
Q: Can the LPS28 sensor measure altitude?
A: Yes, the sensor can calculate altitude based on pressure readings using standard atmospheric equations.
Q: Is the sensor compatible with 5V logic?
A: Yes, the breakout board includes level-shifting circuitry, making it compatible with 3.3V and 5V logic.
Q: Can I use this sensor with Raspberry Pi?
A: Absolutely! The sensor supports I2C and SPI communication, which are compatible with Raspberry Pi GPIO pins.
Q: How do I switch between I2C and SPI modes?
A: Tie the CS pin to GND for I2C mode or connect it to a GPIO pin for SPI mode. Configure the communication protocol in your code accordingly.