BMP280 Pressure Sensor with an ESP32 DevKit V1
Bosch's barometric pressure and temperature sensor, 300 to 1100 hPa at ±0.12 hPa relative accuracy, over I2C or SPI.

The GY-BMP280 module has no regulator, so on the ESP32 DevKit V1 it must sit on 3V3, never VIN. SDA goes to GPIO21 and SCL to GPIO22, and the sketch asks address 0x76 because the module ties SDO low.
Wiring the BMP280 Pressure Sensor to the ESP32 DevKit V1
Pin by pin.
| BMP280 Pressure Sensor | ESP32 DevKit V1 |
|---|---|
| VCC | 3V3 |
| GND | GND |
| SCL | GPIO22 (D22) |
| SDA | GPIO21 (D21) |
What to know on the ESP32 DevKit V1
- The chip's supply is 1.71 V to 3.6 V with 4.25 V absolute maximum. The DevKit's VIN gives about 5 V on USB and would destroy it; 3V3 is the only correct pin.Bosch BMP280 datasheet rev 1.26, pp. 7, 9
- SPI works directly on the ESP32 with no level converter: SCK on GPIO18, SDO to MISO on GPIO19, SDA to MOSI on GPIO23, CSB on any free output. Avoid GPIO34 to GPIO39 for CSB, they are input-only.Espressif ESP32 Series Datasheet v5.3, p. 36; Espressif ESP32 Series Datasheet v5.3, p. 61
- Mount it away from the DevKit when you need temperature: the ESP32 draws about 240 mA while transmitting, and its own heat reaches a sensor sitting on the board.Espressif ESP32 Series Datasheet v5.3, p. 52
BMP280 Pressure Sensor code for the ESP32 DevKit V1
Compiled for esp32:esp32:esp32 on 2026-10-30.
// BMP280 Pressure Sensor on ESP32 DevKit V1: wiring and a free simulation at https://www.tinkered.ai/components/bmp280/esp32
#include <Wire.h>
#include <Adafruit_BMP280.h>
Adafruit_BMP280 bmp; // I2C
void setup() {
Serial.begin(115200);
if (!bmp.begin(0x76)) { // 0x77 with SDO on 3.3 V
Serial.print("BMP280 not found, chip id 0x");
Serial.println(bmp.sensorID(), HEX); // 0x60 = a BME280, 0xFF/0x00 = nothing at that address
while (1) delay(10);
}
// normal mode, ×2 temperature, ×16 pressure, filter ×16, 500 ms standby
bmp.setSampling(Adafruit_BMP280::MODE_NORMAL,
Adafruit_BMP280::SAMPLING_X2,
Adafruit_BMP280::SAMPLING_X16,
Adafruit_BMP280::FILTER_X16,
Adafruit_BMP280::STANDBY_MS_500);
}
void loop() {
Serial.print("Temperature: ");
Serial.print(bmp.readTemperature());
Serial.println(" C");
Serial.print("Pressure: ");
Serial.print(bmp.readPressure() / 100.0);
Serial.println(" hPa");
Serial.print("Altitude: ");
Serial.print(bmp.readAltitude(1013.25)); // the local sea-level pressure, hPa
Serial.println(" m");
delay(1000);
}
BMP280 Pressure Sensor on the ESP32 DevKit V1: questions
Why does bmp.begin() fail on the ESP32?
Adafruit_BMP280's bare begin() asks 0x77, and the GY-BMP280 answers at 0x76 with SDO low (Bosch datasheet, p. 28). The page's sketch calls begin(0x76).
Can I power the BMP280 from the ESP32's VIN pin?
No. VIN is about 5 V on USB, beyond the chip's 4.25 V absolute maximum (Bosch datasheet, p. 9). Use 3V3.
Keep going
This guide as plain Markdown. /components/bmp280/esp32.md