LEDs, Resistors and Breadboards
Wire an external LED on a breadboard, calculate the current-limiting resistor with Ohm's law, and avoid the mistakes that burn out LEDs and pins.
Welcome back!
Step 1 of 12Learn
The LED that lasted half a second
Leo pushes an LED straight into pin 13 and GND, uploads Blink, and gets one bright flash followed by darkness. The LED is dead, and he was lucky the pin survived.
An LED (light-emitting diode) is not like a light bulb. Once the voltage across it reaches its forward voltage (about 2 V for red, about 3 V for blue or white), its resistance collapses and current shoots up. With nothing to limit it, an LED on a 5 V pin tries to draw far more current than either the LED (typically rated around 20 mA) or the pin can survive.
The fix is one cheap part: a resistor in series with the LED. It drops the extra voltage and sets the current. Two more facts about LEDs matter:
- Polarity. Current flows only from the anode (+, longer leg) to the cathode (−, shorter leg, next to the flat edge on the plastic rim). Backward, the LED simply stays dark.
- Order doesn't matter in a series loop. The resistor can go before or after the LED; the same current flows through both.
On the Uno, pin 13 has a built-in LED with its own resistor on the board, but an external LED plugged into pin 13 does not get that protection.
Step 2 of 12Learn
Choosing the resistor with Ohm's law
Ohm's law says V = I × R: voltage equals current times resistance. To size the resistor, work out the voltage it has to drop and divide by the current you want:
R = (V_supply − V_LED) / I
Example: a red LED (2.0 V) on a 5 V pin, aiming for 15 mA (0.015 A):
R = (5 − 2.0) / 0.015 = 3.0 / 0.015 = 200 Ω
Resistors come in standard values, so you pick the nearest value above the result: 220 Ω is the classic choice. That gives (5 − 2) / 220 ≈ 13.6 mA, which is bright and safe.
A blue LED (3.2 V) with the same 220 Ω resistor gets (5 − 3.2) / 220 ≈ 8 mA: a little dimmer but fine. That's why 220 Ω to 330 Ω works for almost every common LED on a 5 V Arduino.
Common mistakes: forgetting to convert milliamps to amps (15 mA is 0.015 A, not 15), and using the full 5 V instead of subtracting the LED's forward voltage. Going higher in resistance is always safe; the LED just gets dimmer. Going lower is how parts get damaged.
Step 3 of 12Diagram
The current path in an LED circuit
Trace the loop from the output pin back to ground. Every part is in series, so the same current flows through all of them.
Tap a shape with to see more.
- Pin 9 HIGH (5 V)
The pin supplies current, ideally 20 mA or less.
- Resistor
Drops the extra voltage and sets the current. Its position, before or after the LED, does not matter.
- LED anode (long leg)
Current must enter here. The anode is the longer leg.
- LED cathode (flat side)
Current leaves through the shorter leg, next to the flat edge of the LED rim.
- GND (0 V)
The loop closes back at the board's ground.
Step 4 of 12Try the calculator
LED resistor calculator
Enter your supply voltage, the LED's forward voltage and the current you want.
- Minimum resistor
- 200 Ω
- Current with a 220 Ω resistor
- 13.6 mA
- Power in the resistor at target current
- 45 mW
Step 5 of 12Practice · Work it out
A green LED with a forward voltage of 2.2 V runs from a 5 V pin. What resistance (in ohms) gives exactly 14 mA?
Step 6 of 12Learn
How a breadboard is wired inside
A solderless breadboard lets you build circuits by pushing wires and parts into holes. Hidden metal clips connect certain holes together:
- In the main area, each row of five holes (a–e, or f–j) is connected. The two halves are separated by a central gap, made to fit chips.
- The long rails along the edges, marked red (+) and blue (−), run the length of the board. Use them to distribute 5 V and GND.
- On some long breadboards the rails are split in the middle. If half your circuit is dead, check for a gap in the red or blue line.
To wire the LED: run a jumper from the Uno's GND to the blue rail. Put the LED across two rows with the long leg in one row. Connect a 220 Ω resistor from the long-leg row to an empty row, and a jumper from that row to pin 9. Finally, connect the short-leg row to the blue rail.
The classic beginner mistake is placing a part with both legs in the same row. The row connects them together, so current bypasses the part completely. Every two-legged part must bridge two different rows.
Step 7 of 12Note
Step 8 of 12Tap to reveal
Reading resistor color bands
How the code works
A typical four-band resistor has two digit bands, a multiplier band and a tolerance band. The colors stand for digits: black 0, brown 1, red 2, orange 3, yellow 4, green 5, blue 6, violet 7, grey 8, white 9.
Example: 220 Ω
Red (2), red (2), brown (multiply by 10) gives 22 × 10 = 220 Ω. A gold fourth band means ±5% tolerance, so the real value lies between 209 and 231 Ω.
Example: 10 kΩ
Brown (1), black (0), orange (multiply by 1,000) gives 10 × 1,000 = 10,000 Ω, the standard pull-up and pull-down value.
When in doubt, measure
Colors can be hard to tell apart under warm light, and red, orange and brown are easily confused. A cheap multimeter set to resistance settles it in two seconds. Read the bands starting from the end farther from the gold or silver band.
Step 9 of 12Practice · True or false
Placing a resistor with both of its legs in the same five-hole row of a breadboard has no effect on the circuit.
Step 10 of 12Practice · Choose one
Your LED circuit is wired, the code uses pin 9, but the LED stays dark. The resistor and LED test fine. What is the most likely cause?
Step 11 of 12Practice · What would you do?
What would you do?
Priya wants four LEDs that blink in sequence on pins 4 to 7. She plans to use one 220 Ω resistor in the shared GND line for all four. Is that a good idea?
Step 12 of 12Practice · Select all that apply
Which of these LED setups on a 5 V pin are safe? Select all that apply.
Select all that apply.
Lesson complete!