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 SuperMini | BME280 breakout | Wire | Notes |
|---|---|---|---|
| 3V3 | VIN / VCC | red | |
| GND | GND | black | |
| 5 | SDA | blue | Set in code with Wire.begin(5, 6). |
| 6 | 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
- 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 (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);
}// 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
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 hPaSensor 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.