Skip to content
RoboLearn
Not completed

Your first circuit: light an LED

ElectronicsBeginner30 minTry it in the simulator ↓Before this: Using a breadboard, Ohm's law

What you’ll learn

  • Why an LED always needs a resistor
  • How to calculate that resistor
  • How to wire an LED and a push button on a breadboard

Parts

Part Qty Notes
Breadboard 1 Half-size is fine
LED (any colour, 5 mm) 1
220 Ω resistor 1 Stripes: red-red-brown
Push button 1 4-leg tactile switch
4 × AA battery holder (6 V) or 5 V from an Arduino/USB 1
Jumper wires 4–5

No parts? Use the simulator in the Try it section below.

LEDs only work one way

LED = Light-Emitting Diode. A diode lets current flow in one direction only.

  • Long leg = anode (+), connects towards the + supply
  • Short leg = cathode (−), connects towards GND. The rim of the LED also has a flat edge on this side.

Put it in backwards and it simply won’t light (no harm done at these voltages).

Why the resistor?

An LED has almost no resistance once it turns on. Without a resistor, Ohm’s law says current would be huge, and the LED burns out in a flash.

Each LED “uses up” a fixed voltage called its forward voltage (Vf): about 2 V for red/yellow/green and 3 V for blue/white. The resistor takes the rest.

R = (Vsupply − Vf) ÷ ILED

For a red LED on 5 V at 15 mA: R = (5 − 2) ÷ 0.015 = 200 Ω. Round up to the next common value: 220 Ω.

Build it

  1. Connect the battery/5 V + to the breadboard’s red rail and − to the blue rail. Leave the power off/unplugged.
  2. Put the LED in rows 10 and 11: long leg in row 10, short leg in row 11.
  3. Put the 220 Ω resistor from the red + rail to row 10.
  4. Connect a jumper from row 11 to the blue − rail.
  5. Connect power. The LED should light. If not, see the table below.
  6. Now add a button: unplug power, move the resistor so it goes from + rail to row 5, place the button across the centre gap with its legs in rows 5 and 7, and add a jumper from row 7 to row 10 (same side of the gap as the LED). Power on and press: the LED lights only while pressed.

What you should see

The LED glows steadily (step 5), then only while the button is held (step 6).

If it doesn’t work

Symptom Likely cause
LED never lights LED backwards; GND not connected; battery flat
LED very dim Resistor too large (check stripes: 220 Ω is red-red-brown)
LED flashes once and dies No resistor, so the LED is burnt out. Replace it and add the resistor!
Button does nothing / always on Button rotated 90°; its legs are connected in pairs. Rotate it.

Finished this lesson?