LIBRARYSPI vs I2C vs UART.
Pick the bus by the job. UART for a simple stream, I2C when pins are short and speed does not matter, SPI when you need speed. A side-by-side comparison.
Pick the bus by the job. Reach for UART for a simple point-to-point stream, I2C when you are short on pins and speed does not matter, and SPI when you need speed and can spare a pin per device. Most boards run more than one of them at once.
The trade-off at a glance
| Bus | Wires | Clock | Devices | Speed |
|---|---|---|---|---|
| UART | 2 (TX, RX) | none (async) | 2, point to point | low to moderate |
| I2C | 2 (SDA, SCL) | shared | many, by address | moderate |
| SPI | 3 plus 1 per device | shared | one per chip-select | high |
Read the table as three trade-offs. UART costs the fewest ideas but only joins two devices. I2C adds as many devices as you like on the same two wires, at a lower speed. SPI buys the highest speed and full-duplex data, and pays a chip-select pin for every peripheral.
Which bus does a part use?
You rarely choose a sensor's bus; the part chooses for you. Its datasheet's first page states the interface, and that decides how you wire it and how many pins it costs. Read that line before you commit a design to a part.
A single One Thousand Drones board often carries all three at once: USB serial back to the host, SPI to a fast converter, and I2C to a slow housekeeping sensor, each chosen for what it connects to.
Checkpoint
Quick check
One Thousand Drones engineering team · verified 2026-07