Blog

BMP280 Barometric Pressure Sensor – Complete Guide

Barometric Pressure Sensor

BMP280 Barometric Pressure & Temperature Sensor

High-Precision Digital Pressure Sensing with I2C/SPI Interface

The BMP280 measures atmospheric pressure using a MEMS piezo-resistive sensing element - a microscopic membrane that flexes in response to ambient air pressure, with that flex changing the resistance of piezo-resistive elements bonded to it, which the onboard signal-processing circuitry converts into a calibrated digital pressure reading, compensated against factory-stored coefficients unique to each individual chip. What makes barometric pressure useful well beyond weather monitoring is altitude estimation: pressure decreases in a well-understood, predictable way as altitude increases, so by comparing a current reading against a known sea-level reference pressure, the same sensor can estimate relative altitude to within roughly a meter of resolution - precise enough that BMP280s are commonly used for drone altitude hold and hiking altimeters, not just weather stations. It also includes an integrated temperature sensor, both because temperature is needed internally to compensate the pressure reading accurately, and because it's a genuinely useful secondary measurement in its own right.

300–1100 hPa
Pressure Range
± 1 hPa
Accuracy
~± 1m
Altitude Resolution

Key features

High-Precision Pressure Sensing

A MEMS piezo-resistive element with factory calibration for each individual chip.

Altitude Estimation

Derives relative altitude to roughly ±1m resolution from pressure readings.

Integrated Temperature Sensor

Compensates pressure readings internally and reports temperature directly.

I2C and SPI Support

Flexible wiring to match whichever bus your project already uses.

Low Power Consumption

Selectable power modes down to microamp-level standby current.

Tiny Footprint

Small enough for wearables and space-constrained flight controllers.

Technical specifications

Supply Voltage 1.8V – 3.6V (breakouts often add a 5V-tolerant regulator)
Pressure Range 300 – 1100 hPa
Pressure Accuracy ± 1 hPa
Temperature Accuracy ± 1.0°C
Altitude Resolution ~± 1m
Interface I2C (up to 3.4MHz) or SPI
Default I2C Address 0x76 or 0x77
Operating Current ~2.7µA (1Hz sampling, typical)
Package Breakout module (often paired with humidity as BME280)

Pinout

PinFunction
VCC Power supply
GND Ground
SCL I2C clock / SPI clock
SDA I2C data / SPI MOSI
SDO I2C address select (also SPI MISO on some breakouts)
CSB SPI chip-select (tie HIGH for I2C mode on some breakouts)

Applications

Weather stations Drone and RC altitude-hold assistance Hiking and sports altimeters Indoor climate monitoring Elevator floor-detection projects Weather-balloon (HAB) telemetry

What's in the box

1x BMP280 breakout module

Downloads

Datasheet (PDF) Adafruit BMP280 Library Example
🔌
Pin Connections
1 Table
Pin Connections Table 1
BoardSensor PinConnection
BMP280VCC/GND/SDA/SCL3.3V / GND / board SDA / board SCL
📟
BMP280 Barometric Pressure and Temperature Sensor Module
7 Examples • C/C++ | Boards: Arduino Uno, Arduino Nano, Arduino Mega, ESP32, ESP8266, STM32, Raspberry Pi Pico
BMP280 Barometric Pressure and Temperature Sensor Module - Arduino Uno
BMP280 Barometric Pressure and Temperature Sensor Module - Arduino Nano
BMP280 Barometric Pressure and Temperature Sensor Module - Arduino Mega
BMP280 Barometric Pressure and Temperature Sensor Module - ESP32
BMP280 Barometric Pressure and Temperature Sensor Module - ESP8266
BMP280 Barometric Pressure and Temperature Sensor Module - STM32
BMP280 Barometric Pressure and Temperature Sensor Module - Raspberry Pi Pico
📄 File: bmp280_barometric_pressure_and_temperature_sensor_module_-_arduino_uno.inoArduino Uno
779 characters
1//ekostra.com
2//electronics store in egypt
3//+201008896258
4
5// I2C wiring for Arduino Uno: A4=SDA, A5=SCL. VCC->3.3V or 5V per module label, GND->GND.
6#include <Wire.h>
7#include <Adafruit_Sensor.h>
8#include <Adafruit_BMP280.h>
9
10Adafruit_BMP280 bmp; // I2C, default address 0x76
11
12void setup() {
13 Serial.begin(115200);
14 Wire.begin();
15 if (!bmp.begin(0x76)) {
16 Serial.println("BMP280 not found - try address 0x77, or check wiring!");
17 while (1) delay(10);
18 }
19}
20
21void loop() {
22 Serial.print("Temp: "); Serial.print(bmp.readTemperature()); Serial.print(" C ");
23 Serial.print("Pressure: "); Serial.print(bmp.readPressure() / 100.0F); Serial.print(" hPa ");
24 Serial.print("Altitude: "); Serial.print(bmp.readAltitude(1013.25)); Serial.println(" m");
25
26 delay(1000);
27}
📄 File: bmp280_barometric_pressure_and_temperature_sensor_module_-_arduino_nano.inoArduino Nano
780 characters
1//ekostra.com
2//electronics store in egypt
3//+201008896258
4
5// I2C wiring for Arduino Nano: A4=SDA, A5=SCL. VCC->3.3V or 5V per module label, GND->GND.
6#include <Wire.h>
7#include <Adafruit_Sensor.h>
8#include <Adafruit_BMP280.h>
9
10Adafruit_BMP280 bmp; // I2C, default address 0x76
11
12void setup() {
13 Serial.begin(115200);
14 Wire.begin();
15 if (!bmp.begin(0x76)) {
16 Serial.println("BMP280 not found - try address 0x77, or check wiring!");
17 while (1) delay(10);
18 }
19}
20
21void loop() {
22 Serial.print("Temp: "); Serial.print(bmp.readTemperature()); Serial.print(" C ");
23 Serial.print("Pressure: "); Serial.print(bmp.readPressure() / 100.0F); Serial.print(" hPa ");
24 Serial.print("Altitude: "); Serial.print(bmp.readAltitude(1013.25)); Serial.println(" m");
25
26 delay(1000);
27}
📄 File: bmp280_barometric_pressure_and_temperature_sensor_module_-_arduino_mega.inoArduino Mega
782 characters
1//ekostra.com
2//electronics store in egypt
3//+201008896258
4
5// I2C wiring for Arduino Mega: D20=SDA, D21=SCL. VCC->3.3V or 5V per module label, GND->GND.
6#include <Wire.h>
7#include <Adafruit_Sensor.h>
8#include <Adafruit_BMP280.h>
9
10Adafruit_BMP280 bmp; // I2C, default address 0x76
11
12void setup() {
13 Serial.begin(115200);
14 Wire.begin();
15 if (!bmp.begin(0x76)) {
16 Serial.println("BMP280 not found - try address 0x77, or check wiring!");
17 while (1) delay(10);
18 }
19}
20
21void loop() {
22 Serial.print("Temp: "); Serial.print(bmp.readTemperature()); Serial.print(" C ");
23 Serial.print("Pressure: "); Serial.print(bmp.readPressure() / 100.0F); Serial.print(" hPa ");
24 Serial.print("Altitude: "); Serial.print(bmp.readAltitude(1013.25)); Serial.println(" m");
25
26 delay(1000);
27}
📄 File: bmp280_barometric_pressure_and_temperature_sensor_module_-_esp32.inoESP32
781 characters
1//ekostra.com
2//electronics store in egypt
3//+201008896258
4
5// I2C wiring for ESP32: GPIO21=SDA, GPIO22=SCL. VCC->3.3V or 5V per module label, GND->GND.
6#include <Wire.h>
7#include <Adafruit_Sensor.h>
8#include <Adafruit_BMP280.h>
9
10Adafruit_BMP280 bmp; // I2C, default address 0x76
11
12void setup() {
13 Serial.begin(115200);
14 Wire.begin();
15 if (!bmp.begin(0x76)) {
16 Serial.println("BMP280 not found - try address 0x77, or check wiring!");
17 while (1) delay(10);
18 }
19}
20
21void loop() {
22 Serial.print("Temp: "); Serial.print(bmp.readTemperature()); Serial.print(" C ");
23 Serial.print("Pressure: "); Serial.print(bmp.readPressure() / 100.0F); Serial.print(" hPa ");
24 Serial.print("Altitude: "); Serial.print(bmp.readAltitude(1013.25)); Serial.println(" m");
25
26 delay(1000);
27}
📄 File: bmp280_barometric_pressure_and_temperature_sensor_module_-_esp8266.inoESP8266
789 characters
1//ekostra.com
2//electronics store in egypt
3//+201008896258
4
5// I2C wiring for ESP8266: D2(GPIO4)=SDA, D1(GPIO5)=SCL. VCC->3.3V or 5V per module label, GND->GND.
6#include <Wire.h>
7#include <Adafruit_Sensor.h>
8#include <Adafruit_BMP280.h>
9
10Adafruit_BMP280 bmp; // I2C, default address 0x76
11
12void setup() {
13 Serial.begin(115200);
14 Wire.begin();
15 if (!bmp.begin(0x76)) {
16 Serial.println("BMP280 not found - try address 0x77, or check wiring!");
17 while (1) delay(10);
18 }
19}
20
21void loop() {
22 Serial.print("Temp: "); Serial.print(bmp.readTemperature()); Serial.print(" C ");
23 Serial.print("Pressure: "); Serial.print(bmp.readPressure() / 100.0F); Serial.print(" hPa ");
24 Serial.print("Altitude: "); Serial.print(bmp.readAltitude(1013.25)); Serial.println(" m");
25
26 delay(1000);
27}
📄 File: bmp280_barometric_pressure_and_temperature_sensor_module_-_stm32.inoSTM32
796 characters
1//ekostra.com
2//electronics store in egypt
3//+201008896258
4
5// I2C wiring for STM32: PB7=SDA, PB6=SCL (Blue Pill / F103C8). VCC->3.3V or 5V per module label, GND->GND.
6#include <Wire.h>
7#include <Adafruit_Sensor.h>
8#include <Adafruit_BMP280.h>
9
10Adafruit_BMP280 bmp; // I2C, default address 0x76
11
12void setup() {
13 Serial.begin(115200);
14 Wire.begin();
15 if (!bmp.begin(0x76)) {
16 Serial.println("BMP280 not found - try address 0x77, or check wiring!");
17 while (1) delay(10);
18 }
19}
20
21void loop() {
22 Serial.print("Temp: "); Serial.print(bmp.readTemperature()); Serial.print(" C ");
23 Serial.print("Pressure: "); Serial.print(bmp.readPressure() / 100.0F); Serial.print(" hPa ");
24 Serial.print("Altitude: "); Serial.print(bmp.readAltitude(1013.25)); Serial.println(" m");
25
26 delay(1000);
27}
📄 File: bmp280_barometric_pressure_and_temperature_sensor_module_-_raspberry_pi_pico.inoRaspberry Pi Pico
791 characters
1//ekostra.com
2//electronics store in egypt
3//+201008896258
4
5// I2C wiring for Raspberry Pi Pico: GPIO4=SDA, GPIO5=SCL. VCC->3.3V or 5V per module label, GND->GND.
6#include <Wire.h>
7#include <Adafruit_Sensor.h>
8#include <Adafruit_BMP280.h>
9
10Adafruit_BMP280 bmp; // I2C, default address 0x76
11
12void setup() {
13 Serial.begin(115200);
14 Wire.begin();
15 if (!bmp.begin(0x76)) {
16 Serial.println("BMP280 not found - try address 0x77, or check wiring!");
17 while (1) delay(10);
18 }
19}
20
21void loop() {
22 Serial.print("Temp: "); Serial.print(bmp.readTemperature()); Serial.print(" C ");
23 Serial.print("Pressure: "); Serial.print(bmp.readPressure() / 100.0F); Serial.print(" hPa ");
24 Serial.print("Altitude: "); Serial.print(bmp.readAltitude(1013.25)); Serial.println(" m");
25
26 delay(1000);
27}
I2C pressure + temperature + altitude sensor.
Altitude readings are only as accurate as the sea-level pressure value you calibrate against, and that value genuinely changes day to day with weather - for serious altitude accuracy, look up the current local sea-level pressure rather than hardcoding the standard 1013.25 hPa constant. If the sensor doesn't show up on an I2C scan, check the SDO pin's state first, since it determines whether the module answers at 0x76 or 0x77. And shield the sensor from direct airflow and from its own board's heat sources - both pressure and temperature readings are sensitive to being disturbed by nearby drafts or a warm voltage regulator sitting right next to the sensor.