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 SuperMini | BMP280 breakout (GY-BMP280) | Wire | Notes |
|---|---|---|---|
| 3V3 | VCC | red | |
| GND | GND | black | |
| 5 | SDA | blue | |
| 6 | SCL | yellow |
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 (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);
}// 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
BMP280 ready
Temp 29.8 °C Pressure 1005.2 hPa Altitude 67 m
Temp 29.8 °C Pressure 1005.1 hPa Altitude 68 mBMP280 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.