Electronics for Building Things · Lesson 15 · The Microcontroller
The three "languages" that connect your board to sensors and displays.
Most of the cool parts — temperature sensors, OLED screens, real-time clocks — aren't single components but little modules that exchange data with your board over a bus. You don't need to understand the bus deeply; you need to recognize which one a module uses and wire it correctly. Then a library does the talking.
| Bus | Wires | Best for |
|---|---|---|
| UART (Serial) | 2: TX → RX and back |
Two devices, point-to-point. Also how your board talks to your computer (the Serial Monitor). |
| I²C | 2 shared: SDA + SCL |
Many modules on the same two wires, each with an address. The hobby default for sensors. |
| SPI | 4: MOSI, MISO, SCK, CS |
Fast data — displays, SD cards, high-rate sensors. Each device needs its own CS line. |
(Sources: SparkFun I²C, SPI, Serial/UART.)
I²C wins for hobby projects because many modules share just two wires. Every device has an address, so your board can speak to each in turn. Wiring is delightfully repetitive:
SDA on the board → SDA on every module (data)SCL on the board → SCL on every module (clock)GND to each moduleThe beautiful part: once wired, you install a library for the module and call simple
functions like sensor.readTemperature(). The library handles the bit-level conversation. Your
job is correct wiring and matching voltage (3.3V vs 5V — Lesson 4
still applies on these data lines!).
This is the doorway to the sensors in Lesson 18 — many of them are I²C modules you'll connect exactly this way.
See also: Glossary · Signals & buses · Rules of thumb