Problem-solving recipes
A step-by-step procedure for every problem type this course teaches — what to do first, what to do next, and how to tell which case you're in.
What are you being asked to do?
What is in front of you right now?
- You're about to buy or plan something → Choose a board for a project, then Check a board listing before buying. Someone has described a whole device in everyday words → Plan a small embedded project from a request.
- You have a number to read or convert → a value with the wrong prefix: Convert between SI prefixes; coloured bands: Read a resistor's colour code; a limit for a chip: Answer a design question from a datasheet.
- You're choosing a part's value → an LED: Size an LED's series resistor; a voltage too high for a pin: Scale a voltage down for an input pin; a delay or a slow filter: Size an RC for a delay or a filter; smoothing PWM into a steady voltage: Size an RC filter for PWM; a coil: Choose and fit a flyback diode; a supply at the wrong voltage: Choose a regulator for a board or module.
- A pin has to turn something on → first Can this pin drive it directly? If not, an NPN switch: Size an NPN base resistor; a DC motor: Wire a DC motor to a board safely.
- You're wiring power or two boards together → a battery or adapter: Power a board from something other than USB; a 3.3 V part and a 5 V part: Connect a 3.3 V part and a 5 V part; a schematic to build: Build a schematic on a breadboard. Before every power-up: Check a circuit before you power it. Something already misbehaves and the firmware is known to work: Find a wiring fault.
- The computer and the board aren't talking → no port, or the wrong one: Find the port your board is on. A normal upload: Upload firmware to a board. An upload or a sketch that fails: When an upload fails, in order.
- Firmware has a raw reading → an ADC code: Turn an ADC reading into a real-world value; a thermistor: Turn a thermistor reading into degrees; an ultrasonic echo: Turn an echo time into a distance. Readings steadily off: Calibrate a sensor with two reference points; readings noisy: Choose an EMA's alpha. Still choosing the sensor: Check a sensor against your board and your project.
- It runs on a battery → one steady current: Estimate a battery's life, best case; a device that sleeps and wakes: Estimate battery life from a duty-cycle table; charged by the sun: Size a solar panel and battery for a small node.
Planning and buying
Check a board listing before buying
Use when: you are about to buy a clone, a compatible board, or any board not sold by its maker
Goal: a listing whose chip, USB, voltage, pinout and schematic you have confirmed, or a reason to walk away
Buying parts wisely
The second check, on the specific listing you're about to pay for.
Plan a small embedded project from a request
Use when: someone describes a device in everyday words and you have to build it and prove it works
Goal: a written plan whose every requirement has a test, and a build order that always leaves a working device
Engineering a project
The capstone procedure, from a spoken request to requirements, tests and a build order.
Reading numbers and documents
Answer a design question from a datasheet
Use when: you need a voltage, current, pin or time limit for a chip before wiring or writing firmware
Goal: a number you can design on: the right table, a guaranteed column, and conditions that match your circuit
Reading a datasheet
The right table, a guaranteed column, and conditions that match your circuit.
Choosing part values
Size an RC filter for PWM
Use when: a PWM pin must give a nearly steady voltage, for a reference, a slow analog input, or a sensor test
Goal: a filter whose ripple is small enough and whose response is fast enough, at the highest PWM frequency available
From PWM to analog
An RC sized for ripple and response time together, at the highest PWM frequency.
Switching loads from a pin
Can this pin drive it directly?
Use when: you want a pin to turn something on, and need to know whether it may connect straight to the pin
Goal: a yes with a calculated current under the pin's limit, or a clear no that sends you to a switch
GPIO is not a power supply
Always first. A clear no sends you to one of the two below.
Wire a DC motor to a board safely
Use when: a board's pin must turn a brushed DC motor on and off, in one direction
Goal: a circuit where the pin only signals, the motor's current comes from its own supply, and no spike or sag reaches the board
Driving motors safely
A logic-level MOSFET, a flyback diode, bulk capacitance and a separate supply.
Power, wiring and faults
Getting firmware onto the board
When an upload fails, in order
Use when: a sketch won't compile, won't upload, or uploads but doesn't work, on an Uno R4 Minima or an ESP32-S3-DevKitC-1
Goal: the one stage that failed, found and fixed, with every earlier stage known to work
When flashing fails
When any stage fails. Works through the stages in order, from compile to running.
From raw readings to real values
Turn a thermistor reading into degrees
Use when: an NTC thermistor sits on top of a fixed resistor in a divider, read by an analog pin
Goal: the temperature in °C, from the ADC code (or millivolts) and the thermistor's datasheet numbers
Temperature and humidity
A divider, then the ADC, then the beta equation.
Batteries and energy
Estimate a battery's life, best case
Use when: a circuit runs from a battery labelled in mAh and you know, or can measure, its average current
Goal: an upper bound on running time in hours, and the battery's energy in Wh
Power, energy, and heat · extended later in this course
One steady average current against a battery's capacity.
Estimate battery life from a duty-cycle table
Use when: a device repeats a cycle of states (sleep, measure, send) and runs from a battery
Goal: an average current and a battery-life estimate, each with its sources and assumptions stated
Power budgets
Extends the recipe above to a device that sleeps, measures and sends. The more complete version.