Sensor Interfaces Compared
Analog Output
Simple and fast — connect directly to an ADC. Low latency but susceptible to noise.
PWM Output
Duty cycle encodes measurement — good for distance sensors.
I2C
Two-wire bus, multiple devices. Pro: 2 wires for many devices. Con: slower for high-rate data.
SPI
Four-wire bus, very fast, full-duplex. Pro: highest speed. Con: more wires.