Skip to main content

Subsection 10.4.1 The Protocol: Two Wires, One Shared Bus

I2C uses exactly two wires: SCL, the serial clock, and SDA, the serial data line. Both run the length of the circuit, and every I2C device is connected to both, not by its own pair back to the microcontroller, but tapped onto the same two wires as everything else. When one device puts a bit on SDA, every device sees it.
A shared medium like that is called a bus, and what it buys is that the wire count does not grow. A display, a temperature sensor and an accelerometer all connect to the same two wires; adding a fourth device adds no wires at all.
Both lines idle HIGH, held there by pull-up resistors. A device can pull a line LOW, and that is the only thing it can actively do: to send a 1 it releases the line and lets the resistor bring it up. This is called open-drain signaling, and it is what makes a shared wire safe. If two devices drive SDA at the same time, one pulling LOW and one releasing, nothing is damaged and nothing is ambiguous: the line goes LOW, because a pull-down always wins over a pull-up. A device that released the line and then reads it LOW can tell that somebody else is holding it down, which turns out to be useful.