The BME280 measures temperature, humidity and pressure on one I2C board. On the S3-DevKitC-1 it is a four-wire job using the core’s default I2C pins: SDA on GPIO8 and SCL on GPIO9.
The sketch passes those pins to Wire.begin() explicitly, so moving the sensor to other pins later is a one-line change.
Wiring
| ESP32-S3-DevKitC-1 | BME280 breakout | Wire | Notes |
|---|---|---|---|
| 3V3 | VIN / VCC | red | |
| GND | GND | black | |
| 8 | SDA | blue | |
| 9 | SCL | yellow |
3.3 V (VIN boards with a regulator: 3.3–5 V) part, 3.3 V board. The chip itself is 3.3 V-only. Many purple 6-pin boards have no regulator — feed them 3.3 V only. Boards with a VIN pin and regulator accept 5 V, but keep SDA/SCL at the board's logic level.
Board quirks
- On the S3, GPIO8/9 are the core’s default I2C pins and are safe to use — unlike the ESP32-C3, where 8/9 are strapping pins. The S3 can route I2C to almost any GPIO, so
Wire.begin(sda, scl)works with other free pins too. - Don’t use GPIO21/22 from old ESP32 tutorials: GPIO22 doesn’t exist on the S3, and GPIO21 is just a normal GPIO here.
- Many “BME280” boards are BMP280s. The sketch prints the chip ID: 0x60 = BME280, 0x58 = BMP280 (no humidity).
Code
// BME280 on an ESP32-S3-DevKitC-1 over I2C — the S3 core's default Wire pins.
// VIN → 3V3, GND → GND, SDA → GPIO8, SCL → GPIO9. Serial on the "UART" USB-C port.
#include <Wire.h>
#include <Adafruit_BME280.h>
Adafruit_BME280 bme;
void setup() {
Serial.begin(115200);
Wire.begin(8, 9); // SDA, SCL — the defaults, written out so they're easy to change
if (!bme.begin(0x76, &Wire) && !bme.begin(0x77, &Wire)) {
Serial.println("No BME280 at 0x76 or 0x77 — check SDA/SCL and power");
while (true) delay(1000);
}
uint32_t id = bme.sensorID();
Serial.printf("Sensor ID 0x%02lX %s\n", (unsigned long)id,
id == 0x60 ? "(BME280)" : id == 0x58 ? "(BMP280 — no humidity!)" : "(unknown)");
}
void loop() {
Serial.printf("Temp %.1f °C Humidity %.1f %% Pressure %.1f hPa\n",
bme.readTemperature(), bme.readHumidity(), bme.readPressure() / 100.0F);
delay(2000);
}// BME280 on an ESP32-S3-DevKitC-1 over I2C — the S3 core's default Wire pins.
// VIN → 3V3, GND → GND, SDA → GPIO8, SCL → GPIO9. Serial on the "UART" USB-C port.
#include <Wire.h>
#include <Adafruit_BME280.h>
Adafruit_BME280 bme;
void setup() {
Serial.begin(115200);
Wire.begin(8, 9); // SDA, SCL — the defaults, written out so they're easy to change
if (!bme.begin(0x76, &Wire) && !bme.begin(0x77, &Wire)) {
Serial.println("No BME280 at 0x76 or 0x77 — check SDA/SCL and power");
while (true) delay(1000);
}
uint32_t id = bme.sensorID();
Serial.printf("Sensor ID 0x%02lX %s\n", (unsigned long)id,
id == 0x60 ? "(BME280)" : id == 0x58 ? "(BMP280 — no humidity!)" : "(unknown)");
}
void loop() {
Serial.printf("Temp %.1f °C Humidity %.1f %% Pressure %.1f hPa\n",
bme.readTemperature(), bme.readHumidity(), bme.readPressure() / 100.0F);
delay(2000);
}Library: Adafruit BME280 Library (Adafruit (also install Adafruit Unified Sensor)) — compiled with Adafruit BME280 Library 2.3.0.
Expected serial output
Sensor ID 0x60 (BME280)
Temp 28.9 °C Humidity 62.7 % Pressure 1006.3 hPa
Temp 28.9 °C Humidity 62.6 % Pressure 1006.3 hPaSensor ID 0x60 (BME280) Temp 28.9 °C Humidity 62.7 % Pressure 1006.3 hPa Temp 28.9 °C Humidity 62.6 % Pressure 1006.3 hPa
Common errors
“No BME280 at 0x76 or 0x77”
Check SDA/SCL and power. Full fix.
Serial Monitor empty
Use the UART USB-C port, or enable USB CDC On Boot for the USB port.