What Are UART, SPI and I2C? (Serial Communication Protocols)
UART, SPI and I2C are the three most common serial communication protocols that microchips and modules use to exchange data. Reading a sensor or printing text to a display is usually done with one of these.
What Is Serial Communication?
In serial communication, data is sent one bit at a time, in sequence, over a single line (serial vs. parallel). These protocols set the rules for how and how fast the bits are sent.
UART
UART is asynchronous: there's no shared clock line; the two sides talk at a pre-agreed speed (baud rate). It uses two lines: TX (transmit) and RX (receive). It's ideal for simple point-to-point communication between two devices.
SPI
SPI is synchronous and fast; it runs on a clock line (SCK). It usually uses 4 lines: MOSI, MISO, SCK and chip select (CS). It's preferred for high-speed devices like displays and memory.
I2C
I2C uses only 2 lines (SDA data, SCL clock) and gives each device an address. That way many devices can share the same two lines, saving pins.
Comparison
| Protocol | Lines | Speed | Devices |
|---|---|---|---|
| UART | 2 (TX/RX) | Low-medium | 2 (one-to-one) |
| SPI | 4 | High | Many (with CS) |
| I2C | 2 (SDA/SCL) | Medium | Many (addressed) |
Which One to Choose?
UART for a simple two-device link; SPI for high speed; I2C to connect many devices with few pins. In all three, both sides must run at the same logic level (e.g. 3.3 V).
Common Mistakes
- Forgetting the common ground: if GND isn't shared between two devices, no protocol works.
- Baud mismatch in UART: if the two sides aren't at the same speed, the data comes through garbled.
- Missing pull-ups in I2C: the SDA and SCL lines need pull-up resistors, or communication can't start.
Frequently Asked Questions
Which is the fastest?+
How do I connect many sensors with the fewest pins?+
Search related parts in our catalog
Find the right part by comparing price, stock and distributors.