Working Principle
The Bosch BMP280 is a MEMS barometric pressure sensor. A microscopic silicon diaphragm deflects under atmospheric pressure; piezoresistive elements on the diaphragm change resistance proportionally. An on-chip ADC and DSP compensate for temperature and convert the raw reading into calibrated pressure.
Analogy: Picture a tiny drum skin inside a chip. As air pressure changes, the drum skin flexes by nanometres, and strain gauges printed on it report the flex as an electrical signal.
Electrical Characteristics
| Parameter | Value |
|---|---|
| Supply Voltage | 1.71 V – 3.6 V |
| Pressure Range | 300 – 1100 hPa |
| Pressure Accuracy | ± 1 hPa (relative) |
| Temperature Range | −40 to +85 °C |
| Interface | I2C (addr 0x76/0x77) or SPI |
| Current (normal mode) | 2.7 µA typical |
Interfacing & Wiring
Calibration
The BMP280 stores factory calibration coefficients in internal registers. The compensation algorithm (provided in the datasheet) must be applied to raw readings. For altitude estimation, use the barometric formula:
altitude = 44330.0 * (1.0 - pow(pressure / seaLevelPressure, 0.1903))
Set seaLevelPressure from a local weather station for GPS-grade accuracy.
Code Example
/*
* BMP280 Pressure & Altitude Reader — Arduino
* Requires: Adafruit_BMP280 library
* Wiring: I2C — SCL→A5, SDA→A4, VCC→3.3V
*/
#include <Wire.h>
#include <Adafruit_BMP280.h>
Adafruit_BMP280 bmp; /* I2C interface */
void setup() {
Serial.begin(9600);
if (!bmp.begin(0x76)) {
Serial.println("BMP280 not found! Check wiring.");
while (1) delay(10);
}
/* Configure oversampling & filter */
bmp.setSampling(Adafruit_BMP280::MODE_NORMAL,
Adafruit_BMP280::SAMPLING_X2, /* temp */
Adafruit_BMP280::SAMPLING_X16, /* pressure */
Adafruit_BMP280::FILTER_X16,
Adafruit_BMP280::STANDBY_MS_500);
}
void loop() {
float pressure = bmp.readPressure() / 100.0F; /* hPa */
float altitude = bmp.readAltitude(1013.25); /* sea-level ref */
float tempC = bmp.readTemperature();
Serial.print("Pressure: "); Serial.print(pressure); Serial.println(" hPa");
Serial.print("Altitude: "); Serial.print(altitude); Serial.println(" m");
Serial.print("Temp: "); Serial.print(tempC); Serial.println(" °C");
Serial.println();
delay(2000);
}
Real-World Applications
Drone Altitude Hold
Quadcopter flight controllers fuse BMP280 barometric data with accelerometer readings (complementary filter) to achieve stable altitude hold within ±0.5 m — far smoother than GPS alone.
BMP180: The Predecessor
The Bosch BMP180 (successor to BMP085) was the first widely adopted MEMS barometric sensor in the hobbyist community. It uses the same piezoresistive MEMS principle but with older technology:
- Pressure range: 300–1100 hPa (same as BMP280)
- Accuracy: ±1 hPa (same class, but noisier raw readings)
- Interface: I2C only (address 0x77) — no SPI option
- Resolution: 16–19 bit ADC vs BMP280’s 20-bit ADC
- Current: 12 µA at 1 Hz (vs BMP280’s 2.7 µA)
- EOL status: Discontinued by Bosch — BMP280 is the direct replacement
BME280: Adding Humidity
The Bosch BME280 is a drop-in upgrade that adds a humidity sensor to the BMP280’s pressure and temperature channels. Same footprint, same pinout, same I2C/SPI interface:
- Humidity range: 0–100% RH (±3% accuracy)
- Humidity response time: 1 second (63% step)
- Pressure & temperature: Identical specs to BMP280
- Current: 3.6 µA at 1 Hz (weather monitoring mode) — slightly higher than BMP280 due to humidity sensor
- Library: Use Adafruit_BME280 — API is nearly identical to Adafruit_BMP280 with added
readHumidity()
Bosch Family Comparison
| Feature | BMP180 | BMP280 | BME280 |
|---|---|---|---|
| Pressure Range | 300–1100 hPa | 300–1100 hPa | 300–1100 hPa |
| Pressure Accuracy | ±1.0 hPa | ±1.0 hPa | ±1.0 hPa |
| Temperature | ✓ (±1°C) | ✓ (±1°C) | ✓ (±1°C) |
| Humidity | ✗ | ✗ | ✓ (±3% RH) |
| ADC Resolution | 16–19 bit | 20 bit | 20 bit |
| Interface | I2C only | I2C + SPI | I2C + SPI |
| IIR Filter | ✗ | ✓ | ✓ |
| Current (1 Hz) | 12 µA | 2.7 µA | 3.6 µA |
| Status | Discontinued | Active | Active |
BME680 & BME688: Gas Sensing Upgrade
The BME680 adds a MOX gas sensor to the BME280’s temperature, pressure, and humidity measurements, detecting volatile organic compounds (VOCs) and outputting an Indoor Air Quality (IAQ) index. The BME688 extends this with an AI-ready 8-step gas heater profile for pattern recognition of specific gas mixtures (e.g., distinguishing cooking fumes from paint solvents).
| Feature | BME280 | BME680 | BME688 |
|---|---|---|---|
| Temperature | ✓ (±1 °C) | ✓ (±1 °C) | ✓ (±1 °C) |
| Pressure | ✓ (±1 hPa) | ✓ (±1 hPa) | ✓ (±1 hPa) |
| Humidity | ✓ (±3% RH) | ✓ (±3% RH) | ✓ (±3% RH) |
| Gas (VOC/IAQ) | ✗ | ✓ (single heater step) | ✓ (8-step AI heater) |
| AI Gas Scanning | ✗ | ✗ | ✓ (BME AI-Studio) |
| I²C Address | 0x76/0x77 | 0x76/0x77 | 0x76/0x77 |
| Current (1 Hz) | 3.6 µA | ~3.7 mA (gas heater on) | ~3.7 mA (gas heater on) |
| Use Case | Weather | Indoor air quality | Odour classification |
Limitations
- Altitude drift: Pressure varies with weather; without regular sea-level calibration, altitude readings drift metres per hour.
- Slow response: 16× oversampling adds latency (~40 ms) — acceptable for weather stations, too slow for shock detection.
- BMP280 lacks humidity: Upgrade to BME280 (drop-in compatible, same footprint) if humidity is also needed.
- BMP180 discontinued: No longer manufactured; use BMP280 or BME280 for new designs.
- BME680/688 gas heater: The MOX heater draws ~3.7 mA and needs 48-hour burn-in for stable IAQ readings — not suitable for ultra-low-power applications.