The SPI Protocol
A faster alternative to I2C that trades extra wires for higher speed and simpler, dedicated per-device connections.
SPI (serial peripheral interface) is the other common multi-device communication protocol, and it makes the opposite tradeoff from I2C: more wires, but significantly higher speed and simpler timing. It's the usual choice for devices that need to move data fast — SD cards, displays, and higher-speed sensors commonly use SPI.
A full SPI connection uses four lines: SCK (serial clock, set by the master), MOSI (master out, slave in — data flowing from the microcontroller to the device), MISO (master in, slave out — data flowing back), and CS or SS (chip select / slave select) — a dedicated wire per device used to tell that specific device "the next data on the bus is for you."
Unlike I2C's shared address scheme, SPI selects a device by physically pulling its individual CS line LOW rather than sending an address over the shared data lines. This means SCK, MOSI, and MISO can be shared across every device on the bus, but each device needs its own separate CS wire running back to the microcontroller — so SPI uses more total pins as you add more devices, exactly the tradeoff I2C was designed to avoid.
Because there's no address-matching step and the clock can run much faster, SPI transfers data considerably quicker than I2C, which is why it's preferred whenever raw speed matters more than pin count — reading a fast sensor at high sample rates, or refreshing a display many times per second.