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.

BMP280 with ESP32-C3 SuperMini — pressure and altitude

Read temperature, pressure and altitude from a BMP280 on an ESP32-C3 SuperMini, with I2C moved to GPIO5/6 away from the C3’s strapping pins.

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

Community draft — report a mistake

The BMP280 is the cheaper sibling of the BME280: temperature and pressure, no humidity. It is handy for altitude logging or for spotting the pressure drop before a monsoon storm.

The SuperMini wiring is four wires to 3V3, GND, GPIO5 and GPIO6. The sketch puts the sensor in its normal, filtered mode so pressure readings don’t jump around.

Wiring

ESP32-C3 SuperMiniOnly the pins used are shown · 3.3 V logicBMP280 breakout (GY-BMP280)GND3V35 · 56 · 6VCCGNDSCLSDACSB (not connected)SDO (not connected)
Every connection
ESP32-C3 SuperMiniBMP280 breakout (GY-BMP280)WireNotes
3V3VCCred
GNDGNDblack
5SDAblue
6SCLyellow

3.3 V (boards with a regulator: 3.3–5 V) part, 3.3 V board. The common purple 6-pin GY-BMP280-3.3 board has no regulator and no level shifting: power it from 3.3 V only. On a 5 V Uno, use a board with a regulator or a level shifter on SDA/SCL.

Board quirks

  • Leave CSB and SDO unconnected on the common purple 6-pin board: it then answers on I2C, usually at 0x76. The sketch also tries 0x77.
  • GPIO8/9 are the core’s default I2C pins but are strapping pins on the C3 (LED and BOOT button on the SuperMini). Wire.begin(5, 6) avoids them.
  • Altitude is calculated from SEA_LEVEL_HPA. With the standard 1013.25 hPa it can be off by 50 m or more — use today’s sea-level pressure from a local weather report.

Code

bmp280-esp32c3.inoArduino C++Open in PlaygroundOpen in PlaygroundFlash
// BMP280 (temperature + pressure) on an ESP32-C3 SuperMini over I2C.
// VCC → 3V3, GND → GND, SDA → GPIO5, SCL → GPIO6. CSB and SDO left open (I2C, address 0x76).
// GPIO8/9 (the core's default I2C pins) are strapping pins, so Wire gets GPIO5/6 instead.
#include <Wire.h>
#include <Adafruit_BMP280.h>

constexpr int SDA_PIN = 5;
constexpr int SCL_PIN = 6;
constexpr float SEA_LEVEL_HPA = 1013.25;  // set today's sea-level pressure for a better altitude
Adafruit_BMP280 bmp(&Wire);

void setup() {
  Serial.begin(115200);
  delay(1500);  // let the native USB serial port enumerate
  Wire.begin(SDA_PIN, SCL_PIN);
  if (!bmp.begin(0x76) && !bmp.begin(0x77)) {
    Serial.println("No BMP280 at 0x76 or 0x77 — if the board says BME280, its chip ID is 0x60: use the BME280 library");
    while (true) delay(1000);
  }
  bmp.setSampling(Adafruit_BMP280::MODE_NORMAL, Adafruit_BMP280::SAMPLING_X2,
                  Adafruit_BMP280::SAMPLING_X16, Adafruit_BMP280::FILTER_X16,
                  Adafruit_BMP280::STANDBY_MS_500);
  Serial.println("BMP280 ready");
}

void loop() {
  Serial.printf("Temp %.1f °C  Pressure %.1f hPa  Altitude %.0f m\n",
                bmp.readTemperature(), bmp.readPressure() / 100.0F, bmp.readAltitude(SEA_LEVEL_HPA));
  delay(2000);
}

Library: Adafruit BMP280 Library (Adafruit (also install Adafruit Unified Sensor)) — compiled with Adafruit BMP280 Library 3.0.0.

Expected serial output

Serial Monitor · 115200Output
BMP280 ready
Temp 29.8 °C  Pressure 1005.2 hPa  Altitude 67 m
Temp 29.8 °C  Pressure 1005.1 hPa  Altitude 68 m

Common errors

“No BMP280 at 0x76 or 0x77”

If the board is really a BME280 (chip ID 0x60) this library refuses it — use the BME280 guide. Otherwise run an I2C scan.

Pressure is 0 or wildly wrong

Loose SDA/SCL jumper, or a bare sensor on 5 V. Power it from 3V3.

↑↓ to move · Enter to open