I2C Explained: SDA, SCL, Addresses and Pull-ups
Updated
How the two-wire I2C bus connects displays and sensors, why addresses matter, and the default pins on popular boards.
Two wires, many devices
I2C uses SDA (data) and SCL (clock) plus a shared ground. Several devices can share the same two wires because each one answers only to its own 7-bit address, such as 0x3C for most SSD1306 OLEDs or 0x27 for many LCD backpacks.
Default pins
- Arduino Uno: SDA = A4, SCL = A5 (fixed).
- ESP32 DevKit: SDA = GPIO21, SCL = GPIO22 by default; other output-capable pins can be used with Wire.begin(SDA, SCL).
- ESP32-C3 Super Mini (Arduino core): SDA = GPIO8, SCL = GPIO9 by default.
- Raspberry Pi Pico: I2C0 or I2C1 on specific pin pairs, e.g. GP4/GP5 for I2C0. SDA and SCL must belong to the same controller.
Pull-up resistors
I2C lines are open-drain: devices only pull them LOW, and resistors pull them HIGH. Most breakout boards already include pull-ups. If those pull-ups go to 5 V, the bus is at 5 V, which matters for 3.3 V boards.
Debugging checklist
- Run an I2C scanner sketch and confirm the address.
- Check SDA and SCL aren't swapped.
- Make sure the module shares ground with the board.
- If two devices report the same address, change one using its address jumper or pin.