Skip to content
ohmplay. Electronics
laboratory

Home / Tools / LED resistor

Experiment 001 / Essential electronics

LED resistor

Choose a resistor, calculate its dissipation and see what current will flow through your LED.

Workbench / Ideal model ● In your browser
01 / Adjust the inputs

Sliders with a wide range use a logarithmic scale. When zero is allowed, it has its own position. Type a number to set an exact value.

Try an example
02 / Observe the circuit Direct current
+ − 5 V R I → LED · 2 V
Ideal resistance 150 Ω
Commercial E12 150 Ω
Current with E12 20 mA
Ideal power 60 mW
Power with E12 60 mW
Suggested power rating¹ 125 mW

R = (5 − 2) / 0.020 = 150 Ω. In the nominal model, the suggested E12 value does not exceed the requested current.

What the blue LED example shows: with a 3.3 V supply and a 3 V LED drop, only 0.3 V remains across the resistor. The suggested 33 Ω gives about 9.09 mA. If the real LED has Vf = 3.1 V and you keep the same 33 Ω resistor, the current falls to 6.06 mA: about 33% lower. With little voltage across the resistor, changes in Vf matter more. When you change Vf here, the calculator selects a new resistor for the requested current; it does not keep the previous resistor fixed.

¹ First power rating with a margin of at least ×2. Check tolerances and temperature. The diagram does not show measured LED brightness.

Use it in your classroom

Share this exercise with its current values. The link contains only numbers and model options; do not add names or email addresses.

The code includes a text link to the full explanation outside the frame. Animation starts paused. Adjust the iframe height if your platform needs it.

A red LED and a 5 V supply

You want 20 mA and assume a 2 V LED drop. That leaves 3 V across the resistor. Dividing 3 V by 0.020 A gives 150 Ω. This is already an E12 value, so no rounding is needed.

The resistor dissipates 0.060 W. A 0.125 W rating is more than twice that dissipation in this example; also check the manufacturer’s temperature-derating requirements.

From the remaining voltage to resistance

R = (Vs − Vf) / I
Pr = I² × R = (Vs − Vf) × I
Ireal = (Vs − Vf) / Rcomercial

The tool selects the first E12 value equal to or above the calculated resistance, avoiding a nominal current increase caused by rounding down. E12 uses 1, 1.2, 1.5, 1.8, 2.2, 2.7, 3.3, 3.9, 4.7, 5.6, 6.8 and 8.2 times a power of ten.

What this model represents

One LED, one series resistor and an ideal DC supply. Vf is held constant, though a real LED’s forward voltage varies with current and temperature. Tolerances, heating and the driving pin’s limits are not modeled.

The suggested commercial value does not guarantee a real maximum current. Check the LED data sheet and supply range. Do not extend this circuit to power LEDs without analyzing current control and heat dissipation. Diagram color identifies the component; it does not measure brightness.

Common mistakes

  • Entering 20 A instead of 20 mA: a thousand times more current.
  • Using Vs instead of Vs − Vf: the resistor does not receive the entire supply voltage.
  • Connecting parallel LEDs through one shared resistor does not guarantee equal currents.
  • Choosing a power rating below the calculated dissipation.

Try it yourself

3.3 V, Vf = 2 V and 10 mA: which E12 value would you use?

R = 1.3 / 0.010 = 130 Ω. The next E12 value is 150 Ω, giving 8.667 mA and about 11.27 mW dissipation.

What happens if Vs = Vf?

No voltage remains across a positive current-limiting resistor. This model cannot set the requested current; increase Vs or review Vf.