BMP280 Explained: How It Measures Pressure and Altitude, and How to Wire It to an ESP32
Share
The BMP280 is a digital barometric pressure and temperature sensor from Bosch Sensortec that reports absolute atmospheric pressure across 300–1100 hPa and temperature across −40°C to +85°C, over I²C (default address 0x76, or 0x77 with the SDO pin pulled high) or SPI. It does not measure humidity — that capability belongs to its sibling chip, the BME280. Because atmospheric pressure falls in a predictable, well-modeled way as altitude increases, firmware can convert a BMP280 pressure reading into an estimated altitude using the barometric formula, calibrated against a known sea-level reference — which is why the same small breakout shows up in weather stations, drone and rocket altimeters, and indoor climate monitors.
What does the BMP280 measure?
| Output | Range | Notes |
|---|---|---|
| Pressure | 300–1100 hPa | Resolution down to roughly 0.16 Pa in high-resolution modes |
| Temperature | −40°C to +85°C | Used both as a direct reading and to compensate the pressure measurement internally |
Both outputs come off the same MEMS pressure-sensing element and its companion temperature diode, read over a shared I²C or SPI bus. There's no humidity channel on this chip — if a build needs that, it's a different sensor, not a mode switch.
How can a pressure sensor also measure altitude?
Air gets thinner, and therefore lower-pressure, in a predictable curve as you go up. The BMP280 doesn't measure height directly; firmware plugs its pressure reading into the barometric formula alongside a reference sea-level pressure (either a standard constant like 1013.25 hPa, or a locally calibrated value) and solves for altitude. That's why altimeter accuracy is really weather-reference accuracy: the sensor itself is precise, but the altitude number drifts if the reference pressure it's calibrated against goes stale, which is also why the same chip works for both "how high am I" and "is a storm coming" — both readings come from watching the same pressure trend, just interpreted differently.
How do you wire the BMP280 to an ESP32?
| ESP32 pin | BMP280 pin | Signal |
|---|---|---|
| 3V3 | VCC | power |
| GND | GND | ground |
| GPIO21 | SDA | I²C data |
| GPIO22 | SCL | I²C clock |
Four wires, the same I²C pattern as most breakout sensors. GPIO21/22 are the default I²C pins on the common ESP32-WROOM-32 dev board family; other ESP32 variants (the C3, S2, S3) can map I²C to different GPIOs, so confirm the pinout for the specific board you're holding before wiring. Most breakout modules run their chip logic at 3.3V but carry an onboard regulator that tolerates 3.3–5V in, so the same four wires generally work on an Arduino Uno's 5V rail too — check the regulator on the specific module you have rather than assuming.
BMP280 vs BME280 — what's the difference?
They're pin-compatible and code-compatible cousins from the same Bosch family, and the confusion between them is common enough to be worth stating plainly: the BMP280 measures pressure and temperature only. The BME280 adds a third channel — relative humidity — on the same footprint and largely the same I²C register map. If a build only needs pressure-derived altitude or basic temperature logging, the BMP280 is the simpler and usually cheaper part; reach for the BME280 only when humidity is actually part of the spec.
Watch it built live: a real ESP32 + BMP280 project
Rather than describe a generic build, we typed one real sentence into Compoden's AI build assistant on the storefront and let it do the part-picking, pricing, and explaining — unscripted, screenshotted as it happened:
"I want to build a weather station project using a BMP280 and an ESP32"

It picked four in-stock parts — an ESP32-C3 Super Mini Development Board for the WiFi-capable microcontroller, the BMP280 module, a power adapter, and connecting wire — and explained the reasoning for each. On the sensor itself, it wrote: "The BMP280 Barometric Pressure & Temperature Sensor Module is what actually measures the weather. This module contains a sensor that can detect both the air pressure and the temperature. It communicates using a standard called I2C… It needs a pull-up resistor, which is a component that helps ensure the I2C communication works correctly." It also flagged a real mismatch unprompted: the ESP32-C3 board it picked charges over USB-C, while the cheapest in-stock power adapter option is micro-USB, so the two need an adapter cable to actually connect.
Watch the firmware get generated
We then asked Compoden's build companion, Soldr, to write the actual firmware for the same project — real I²C init code, real sensor object setup, targeting a generic ESP32 dev board:

The generated sketch pulls in Adafruit_BMP280.h (with Adafruit_Sensor.h as its dependency), sets the I²C address to 0x76, and opens with wiring comments matching the table above — SDA to GPIO21, SCL to GPIO22, plus 3V3 and GND. Soldr's own summary of the file: "It will read temperature, pressure, and estimated altitude, printing the values to the serial monitor at 115200 baud." The code is editable in place in the Firmware tab and can be compiled to multiple board targets, including several ESP32 variants and the Arduino UNO R4 family.
So what is the BMP280 actually good for?
Anything that needs to know ambient air pressure or a rough altitude: DIY weather stations, altimeters for drones and model rockets, indoor climate monitoring, GPS-assisted altitude correction, and HVAC or greenhouse controllers that need to react to pressure trends. It earns the default slot in most of these builds for the same reason the MPU-6050 does for motion sensing — it's inexpensive, needs only four wires on I²C, and has mature, well-documented libraries.
Get everything in this build
The exact four parts Soldr picked above, at today's live price and stock — each links straight to checkout, or add the whole tray in one click.
| Part | Price | |
|---|---|---|
| ESP32-C3 Super Mini Development Board | ₹290 | Add to cart → |
| BMP280 Barometric Pressure & Temperature Sensor Module | ₹40 | Add to cart → |
| 5V 2A Micro-USB Power Adapter | ₹140 | Add to cart → |
| 23 AWG Multi-Strand Breadboard Wire | ₹10 | Add to cart → |
| Total | ₹480 | Add all 4 to cart → |
Prices and stock verified live at the time this was written; Compoden's storefront always reflects the current price at checkout.
Built and Backed by Compoden
Every part above ships from Compoden's own India stock, tested for compatibility before it's carded together — not sourced individually and hoped to work. Delivery in 3–7 days across India, with COD and UPI available at checkout. If a part in this build doesn't perform as described, Compoden's support team will help you troubleshoot or replace it.
FAQ
What I2C address does the BMP280 use?
0x76 by default on most breakout modules. Pulling the SDO pin high moves it to 0x77, which lets two BMP280 sensors share one I2C bus without conflicting.
Does the BMP280 measure humidity?
No. The BMP280 reports pressure and temperature only. Its sibling chip, the BME280, adds a humidity channel on the same footprint and largely the same register map.
How accurate is BMP280-based altitude, really?
The pressure reading itself is precise, but the altitude number it's converted into depends on the sea-level reference pressure used in the calculation. Without a locally calibrated reference, expect the altitude estimate to drift as weather systems change the actual sea-level pressure.
Can the BMP280 run on an Arduino Uno's 5V rail?
Most breakout boards can, because they carry an onboard regulator even though the bare chip's logic is 3.3V — but this varies by module, so check the specific breakout's regulator before assuming it's 5V-safe.