Maker Pro
Maker Pro

Math Question, How Do You Really Figure This Out

I wasn't going to put in the title how to calculate LED current, but that's what this is.

I subtract the Forward voltage from the supply voltage. Let's say for this white LED it's 3.4V - 3V.
I'm left with an extra 0.4V, which I run by the current limiting resistor. In this case 13.15 Ohm.

So I get 0.4 / 13.15 = 30.4mA

Now I check the datasheet to see what actual Vf (Forward voltage) is and I find that at 30.4mA it's actually more. So I keep running in circles. Every time I calculate the current through the LED, I come back around.

Take a look at the picture I attached. For those that don't suck at math like myself, is there a way to actually calculate this?
So far I've always guestimated it, and that has worked perfectly fine. But I'm thinking what if I wanted to split hairs :)

how.png
 
Do you have the data sheet?
Possible you are going over tha max standard operating current.
Try a 22R...I doubt you will see the light output difference anyhow.
 
An LED is not a white hot piece of an accurate length and diameter of wire that can be made to draw certain current at a certain voltage (incandescent light bulb). Instead an LED cannot be made accurately so its datasheet shows a range of forward voltage, a minimum, a typical and a maximum. Some expensive LEDs are tested then "binned" into bins, each bin has a certain voltage.

Since an LED has a range of voltage then the resistor should have about 33% if the supply voltage across it. Calculate the maximum current and select the resistor value when the LED has a minimum voltage and calculate the current to be enough when the LED has a maximum voltage.
 
Or you can buy thousands of LEDs, then measure them all and sort them into piles that have similar voltages.
Many Chinese LED products doo dat.
 
You are already splitting hairs...for example your 13.15 ohm resistor comes with a tolerance value of maybe 1-5 %. But as your graph indicates that the Vf increases about .036V as the current increases by 2mA, you won't get a runaway condition unless the resistor value decreases as the current through it increases with a small wattage type. I've seen where heat buildup in the LED can cause thermal runaway in some so you'd have to take that into account if your driving voltage increases too with a higher temperature inside the enclosure. You driving voltage probably has a thermal component to its actual value too. Choose your max current through the LED which gives you a Vf to design to and just use that for your calculations.
 
I wasn't going to put in the title how to calculate LED current, but that's what this is.

I subtract the Forward voltage from the supply voltage. Let's say for this white LED it's 3.4V - 3V.
I'm left with an extra 0.4V, which I run by the current limiting resistor. In this case 13.15 Ohm.

So I get 0.4 / 13.15 = 30.4mA

Now I check the datasheet to see what actual Vf (Forward voltage) is and I find that at 30.4mA it's actually more. So I keep running in circles. Every time I calculate the current through the LED, I come back around.

Take a look at the picture I attached. For those that don't suck at math like myself, is there a way to actually calculate this?
So far I've always guestimated it, and that has worked perfectly fine. But I'm thinking what if I wanted to split hairs :)

View attachment 31219

Good observation. Forget precision. Settle on any one. Use a 13 ohm 5% resistor and let the current settle where it will.
 

Harald Kapp

Moderator
Moderator
A classsical method for determining the operation point in this scenario is by a simple graphical procedure:
upload_2017-1-5_8-6-6.png
You insert the resistor's characteristic into the characteristic of the LED, the find the intersection of the two graphs and voilá there you are.
The resistor's characteristic is inserted as follows:
  1. Calculate voltage drop across the resistor for a specific current, then calculate the remaining voltage drop across the LED. Use this current and the voltage drop across the LED as a first data point into the characteristic diagram.
    Example: at 22 mA the voltage drop across the resistor is 0.289 V, therefore the remaining voltage for the LED is 3.4 V - 0.289 V = 3.11 V. Your 1st data point is 22 mA / 3.11 V
  2. Repeat this calculation for a second data point, in the example I used 10 mA / 3.27 V.
  3. Since a resistor is a linear element, draw a straight line between these two data points.
  4. Find the intersection which in the example is at ~ 19 mA / 3.12 V
This method is even easier to use when the characteristic diagram includes the axes as you can easily determine the datapoints for I=0 (Vled = Vcc as there is no voltage drop across the resistor) and for Vled 0 V (I = Vcc/R as there is no voltage drop across the LED).

In addition observe the remarks concerning tolerance. The characteristic diagram shows only the typical curve. Real curves vary from LED to LED, with temperature, age etc.
 
When I buy LEDs their forward voltages do not match. But when I found strings of Chinese LEDs (powered from 4.5VDC) they are all in parallel and the forward voltage matched. Even the series-connected outdoors blue LEDs matched pretty well. Even my cheap Chinese flashlight has 24 well-matched white LEDs in parallel.

The string of blue Chinese outdoors LEDs was also thrown away but I rescued it. Of course it didn't work. You know why?
The wires on the LEDs were simply touching the socket, no soldering. Where they touched there was some corrosion. Every LED worked perfectly when I soldered them into my project.
 
I wasn't going to put in the title how to calculate LED current, but that's what this is.

I subtract the Forward voltage from the supply voltage. Let's say for this white LED it's 3.4V - 3V.
I'm left with an extra 0.4V, which I run by the current limiting resistor. In this case 13.15 Ohm.

So I get 0.4 / 13.15 = 30.4mA

Now I check the datasheet to see what actual Vf (Forward voltage) is and I find that at 30.4mA it's actually more. So I keep running in circles. Every time I calculate the current through the LED, I come back around.

Take a look at the picture I attached. For those that don't suck at math like myself, is there a way to actually calculate this?
So far I've always guestimated it, and that has worked perfectly fine. But I'm thinking what if I wanted to split hairs :)

View attachment 31219

If you want to calculate directly what the current will be at the supplied voltage and a particular external resistor, you have to know the logarithmic I-V equation of diode. Each diode has a slightly different equation due to manufacturing inconsistencies. There is a branch of mathematics called "curve fitting" that deduces the equation from a set of data points. As others have pointed out above, it is hardly worth the effort to do this. The load line method as illustrated above by Harold Kapp is a good way to find the current graphically if you have the diode I-V curve available. Or, you can plot the curve yourself. The iterative method you used should converge on the solution asymptotically.

Ratch
 
It wasn't really so much about LEDs but the math problem. Both Harold Kapp and Ratch provided excellent answers. Since I'm not very good at math, I was wondering if there is some simple trick, which now I see there is :)

The iterative method you used should converge on the solution asymptotically.

That's cool. I actually wasn't sure that if I keep repeating my method if I would eventually arrive at the right point (or very close to of course), and now I understand that I would.

You insert the resistor's characteristic into the characteristic of the LED, the find the intersection of the two graphs and voilá there you are.

This method is even easier to use when the characteristic diagram includes the axes as you can easily determine the datapoints for I=0 (Vled = Vcc as there is no voltage drop across the resistor) and for Vled 0 V (I = Vcc/R as there is no voltage drop across the LED).

That's so smart! It took me a little while to wrap my mind around it. My first attempt looked pretty bad but then I figured out what I was doing wrong. I plotted it on a logarithmic scale :) Anyways, I understand it now how it works, and thank you so much!
how2.png
 
Did you measure the forward voltage of your LEDs and group them into matched sets?
Then did you calculate a different resistor value for each set?
 
Did you measure the forward voltage of your LEDs and group them into matched sets?
Then did you calculate a different resistor value for each set?
No I did not, there only will be one LED. For me this was more of a theoretical question. In praxis there is extra margin which will absorb any variance, including temperature.
 
Since you have only 1 LED then you must have measured its forward voltage so that if it is minimum then it does not burn out and if it is maximum then it is not too dim.

Temperature change causes a tiny variance, its wide range of possible forward voltage is a huge variance.
 

Harald Kapp

Moderator
Moderator
I plotted it on a logarithmic scale
That won't work as a resistor's characteristic on a log scale is not a straight line. therefore your graph in post #10 is still not correct. Both axes need to be linear, or you'll have to calculate a few more points for the resistor's characteristic within this log scale characteristic an interpolate manually. Not so elegant anymore.
 
@Audioguru, I took the forward voltage from the datasheet and I understand it's an approximation.
@Harald Kapp, I definitely realized that. I posted the picture anyways to show what the wrong thing looks like (don't ask me why) :)
Here is a better one:
x.png
 
Top