workbench series · pamphlet no. 5

Microcontrollers & Code

µC

The brain of the whole series — the chip that reads the sensors and drives the actuators. A few dollars, a USB cable, and some code turns a pile of parts into something that decides. Here's where to start, and what to build toward.

Pick your board

Arduino

The friendly classic — easy, forgiving, huge community. The best first board.

start here

Pi Pico

Cheap, fast, dual-core (RP2040). MicroPython or C; great value.

cheap & capable

ESP32

WiFi and Bluetooth built in — the board for connected projects.

wireless

Raspberry Pi

Not an MCU — a full Linux computer. For cameras, AI, heavy lifting.

a computer

ATtiny

A tiny, cheap chip for a single job once you've outgrown the breadboard.

one job

micro:bit

Sensors, an LED grid, and radio already on board — instant projects.

batteries-included
First light
01

Blink

The first program — an LED on, off, on. Proof the board lives.

need a board · an LED + resistor

do set a pin high, wait, low, wait, repeat.

02

Fade (PWM)

Dim and brighten smoothly — the LED breathes.

need a board · an LED on a PWM pin

do ramp the duty cycle up and down in a loop.

03

Addressable LEDs

Set every pixel on a strip individually.

need a board · a WS2812/NeoPixel strip · a library

do color each pixel; run animations or ambient light.

04

Drive a display

Push text and graphics to a little screen.

need a board · an OLED/LCD · a library

do send it over I²C/SPI; show readings, menus, art.

Talk to the world
05

Read a button

The first input — and a lesson in debouncing.

need a board · a button · a pull resistor

do read the pin, debounce it, toggle something.

06

Sense & respond

Wire in any sensor and act on it — the core move.

need a board · a sensor (see no. 4) · an output

do read it, decide, drive the output.

07

Drive a motor or coil

Command the actuators from issues 2 & 3.

need a board · a driver (H-bridge / transistor + flyback) · the load

do never from the pin — through a driver, on its own supply.

08

Serial monitor

Print what the board sees, to your computer.

need a board · USB · the IDE's monitor

do print values live — the first debug tool you'll reach for.

Sense & decide
09

Reactive lighting

Sound or motion drives the LEDs.

need a board · a mic/PIR · addressable LEDs

do map the sensor to color and brightness.

10

Clock / timer

Keep time, show it, alarm.

need a board · a display · an RTC (for accuracy)

do count seconds; an RTC holds time through power loss.

11

Handheld game

Buttons + a small screen = a tiny console.

need a board · a screen · a few buttons

do code Pong or snake — the loop is the game.

12

Robot brain

Read sensors, run logic, drive motors — autonomous.

need a board · sensors · motors + driver

do sense → decide → move; the whole series in one build.

Go wireless
13

WiFi dashboard

An ESP32 serves a web page you open on your phone.

need an ESP32 · WiFi · a browser

do control outputs and read sensors from across the network.

14

Log to the cloud

Push readings online and get alerts.

need a connected board · a service endpoint

do post each reading; ping your phone above a threshold.

15

Bluetooth control

Drive a robot or read sensors from a phone.

need an ESP32/BLE board · a phone app

do send commands over BLE; stream data back.

16

Board-to-board

Two MCUs swap data over radio, serial, or I²C.

need two boards · a shared link

do one talks, one listens — the seed of a mesh.

Level up
17

Battery & sleep

Deep-sleep modes stretch a coin cell to months.

need a low-power board · sleep code

do wake on a timer or a pin; sleep between.

18

Interrupts & timing

Respond the instant something happens, not when you get around to polling.

need an interrupt-capable pin

do attach an interrupt; let the hardware catch the event.

19

State machines

Structure behavior so it doesn't become spaghetti.

need just a way of thinking

do name your states and the transitions between them.

20

Breadboard to PCB

Once it works, make it permanent.

need perfboard, or a PCB tool + a fab

do solder it down, or lay out a board and order it.

Core moves
Before it bites

workbench series · read, decide, drive, repeat · it does what you wrote, not what you meant