BME280 with an ESP32 DevKit V1
A Bosch BME280 breakout that measures barometric pressure, temperature, and relative humidity on one small board, talking to a microcontroller over I2C or SPI.

On an ESP32 DevKit V1 the BME280 module runs from 3V3 with SDA on GPIO21 and SCL on GPIO22, and CSB tied to 3V3 to keep it in I2C mode. The chip itself is a 1.71 V to 3.6 V part, so the 3.3 V rail and the ESP32's 3.3 V logic suit it directly.
Wiring the BME280 to the ESP32 DevKit V1
Pin by pin.
| BME280 | ESP32 DevKit V1 |
|---|---|
| VCC | 3V3 |
| GND | GND |
| SCL | GPIO22 (D22) |
| SDA | GPIO21 (D21) |
| CSB | 3V3 |
What to know on the ESP32 DevKit V1
- Mount the sensor away from the DevKit. The ESP32 draws about 240 mA while transmitting 802.11b at full power, and that heat on the board raises the temperature the BME280 reports and lowers its humidity.Espressif ESP32 Series Datasheet v5.3, p. 52; Bosch BME280 datasheet rev 1.24, p. 12
- For a battery weather node that deep-sleeps between readings, the BME280 costs 3.6 µA at one reading per second and 0.1 µA asleep, so the ESP32 dominates the power budget.Bosch BME280 datasheet rev 1.24, p. 2
- Its default 0x76 leaves 0x77 free, so a BME680 (0x77 by default) can share GPIO21 and GPIO22 with it without any address change.Bosch BME280 datasheet rev 1.24, p. 32
BME280 code for the ESP32 DevKit V1
Compiled for esp32:esp32:esp32 on 2026-10-30.
// BME280 on ESP32 DevKit V1: wiring and a free simulation at https://www.tinkered.ai/components/bme280/esp32
#include <Wire.h>
#include <Adafruit_BME280.h>
Adafruit_BME280 bme;
void setup() {
Serial.begin(9600);
if (!bme.begin(0x76)) { // 0x77 if SDO is tied HIGH
Serial.println("BME280 not found");
while (1) delay(10);
}
}
void loop() {
Serial.print(bme.readTemperature()); Serial.print(" C ");
Serial.print(bme.readHumidity()); Serial.print(" % ");
Serial.print(bme.readPressure() / 100.0); Serial.println(" hPa");
delay(1000);
}
BME280 on the ESP32 DevKit V1: questions
Can I use a BME280 with an ESP32 over SPI instead?
Yes, the chip speaks SPI up to 10 MHz (Bosch datasheet, p. 2). On the ESP32 use the VSPI pins GPIO18, GPIO19 and GPIO23 with any GPIO as chip select; the page shows the I2C wiring.
Why does my BME280 read too warm on an ESP32?
Self-heating from the board. The ESP32 draws around 240 mA when transmitting (ESP32 datasheet, p. 52); keep the sensor on wires a few centimetres from the DevKit and read in forced mode.
Keep going
This guide as plain Markdown. /components/bme280/esp32.md