Skip to content
SensorBSDv2.6.8

Adafruit BMP280 Library

by Adafruit

This is Adafruit's driver for the BMP280 pressure/temperature sensor — the BME280's simpler sibling without a humidity element. It reads the chip's factory calibration coefficients automatically and exposes `readTemperature()`, `readPressure()`, and `readAltitude(seaLevelHPa)` behind the same API shape as the BME280 library, making it easy to swap between the two chips. The catch that trips people up is confusing this with the BME280 library — they are separate Adafruit libraries with separate headers (`Adafruit_BMP280.h` vs `Adafruit_BME280.h`), and installing the wrong one for your actual chip will fail at `begin()` with a "sensor not found" error even though the wiring is correct.

Installation

Arduino IDE — Library Manager

Sketch → Include Library → Manage Libraries → search Adafruit BMP280 Library

PlatformIO

lib_deps = adafruit/Adafruit BMP280 Library

Supported boards

Arduino UnoESP32STM32 Blue Pill

Examples

Read pressure in hPa

Same API shape as the BME280 library, minus humidity — easy to swap between the two chips.

#include <Wire.h>
#include <Adafruit_BMP280.h>

Adafruit_BMP280 bmp;

void setup() {
  Serial.begin(9600);
  bmp.begin(0x76);
}

void loop() {
  Serial.print("Pressure: ");
  Serial.println(bmp.readPressure() / 100.0F);
  delay(1000);
}