# How do resistors limit current for an LED? [closed]

If I have an LED with Vf = 2.1V and I = 20mA, Ohm's Law says I should have a resistor in series at a value of R = 145Ω, if the voltage supply is Vs = 5V.

However, I believe can put a higher valued resistor instead, to reduce the power consumption and brightness of the LED. I've done this in experiment lots of times, but I don't know the math behind it. Does a higher valued resistor in series reduce the current going to the LED? If so, what are the equations so I can design a proper circuit without having to experiment?

Thank you for the help! I am also interested in higher valued resistors because I know they won't get as warm or use as much power.

• Well, ohms law, just apply it? – PlasmaHH Dec 20 '17 at 16:28
• Look up: Kirchhoff's Laws and Ohm's Law – user103380 Dec 20 '17 at 16:31
• I believe this is the first time we've had this question on this site. – Harry Svensson Dec 20 '17 at 17:44
• @HarrySvensson Perhaps. But there is this one I recall, which may at least touch on some of the question asked: Diode equation with a series resistance. – jonk Dec 20 '17 at 18:19
• @HarrySvensson :) Okay. I guess what I really enjoy is that an LED and a resistor involve math that is at once VERY simple and accessible and also VERY complex. For most uses, it's extremely easy. But I suppose if you were using some 3rd order effect for some unusual purpose, the more complex math may be required. It's just fun that something seemingly simple can also tax the typical training of many undergraduates. – jonk Dec 20 '17 at 19:44

Since the forward voltage of the diode varies slightly according to the current through it, more accurate value of the current can be found out by -

Vs - Power supply voltage.

V,I - Forward voltage and current through the LED.

Is - Current through the LED for the given series resistor R.

• To say this in a different way: you can pick off any point from the diode's V-i curve and plug those numbers back into your equation to calculate a new resistance. There is also a physics-derived equation for diodes but it has a lot of physical constants in it, which you wouldn't be able to find for any given off-the-shelf diode so it's sort of impractical for this problem. – kjgregory Dec 20 '17 at 19:38

A very simple model works nearby the normal area of operation for an LED. Just the following very approachable linear function:

$$V_D=V_F+I_D\cdot R_F$$

Note that my $V_F$ isn't the same as the one you wrote in your question. This is the minimal value which occurs when $I_D=0\:\textrm{A}$. (Which is never useful, so again this is just a model value.)

Also, $V_D=V - I_D\cdot R_1$, so:

\begin{align*} V - I_D\cdot R_1&=V_F+I_D\cdot R_F\\\\ &\therefore\\\\ I_D&=\frac{V-V_F}{R_1+R_F} \end{align*}

Let's say that $V_F=1.6\:\textrm{V}$ and $R_F=25\:\Omega$. Then you'd find that you get $2.1\:\textrm{V}$ at $20\:\textrm{mA}$. (Which given only one data point is perhaps the best we can do for now.)

You can now compute the value of $R_1$ as a function of the desired current:

$$R_1=\frac{V-V_F}{I_D}-R_F$$

And that's pretty easy to apply. Going with the above parameters, I get $R_1=\frac{5\:\textrm{V}-1.6\:\textrm{V}}{20\:\textrm{mA}}-25\:\Omega=145\:\Omega$.

But now you actually have a function allowing you to plug in smaller or larger current values that will use the local slope of the LED operation to get a better estimate for your resistor. (Assuming you got anywhere close with the parameter values.)

You only need two measurements with the actual LED using two nearby but different resistor values in order to figure out, pretty accurately, what the parameter values should be near the average measured current for that experiment. So it isn't difficult to come by, just from a bench test.

The actual diode voltage vs diode current curve isn't linear. But for a narrow range around the designed operation point it does have a slope that doesn't vary much, which is why the above equation can work reasonably well if you stay near the recommended operating point.

If you want to support a much wider range of behavior things get a little more complicated. Let's start by just showing the basic circuit you are talking about: simulate this circuit – Schematic created using CircuitLab

The LED diode follows the Shockley equation model pretty well, over a very wide range of behaviors. To compute the intersection of the resistor load line and the LED diode curve, let's go through the crazy math involved now.

The current based upon the Shockley equation is:

$$I_{D}=I_{S}\cdot\left(e^\frac{V_{D}}{n\cdot V_T}-1\right)$$

In the above equation, $I_S$ is the saturation current of the diode or LED (which is itself a strong function of temperature), $n$ is the emission coefficient, and $V_T$ is the thermal voltage (about $26\:\textrm{mV}$ at room temperature.) The first two are model parameters and the last one is a physical characteristic that arrives from the large population statistics of colliding, interacting matter.

It is also the case that the diode voltage is what's left over after the resistor drops its voltage, so recalling what I wrote earlier:

$$V_D=V - I_D\cdot R_1$$

Putting these two together gives:

$$I_{D}=I_{S}\cdot\left(e^\frac{V - I_D\cdot R_1}{n\cdot V_T}-1\right)$$

Note that $I_D$ is on both sides of the equation.

Solving this requires the LambertW function, which solves $v=u e^u$ for $u$, given $v$. So all we have to do is get things into that form:

\begin{align*} I_{D}&=I_{S}\cdot\left(e^\frac{V - I_D\cdot R_1}{n\cdot V_T}-1\right)\tag{1}\\\\ \left(I_{D}+I_{S}\right)e^\frac{I_D\cdot R_1}{n\cdot V_T}&=I_{S}\:e^\frac{V}{n\cdot V_T}\tag{2}\\\\ \frac{\left(I_D+I_S\right)\cdot R_1}{n\cdot V_T}\:e^\frac{I_D\cdot R_1}{n\cdot V_T}&=\frac{I_S\cdot R_1}{n\cdot V_T}\:e^\frac{V}{n\cdot V_T}\tag{3}\\\\ \frac{\left(I_D+I_S\right)\cdot R_1}{n\cdot V_T}\:e^\frac{\left(I_D+I_S\right)\cdot R_1}{n\cdot V_T}&=\frac{I_S\cdot R_1}{n\cdot V_T}\:e^\frac{V+I_S\cdot R_1}{n\cdot V_T}\tag{4}\\\\ &\therefore\\\\ \frac{\left(I_D+I_S\right)\cdot R_1}{n\cdot V_T}&=\operatorname{LambertW}\left(\frac{I_S\cdot R_1}{n\cdot V_T}\:e^\frac{V+I_S\cdot R_1}{n\cdot V_T}\right)\tag{5}\\\\ I_D &=\frac{n\cdot V_T}{R_1}\:\operatorname{LambertW}\left(\frac{I_S\cdot R_1}{n\cdot V_T}\:e^\frac{V+I_S\cdot R_1}{n\cdot V_T}\right)-I_S\tag{6} \end{align*}

That's the actual mathematics involved. Usually, the value of $I_S$ is quite small, so the above can be simplified a bit:

\begin{align*} I_D &\approx\frac{n\cdot V_T}{R_1}\:\operatorname{LambertW}\left(\frac{I_S\cdot R_1}{n\cdot V_T}\:e^\frac{V}{n\cdot V_T}\right)\tag{7} \end{align*}

Of course, you need the model values for the diode. Different model values because this is based upon a different (and more complete) LED diode model.

Taking your example, I might guess that $n=4$ and $I_S=35\:\textrm{pA}$. Using the above equation I get $I_D\approx 8.5\:\textrm{mA}$. Note that this isn't the value you proposed. But I just made up some model values, too. And in reality, you'd need to hook things up just as you wrote and measure the results for either argument to be selected as closer. Who knows?

Absolutely no one I know ever does any of that, though. The above equation, if the model parameters are worked out and if the LED die temperature is maintained, will be very close to right over many, many orders of magnitude. It's surprisingly good over a large range of behaviors. But in practice for driving an LED, a designer doesn't need to go there.

There are lots of reasons why. The temperature of an LED is never really kept stable, in practice. And in any case, model parameters that work over a large range aren't needed because the LED is usually operated near its nominal current value. Besides, human perceptions of LED brightness are logarithmic and not particularly sensitive to modest differences in current (unless you are seeing two, side-by-side, I suppose.) So the whole point of the above exercise is more about being able to manipulate equations than being of any practical value for LEDs.

You're doing it right. Subtract Vf from the supply voltage. This gives the voltage drop across the resistor. Now apply Ohm's law to the resistor, specifying the desired current. Since you know voltage and current, you can calculate the appropriate resistance.

• Thank you, I don't know why but it felt recursive to use Ohm's Law, but now it makes sense. – AnimationB Dec 20 '17 at 16:40
• @AnimationB - Ohm's Law - it's not just about resistance. Ohm's law is a multi-purpose tool. It relates 3 quantities: resistance, voltage and current. So you can use it to find any of those quantities if you know the other two. – WhatRoughBeast Dec 20 '17 at 16:45
• use ohms law for all parts , even ripple current thru ESR in ecaps for SMPS – Tony Stewart EE75 Dec 20 '17 at 16:45
• @TonyStewart.EEsince'75 - Ha! Beat you by 1 second. That's cutting it close. – WhatRoughBeast Dec 20 '17 at 16:46

If series resistance = R, diode forward voltage = Vf, supply voltage = Vs, then current flowing is roughly equal to: $$I = (Vs-Vf)/R$$

To work out the precise value of the current through he LED for a given value of resistor can get a little tricky. But with LED current we're usually not too concerned about accuracy, so we can make a simplification: that the voltage across the LED will always be 2.1V no matter how much current flows through it. With a supply voltage of 5V you can see that the difference, 2.9V, must be dropped across the resistor no matter how much current is flowing. Lets call this Vr.

Using Ohms law the current through the resistor (and hence through the LED) will be given by Vr/R, or in your case 2.9/R. Alternatively the value of the resistor for a given current is R = Vr/I.

As an example, if you want 5mA LED current, R = Vr/I, or 2.9/0.005. which is 580 Ohms.

• Note that the voltage across an operating LED depends on the colour - about 1.8 volts for red, 2.1 for green, and 3 volts or more for blue and white - you can't (or shouldn't) just assume 2.1 volts for all LEDs. – Peter Bennett Dec 20 '17 at 16:53
• @PeterBennett yes you're right, I over simplified it a bit too much. I was meaning for his specific LED, which I presume is green. – Steve G Dec 20 '17 at 16:58

Here is the thing about LEDs, they are really intended to be current driven devices.

If you look at the spec sheet for a typical LED you will see something like this. Notice the test condition of 20mA.

Almost every LED you will find will be specified at a recommended operating current. The forward voltage is the range of voltages that the device is guaranteed to be within when driven with that current. The range includes manufacturing tolerances.

If you delve further into the spec sheets, you can often also find a graph like this one for a typical diode from the line. Notice, like all diodes, the actual forward voltage varies depending on how much current you attempt to pass through it. Be aware that the graph and the max-min numbers are not the same thing. The graph has a similar left right variance between parts.

However, driving an LED with a current source requires additional components and as such we often cheat and use a current limiting resistor instead.

Because this is really cheating the math gets a bit more involved.

To drive the above LED from say a 5V source at a maximum of 20mA we would need to use the lower Vf value. That is $R =( 5 - 1.8)/0.02 = 160\Omega$.

We now need to check the lower and upper limits including the resistor tolerance.

$I_{f_{hi}} = (5-1.8)/(160*0.95) = 21.05mA$
$I_{f_{lo}} = (5-2.6)/(160*1.05) = 14.29mA$

That seems a little wide, so let's use the graph instead.

At 20mA the graph is indicating about 2.3V.

Using the formula that makes $R =( 5 - 2.3)/0.02 = 135\Omega$.

130R 5% is out closest resistor value so now we need to check both ends including resister tolerance.

$I_{f_{hi}} = (5-1.8)/(130*0.95) = 25.9mA$
$I_{f_{lo}} = (5-2.6)/(130*1.05) = 17.6mA$

You can see the variance is actually worse and the bright is a lot brighter so the first method was better.

Whether the variance is tolerable is a matter of design requirements. As you can see from the typical graph below, the brightness of LEDs is fairly linear with applied current. When using a lower supply voltage this math does not always provide you with a suitable resistor value. The value gets to be so small that the variance can either prevent the LED from lighting or burn it out.

To complicate matters further, the currents and voltages change with temperature.

As such, in some situations, you really need to use some sort of constant current driver, especially if you intend to drive the LED anywhere close to it's maximum current rating.