Predicting current for parallel LEDs - Page 1
Forum section: electronics / beginners

author: maelh
author_rank: Regular Contributor
timestamp: October 24, 2022, 06:30:09 pm
content: Hello,So this is a classical problem apparently, and I know this design is not advisable, but I am interested in computing the currents/predicting the circuit's behavior without simulation (for general learning purposes/insight). The explanations I found use iterative computations only, resembling simulation. I am looking for something more intuitive.As you can see in the attachment, this circuit has two LEDs in parallel, sharing a current limiting resistor.Usually for diodes you assume there is a voltage drop across the diode that corresponds to its forward voltage Vf as given in the datasheet, but apparently with two diodes in parallel, you cannot use that rule of thumb.The explanations I read essentially boil down to the LED with the lesser forward voltage conducting almost all of the current, so the other LED will never reach its forward voltage and remain off/very dim. (Which is then even more pronounced, because the conducting LED/semi conductor heats up and thereby becomes a better conductor compared to the dim LED.)But they don't really explain what happens when you have two LEDs with Vf close to each other (which makes them both light up) and why that is the case, and at which Vf delta it's not the case anymore.I thought about solving this problem graphically, with theDC load line. I don't have the datasheets from the physical LEDs I own, so I looked some up that are supported by LTSpice (see attachment).Here are the datasheets for thebright green LED, theblue LED, and thered LEDas used in the simulation. There is also anoverview page/catalog for all the LEDs.I combined the "Forward Current vs. Forward Voltage" graphs for the red and blue LEDs, and then drew the black DC load line into it (220 Ohm current limiting resistor like in the circuit diagram, 5V supply => 5V/220Ohm = 22.72mA). See the attachment for the DC load line (red LED curve left, blue LED curve right).So the red LED would have roughly Vf=2.1V at If=15ma and the blue one Vf=3.15V at If=9mA. But obviously that is incorrect when the LEDs are in parallel: both would be glowing with those values, but the simulation shows 2.09V across both LEDs, 13.18mA for red and 18.2nAfor blue, so only the red one would actually light up. So how would you do this correctly using the graphs above?Is there a simple graphical or arithmetic method to estimate how such a parallel LED circuit will behave, at least so it roughly matches values from a simulation/real circuit?Edit: since this thread is getting long, for people looking forthe answer I found(with help from people in this thread, thanks!), is here:https://www.eevblog.com/forum/beginners/predicting-current-for-parallel-leds/msg4483126/#msg4483126

author: maelh
author_rank: Regular Contributor
timestamp: October 24, 2022, 08:31:14 pm
content: To make the problem even more clear, here is the DC load line for the same circuit in principle, but with aredandbright greenLED in parallel. (They should have chosen more contrasting colors in the graph, but I combined the original ones. So, left curve is red, right curve is green.)As they have the same typical forward voltage (see datasheet) you would expect both of them to light up, and indeed, the simulation shows they would (and a real world circuit shows they do as well). The green one has a slightly higher forward voltage, as can be seen in the graph, and therefore is a bit dimmer.Simulation shows also that difference in current: 10.58mA for the red LED, 2.66mA for the bright green LED.However the DC load line for both shows about 15-16mA.While it is expected that the bright green LED is dimmer than the red one (from the graphs alone), I fail to see how to estimate the actual currents (ignoring temperature variations etc.). How do you get in the right ballbark to match the simulation results?Is there a graphical method?

author: TimFox
author_rank: Super Contributor
timestamp: October 24, 2022, 08:52:27 pm
content: You need to add a third curve to the graph with that load line, that shows the total current of the two devices.Note that where the "red" curve by itself intersects the load line, the voltage is low enough that at that voltage, the current drawn by the "green" device is very low.Since the diodes are directly in parallel, the voltage across each of them is the same.With the third curve of total current vs. forward voltage, you can find the voltage across the parallel load, then look at the individual currents in the two curves you already have at that value of forward voltage.

author: Benta
author_rank: Super Contributor
timestamp: October 24, 2022, 08:57:41 pm
content: Just place a vertical line around the VF point and move it left or right as needed. The intersections of the line and the two VF curves should give you the current relationship between red and green.For red/blue this won't work (you'll never have an intersection for both curves), telling you that onle the lower VF part (red) will light up.

author: TimFox
author_rank: Super Contributor
timestamp: October 24, 2022, 09:05:53 pm
content: You need to find that vertical line by intersecting the third curve I mentioned (total current vs. Vf) with the load line, then look at the individual current values on the two original curves.

author: maelh
author_rank: Regular Contributor
timestamp: October 24, 2022, 09:43:51 pm
content: Quote from: TimFox on October 24, 2022, 09:05:53 pmHow would I know what the total current vs. Vf is like? Can you give an example? That's essentially the main question I don't know how to solve.

author: ledtester
author_rank: Super Contributor
timestamp: October 24, 2022, 11:03:54 pm
content: Let I_1(v) be the current through LED 1 when the voltage across it is v. Let I_2(v) be the same for LED 2. Then I_total(v) = I_1(v) + I_2(v) is the I-V curve for the parallel combination.Intersect I_total with the load line to determine the operating voltage and then plugged that voltage into I_1 and I_2 to get the currents for the individual LEDs.

author: TimFox
author_rank: Super Contributor
timestamp: October 24, 2022, 11:11:15 pm
content: Quote from: maelh on October 24, 2022, 09:43:51 pmYou have two curves for diode current vs. Vf.For each value of Vf, add the two currents together to get the total current at that Vf.The Vf value must be the same on both diodes since they are connected together.

author: timenutgoblin
author_rank: Regular Contributor
timestamp: October 25, 2022, 12:04:16 am
content: Quote from: maelh on October 24, 2022, 06:30:09 pmQuote from: maelh on October 24, 2022, 08:31:14 pmLooking at your graphs with the black DC load line, the line should (I think) intercept with the Y-axis at 18.18mA instead of 22.72mA. The X-axis only goes to 1.0V (Forward Voltage). If you extend the X-axis to 0V or revise your DC load line to intercept at 18.18mA on the Y-axis then the number will correspond to your expected values more closely. You'll get 12.4mA which is closer to your expected value of 10.58mA instead of 15mA - 16mA as you appear to be getting at the moment.

author: maelh
author_rank: Regular Contributor
timestamp: October 25, 2022, 07:34:51 am
content: So I was a bit more systematical about it, and after many hours got the following result (clarification edit: it seems to be pretty accurate/to be a success).I made screenshots of the V-I curves in the LEDs' datasheets, and converted the graphs to CSV-files with this website:https://automeris.io/WebPlotDigitizer/Loaded the datapoints/CSV-files into Python with PandasLinearly interpolated the data points with SciPyDefined the DC loadline equationDefined two new functions:sum of the red LED's VI-curve and the blue LED's VI-curve (simply called sum in the graphs)sum of the red LED's VI-curve and the green LED's VI-curve (simply called sum in the graphs)Used SciPy's fsolve to find the intersection between the sum VI-curves and the DC loadlineAnd finally created annotated graphs with Matplotlib containing all this informationThe Python program also outputs the following results:QuoteThe results don't perfectly match the simulation in LTSpice but are pretty close. For comparison, the LTSpice values:QuoteThe following graphs contain the original V-I-curves (converted from the datasheets to CSV files, then drawn again with Matplotlib), the sum of two LEDs' V-I-curves, the DC loadline, and the intersection point between the DC loadline and the sum curve.There is no vertical line at the operating point voltage, instead the values were computed only (see quote above for the results of the Python program).Note that the 2nd graph might look not completely right, because of the limited data, and the interpolation being only linear (the extrapolation at the end of the curves is linear as well, which is why they look like straight lines). I guess you could also do curve fitting to extract the more closely matching exponential function and get a bit better results. But the main point I wanted to illustrate is that the sum curve is always a bit to the left of both LED curves, indicating that more current flows when there are two LEDs in parallel, rather than one "working" alone, even if it is very little when the forward voltages are further apart.As ledtester mentioned, summing the currents/V-I-curves of the LEDs that are in parallel is what is needed to get the "equivalent" circuit's V-I curve, that "replaces" both LEDs. It makes sense as the circuit is divided into two branches after the resistor, each branch having one LED: according to KCL, I(R5)=I(D6)+I(D7). So, whatever current exits the resistor must be divided among the two diodes/LEDs. How that division happens, is shown in the graphs.Edit: to clarify, it seems the problem was solved with acceptable accuracy, as shown above.

author: maelh
author_rank: Regular Contributor
timestamp: October 25, 2022, 08:00:18 am
content: So far I don't see any errors (except for slight differences in the resulting values). If you have any additional comments, feel free to add them

author: maelh
author_rank: Regular Contributor
timestamp: October 25, 2022, 01:18:36 pm
content: Also, is there a way to extract the values from graphs/curves in datasheets without using a tool to retrace the curves? Aside from simulation/building a test circuit, do manufacturers provide these curves as raw data / CSV files or even arithmetic expressions?

author: ledtester
author_rank: Super Contributor
timestamp: October 25, 2022, 03:02:58 pm
content: Quote from: maelh on October 25, 2022, 01:18:36 pmCouple of reasons:* There will always be variation in produced units so it's kinda pointless to specify precise values. If present in the datasheet an I-V curve is there mainly to give you an idea of what to expect. The same can be said for any graph in a datasheet.* LEDs are generally not chosen for their I-V curve but for other things like brightness at various currents, type of lens/diffusion and color.I'm curious why you are interested in having both LEDs share the same resistor. If each had their own resistor you could control the current through each of them individually.

author: maelh
author_rank: Regular Contributor
timestamp: October 25, 2022, 04:25:08 pm
content: Quote from: ledtester on October 25, 2022, 03:02:58 pmI am not for practical circuits, and I am aware it's not good circuit design. This task/question came up in a lecture on youtube, and their explanation on why the LEDs behave the way they do was winging it too much for my taste.Precise examples help to understand it clearly step by step, later on you can add wiggle room when a precise example made sense.Also when there are too many implicit rules of thumb everywhere it's hard to think independently. Precise graphs allow to play around a bit mathematically and observe the effects of simplifying VI curves first hand.For example if the 2nd graph (in my initial post) was really exponential, the sum curve would not have a significant distance to the red LED curve.True exponential graph:As opposed to the linear approximation (and extrapolation) I posted earlier:Yet in real life experiments I could get the red and the blue LED to both light up and stay at/below 30mA, despite their forward voltages being 1V or so apart (measured with a component tester).If the curves of the real life LEDs were truly exponential this would not work. But when they taper off to something linear like in the 2nd graph, it can work.

author: TimFox
author_rank: Super Contributor
timestamp: October 25, 2022, 04:27:47 pm
content: Another complication that makes an accurate mathematical solution difficult is that the curve of current vs. forward voltage for any semiconductor depends on the temperature of the junction, which depends on more than just the current through the device.As a practical matter, this is usually seen as a shift in the forward voltage at a given current with change in temperature.As ledtester commented, LEDs are usually specified by light output as a function of current, but even that is a function of junction temperature.More generally, wiring semiconductor diodes in parallel (without "equalizing resistors" in series with each) is usually a bad idea.

author: maelh
author_rank: Regular Contributor
timestamp: October 25, 2022, 04:54:38 pm
content: Yes, and to see what all those changes look like in practice on graphs, rather than just having a rough idea of what happens is the purpose of it. The point is to get a better intuition for circuits/graphs, not to actually put LEDs in parallel. I added some pictures above to illustrate this goal.If I had no proper data at all (which needs to be precise, even if it could vary over time due to temperature etc.), I would have to know the theoretical result/interpretation already to see the effects. Think of it as empirical tests to understand the theory, and playing around to get an intuition.

author: maelh
author_rank: Regular Contributor
timestamp: October 26, 2022, 12:18:42 am
content: Further tests show that the VI curve created in LTSpice (with the LED model provided by the manufacturer) actually differs from the curve in the datasheet slightly. I suppose they drew an idealized exponential curve, because curve fitting the graph from the datasheet renders a simple exponential term which matches very closely the curve from the datasheet.The VI-curve obtained from LTSpice however does not follow it so closely.

author: TimFox
author_rank: Super Contributor
timestamp: October 26, 2022, 03:41:07 am
content: The Shockley equation for a P-N junction is idealized, and there is always parasitic resistance in a practical diode.Again, if you trace the curve yourself on an actual diode, you will find noticeable temperature effects as the diode heats and cools with changes in current.

author: MrAl
author_rank: Super Contributor
timestamp: October 26, 2022, 08:51:52 am
content: Quote from: maelh on October 24, 2022, 06:30:09 pmHello,Lot of good replies in this thread already. I'll add a little too.First, are you suggesting placing LED's of two different colors in parallel?I have to ask why you would even consider doing that due to the fact that they will have different characteristic voltage specs and that means the currents for each will be much different. For example, a standard red LED and a bright white LED in parallel, the white LED may not light up at all while the red one is as bright as the nearest star.This means if you plan for a total current of 40ma (thinking each will get 20ma) the red LED would get the full 40ma and burn out.Placing two of the same color in parallel is even a risk because they may not have the same characteristic voltage specs either even if the same make and model. Since the characteristic voltage has a lot to do with the current an LED will draw and since the current level is very sensitive to the voltage, you may see wide differences in currents between the two LEDs. This means one is likely to burn up if you dont take this into consideration.There was (not sure if it is anymore) a Streamlight flashlight like this. It had four AA batteries and i think 10 white LEDs. The LEDs were wired in parallel with just one current limiting resistors. I had two of the same model. With both, the white LEDs burnt out one by one, first blinking on and off then out completely. After a few burnt out, the rest would get even more current which burnt them out even faster. This is because when they are in parallel and they initially share the total current which may be twice that of the requirement of one LED, when one burns out it becomes an open circuit and so the remaining LED gets the full current which again may be twice as much as it should have. The LED wont last long like that.The only way around this really is to set the total current to that of just one LED, ideally. That way if one burns out the remaining LED gets just the regular normal but max current for that model. This kind of defeats the purpose of having more than one LED though because then each one normally works at only one half the current and that means approximately one half the brightness, although each one will be slightly more bright than that.The right way to do this and get full brightness is to use a resistor for each LED being used in the circuit. This way each LED is protected. If one burns out, the others go right on lighting up the room with no problem.Ideally LEDs should get a particular current rather than a particular voltage. If the current is to be 20ma, then supply 20ma, and let the voltage go to whatever it needs to be. That means an LED that has characteristic voltage of 3.1 volts will be lit the same as one with a characteristic voltage of 3.2 volts. They both get 20ma, they both are happy, and should last the expected life of the device.Maybe you can make it clear why you want to place two of different colors in parallel though. I would think that would not work very well.If you want to study this in more detail, look for the exponential model of a diode and go from there. The LEDs are similar to that although they have different parameters. You can then do a non linear circuit analysis and see what exactly is happening. You can also see what happens when they start to heat up.

author: TimFox
author_rank: Super Contributor
timestamp: October 26, 2022, 02:06:32 pm
content: Mr Al is right that the best way to power the two LEDs is with separate resistors.The second-best way is to wire them in series with a single resistor, since at least you know that the current in the two devices is equal.However, the light output from different color devices at a given current differs.

author: maelh
author_rank: Regular Contributor
timestamp: October 27, 2022, 08:23:11 am
content: Quote from: MrAl on October 26, 2022, 08:51:52 amAs I mentioned in my initial and several other posts:notto make a practical circuit. And I am aware of the negatives. It was a topic in a youtube lecture, and I wanted to understand what happens better. For details, please read the last posts about experimenting to get intuition above.QuoteThanks for your added details. Maybe you haven't seen my detailed posts where I cleared up the questions and documented the results? If you have another practical non-linear analysis, I'd be open to see it. What I found mostly resembles iterative solving of differential equations in a way similar to a circuit simulator. Not too helpful for creating an intuition.

author: maelh
author_rank: Regular Contributor
timestamp: October 27, 2022, 08:32:10 am
content: Quote from: TimFox on October 26, 2022, 03:41:07 amI was comparing thedatasheetto the LTspicemodel, both stemming from the same manufacturer, so no real LED involved here, just models expressed differently (and since it's a simulation no temperature effects). So all is virtual/theoretical and from the same source, so should match.So I was expecting to get very similar graphs, but something is slightly off.Maybe I'll post a new question about this.Apart of that the question is solved, as documented in my replies.

author: MrAl
author_rank: Super Contributor
timestamp: October 27, 2022, 09:36:25 am
content: Quote from: maelh on October 27, 2022, 08:23:11 amOh i see what you are after now, you are more interested in the theory and how to visualize it more or less to understand it better.Well, not all circuits are as simple as a couple resistors and battery, for example. Some circuits are much more complicated. That doesnt mean you cant get some sort of intuitive view of what is happening though, it just means a little higher level of intuition.For non linear circuits with no storage elements, there are basically two or three ways to handle them.The first is a straightforward non linear analysis which will almost always involve solving an equation that can only be solved using a numerical method, such as Newton's. That involves an iterative loop as you found out.The second is a curve fitting method that attempts to find a curve that solves the problem. This is a little more deterministic but still requires a step that involves a hunt for the solution. It also involves a bunch of matrix calculations to 'rotate' the parameters so they can be singled out in order to predict their solutions.The third is a linearization technique that makes the 'diodes' look more linear, and thus a completely linear solution comes out of it which does not involve an iteration. This means assuming an operating point for the LEDs and within a small range treating them as pseudo linear devices. For example, if you have a red LED that has a spec of 20ma and you intend to run it at 10ma, then you can test it at maybe 8ma to 12ma to determine the pseudo resistance, and then you can replace the LED with a voltage source in series with a resistor. As you probably know, even of you have 100 constant voltage sources and 100 resistors in the same circuit, the circuit is still linear, so you can use linear techniques to solve it, which of course do not have to be iterative. There's still a bit of work to be done though because you have to test each LED, but if you are only interested in the theory behind it then you can probably just estimate the value of the voltage source and the value of the resistor for each LED. You can probably get that from the data sheet. Once you have that, you can then just vary the voltage source for an LED to see what happens when one LED voltage is different than the other.As a quick example, say we have a white LED that has a voltage of 3v at 8ma and 3.2v at 12ma. The difference in voltage is 0.2v and for current it is 4ma, so the resistor value would be 50 Ohms. To get the voltage value, we know that at 3v it draws 8ma and 8ma times 50 Ohms gives us 0.4 volts, and since we have to read 3v across the entire LED at that point that means the voltage source voltage has to be 2.6v.Just to check, with the 50 Ohms in series with 2.6v, at 8ma we get exactly 3v and at 12ma we get: 2.6+50*0.012 which equals 3.2v, so we calculated the right voltage and resistor values. This source of 2.6v and with 50 Ohms in series would replace the entire LED. If we had a second LED of the same make and model, we would have a second voltage of 2.6v and second 50 Ohm resistor, but to see any variation effects we could change the source a little to maybe 2.5v and up to maybe 2.7v just to see the effects of the current draw. With a few calculations you can develop a formula for the two LEDs in parallel and then you can plot the results.Just keep in mind that you can not go too far out of range with the current or voltage because the linearization model will start to deviate too far from the real LED. Even with that small range though you should be able to start to get a feel for how this works and the calculations will be much, much simpler.Maybe you can get back here with some results of your experiments we can talk about that more.