DEV Community

EvvyTools
EvvyTools

Posted on

How to Pick a Current Limiting Resistor for an LED Without Frying It (Step by Step)

The first circuit most people build is an LED in series with a resistor. The second one is the same circuit, but smoking, because the math felt easy enough to skip. Picking the right series resistor for an LED is the cheapest engineering problem in hobby electronics, and it is also the one people get wrong the most often. The steps below are the routine that holds up across the small failures.

A small breadboard with an LED, a resistor, and jumper wires connected to a 5 volt USB power source
Photo by Tanha Tamanna Syed on Pexels

Step 1: write down the supply voltage you actually have, not the one on the label

The first input is the supply voltage. A USB phone charger calls itself 5 volts but usually measures between 4.8 and 5.2 depending on the cable and load. A 9-volt alkaline battery is 9.5 volts fresh and as low as 6 volts when half-dead. A regulated bench supply is whatever you set it to. Use the value your multimeter shows, not the value on the label, especially if the LED is going on a battery that might be reused for hours.

If you do not have a multimeter, assume the worst case for the supply: 5 volts for USB, 7 to 9 volts for alkaline, and the rated value for any regulated source. Write that number down.

Step 2: write down the LED's forward voltage from a real datasheet

The second input is the LED's forward voltage. Color is a rough guide. Red LEDs drop about 1.8 to 2.2 volts. Yellow and green are around 2.0 to 2.4. Blue, white, and high-brightness colors are 3.0 to 3.4. UV and some high-power LEDs go higher.

The numbers vary by manufacturer, current, and chip family. If the LED came in a labeled kit, the kit page usually lists the forward voltage. If it came in a bag of mixed parts from a hobby shop, assume the high end of the color range. Reference data for the chemistry behind these values lives on the Wikipedia LED article, and detailed datasheets for specific parts are published by vendors like Vishay, Kingbright, and Cree LED.

Write the forward voltage down. If you are not sure, pick the higher end of the range.

Step 3: pick a target current

The third input is the current you want through the LED. Most small indicator LEDs are rated for 20 milliamps but look perfectly bright at 5 to 10 milliamps and last longer. High-brightness LEDs in lights and panels are rated for 30 to 100 mA or more, but they need heatsinking and a different calculation.

For an indicator on a panel, 5 to 10 mA is fine. For a flashlight, 20 mA per emitter and check the datasheet. For anything beyond 20 mA, plan to use a constant-current driver, not a series resistor, because the resistor approach gets imprecise at higher currents.

Write down the target current in milliamps.

Step 4: compute the resistor value

The math is the supply voltage minus the LED forward voltage, divided by the target current. Concretely: V minus VF, divided by I, equals R. Units have to match. Volts and amps give ohms. Volts and milliamps give kilohms, but you usually want the answer in ohms, so multiply current by 0.001 first or use a calculator that handles the conversion.

For a 5-volt supply, a red LED at 2 volts forward, and a 10 mA target, the math is (5 minus 2) divided by 0.010, which gives 300 ohms. Round up to the nearest standard value, 330 ohms in the E12 series, and you are done.

The arithmetic is identical no matter which numbers you pick. The trap is the unit on the current. If you type 10 into a calculator and it expects amps, the answer is 0.3 ohms, which is meaningless. A purpose-built calculator with prefix selectors removes the trap. The free Ohm's Law calculator from EvvyTools handles all three variables with explicit prefix dropdowns, which is the discipline you want when the inputs are coming off a multimeter in three different prefix scales.

Step 5: compute the power dissipation in the resistor

The fifth step is the one beginners skip and pay for. Power equals voltage across the resistor times current through it. With three volts across a 330 ohm resistor at about 9 milliamps, the dissipation is about 27 milliwatts. That is comfortably under the quarter-watt rating of any standard through-hole resistor.

Now imagine the same circuit on a 24-volt feed without resizing. Voltage across the resistor is 22 volts. Current at 330 ohms is 66 mA, which exceeds the LED rating. Power dissipation is 1.5 watts, six times the resistor's rating. The resistor cooks before the LED does.

The fix is to recompute power every time you reuse the circuit at a different voltage. The Electrical Engineering Stack Exchange archives have postmortems for exactly this failure mode. The math is on the same page of the same textbook. Skipping it is the cause.

Step 6: pick the nearest standard resistor value, rounded the safe way

Standard E12 resistor values are 10, 12, 15, 18, 22, 27, 33, 39, 47, 56, 68, 82, and multiples of ten of those. The E24 series adds the half-steps. When the calculator gives you 300 ohms, the nearest E12 values are 270 and 330.

Round up, not down. A higher resistor value gives less current, which means a slightly dimmer LED and a longer life. Rounding down gives more current, which means a brighter LED for now and a shorter life later. The difference is small enough not to matter visually for indicator LEDs, but the discipline holds across higher-power circuits where the margin is thinner.

Step 7: verify with a multimeter before walking away

The last step is to actually measure the current. Set the multimeter to mA, break the circuit at the resistor, put the meter in series, and read the value. If the measured current is close to the target, you are done. If it is wildly different, one of the inputs to Step 4 was wrong. The supply might not be the voltage on the label. The LED might be a different chemistry than you assumed. The resistor color code might have been misread.

The fix is to redo Steps 1 through 4 with the measured supply voltage and measured resistor value, and recompute the expected current. The longer guide on how unit conversions and assumption errors compound in real circuits walks through the same diagnostic loop with more examples.

Bonus tips that save the most parts

A few extras that come up often enough to be worth writing down.

If the supply is a small battery, recompute the resistor for the half-discharged voltage, not the nominal voltage. A nine-volt battery that reads seven and a half volts after a few hours of use changes the current target enough to matter. Pick a resistor that gives you the right current at the supply voltage you will actually see most of the time, not just the brand-new one.

If the LED is in a long cable run away from the board, the cable resistance is also in the circuit. For thin hookup wire over a couple of meters, the resistance is small and you can usually ignore it. For longer runs in thin wire, the voltage drop in the cable starts to compete with the resistor's role. The American Wire Gauge tables on Wikipedia give the resistance per foot or per meter for the common gauges.

If you are driving multiple LEDs from the same supply, parallel them with their own series resistors, not a single shared resistor. The shared-resistor approach saves a part but the LEDs in a parallel string with one resistor share the current unevenly because their forward voltages are not identical, and the brightest one tends to run hot and fail first. One resistor per LED is the discipline.

The short version

Pick the supply, pick the forward voltage, pick the target current. Subtract, divide, round up to a standard value, check the power, measure to confirm. Seven steps, none of them hard, all of them done with a calculator that respects the unit prefix.

For more bench-math tools that follow the same prefix discipline, the EvvyTools math and science directory keeps the standard calculators together in one ad-free place.

Top comments (0)