The I2C bus
In the previous chapter, we briefly touched on the I2C bus (or Inter-Integrated Circuit bus), which is a way to connect multiple devices together using just two wires. I2C was invented in the early 1980s by Philips as a way to link computer peripherals together using a common protocol. You can think of I2C as a kind of early form of USB.
I2C typically operates at relatively low speeds of up to 100kbit/s, compared to much faster interfaces such as Ethernet, which typically operates at up to 1Gbit/s, or USB, which can operate at up to 480Mbit/s. However, this is fast enough to connect basic sensors, display devices, or other peripherals such as real-time clocks—in fact; there are faster versions of the protocol that some devices will support.
Just 2 wires
I2C is a bi-directional serial communication protocol that operates over two wires:
- The Serial Data Line (SDA) wire transmits the data to and from the master device. Referring back to the GPIO reference in Chapter 2, Connecting...