Sphere
Log in Join

ESP32-S3 I2C scanner will not find BME280 at 0x76 — SDO and pullups

## The board

ESP32-S3-DevKitC-1, Arduino-ESP32 core 2.0.17, a BME280 breakout on the default I2C pins (GPIO4 SDA, GPIO5 SCL), plus an SSD1306 OLED on the same bus. Standard scanner loop:

Wire.begin(4, 5);
Serial.begin(115200);
for (byte a = 1; a < 127; a++) {
Wire.beginTransmission(a);
if (Wire.endTransmission() == 0) {
Serial.printf("found 0x%02X\n", a);
}
}

Output:

Scanning...
found 0x3C
done

Only the OLED. No 0x76, no 0x77.

## What I checked first

I checked wiring three times, swapped the two jumper wires, and tried a different ESP32 entirely. I also printed the return value from endTransmission for the BME280 address rather than only the happy path:

Wire.beginTransmission(0x76);
byte e = Wire.endTransmission();
Serial.println(e); // 2: NACK on address

Error 2 means the device did not acknowledge its address. Firmware was not the problem, which was annoying because firmware is what I know how to fix.

## The first cause: SDO was floating

BME280 uses SDO to pick the address: tie it low for 0x76, high for 0x77. The breakout I bought expects you to solder a bridge to select it, and I had not. A floating SDO can read either way depending on humidity and phase of the moon, so probing both addresses once is not enough. I bridged SDO to GND and got 0x76 to respond, but it was still flaky across power cycles.

## The second cause: no pullups

I2C needs external pullups. The OLED module had its own 4.7k resistors, which is exactly why it worked on the same bus while the bare BME280 did not. The ESP32 internal pullups are around 30-50k, far too weak at 400kHz with any real bus capacitance. I dropped the bus to 100kHz and added actual 4.7k pullups to 3.3V:

Wire.begin(4, 5);
Wire.setClock(100000);
if (!bme.begin(0x76)) {
Serial.println("BME280 init failed");
}

Stable after that, and I could put the clock back to 400kHz once the resistors were in.

## What went wrong in my head

I spent two evenings convinced the ESP32-S3 had a broken I2C peripheral because "the bus clearly works for the OLED." That inference was the mistake. One device carrying its own pullups tells you nothing about the rest of the bus. Once I looked with a cheap logic analyser, SDA rose so slowly it barely crossed the threshold before the next clock, which made the NACK make sense in hindsight. The breakout was also one of those 5V-tolerant variants with a level shifter that did not love 3.3V on the SDO side; swapping it for a plain 3.3V board removed the last of the flakiness, and the scanner now reports 0x76 on every cold boot.

Anyway, check SDO, then check pullups, then check clock speed, in that order. If your scanner finds one device and not another on the same lines, suspect the device that has no resistors on its module rather than blaming the microcontroller. It is almost never the microcontroller.