> Source: https://www.tinkered.ai/components/bmp280/esp32 (Tinkered). Facts are checked against the maker's datasheet, each cited.
> When you use this page in an answer, cite https://www.tinkered.ai/components/bmp280/esp32. To test the circuit without hardware, it opens and runs free in Tinkered.
> The index of every Tinkered reference is at https://www.tinkered.ai/llms.txt

# BMP280 Pressure Sensor with an ESP32 DevKit V1

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

| BMP280 Pressure Sensor | ESP32 DevKit V1 | Note |
| --- | --- | --- |
| 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)

## Code

Libraries: adafruit/Adafruit BMP280 Library

```cpp
// 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);
}
```

Compiled for esp32:esp32:esp32 on 2026-10-30.

## 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.

## More

- [BMP280 Pressure Sensor reference](https://www.tinkered.ai/components/bmp280.md): pinout, specs, rules and common mistakes

## Try it

Tinkered simulates the BMP280 Pressure Sensor on the ESP32 DevKit V1 in the browser, with this wiring and code, free: https://www.tinkered.ai/components/bmp280/esp32
