LED resistor calculator
Finds the series resistor an LED needs from the supply voltage, the LED's forward voltage and current.
anındahesapla Editör Ekibi · Updated:
Required resistance: 150 Ω. An LED with a forward voltage of 2 V running at 20 mA from a 5 V supply needs this resistor in series. That resistor turns 0.06 W into heat.
LEDs burn out quickly without a current limit, because a small rise in voltage causes a large rise in current. Hobby electronics, indicator lights on control panels and LED strips on custom builds all start with this step. Getting it right makes the LED last and keeps brightness stable.
Result
150 Ω
Required resistance: 150 Ω
Result in all units
Step-by-step solution
R = (Vs − Vled) / I
Why an LED needs a resistor
A light-emitting diode drops a nearly fixed voltage across itself when it conducts. Red LEDs drop less, blue and white ones more. A datasheet lists this forward voltage and the recommended current.
Above that voltage the diode conducts almost freely. Connected straight to a battery or a power rail, it would draw far more current than it can handle. A series resistor absorbs the excess voltage and sets the current.
Ohm's law gives the value. Whatever voltage remains for the resistor is the supply voltage minus the LED drop. Dividing it by the target current, in amperes, gives the resistance in ohms.
Resistors come in standard values. When the calculated value falls between two, pick the next higher one. Your LED then runs a little dimmer and a little cooler, which is the safe side.
Power rating deserves the same attention as resistance. Its voltage drop times the current is turned into heat. A part rated for at least twice the calculated wattage stays cool and lasts longer.
Several LEDs can share one resistor when wired in series, with their drops added together. LEDs wired in parallel should each get their own resistor, since small differences between diodes make one hog the current.
Microcontroller pins can drive small LEDs directly but have their own current limit per pin and per chip. Such a resistor protects the pin as much as the LED, and its value is chosen so both limits are respected.
How to calculate
Resistance = (supply voltage − LED voltage) ÷ current. Power = (supply voltage − LED voltage) × current.
- Enter the supply voltage.
- Enter the LED forward voltage from the datasheet.
- Enter the LED current in milliamps.
- Read the resistance and the resistor power.
| Input or result | Value |
|---|---|
| Supply voltage | 5 V |
| LED voltage | 2 V |
| LED current | 20 mA |
| Resistance | 150 Ω |
| Resistor power | 0.06 W |
The worked line is (5 − 2) ÷ 0.02. Milliamps are converted to amps before dividing, which is where most hand calculations go wrong.
Battery-powered circuits see their supply drop as cells drain. Calculating with the fresh battery voltage keeps current within limits at the start, and the LED dims as the battery ages.