Sensors & Measurement · Study deck
Sensor Interfacing Protocols
Picture a room sensor connected to a small controller.
Physics Phoebe is your guide for this deck.

After studying this chapter
Learning objectives
You will be able to:
- Differentiate between I2C, SPI, and UART communication protocols based on wiring, speed, and topology
- Configure an I2C bus with correct pull-up resistors and address assignments for multi-sensor applications
- Implement SPI communication with proper mode selection for high-speed sensor data transfer
- Evaluate and justify the appropriate protocol for specific sensor requirements and constraints
Major section
Start With the Measurement Story
The sensor may use one pin, two shared wires, a clocked link, or a simple serial line.
- The best choice is the one that keeps the reading and its failure state clear.
- A protocol means shared rules for an exchange.
- GPIO means general purpose input and output pins.
- Silence must not become a valid zero.
Major section
Start With the Measurement Story (continued)
Inter-integrated circuit (I2C) means a short shared wired link between chips.
- Serial Peripheral Interface (SPI) means a clocked wired link with separate data paths.
- Universal asynchronous receiver-transmitter (UART) means a serial link that agrees on timing without a shared clock.
- This runway does not prove cable length, noise margin, or power use.
Major section
In 60 Seconds
Sensor communication protocols (I2C, SPI, UART) are the "languages" sensors and microcontrollers use to exchange data.
- I2C uses just two wires and supports dozens of sensors on one bus, while SPI trades extra wires for much faster data transfer.
- The mathematical gist.: I2C rise time is $t_r=0.847RC$.
Major section
I2C Communication Protocol
I2C (Inter-Integrated Circuit) is a two-wire synchronous protocol perfect for connecting multiple sensors using minimal GPIO pins.
- The controller addresses the sensor for writing, selects a register, issues a repeated START, addresses it for reading, accepts the returned byte, and ends the transfer with NACK and STOP.
Major section
SPI Communication Protocol
SPI (Serial Peripheral Interface) is a synchronous, full-duplex communication protocol using four lines: MISO (Master In Slave Out), MOSI (Master Out Slave In), SCK (Serial Clock), and CS (Chip Select).
- Unlike I2C, SPI supports simultaneous bidirectional data transfer.
- The transaction is easiest to understand when chip selection and clocking are separated from the two data paths.
Major section
UART Serial Communication
Many sensors provide UART as a simpler alternative to I2C/SPI, though at lower data rates.
- UART (Universal Asynchronous Receiver/Transmitter) is the simplest serial protocol, using just two wires for point-to-point communication without a clock signal.
- Unlike I2C and SPI, UART is asynchronous -- both sides must agree on the baud rate (bits per second) beforehand.
- void loop() { while (Serial2.available()) { char c = Serial2.read(); Serial.print(c); // Forward GPS NMEA sentences to USB } }.
Deck summary
Key takeaways
The sensor may use one pin, two shared wires, a clocked link, or a simple serial line.
- Inter-integrated circuit (I2C) means a short shared wired link between chips.
- Sensor communication protocols (I2C, SPI, UART) are the "languages" sensors and microcontrollers use to exchange data.
- I2C (Inter-Integrated Circuit) is a two-wire synchronous protocol perfect for connecting multiple sensors using minimal GPIO pins.
- SPI (Serial Peripheral Interface) is a synchronous, full-duplex communication protocol using four lines: MISO (Master In Slave Out), MOSI (Master Out Slave In), SCK (Serial Clock), and CS (Chip Select).
Retrieval practice
Recall check 1 of 4

Physics Phoebe says: answer from memory, then check your reasoning.
Q1Per Phoebe's Field Notes, why can't a 4.7 kOhm pull-up reliably run an I2C bus at the full 400 pF capacitance ceiling, even at just 100 kHz (Standard mode)?
Show answer
Answer: A
Retrieval practice
Recall check 2 of 4

Physics Phoebe says: answer from memory, then check your reasoning.
Q2In the I2C protocol, what does Wire.endTransmission(false) do differently from Wire.endTransmission(true)?
Show answer
Answer: C Passing false to endTransmission() sends a Repeated START instead of a STOP.
Retrieval practice
Recall check 3 of 4

Physics Phoebe says: answer from memory, then check your reasoning.
Q3Per this chapter's 'When to Choose Each Protocol' guidance, which requirement is listed as a reason to choose SPI over I2C?
Show answer
Answer: A see answers page
Retrieval practice
Recall check 4 of 4

Physics Phoebe says: answer from memory, then check your reasoning.
Q4Per this chapter's UART Key Characteristics, what fundamentally limits UART to connecting exactly two devices, unlike I2C or SPI?
Show answer
Answer: A see answers page
Print reference
Answers 1 of 2
Answer key.
- A
- C · Passing false to endTransmission() sends a Repeated START instead of a STOP.
- A · The chapter's two lists: Choose I2C when multiple sensors are needed, GPIO pins are limited, data rates are moderate (<50 kB/s), and cable runs are moderate; Choose SPI when high-speed transfer (>1 MB/s), large data blocks, real-time (<1 ms) requirements, and plenty of GPIO pins are the priorities.
Print reference
Answers 2 of 2
Answer key.
- A · The chapter's UART Key Characteristics list 'Point-to-point only: Connects exactly two devices (no bus topology)' -- UART has neither I2C's 7-bit addressing nor SPI's per-device CS line, so it has no mechanism to distinguish or share among more than two devices.