Troubleshooting · Microcontroller projects
When the board does nothing: debugging microcontroller hardware
A microcontroller project that does not work is a very different problem from a program that does not work, and the difference is that software fails the same way every time while hardware fails intermittently, differently, and often only under load. This is the order to check things in, why that order and not another, and what each symptom actually narrows the fault down to.
The single most expensive habit in hobby electronics is debugging from the top down — reading the code first, because the code is the part you wrote and the part you can see. Hardware faults are far more common in a first year, far quicker to check, and they produce symptoms that look exactly like software bugs. A sensor returning nonsense reads as a parsing error. A board that restarts mid-loop reads as a crash. Both are usually wiring.
So the order below is deliberately bottom-up: power, then ground, then connection, then signal, then code. Each step is quick, each one either eliminates a whole class of fault or finds it, and none of them requires equipment beyond a multimeter. Working through it takes about ten minutes and it is faster than reading your own code once.
The other reason for a fixed order is that hardware faults compound. A loose ground makes a sensor read badly *and* makes the serial output unreliable *and* makes the board brown out under load, which presents as three separate mysteries. Checking ground early collapses all three into one fix.
Step 1: Is there power, at the pin, under load?
Measure the supply voltage at the board itself, not at the power supply, and measure it while the project is doing the thing that fails. A supply that reads 5 V idle and 4.1 V when a motor starts is the fault, and no amount of code will fix it. USB ports and cheap adaptors both sag badly.
You will know it worked when: A voltage you have measured rather than assumed.
Step 2: Is everything on the same ground?
Every device in the project must share a ground connection with the microcontroller — a separately powered sensor, motor driver or LED strip that does not have its ground tied to the board’s ground will behave randomly or not at all. This is the single commonest fault in hobby projects and it is invisible in a photograph of the circuit.
You will know it worked when: One continuous ground, confirmed with a continuity test.
Step 3: Is the connection actually a connection?
Breadboard contacts wear out, jumper wires fail inside the insulation at the crimp, and the centre rails of many breadboards are split in the middle without any marking. Test continuity end to end rather than looking at it. If a circuit works when you press on a wire, that wire is the fault.
You will know it worked when: Continuity proven on every line that matters.
Step 4: Is the pin the pin you think it is?
Board pin numbering and chip GPIO numbering are frequently different, silkscreen is often wrong on inexpensive clones, and several pins on most boards are unusable for general input or output because they are tied to boot behaviour or to internal flash. Check the pinout diagram for the exact board variant.
You will know it worked when: A pin choice verified against a pinout, not against memory.
Step 5: Is the signal what you expect?
A floating input reads randomly, which is what an unconnected pin with no pull-up or pull-down does. A logic level mismatch — a 5 V sensor on a 3.3 V board — reads as intermittent nonsense at best. Confirm the idle state of every input before blaming the reading.
You will know it worked when: Inputs that are defined when nothing is happening.
Step 6: Now read the code
And read it in that state: with the hardware proven, a bug in the code is now genuinely likely to be a bug in the code. Add output at the point where behaviour diverges rather than at the top.
You will know it worked when: Debugging one layer instead of two at once.
- The board restarts whenever a motor or servo moves — A brownout. The motor draws more current than the supply can deliver, the rail dips below the microcontroller’s minimum, and the chip resets. The fix is a separate supply for the motor with a common ground, plus a decoupling capacitor across the supply. Never power a motor from the board’s regulator.
- Serial output is garbage characters — Almost always a baud rate mismatch between the sketch and the monitor. If the baud rate is right, suspect the board resetting mid-transmission, or a device sharing the serial pins with the USB connection — many boards use the same hardware serial port for both.
- Nothing at all, and the board does not appear as a port — In order: a charge-only USB cable with no data lines, a missing driver for the board’s USB-to-serial chip, or a board that needs a button held during upload. Try a different cable before anything else — it is the most common cause and the least suspected.
- An I2C device is not found by a scan — Missing pull-up resistors on the data and clock lines, an address collision between two devices, or swapped data and clock. Run an address scanner sketch before writing any device code at all; it converts a mystery into a number.
- Readings drift or jump with no input change — A floating pin, a shared ground carrying motor current, or a long unshielded sensor lead acting as an aerial. Analogue inputs in particular pick up everything. Averaging in software hides this rather than fixing it.
- It works on the bench and fails in the enclosure — Heat, a trapped wire, or a metal case coupling to something. It is also when a wireless board stops connecting, because most small boards have a printed antenna that a metal enclosure detunes completely.
- It worked yesterday and does not today — A breadboard connection that has relaxed, or a battery that is now flat enough to sag under load but not flat enough to look flat. Measure under load.
- A multimeter with a continuity beeper — The single highest-value purchase in the hobby, and an inexpensive one is entirely adequate. Continuity testing turns "is that wire connected" from a guess into a beep, and the voltage range turns brownouts from a mystery into a number.
- A second, known-good everything — A spare board, a spare cable, a spare breadboard. Substitution is the fastest diagnostic technique there is, and it is unavailable if there is only one of each thing on the bench.
- A logic analyser, eventually — Not a first purchase, but inexpensive ones are genuinely cheap and they make serial protocols visible. The moment a project has two devices talking to each other, guessing stops working and this is what replaces it.
Questions this guide answers
Listed so you can tell at a glance whether this is the page you wanted. HobbyHQ keeps one guide per question family rather than a page per phrasing.
- my arduino is not responding what do I check
- why does my esp32 keep restarting
- why is my serial monitor showing garbage
- why does my servo make the board reset
- how do I debug a breadboard circuit that does nothing
- why does my sensor read random values
- do I need a pull up resistor
Part of Microcontroller projects. Last reviewed 2026-08-20.