← All parts

Adafruit BME280 Temp/Humidity/Pressure

AdafruitArduino, Feather M0, Raspberry Pi

The Adafruit BME280 is an environmental sensor for temperature, humidity, and pressure with support for I2C and SPI interfaces.

In stock

Specifications

4
Operating Voltage
3-5VDC (Vin) / 3.3V (3Vo)
Logic Level
3-5V
Dimensions
STEMMA QT form factor
Connectivity
I2C, SPI

Pinout

7
PinNameFunctionsNotes
VinPower
POWER
3-5VDC input
3Vo3.3V Output
Up to 100mA available
GNDGround
GND
SCKSPI Clock
SPI
SDOSerial Data Out
SPI
SDISerial Data In
SPI
CSChip Select
SPI

Interactive pinout

Highlight:
Arduino, Feather M0, Raspberry Pi

Click a pin to copy its name · tap a tag above to spotlight a bus.

Starter code

Community starter examples — minimal, unofficial, and provided to get you wiring fast. Verify against the manufacturer datasheet before relying on them.

Arduino (C++)

Arduino library: Adafruit BME280 Library (+ Adafruit Unified Sensor)

arduino
// BME280 temp/humidity/pressure over I2C — community starter example
#include <Wire.h>
#include <Adafruit_BME280.h>

Adafruit_BME280 bme;  // I2C

void setup() {
  Serial.begin(115200);
  Wire.begin();                 // Uno: A4=SDA A5=SCL | ESP32: GPIO21/GPIO22
  if (!bme.begin(0x77)) {       // many generic clones use 0x76
    Serial.println("BME280 not found");
    while (1) delay(10);
  }
}

void loop() {
  Serial.print("T="); Serial.print(bme.readTemperature()); Serial.print(" C  ");
  Serial.print("RH="); Serial.print(bme.readHumidity()); Serial.print(" %  ");
  Serial.print("P="); Serial.print(bme.readPressure() / 100.0F); Serial.println(" hPa");
  delay(1000);
}

MicroPython

MicroPython library: bme280 (robert-hh/BME280)

python
# BME280 over I2C (ESP32) — community starter example
# lib: robert-hh/BME280 (copy bme280.py onto the board)
from machine import Pin, I2C
import bme280, time

i2c = I2C(0, scl=Pin(22), sda=Pin(21))   # ESP32 default I2C pins
sensor = bme280.BME280(i2c=i2c)          # auto-detects 0x76 / 0x77

while True:
    print(sensor.values)                  # (temperature, pressure, humidity)
    time.sleep(1)

Wiring

PinArduino Uno R3ESP32 DevKitC (WROOM-32)Notes
VIN+5V3V3Onboard regulator + level shifting: 3-5 V safe
GNDGNDGND
SCKA5/SCLGPIO22I2C clock (SCL) on this breakout
SDIA4/SDAGPIO21I2C data (SDA) on this breakout

Typical uses

  • Weather stations and indoor climate logging
  • Altitude estimation from barometric pressure

Related parts

6