Skip to content

Electronics

Build an LED flashlight circuit

An LED flashlight is one loop: three 1.5 V cells in series, a switch, a resistor and a white LED. The cells give 4.5 V, the LED takes about 3.2 V, and the resistor takes the 1.3 V that's left. For about 20 mA that's 1.3 ÷ 0.02 = 65 Ω, so fit a standard 68 Ω.

3 × 1.5 VswitchR = ?white≈ 3.2 V
Pocket flashlight: three cells, a switch, a resistor and an LED

The parts

  • Three AA cells stacked + to −, so their voltages add: 1.5 × 3 = 4.5 V
  • A switch, anywhere in the loop
  • A white LED, long leg (the anode) towards the cells' + end
  • A resistor to set the LED's current

Every part sits on the one path, so one current flows through all of them. The switch opens that path and everything stops.

Live experiment

The finished flashlight

A dark room and the flashlight this page designs. Tap the switch to light it, then aim it up, ahead and down to find Pip, his sock and his key. Flip the switch off and the room goes dark again.

Try it yourself: free lesson

“Project: Pocket Flashlight” is the project that ends Copper Flats, Electronics World 1. Free with an account. Lessons unlock in order, so you’ll do the 6 before it first.

Size the resistor

An LED keeps a roughly fixed voltage for itself, its forward voltage, about 3.2 V for white at 20 mA. The resistor gets whatever the cells have left, and Ohm's law turns that into a value:

R = Vcells − VLED over I = 4.5 − 3.2 over 0.02 = 65 Ω

65 Ω isn't a standard value. The nearest one up, 68 Ω, gives 1.3 ÷ 68 ≈ 19 mA. Rounding up keeps the current just under your target, which is the safe side.

Check the power

A resistor turns its share into heat, P = V × I:

P = 1.3 V × 0.019 A ≈ 0.025 W

That's a tenth of a common 0.25 W resistor's rating, so it stays cool. The LED gets 3.2 ÷ 4.5, about 71% of the battery's power, and the resistor wastes the rest.

Why three cells, not two or four

Two cells make 3 V, less than the 3.2 V a white LED needs, so there's nothing left for a resistor and the LED barely glows. Four cells make 6 V: it works, with a 150 Ω resistor, but the resistor then burns 2.8 V of every 6, nearly half the energy.

Three is the sweet spot for a white LED. A red LED drops only about 2 V, so it would need a bigger resistor on the same cells: (4.5 − 2) ÷ 0.02 = 125 Ω.

Free lesson

Now build it yourself

Each lesson comes in three short parts: see the idea, try it on a live board, then build it yourself, with quick checks as you go.

Try it yourself: free lesson

“Project: Pocket Flashlight” is the project that ends Copper Flats, Electronics World 1. Free with an account. Lessons unlock in order, so you’ll do the 6 before it first.

Or start from the very first lesson, no account needed

Work it out

Practice questions

Three quick questions from the lessons. Pick an answer to check it.

  1. Question 1 of 3An LED wired straight to a 9 V battery, with no resistor at all…
    Show the answer

    Answer: Burns out. Nothing inside an LED holds the current back. With no squeeze, far too much current rushes through and it burns out. That's why it needs a resistor.

    • Why not “Stays dark”? 9 V is far above the 2 or 3 V an LED needs to turn on, so it conducts hard instead of staying dark.
    • Why not “Glows dimly forever”? With nothing to limit it, the current doesn't settle at a dim glow. It rises until the LED fails.
    • Why not “Glows gently”? Nothing in the loop holds the current down, so it doesn't settle at a gentle glow. It climbs far past the LED's 20 mA.
  2. Question 2 of 3The load reads 1.5 V with all four cells wired. They must be…
    Show the answer

    Answer: Side by side, every + together and every − together. Side by side, the volts don't add: four cells in a column are still 1.5 V. Only a chain adds.

    • Why not “In a chain”? A chain adds the cells' voltages, so four 1.5 V cells in a chain would read about 6 V, not 1.5 V.
    • Why not “Backwards”? A reversed cell in a chain subtracts, but four cells can't net 1.5 V that way: one reversed gives 3 V and two reversed give 0 V.
    • Why not “Shorted”? Shorted cells would put about 0 V on the load and heat up. They wouldn't hold a steady 1.5 V.
  3. Question 3 of 3You snip one wire in a loop, far away from the LED. What happens to the LED?
    Show the answer

    Answer: It goes out. Charge needs a complete loop. One gap anywhere stops the flow everywhere, however far it is from the LED.

    • Why not “It stays on”? Current needs a complete loop. A gap anywhere stops it everywhere, however far from the LED it is.
    • Why not “It gets a bit dimmer”? A cut wire doesn't add a little resistance. It opens the loop, so the current stops completely and the LED goes dark.
Keep practising: free lesson

“Project: Pocket Flashlight” is the project that ends Copper Flats, Electronics World 1. Free with an account. Lessons unlock in order, so you’ll do the 6 before it first.

Questions people ask

What resistor does a white LED need on 4.5 V?

About 68 Ω. Three cells give 4.5 V, a white LED drops about 3.2 V, so the resistor takes 1.3 V. For 20 mA that's 1.3 ÷ 0.02 = 65 Ω, and the nearest standard value, 68 Ω, gives about 19 mA.

Can a white LED run from two AA batteries?

Not properly through a resistor. Two cells make 3 V, just under the 3.2 V a white LED drops at its normal current, so it glows faintly at best. Cheap two-cell torches use a small boost converter to lift the voltage.

Does the switch go before or after the LED?

Either. A flashlight is one loop, and one current flows all the way round it. Open the loop anywhere and the current stops everywhere, so the switch works on either side of the LED or the resistor.

Why does my flashlight get dimmer as the batteries run down?

Fresh AA cells give about 1.5 V each, tired ones nearer 1.2 V. At 3.6 V the resistor gets only 0.4 V, so the current falls to about 6 mA. The resistor's share shrinks much faster than the cells do.

Every topic