When I was learning embedded systems, the three protocols that confused me most were UART, SPI, and I2C. They all send data between chips, but they work very differently. Once I understood each one clearly, choosing between them became easy.
Let me explain each one in plain terms.
UART: the simplest one
UART stands for Universal Asynchronous Receiver/Transmitter. It uses two wires: TX (transmit) and RX (receive). Your microcontroller's TX connects to the other device's RX, and vice versa.
The "asynchronous" part means there is no shared clock signal. Both devices must agree on the speed (called baud rate) in advance. Common speeds are 9600, 115200, and 921600 bits per second.
Data is sent one byte at a time. Each byte is wrapped in a start bit and a stop bit so the receiver knows where each byte begins and ends.
UART is great for connecting to modules that have their own processor — GPS modules, Bluetooth modules, WiFi modules. It is also what you use when you want to print debug messages to your computer's serial monitor.
The limitation: UART is point-to-point. One device to one device. You cannot connect three devices on the same UART bus.
I2C: two wires, many devices
I2C (pronounced "I squared C") uses two wires: SDA (data) and SCL (clock). The clever design is that many devices can share the same two wires. Each device has a unique 7-bit address.
When the microcontroller wants to talk to a specific sensor, it sends that sensor's address first. Only the sensor with that address responds. All other devices on the bus ignore the message.
Typical speeds are 100 kHz (standard mode) and 400 kHz (fast mode). This is slower than SPI but fast enough for most sensors.
I2C requires pull-up resistors on both lines — usually 4.7kΩ to 10kΩ. Without them, the bus does not work. This is a common mistake for beginners.
I2C is the go-to protocol for sensors: temperature, humidity, pressure, accelerometers, magnetometers, OLED displays. If you are connecting multiple sensors to one microcontroller, I2C is usually the right choice.
SPI: fast and full-duplex
SPI (Serial Peripheral Interface) uses four wires: MOSI (master sends data), MISO (master receives data), SCK (clock), and CS (chip select, one per device).
The key difference from I2C: SPI can send and receive data at the same time (full-duplex). And it is much faster — up to 50 MHz or more, compared to I2C's 400 kHz.
To talk to a specific device, the microcontroller pulls that device's CS line low. When done, it pulls CS high again. This is how multiple SPI devices share the same MOSI, MISO, and SCK lines.
SPI is used for things that need speed or large data transfers: SD cards, SPI displays, flash memory chips, high-speed ADCs and DACs.
The downside: you need one CS pin per device. If you have 10 SPI devices, you need 10 CS pins plus the 3 shared lines.
Quick comparison
UART: 2 wires, medium speed, point-to-point only. Use for modules with their own processor.
I2C: 2 wires, medium speed, up to 127 devices on one bus. Use for sensors and small displays.
SPI: 4+ wires, very fast, one CS pin per device. Use for SD cards, displays, and high-speed data.
A real-world example
On a recent IoT project, I used all three on the same board. I2C for the temperature and humidity sensors (multiple sensors, two wires). SPI for the display and the SD card (need speed). UART for the cellular modem (it has its own processor and uses AT commands).
Knowing which protocol to use for each component is a skill that comes with experience. But these guidelines will get you started.




