Home · Academy · Robotics & Coding · Introduction to Electronics · Using LEDs and Resistors

Using LEDs and Resistors

Learn LED polarity and why a current-limiting resistor is needed, and light an LED safely.

LESSON COMPASS

What will you use this page for?

Core idea

An LED is a small, directional light source; when we connect it with the correct polarity and place a current-limiting resistor in front of it, it lights up safely.

Evidence to produce

Complete the page task with your own input, test conditions and reasoning.

Control trap

Forgetting the resistor The most common mistake is connecting an LED straight to the battery. Without a resistor the LED draws too much current and can break. The rule is simple: if there is an LED, there must also be a series resistor. Connecting the LED backwards The long leg (anode) goes to plus, the short leg…

Next connection

Buttons and Switches: Turning a circuit on and off with your hand; how buttons and switches work and how they are used to control an LED.

Module sources: Python Tutorial · Arduino Learn

LevelBeginner
Age10–16
Duration30–45 min
PrerequisiteHow a Breadboard Works
ContentStandard lesson · 1,713 words
Last updated

One-sentence summary

An LED is a small, directional light source; when we connect it with the correct polarity and place a current-limiting resistor in front of it, it lights up safely.

Why does it matter?

The first time you see a light come on in your own circuit, it usually puts a smile on your face. The LED is the most familiar part in robotics and electronics projects: when a motor runs, when a sensor detects something or when a program makes a decision, a small LED often shows it to us.

But an LED is a delicate part. Connect it the wrong way and it will not light at all. Connect it straight to a battery without a resistor and too much current flows through it, so the LED may flash once and die, or even break for good. In this lesson we will get to know the LED's two legs, understand why a resistor is needed and learn to build the battery → resistor → LED order correctly.

Short definition: An LED is a small electronic part that turns electric current into light and works in one direction only.

The LED's two poles: anode and cathode

LED stands for "Light Emitting Diode." A diode is a part that lets current pass in one direction only. That is why an LED lights up when connected one way and stays dark when connected the other way.

An LED has two legs, and they are different from each other:

A short reminder sentence can help: "Long leg to plus, short leg to minus."

Everyday example: A one-way turnstile

Think of the turnstile at a metro entrance. Push it from the correct direction and the gate opens. Push it from the wrong direction and nothing moves. An LED is like this: if current arrives from the correct direction, it gives light; from the wrong direction, nothing happens. So if an LED does not light, it is often not broken; it is simply put in backwards. Swapping the legs and trying again is the fastest check.

Why is a resistor needed?

A resistor is a part that limits the current flowing through it. It controls how much current passes, much like a tap controls water.

An LED has no built-in way to limit its own current. Connect it straight to a battery and it will try to draw a large current. It glows very brightly for a moment, then heats up and breaks. We say "an LED without a resistor can burn out." That is exactly why we use a current-limiting resistor in series with the LED.

Everyday example: A garden hose

If you open a garden hose all the way, the water blasts out hard and can damage the flowers. Turn the tap down a little and the water flows gently and does the job. A resistor is like that tap in a circuit: it turns the current going to the LED down to a safe level, so the LED works for a long time.

Choosing the resistor with Ohm's law

To pick the right resistor we use a simple calculation. Ohm's law is:

R = V / I

R = resistance (ohms, Ω)
V = voltage across the resistor (volts, V)
I = the current we want (amperes, A)

For a typical red LED, the approximate values are:

The voltage across the resistor is the battery voltage minus the LED voltage:

V(resistor) = 5 V − 2 V = 3 V
R = 3 V / 0.01 A = 300 Ω

The answer is 300 Ω. If we do not have exactly 300 Ω, we pick the slightly larger 330 Ω resistor. A slightly larger resistor means slightly less current, which is safer for the LED. For beginner projects, a resistor between 220 Ω and 470 Ω works safely in most 5 V circuits.

Building the circuit correctly: battery → resistor → LED

Now let us put the parts together. Our circuit will follow this order: current leaves the battery, passes first through the resistor, then through the LED, and returns to the battery.

As a text schematic:

   (+) Battery terminal
        |
     [ Resistor ]     ← 330 Ω current-limiting resistor
        |
      Anode (+)
     ┌──▶──┐
     │ LED │          ← long leg on top (anode)
     └─────┘
      Cathode (−)
        |
   (−) Battery terminal

Step by step on the breadboard:

  1. Connect the battery's (+) terminal to one row of the breadboard.
  2. Put one leg of the resistor in that same row and the other leg in an empty row.
  3. Put the LED's long leg (anode) in the same row as the resistor's free end.
  4. Put the LED's short leg (cathode) in another empty row.
  5. Connect that last row to the battery's (−) terminal.
  6. Connect the battery and watch the LED light up.

You may place the resistor on the anode side or the cathode side of the LED; both are correct. What matters is that the resistor is in series with the LED, meaning the current must pass through the resistor.

Mini practice

Together with an adult, try the following:

  1. Gather a breadboard, one red LED, one 330 Ω resistor and a 5 V power source (USB or 3 AA cells).
  2. Follow the steps above to build the battery → resistor → LED circuit.
  3. When the LED lights, note its legs: which one was connected to plus and which to minus?
  4. Now remove the battery, turn the LED around and connect it again. The LED does not light, does it? This proves that the LED works in one direction only.
  5. Turn the LED back the correct way. If you have a 220 Ω and a 470 Ω resistor, try each one. With which resistor does the LED glow brighter?

Write your observations in a small notebook: which leg is the anode, and how much brightness each resistor gave. This is how engineers work: try something, then record what happened.

Common mistakes

Forgetting the resistor

The most common mistake is connecting an LED straight to the battery. Without a resistor the LED draws too much current and can break. The rule is simple: if there is an LED, there must also be a series resistor.

Connecting the LED backwards

The long leg (anode) goes to plus, the short leg (cathode) goes to minus. Connect it backwards and the LED will not light at all. Before throwing away an LED that will not light, always check its direction.

Choosing too small a resistor

A very small resistor, such as 10 Ω, does not limit the current enough. The LED still draws too much current. For a start, stay between 220 Ω and 470 Ω.

Making a short circuit

Accidentally connecting the battery's (+) and (−) terminals straight together is a short circuit. When this happens the batteries heat up quickly and drain fast. Check each row by eye before you connect anything.

Safety note

Lesson summary

Check questions

  1. What is the name of the LED's long leg, and to which side of the circuit does it connect?
  2. What happens if you connect an LED straight to a battery without a resistor?
  3. What is the resistor's job in the circuit?
  4. Using Ohm's law, calculate the resistor needed for a 5 V battery, a 2 V LED and a 0.01 A current.
  5. You connected the LED but it does not light. Before deciding it is broken, what first check do you make?

Answers

  1. The long leg is the anode, and it connects to the plus (+) side of the circuit. The short leg is the cathode and connects to minus.
  2. The LED draws too much current; it glows very brightly for a moment, then heats up and can break. That is why it should not be connected without a resistor.
  3. The resistor limits the current going to the LED (a current-limiting resistor). This lets the LED work with a safe current and for a long time.
  4. The voltage across the resistor is 5 V − 2 V = 3 V. R = 3 V / 0.01 A = 300 Ω. If you do not have it, choose the next value up, 330 Ω.
  5. First I check the LED's direction: is the long leg on plus and the short leg on minus? An LED is often not broken, just put in backwards. I swap the legs and try again.

Source and verification note

For “Using LEDs and Resistors”, verification focuses on whether the relationship between The LED's two poles: anode and cathode and Why is a resistor needed? remains consistent across examples. Activities are designed only for low-voltage direct-current circuits; mains electricity is not used. Component values must be rechecked for the actual circuit, and connections should be reviewed with an adult before power is applied.

Next lesson

Buttons and Switches: Turning a circuit on and off with your hand; how buttons and switches work and how they are used to control an LED.

Start QuizBack to Introduction to Electronics
QUESTION POOL

Reinforce this lesson with 10 questions

This lesson has a pool of 20 questions. Each attempt selects 10 and reshuffles the choices.