Arduino – How to connect multiple i2c-interface devices into a single pin A4 (SDA) and A5 (SCL) on Arduino

arduinoi2c

I want to add a real time clock module into my little project. I want to display both time and date on my existing i2c 2×16 LCD module.

Both i2c-interface real time clock module and 2×16 LCD module use the same pin A4 (SDA) and A5 (SCL) on Arduino Uno. After hours of searching on the net the i2c bus can actually take many serial devices. This is possible because each device has its own unique address.

My question is how to physically wire the two i2c-interface devices into a single A4 and A5? Thanks.

Best Answer

Some folks are having a hard time visualizing things connected together, so here's a picture:

(Serving suggestion)

schematic

simulate this circuit – Schematic created using CircuitLab I2C is a bus, so like-named signals are connected together. The addressing scheme allows the microcontroller to select which device it's talking to. On the Arduino, the 10kΩ pull-up resistors go to VDD (Usually +5V or +3.3V).