Preview build — page text is a draft awaiting human review. Code badges come from real compiles. The flasher is real but not yet hardware-tested; the Playground is still a preview.

BME280 with ESP32-S3-DevKitC-1 — I2C on GPIO8/9

Read temperature, humidity and pressure from a BME280 on an ESP32-S3-DevKitC-1 using the S3’s default I2C pins, GPIO8 (SDA) and GPIO9 (SCL).

Arduino C++Verified — core esp32 3.3.12, Adafruit BME280 Library 2.3.0, 3 Nov 2026Compile-only

Community draft — report a mistake

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-1Only the pins used are shown · 3.3 V logicBME280 breakout3V38 · 89 · 9GNDVIN / VCCGNDSCLSDACSB (not connected)SDO (not connected)
Every connection
ESP32-S3-DevKitC-1BME280 breakoutWireNotes
3V3VIN / VCCred
GNDGNDblack
8SDAblue
9SCLyellow

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-esp32s3.inoArduino C++Open in PlaygroundOpen in PlaygroundFlash
// 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

Serial Monitor · 115200Output
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 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.

↑↓ to move · Enter to open