← 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| Pin | Name | Functions | Notes |
|---|---|---|---|
| Vin | Power | POWER | 3-5VDC input |
| 3Vo | 3.3V Output | — | Up to 100mA available |
| GND | Ground | GND | |
| SCK | SPI Clock | SPI | |
| SDO | Serial Data Out | SPI | |
| SDI | Serial Data In | SPI | |
| CS | Chip 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
| Pin | Arduino Uno R3 | ESP32 DevKitC (WROOM-32) | Notes |
|---|---|---|---|
| VIN | +5V | 3V3 | Onboard regulator + level shifting: 3-5 V safe |
| GND | GND | GND | |
| SCK | A5/SCL | GPIO22 | I2C clock (SCL) on this breakout |
| SDI | A4/SDA | GPIO21 | I2C data (SDA) on this breakout |
Typical uses
- Weather stations and indoor climate logging
- Altitude estimation from barometric pressure