Electronics

Make a simple LED circuit on a breadboard (maths included)

Light an LED from a 9 V battery on a breadboard, with a wiring diagram, which way round the LED goes, and the resistor maths worked through step by step.

LED Breadboard Circuit

Some links in this article are affiliate links. If you buy through them, Braindumps may earn a small commission at no extra cost to you.

To light an LED from a 9 V battery, you need the LED, a resistor of about 360 Ω, a breadboard and a couple of wires. This guide shows how a breadboard is connected underneath, which way round the LED goes, how to wire the circuit, how to work out the resistor with Ohm’s law, and what to check if the LED does not light.

What you need

  • A solderless breadboard. Any size will do; a half-size board, such as Pimoroni’s 400-point breadboard (ad), is plenty.
  • A red LED, 3 mm or 5 mm.
  • A 360 Ω resistor. On a four-band resistor, the bands are orange, blue, brown and gold. If your kit only has E12 values, use 390 Ω (orange, white, brown, gold).
  • A 9 V battery (the rectangular PP3 size) and a battery clip with red and black wires. Pimoroni sells the clip as a 9V battery snap (ad).
  • A jumper wire with a pin at each end. Pimoroni’s Jumper Jerky (ad) in the “Pin to Pin” version is a strip of 40 wires that you can pull apart.

How a breadboard is connected

Under the holes, metal strips join them in groups:

  • The main area is made of short lines of five holes, marked a to e on one side of the centre gap and f to j on the other. Each line has a number, and the five holes in a line are connected to each other.
  • The centre gap separates the two halves, so holes a to e and f to j with the same number are not connected.
  • The power rails are the long lines of holes along the edges, marked + and − and often striped red and blue. Each rail is connected along its length. The rails on opposite edges are separate, and on some longer boards each rail is split halfway along.

So the two legs of a part must go into different lines. If both legs share a line of five, the part is short-circuited.

Which way round the LED goes

An LED lets current through in one direction only. The longer leg is the anode, which connects towards the positive side of the battery. The shorter leg is the cathode, which connects towards the negative side. The rim of the LED’s case also has a flat edge on the cathode side, which helps once the legs have been trimmed to the same length.

Build it step by step

Diagram of the circuit on a breadboard: the battery's red wire goes into the + rail and its black wire into the − rail; a 360 Ω resistor runs from the + rail to line 5; the LED's long leg is in line 5 and its short leg in line 6; a jumper wire joins line 6 to the − rail.
  1. Put in the LED. Push the long leg into one line and the short leg into the next one, for example lines 5 and 6.
  2. Add the resistor. Put one leg in the same line as the LED’s long leg (line 5) and the other leg in the + rail.
  3. Add the jumper wire. Connect the LED’s short-leg line (line 6) to the − rail.
  4. Connect the battery last. Put the clip’s red wire in the + rail and its black wire in the − rail, then clip the battery on. The LED lights up.

The resistor can also go on the other side of the LED, between the short leg and the − rail. The same current flows all the way round a single loop, so it works either way.

Working out the resistor

Once an LED is on, the voltage across it stays close to one value, called its forward voltage. Connected straight to a battery, an LED draws far more current than it can take and is usually destroyed. The resistor takes the rest of the battery’s voltage and sets the current. Ohm’s law gives its value:

R = (Vs − Vf) ÷ I

Vs is the supply voltage in volts, Vf is the LED’s forward voltage in volts, and I is the current in amps (20 mA is 0.02 A).

A table from a red LED's datasheet with the forward voltage row highlighted: 2 V typical and 2.5 V maximum, measured at 20 mA

The forward voltage is in the LED’s datasheet. The red LED’s datasheet above gives 2 V typical and 2.5 V maximum, measured at 20 mA. For a 9 V battery:

  1. Supply voltage: 9 V.
  2. Forward voltage of the red LED: 2 V.
  3. Voltage across the resistor: 9 V − 2 V = 7 V.
  4. Current: 20 mA = 0.02 A.
  5. Resistance: 7 V ÷ 0.02 A = 350 Ω.
  6. 350 Ω is not a value you can buy, so choose the next one up: 360 Ω in the E24 series. The current is then 7 V ÷ 360 Ω = 19.4 mA.
  7. Power in the resistor: 7 V × 0.0194 A = 0.136 W. An ordinary ¼ W (0.25 W) resistor is fine.

If your LED’s forward voltage is at the datasheet’s 2.5 V maximum, the same resistor gives (9 − 2.5) ÷ 360 = 18.1 mA, which is still close to the plan.

Circuit diagram: a 9 V battery, a 360 Ω resistor with 7 V across it, and a red LED with 2 V across it, in one loop, with 19.4 mA flowing from + through the resistor and the LED back to −.

Why round up, not down

The nearest common value below 350 Ω is 330 Ω. It gives 7 V ÷ 330 Ω = 21.2 mA, which is more than the 20 mA you planned. Rounding up keeps the current at or below the target, so it is the safer habit. If you only have E12 values, 390 Ω gives 17.9 mA.

Not sure of your LED’s maximum current?

Not every LED is rated for 20 mA. Rapid Electronics’ 5 mm normal red LED has a maximum of 15 mA, while its bright red one is rated for 30 mA. If you do not know your LED’s rating, aim for 10 mA: (9 − 2) ÷ 0.01 = 700 Ω, so use 750 Ω, which gives 9.3 mA. The LED is dimmer but still clearly lit. SparkFun’s resistor guide works through the same 9 V circuit at 10 mA and gets about 720 Ω, because it assumes 1.8 V for a red LED.

Resistors for other LED colours on 9 V

Blue and white LEDs need more voltage than red ones, so they need a smaller resistor. The table uses typical forward voltages and the E24 series, rounding up. Use the figure in your LED’s datasheet when you have it.

LED colour (Vf used) About 20 mA About 10 mA
Red (2.0 V) 360 Ω (19.4 mA) 750 Ω (9.3 mA)
Yellow or amber (2.1 V) 360 Ω (19.2 mA) 750 Ω (9.2 mA)
Green, traditional (2.2 V) 360 Ω (18.9 mA) 680 Ω (10.0 mA)
Blue (3.2 V) 300 Ω (19.3 mA) 620 Ω (9.4 mA)
White (3.2 V) 300 Ω (19.3 mA) 620 Ω (9.4 mA)

Green LEDs vary the most: newer, brighter ones can need 3 V or more, like blue ones. For other supplies, such as 5 V from a USB lead or an Arduino, use the LED resistor calculator.

If the LED does not light

  • Turn the LED round. Backwards, it blocks the current. Unclip the battery first.
  • Check that its legs are in different lines. If they share a line of five, the LED is short-circuited.
  • Check the rails. On a longer breadboard, a rail may be split halfway along. Keep the battery wires and the parts on the same half, or join the two halves with a wire.
  • Check the resistor’s bands. Orange, blue, brown is 360 Ω. Orange, blue, red is 3.6 kΩ, ten times as much, and the LED is then much dimmer.
  • Try another battery, or measure yours with a multimeter.

Safety

  • Always use the resistor. An LED connected straight to a 9 V battery is usually destroyed.
  • Keep spare 9 V batteries in their packaging. Their two terminals are side by side, so two loose batteries can touch, short-circuit each other and get hot.

Next steps

Questions people ask

What resistor do I need for an LED on a 9 V battery?

For a red LED at about 20 mA, 360 Ω, or 390 Ω from an E12 kit. For a blue or white LED, 300 Ω. If you do not know the LED’s maximum current, use 750 Ω for red or 620 Ω for blue or white, for about 10 mA.

Can I use a 330 Ω resistor with a red LED on 9 V?

It gives about 21 mA. That suits an LED rated for 25 or 30 mA, but it is over the limit of one rated for 20 mA or less, so check the datasheet first.

Does it matter which side of the LED the resistor goes?

No. In a single loop the same current flows through every part, so the resistor works on either side.

Sources: SparkFun, How to use a breadboard (the connections, the centre gap and split rails); SparkFun, Light-emitting diodes (the anode is the longer leg; an LED without a resistor can destroy itself; a reversed LED blocks current); SparkFun, Polarity (the flat edge marks the cathode); SparkFun, Resistors (¼ W and ½ W ratings, and the 9 V example at 10 mA); E series of preferred numbers (Wikipedia); Electronic color code (Wikipedia); Light-emitting diode (Wikipedia, forward voltages by colour); Nine-volt battery (Wikipedia, the PP3 size and loose batteries); Rapid Electronics datasheet 55-1790; Rapid Electronics datasheet 55-1796. Calculations by Braindumps, checked with code.

Get new Braindumps guides by email

One email a week with new guides, the best free 3D prints, LEGO news and tools. Unsubscribe at any time.

No spam. Read our privacy policy.