Guides

How to Pick a Resistor for an LED at 5 V or 9 V

To pick a resistor for an LED, subtract the LED's forward voltage from the supply voltage, then divide by the current you want. The formula is R = (Vs - Vf) / I. Round the answer up to the next standard resistor value.

Why an LED needs a resistor

An LED does not limit its own current. Once the voltage across it passes a certain point, the current rises very fast. Connect an LED straight to a battery and it can draw far too much current and burn out.

VOLT

Learn electronics by building circuits that really simulate. Levels, a daily fix, a sandbox, a symbol guide and 34 bench calculators.

Open it freeRead about it

A resistor in series sets the current. The LED takes its share of the voltage. The resistor takes the rest and holds the current at a safe level.

The formula

R = (Vs - Vf) / I

SymbolMeaningUnit
RResistor valueohms (Ω)
VsSupply voltagevolts
VfForward voltage of the LEDvolts
ILED current you wantamps

This is Ohm's law applied to the resistor. The voltage across the resistor is Vs - Vf. See Ohm's law explained with examples for the background.

Enter the current in amps. 20 mA is 0.02 A. 10 mA is 0.01 A.

Typical forward voltages by color

Forward voltage depends on the color and the type of LED. These are typical ranges for common indicator LEDs.

ColorTypical forward voltage
Red1.8 to 2.2 V
Orange and yellow1.9 to 2.2 V
Green (older, yellow-green type)2.0 to 2.4 V
Green (bright, pure green type)3.0 to 3.4 V
Blue3.0 to 3.4 V
White3.0 to 3.4 V

The datasheet for your LED gives the real figure. Use it if you have it. If you do not, use a value from the low end of the range. A lower Vf gives a larger resistor, which is the safe direction.

Choose the current

Many common 3 mm and 5 mm indicator LEDs have a maximum continuous current of about 20 mA. Check the datasheet, because some LEDs allow less.

You rarely need the maximum. Many modern LEDs are bright enough at 5 to 10 mA. A lower current also keeps the LED and the resistor cooler.

Worked example: red LED on 5 V

The supply is 5 V. The red LED has a Vf of 2.0 V. The target current is 20 mA.

  • R = (5 - 2.0) / 0.02
  • R = 3.0 / 0.02
  • R = 150 Ω

150 Ω is a standard value, so use it as is.

Worked example: blue LED on 5 V

The supply is 5 V. The blue LED has a Vf of 3.2 V. The target current is 20 mA.

  • R = (5 - 3.2) / 0.02
  • R = 1.8 / 0.02
  • R = 90 Ω

90 Ω is not a standard value. Round up to 100 Ω. The real current is then 1.8 / 100 = 0.018 A, which is 18 mA.

Worked example: red LED on 9 V

The supply is a 9 V battery. The red LED has a Vf of 2.0 V. The target current is 20 mA.

  • R = (9 - 2.0) / 0.02
  • R = 7.0 / 0.02
  • R = 350 Ω

350 Ω is not a standard value. Round up to 390 Ω. The real current is then 7.0 / 390 = 0.0179 A, which is about 18 mA.

Round up to a standard value

Resistors come in fixed series of values. The common E12 series has twelve values in each decade:

10, 12, 15, 18, 22, 27, 33, 39, 47, 56, 68, 82

Multiply by 10, 100, 1,000 and so on to get the full range. So you can buy 330 Ω and 390 Ω, but not 350 Ω.

Always round up, not down. A larger resistor means a little less current and a slightly dimmer LED. A smaller resistor means more current than you planned, which can exceed the LED's limit.

Check the resistor power rating

The resistor turns its share of the voltage into heat. Work out the power with P = (Vs - Vf) x I, using the real current.

CircuitVoltage across resistorReal currentPower
Red LED, 5 V, 150 Ω3.0 V0.020 A0.06 W
Blue LED, 5 V, 100 Ω1.8 V0.018 A0.032 W
Red LED, 9 V, 390 Ω7.0 V0.0179 A0.126 W

Common small resistors are rated at a quarter of a watt, which is 0.25 W. A good habit is to keep the power at or below half the rating. That is 0.125 W for a quarter watt part.

The two 5 V circuits are far below that. The 9 V circuit sits right at the limit of the habit, so the resistor will run warm. To cool it down, lower the current. A 680 Ω resistor gives about 10 mA and only 0.07 W.

Higher supply voltages put more power into the resistor. Check the power every time the supply is 12 V or more.

More than one LED

  • LEDs in parallel. Give each LED its own resistor. LEDs that share one resistor do not share the current evenly.
  • LEDs in series. Add the forward voltages together and use that total as Vf. One resistor serves the whole string.

For two red LEDs in series on 9 V at 20 mA: R = (9 - 4.0) / 0.02 = 250 Ω. Round up to 270 Ω.

The supply must be higher than the total forward voltage. Leave at least a volt or two for the resistor, or the current will swing too much as the supply changes. Series vs parallel circuits explains how voltage and current split.

Common mistakes

  • No resistor at all. The LED may flash once and die.
  • Using milliamps in the formula. Dividing by 20, not 0.02, gives an answer 1,000 times too small.
  • LED in backwards. It will not light. The longer leg is the positive side on a new LED.
  • Rounding down. This pushes the current above your target.
  • Misreading the resistor. Check the bands with how to read resistor color codes.

Try it before you build it

VOLT has an LED resistor calculator in its Bench Tools. Use it to check your own answer. Then build the circuit for real with how to use a breadboard.

A note on safety

This guide covers small indicator LEDs on batteries and low voltage DC supplies. High power LEDs need a proper driver and heat sinking. Mains voltage is out of scope. Never connect an LED and a resistor to a wall outlet.

VOLT

Learn electronics by building circuits that really simulate. Levels, a daily fix, a sandbox, a symbol guide and 34 bench calculators.

Open it freeRead about it

electronics LED resistors Ohm's law beginners
✉

Get new articles in your inbox

SCCM guides, AI tools, automation tips — sent when published. No spam.

Keep reading

Comments