0x3C OLED SSD1306Tap a part to see what it does.
Tap the parts to see what each one does. A teaching simulation, not a circuit simulator.
Build it step by step
0 of 4 doneWire the bus
SDA to GPIO21 and SCL to GPIO22 for every module.
Upload
Open the serial monitor at 115200.
Add and remove
Add a module, press EN, see the new address.
Try a clash
Two modules with the same address: note that only one line appears.
How do you build an i²C address explorer?
A scanner sketch lists every I²C device it finds, names the common ones, and shows the result on an OLED: the first thing to run when a module will not respond. You need ESP32 DevKit V1, SSD1306 OLED Display, BME280 Environmental Sensor and Breadboard 830 Tie Points. It takes 4 steps and about 30 minutes.
- Level
- Intermediate
- Time
- About 30 min
- Parts
- 4
Parts list
- Development BoardsBuyESP32 DevKit V1 × 1
- DisplaysBuy
- SensorsBuy
- PrototypingBuy
Tick what you already own. It saves to My Garage, so “Build with what I have” knows.
Wiring
| From | To | Why |
|---|---|---|
| All SDA | GPIO21 | Data |
| All SCL | GPIO22 | Clock |
| All VCC / GND | 3V3 / GND | Power |
Code
Library: Adafruit SSD1306 (the scan works without the OLED too). Press EN to rescan after changing modules.
Runs on a virtual ESP32 Dev Module in your browser, with sliders for the sensors. Happy with it? Verify and upload to your real board from the same page (Chrome or Edge on a computer).
#include <Wire.h>
#include <Adafruit_SSD1306.h>
Adafruit_SSD1306 oled(128, 64, &Wire, -1);
const char* nameOf(byte a) {
switch (a) {
case 0x3C: case 0x3D: return "OLED SSD1306";
case 0x76: case 0x77: return "BME/BMP280";
case 0x68: return "MPU6050 / DS3231";
case 0x40: return "INA219";
case 0x27: case 0x3F: return "LCD backpack";
case 0x48: return "ADS1115";
default: return "unknown";
}
}
void setup() {
Serial.begin(115200); Wire.begin(21, 22);
bool oledOk = oled.begin(SSD1306_SWITCHCAPVCC, 0x3C);
if (oledOk) { oled.clearDisplay(); oled.setTextColor(SSD1306_WHITE); oled.setCursor(0, 0); }
int found = 0;
for (byte a = 1; a < 127; a++) {
Wire.beginTransmission(a);
if (Wire.endTransmission() == 0) {
found++;
Serial.printf("0x%02X %s\n", a, nameOf(a));
if (oledOk) oled.printf("0x%02X %s\n", a, nameOf(a));
}
}
Serial.printf("%d device(s)\n", found);
if (oledOk) { oled.printf("%d device(s)", found); oled.display(); }
}
void loop() {}What the serial monitor should show
Open the serial monitor at the baud rate in the code. This is what our simulator prints for a virtual ESP32 Dev Module with its sensors at their default values. Your numbers will follow your real readings, but the format should match.
0x3C OLED SSD1306 0x76 BME/BMP280 2 device(s)
Test checklist
What you should see at each check. If a reading is far off, stop and use the troubleshooting list.
| Check | Expected |
|---|---|
| OLED and BME280 | Lists 0x3C and 0x76 |
| Unplug the BME280, press EN | Only 0x3C |
| Swap SDA and SCL | 0 devices, nothing breaks |
If it does not work
0 devices
Swapped lines, missing ground, or a 5 V-only module.
Every address found
SDA or SCL shorted to ground.
Unknown address
Search the module's chip name; many have an address pin.
Still stuck? Find the fault step by step with your multimeter →
Common questions
What parts do I need for the i²C address explorer?
ESP32 DevKit V1, SSD1306 OLED Display, BME280 Environmental Sensor and Breadboard 830 Tie Points.
How long does the i²C address explorer take to build?
About 30 minutes for a intermediate maker, in 4 steps.
How do I know the i²C address explorer works?
OLED and BME280: Lists 0x3C and 0x76. Unplug the BME280, press EN: Only 0x3C. Swap SDA and SCL: 0 devices, nothing breaks.
0 devices: what should I check?
Swapped lines, missing ground, or a 5 V-only module.
Every address found: what should I check?
SDA or SCL shorted to ground.
Unknown address: what should I check?
Search the module's chip name; many have an address pin.
