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-C3 SuperMini — I2C on GPIO5/6

Wire a BME280 to an ESP32-C3 SuperMini on GPIO5 (SDA) and GPIO6 (SCL) — not the strapping pins 8/9 — and read temperature, humidity and pressure.

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 gives temperature, humidity and air pressure from one tiny I2C board, which suits a SuperMini weather or room node.

On the C3 the wiring itself is ordinary; the catch is the pins. The core’s default I2C pins collide with the SuperMini’s LED and BOOT button, so this guide uses GPIO5 for SDA and GPIO6 for SCL and tells Wire so in setup(). Power the sensor from 3V3.

Wiring

ESP32-C3 SuperMiniOnly the pins used are shown · 3.3 V logicBME280 breakoutGND3V35 · 56 · 6VIN / VCCGNDSCLSDACSB (not connected)SDO (not connected)
Every connection
ESP32-C3 SuperMiniBME280 breakoutWireNotes
3V3VIN / VCCred
GNDGNDblack
5SDAblueSet in code with Wire.begin(5, 6).
6SCLyellow

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

  • The Arduino core’s default I2C pins for a generic C3 are GPIO8 (SDA) and GPIO9 (SCL). On the SuperMini GPIO8 drives the blue LED and GPIO9 is the BOOT button — both strapping pins — so the sketch calls Wire.begin(5, 6).
  • GPIO5/6 keep GPIO0–4 free for analog: those are the C3’s only reliable ADC pins.
  • Many “BME280” boards sold in India carry a BMP280 (no humidity). The sketch prints the chip ID: 0x60 is a real BME280, 0x58 is a BMP280.
  • The C3 runs warm with Wi-Fi on. Keep the sensor a few centimetres away on wires, or temperature reads 1–2 °C high.

Code

bme280-esp32c3.inoArduino C++Open in PlaygroundOpen in PlaygroundFlash
// BME280 (temperature, humidity, pressure) on an ESP32-C3 SuperMini over I2C.
// VIN → 3V3, GND → GND, SDA → GPIO5, SCL → GPIO6.
// The core's default I2C pins (GPIO8/9) are strapping pins on the C3 and GPIO8 drives the
// SuperMini's LED, so the sketch passes its own pins to Wire.begin().
#include <Wire.h>
#include <Adafruit_BME280.h>

constexpr int SDA_PIN = 5;
constexpr int SCL_PIN = 6;
Adafruit_BME280 bme;

void setup() {
  Serial.begin(115200);
  delay(1500);  // let the native USB serial port enumerate
  Wire.begin(SDA_PIN, SCL_PIN);
  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 29.4 °C  Humidity 61.2 %  Pressure 1004.8 hPa
Temp 29.4 °C  Humidity 61.0 %  Pressure 1004.8 hPa

Common errors

“No BME280 at 0x76 or 0x77”

Check SDA/SCL are not swapped and that the sketch’s pins match your wires. Full fix.

Humidity reads 0 % or NaN

The chip ID says 0x58 — it is a BMP280. Use the BMP280 guide, or buy a board marked BME280.

↑↓ to move · Enter to open