Troubleshooting a circuit

How to find a fault step by step on a breadboard and on a printed circuit board: power, GND, looking, measuring voltage and continuity, splitting in half.

A multimeter with its probes, a magnifying glass over a breadboard with an LED and a resistor, a board with one badly soldered joint, a checklist and a pocket torch

Hunting for a fault like a detective

The circuit doesn’t work. The worst thing you can do is change things at random: move a wire, turn an LED round, swap the Arduino, then something else. If the circuit works after that, you don’t know what the fault was, and if it doesn’t, you may have made a new one.

So we hunt for a fault like detectives: we watch, work things out and check one thing at a time, always in the same order. That way the fault is always found, and found faster.

Switch the power off before every change

  • Move wires and components only while the power is off.
  • If something gets hot, smokes or smells burnt, switch the power off at once and call the instructor.
  • Measure resistance and continuity only without power.

The order of checks

Seven checks in order: 1. describe the problem; 2. power; 3. GND; 4. look at the circuit; 5. measure; 6. split in half; 7. program
  1. Describe the problem. What should the circuit do, and what does it do? Has it ever worked? If it has, what changed last? The answer to that question often shows the fault straight away.
  2. Power. Is the ON LED on the Arduino lit? Measure the voltage on the breadboard’s power rails with a multimeter, not just on the Arduino. On a long breadboard the rails are sometimes split in the middle (see Split power rails). A battery can show a good voltage while nothing draws from it and drop when the circuit is switched on, so measure it while the circuit runs.
  3. GND. If the circuit has two power supplies or two boards, are their GNDs connected? Without a common GND, signals have nothing to be measured against.
  4. Look at the circuit. Switch the power off, take the schematic, and for every connection on it find the same connection in the circuit with your finger. Check which way round the LEDs, diodes, electrolytic capacitors and chips are (a notch or a dot marks pin 1), the resistor values, and that each wire is in the right pin and not the one next to it.
  5. Measure. With the power on, measure the voltages along the circuit (see Measuring voltage along a circuit). With the power off, check the continuity of wires and joints: the multimeter beeps when two points are connected.
  6. Split in half. When a circuit has many parts, don’t check them one after another; check whether the first half works (see Split in half).
  7. Program. Try each part with the simplest program that uses it: an LED with a program that only switches that pin on, a button with a program that only prints its state. If that program works, the fault is in your program, not in the circuit.

While you hunt:

  • Change one thing at a time, and check the circuit after each change.
  • Write down what you have checked, so you don’t check the same thing twice.
  • Swap a suspect part for a good one: an LED for another LED, a wire for another wire, a module for one you know works.
  • Explain the circuit to someone, out loud, connection by connection. You often spot the fault just while you are explaining.

Faults on a breadboard

On a breadboard, faults are most often in the connections, not in the components:

  • a wire has broken inside its insulation but looks fine from outside,
  • a wire or a leg is in the next row, or in the next pin of the Arduino,
  • both legs of a component are in the same row, so the row shorts them,
  • a leg is bent under the component and isn’t in its hole,
  • a hole that someone pushed a thick leg into doesn’t grip well any more.

Pictures of the most common mistakes and the procedure for a breadboard are on Breadboard.

Measuring voltage along a circuit

Two schematics of the same circuit: a 5 V battery, a 220 Ω resistor and a red LED, with test points A, B, C and D. When the circuit works, the voltage at A is 5.0 V, at B and C 2.0 V and at D 0.0 V, and the LED is lit (right). When the wire between B and C is broken, the voltage at A and B is 5.0 V and at C and D 0.0 V, and the LED is dark (wrong)

Put the multimeter’s black probe on GND and touch the points of the circuit one by one with the red probe, from the supply’s plus towards GND. The voltage may drop only across components, never along a wire:

  • Left, the working circuit: at A there is 5 V. The resistor takes 3 V, so at B there is 2 V. The wire from B to C doesn’t change the voltage, so C is at 2 V too. The LED takes the remaining 2 V, so D is at 0 V. A current of (5 V − 2 V) / 220 Ω ≈ 14 mA flows round the circuit.
  • Right, a broken wire: no current flows, so the resistor takes nothing and B is at the full 5 V. C is at 0 V. The voltage jumps from 5 V to 0 V between B and C, and there is only a wire between them. That is where the break is.

The rule: where the voltage jumps between two points joined only by a wire, there is a break. And if two points that should be different have the same voltage, there is a short circuit between them.

Split in half

A chain of eight blocks joined by arrows. The first measurement, between blocks 4 and 5, is right; the second, between 6 and 7, shows a fault; the third, between 5 and 6, is right. Red bars under the blocks show the suspect part getting smaller: blocks 5 to 8, then 5 and 6, then only block 6, which is coloured red

Many circuits are a chain of parts that the signal goes through in turn: power, switch, Arduino, transistor, relay, motor. Instead of checking part after part, measure the signal in the middle of the chain:

  1. Between blocks 4 and 5 the signal is right. So the fault is in blocks 5 to 8.
  2. Measure in the middle of what is left, between 6 and 7: the signal is wrong. The fault is in 5 or 6.
  3. Between 5 and 6 the signal is right, so the fault is in block 6.

Eight blocks need only three measurements, and sixteen need four. The procedure for a breadboard works the same way: split a circuit that doesn’t work into two parts and check each one separately.

Example: a motor on a button

A schematic split into eight numbered blocks: 1. push button S1 on pin D2; 2. the Arduino; 3. a 1 kΩ resistor R1 from pin D9; 4. transistor Q1, a 2N2222; 5. relay K1 with flyback diode D1, whose contact connects the 6 V battery B1; 6. a 1 A fuse F1; 7. switch S2; 8. motor M1. Test points A to G lie between the blocks

While you hold button S1, motor M1 should turn. S1 connects pin D2 to GND (D2 is set as INPUT_PULLUP), and the program then sets pin D9 HIGH. The current through resistor R1 switches transistor Q1 on, Q1 switches on the coil of relay K1, and the relay’s contact connects battery B1 to the motor through fuse F1 and switch S2. The circuit has the same eight blocks as the chain above, with test points A to G between them.

The motor doesn’t turn. The first three checks of The order of checks have passed: the ON LED is lit, B1 has 6 V, and GND is shared. The multimeter’s black probe stays on GND, and someone holds S1 down while you measure. Before you measure, write down what the voltage at each point should be:

PointBetween blocksShould beMeasured
A1 and 20 V
B2 and 35 V
C3 and 40.7 V
D4 and 50.1 V0.1 V (1st measurement)
E5 and 66 V6 V (3rd measurement)
F6 and 76 V0 V (2nd measurement)
G7 and 86 V
  1. The middle of the chain is point D, between blocks 4 and 5. The collector of transistor Q1 is at 0.1 V, which is right when Q1 is on. So the button, the Arduino with its program, R1 and Q1 work, and the fault is in blocks 5 to 8.
  2. The middle of what is left is point F, between blocks 6 and 7. It should be at 6 V, but the multimeter shows 0 V. The fault is in block 5 or 6.
  3. Point E, between blocks 5 and 6, is at 6 V, as it should be. The relay’s contact works, so the fault is in block 6, fuse F1.

Switch the power off, take F1 out and check it for continuity: the multimeter doesn’t beep, so the fuse has blown. Before you put in a new one, find out why it blew: was the motor stalled, or did its wires touch somewhere? The new fuse must have the same rating, 1 A: never a bigger one, and certainly not a piece of wire.

You didn’t need to measure points A, B, C and G. Had you measured in order from point A, only the sixth measurement would have found the fault.

Faults on a printed circuit board

A hand-made board seen from below, with copper tracks and soldered joints, and six faults marked with numbers: 1. a solder bridge between two neighbouring joints; 2. a grey, grainy cold joint; 3. a lead that wasn't soldered; 4. a cracked track; 5. lifted copper with a scorched patch under it; 6. a drop of solder between two tracks

On a soldered board, faults are not as easy to see as on a breadboard. The numbers are the same as in the picture:

  1. A bridge of solder between two neighbouring joints (a short circuit).
  2. A cold joint: grey and grainy. It often works and then stops, especially when the board shakes.
  3. An unsoldered lead: easy to miss when you solder many leads in a row.
  4. A cracked track: a thin crack that you see only under a magnifier or when you hold the board up to the light.
  5. Lifted copper: from heating for too long. The track can be broken even when it looks whole.
  6. A drop of solder between tracks: it doesn’t join anything yet, but it can move and make a short circuit.

What a good and a bad joint look like and how to fix the faults is on Soldering.

A new board, step by step

  1. Inspect it under a magnifier and in good light, joint by joint. Check which way round the diodes, electrolytic capacitors and chips are, and the resistor values.
  2. Before you switch it on for the first time, measure the resistance between the supply’s plus and GND. It mustn’t be close to 0 Ω. (If the board has capacitors, the reading rises at first while the multimeter charges them.)
  3. Switch it on the first time from a bench power supply with a low current limit, or without the chips in their sockets.
  4. Watch whether anything gets hot or smells. If it does, switch off at once.
  5. Measure the voltage on the power pins of every chip.
  6. Compare it with a working board, if you have one: measure the same points on both. Where they differ, there is the fault.
  7. Resolder suspect joints: add a little flux and heat them until the solder flows.

When a circuit works and then doesn’t

The hardest fault to find is one that comes and goes. The most common causes:

  • a cold joint or a loose wire (tap the board gently with a plastic stick while the circuit runs and watch when it fails),
  • a motor or servo that pulls the voltage down when it starts and resets the Arduino (see Powering a project),
  • an input pin without a pull-up or pull-down resistor, which is floating (see Buttons and switches),
  • a part that overheats and stops working only after a while,
  • static electricity that has damaged a chip (see Static electricity).

In the Arduino workshop

This part is for the Arduino workshop (ages 12 and up).

  • Print what the program sees. Serial.println() in the loop shows the state of a pin, the value of a sensor, or which part of the program is running. You read the output in the Serial Monitor.
  • Compare the pin numbers in the program and in the circuit. A common mistake is an LED on pin 7 and pin 6 in the program.
  • Check pinMode(). A pin that isn’t set as OUTPUT gives too little current for an LED to light fully, and a button without INPUT_PULLUP and without an external resistor reads random values.
  • Compile and upload errors are described on Arduino IDE.

What did we learn?

  • We hunt for a fault in order: describe the problem, power, GND, look at the circuit, measure, split in half, program.
  • We change one thing at a time and write down what we have checked.
  • Voltage drops only across components. Where the voltage jumps along a wire, there is a break.
  • Splitting in half finds a fault among eight parts with three measurements.
  • Before a new board is switched on for the first time, we inspect it and measure the resistance between plus and GND.

Quick quiz

1. The circuit worked yesterday and doesn't work today. What is the first question you ask?
What has changed since yesterday? Did someone move wires, change the program, the battery or the power supply? The answer often shows the fault straight away.
2. An LED doesn't light. You measure 5 V on both sides of the resistor in front of it. What does that mean?
No current flows through the resistor, because no voltage is lost across it. The circuit is broken somewhere after the resistor: in the wire to the LED, in the LED (maybe it is the wrong way round) or in the wire to GND.
3. Why don't we change several things at once?
If the circuit starts working, we don’t know which change fixed the fault. If it doesn’t, we may have made a new fault.
4. A chain has 16 parts. How many measurements does it take to find the faulty part by splitting in half?
Four: 16, then 8, then 4, then 2, then 1 part.
5. What do you measure on a new board before you switch it on for the first time, and why?
The resistance between the supply’s plus and GND. If it is close to 0 Ω, there is a short circuit on the board, for example a solder bridge, so I don’t switch it on until I find it.
6. The circuit works, but fails when you tap the board gently. What is the most likely cause?
A cold joint, a cracked track or a loose wire. I tap different parts of the board until I find the spot where it fails, and resolder that joint.