ESP32 BASICS · LESSON 16
Reading Sensors and Displays over SPI
The four SPI wires, chip-select logic, and why SPI is the choice for fast displays.
SPI trades I2C's two shared wires for four dedicated ones, plus a separate chip-select line per device. That extra wiring buys considerably more speed, which is why fast displays and SD cards almost always use SPI instead of I2C.
| Signal | Meaning |
|---|---|
| SCK | Clock, sets the pace of every bit transferred |
| MOSI | Master Out, Slave In — data leaving the ESP32 |
| MISO | Master In, Slave Out — data returning to the ESP32 |
| CS / SS | Chip Select — one per device, picks who's "listening" |
Why chip-select matters
Because SCK, MOSI, and MISO are shared by every device on the bus, only one chip-select line should be pulled active (usually LOW) at a time — otherwise two devices try to answer at once and the data collides.
KEY IDEA
Adding a second SPI device to a project usually means adding one more chip-select pin, not four more wires.