LED Resistor Calculator Formula
Understand the math behind the led resistor calculator. Each variable explained with a worked example.
Formulas Used
Required Resistance
resistor_ohm = (supply_voltage - led_forward_voltage) / led_current_aResistor Power Dissipation
resistor_power_mw = (supply_voltage - led_forward_voltage) * led_current_a * 1000Variables
| Variable | Description | Default |
|---|---|---|
supply_voltage | Supply Voltage(V) | 5 |
led_forward_voltage | LED Forward Voltage(V) | 2 |
led_current_ma | LED Current(mA) | 20 |
led_current_a | Derived value= led_current_ma / 1000 | calculated |
How It Works
How to Size a Resistor for an LED
An LED needs a series resistor to limit current.
Formula
R = (V_supply - V_led) / I_led
Where:
Power dissipated in the resistor is P = (V_supply - V_led) x I_led.
Worked Example
Drive a red LED (2.0 V forward) at 20 mA from a 5 V supply.
supply_voltage = 5led_forward_voltage = 2led_current_ma = 20
- 01Voltage across resistor = 5 - 2.0 = 3.0 V
- 02Current in amps = 20 / 1000 = 0.02 A
- 03R = 3.0 / 0.02 = 150 ohms
- 04Power = 3.0 x 0.02 = 0.06 W = 60 mW
Ready to run the numbers?
Open LED Resistor Calculator