GY-BMP280 pressure + temperature with ESP32
Supply 3.3 V
Bus I2C
I2C address
0x76 / 0x77
Measures temperature, pressure
Pins and ESP32 wiring
| Pin | Role | ESP32 pin | Notes |
|---|---|---|---|
| VCC | Power | 3V3 | |
| GND | Ground | GND | |
| SCL | I2C clock (SCL) | D22 | |
| SDA | I2C data (SDA) | D21 | |
| CSB | Not wired to the ESP32 | — | Chip select. Leave unconnected (pulled HIGH on the board) to use I2C |
| SDO | Not wired to the ESP32 | — | Address select: LOW = 0x76, HIGH = 0x77. Most boards default to 0x76 |
Suggested wiring for the 30-pin ESP32 DevKit, avoiding flash, input-only and strapping pins. BoardPilot checks it for you as you wire.
Good to know
- It measures temperature and pressure only, no humidity. If your code asks for humidity, you need a BME280. (Bosch BMP280 datasheet, Product description)
- The address is 0x76 with SDO to GND and 0x77 with SDO high. Most GY boards answer at 0x76, while the Adafruit library looks at 0x77 unless you pass 0x76. (Bosch BMP280 datasheet, I²C interface, slave address)
Check it is the real chip
Read register 0xD0: a genuine part answers 0x58. BoardPilot does this automatically in “Debug a problem”.
Starter code (Arduino)
#include <Wire.h>
void setup() {
Serial.begin(115200);
Wire.begin(21, 22); // SDA = GPIO 21, SCL = GPIO 22
Wire.beginTransmission(0x76);
bool found = Wire.endTransmission() == 0;
Serial.println(found ? "GY-BMP280 pressure + temperature found at 0x76" : "Not found: check power, GND and SDA/SCL");
}
void loop() {}
Sources
- Bosch BMP280 datasheet, Register 0xD0 id (reads 0x58)
- Bosch BMP280 datasheet, I2C interface: address 0x76 when SDO = GND, 0x77 when SDO = VDDIO
Try it in 3D in BoardPilot
GY-BMP280 pressure + temperature on other boards: wiring and code
Arduino Mega 2560 R3 Arduino Nano Arduino Uno R3 WeAct Black Pill STM32F411CE ESP32-C3-DevKitM-1 ESP32-S3-DevKitC-1 Nordic nRF52840 DK NUCLEO-F401RE Raspberry Pi Pico 2 Raspberry Pi Pico W Raspberry Pi Pico Teensy 4.1
Learn the basics
Lesson: UART, I2C and SPI I2C I2C address SDA and SCL Pull-up resistor
Related parts
ADS1015 12-bit ADCADS1115 16-bit ADCADXL375 high-g accelerometer (±200 g)AHT10 temperature + humidityAHT20 + BMP280 combo moduleAHT20 temperature + humidity
Part data: CC BY 4.0, free to reuse with credit to BoardPilot.