When constant current isn't constant.... on LED driver. - Page 1
Forum section: electronics / projects

author: 1sciguy
author_rank: Contributor
timestamp: March 22, 2019, 03:40:47 pm
content: I have a circuit I designed in 2010. I am starting to get reports of failures of LED's in the field, and I believe this is way too short of a lifetime. Strangely, the LED's are failing shorted because there are six in a series string and two or three in the string will fail but the others remain lit. I have used an LM317 as a constant current source to the string providing 12mA. The LED's are rated at 20mA constant and allow 50mA pulsed. I have two sets that can be on depending on when my microcontroller switches them via the ULN2004 7 channel switch. I normally select the 6 green, or the 7 red LED string. I'm trying to figure out why the green LED's are failing, but the reds never fail. I think I figured it out, and seek further advice. The green LED's are sometimes pulsed at a very high rep rate of varying duty factor to make them brighten and dim in a slow undulation, just like the Apple logo in a Macbook. The forward voltage on the green LED's is 3V at 12mA, so the total string of green is 18V. I believe that when I place them in the undulation mode, the LM317 doesn't have time to stabilize its 12mA output setting, so I am spiking them with much higher currents. The open circuit voltage on the string would go to 24V, so at the very beginning of switch closure on the ULN2004, I have 24V on the series string. My immediate thought is to add a series resistor to drop the remaining 6 volts (24-18V), but I also realize that sometimes the 24V supplied to the LM317 may sometimes be 28V. Also considered an 18V Zener across the string. I'm in the middle of a move and packed up my scope, so I can't measure the size of the current spikes, but it must be substantial. Should I add another path for the LM317 output so it can stay in regulation mode at times when neither the red string or the green string are switched on?

author: chemelec
author_rank: Contributor
timestamp: March 22, 2019, 03:53:51 pm
content: You should Add Filter Caps to the Regulator's Output.

author: 1sciguy
author_rank: Contributor
timestamp: March 22, 2019, 04:09:58 pm
content: But a capacitor in the circuit could make things worse if that cap charges to 24V when all LED's are off. This would be more joules to dump into the LED's. I'm leaning toward putting a 1.6K ohm resistor to ground so when the LED's are off, the regulator will simply rise to a new compliance voltage of 19 volts to stay in regulation.

author: duak
author_rank: Super Contributor
timestamp: March 22, 2019, 04:22:59 pm
content: The LM317 has a 10 mA minimum current requirement. I'd bet there's a high current pulse just after the LEDs are enabled and before the current stabilizes on the desired value. I'd probably consider a zener diode first. A parallel resistor will bypass current from the LEDs whereas the zener will only conduct when the LEDs are disabled. A capacitor might help but it would also store energy that would be discharged into the LEDs when they were enabled.Since green LEDs have a greater forward voltage drop, they'll dissipate more power for the same current. Since the LEDs fail by shorting, I'd expect to find each die to have a very small melted area. This is caused by current filamenting where current is concentrated in the hottest areas and finally runs away.Best o' luck

author: Benta
author_rank: Super Contributor
timestamp: March 22, 2019, 04:35:13 pm
content: As duak says, the LM317 needs a minimum output current of 10 mA to regulate. If the ULN part is off, there is no regulation at all until you suddenly slam it with a load. This will result in ~22...23 V directly on the LEDs until the LM317 settles into regulation.A quick and very dirty solution could be a parallel 10 mA sink and increasing output current to 22 mA, but it's not nice.A better solution would be a discrete solution with an NPN, two diodes and two resistors. This will not have the issue, but will not be as exact as the LM317.

author: magic
author_rank: Super Contributor
timestamp: March 22, 2019, 04:59:46 pm
content: Even if you load the LM317 with its specified minimum current, it will still turn its output fully on in a futile attempt to push 12mA (or 22mA or whatever) through disconnected load. Then when the LEDs turn on, they will get a short pulse of 24V before the regulator recovers from saturation.Simple solution: rewire the LM317 to output constant 24V (or replace with LM7824) and add appropriate series resistors with each string.

author: Benta
author_rank: Super Contributor
timestamp: March 22, 2019, 05:06:37 pm
content: Quote from: magic on March 22, 2019, 04:59:46 pmHow would an LM317 or 7824 output 24 V, when the input voltage is 24 V? Over-unity?

author: 1sciguy
author_rank: Contributor
timestamp: March 22, 2019, 05:07:18 pm
content: I agree with the point that the LM317 has gone out of regulation and it slams the diodes with 24V. I have heard that it is bad to run multiple LED's in series with a constant voltage source and a current limiting resistor because differences in forward voltage will cause one led to burn brighter and the others go dimmer. I should have done this differently and clearly need to redesign, but was looking for a temporary fix for the ones I'm shipping out now.. before my new design is put to pcb. I looked at the 1.8K to ground solution and it does keep the LM317 regulating, but at the expense of stealing a little bit of drive current when I want the LED's on. I think the 18V or 19V zener to ground would be the best solution. The zener would never fire unless the diodes are off... But do they turn on fast enough to satisfy the LM317? I assume they would..

author: 1sciguy
author_rank: Contributor
timestamp: March 22, 2019, 05:08:47 pm
content: Benta, at the point the LED's are off, the voltage at the output of the LM317 becomes the source voltage. No current drop = no voltage drop. Oh.. I answered the wrong question.. you were referring to when it is wired as a voltage regulator. Right. it can't.

author: Benta
author_rank: Super Contributor
timestamp: March 22, 2019, 05:15:38 pm
content: Quote from: 1sciguy on March 22, 2019, 05:08:47 pmNot quite, you'll have a diode drop or two, but that's beside the point.The point is, that an LM317 with no output current simply isn't active. The 10 mA output current is used to supply the internals. Due to loop compensation inside the IC, it'll need some time to settle, and that's what's giving you problems. It's a "cold start" every time your PWM turns on. No wonder your LEDs are dying.

author: nctnico
author_rank: Super Contributor
timestamp: March 22, 2019, 05:17:02 pm
content: Quote from: 1sciguy on March 22, 2019, 05:07:18 pmThis isn't true. The current through each LED in a series string will be equal. If one LED is brighter/dimmer than the other you have to buy better matched LEDS. I think the others already pointed out the problem with the circuit. A better solution however would be to use a simple transistor circuit to create a constant current sink for each string. A +/-30% tolerance in current probably isn't noticable for the user.See the zener diode current source (actually it is a sink) from here:https://en.wikipedia.org/wiki/Current_sourceThe output from your microcontroller can serve as a constant voltage at the base of the transistor.

author: Gyro
author_rank: Super Contributor
timestamp: March 22, 2019, 05:28:47 pm
content: Quote from: 1sciguy on March 22, 2019, 05:07:18 pmI think that would work fine... at least for now.

author: 1sciguy
author_rank: Contributor
timestamp: March 22, 2019, 05:33:55 pm
content: Thanks guys.. sounds good. At least I see my original fatal flaw more clearly. Now I probably have months worth of warranty replacements to start working on.. Aaarggh!Probably would have worked forever had I not wanted to do the fancy PWM dimming. Like I said, the red LED's are not failing in the field and they have an even lower stack voltage drop. Lots of options now.. Since I just bought a huge reel of 317's, I guess I'll turn them into voltage regulators on the board to get a constant 20V and then use current limiting resistors in the next board design.

author: mariush
author_rank: Super Contributor
timestamp: March 22, 2019, 06:44:28 pm
content: You could just replace your Lm317 with something simpler like this :https://uk.farnell.com/on-semiconductor/nsi50010yt1g/ic-led-driver-50v-0-01a-sod123/dp/179497910mA +/- 30% , up to 50v ... cheap in quantity. You could probably solder it between the IN and ADJ in the lm317 footprint so you don't have to throw out the boardsOr this one (10mA +/- 10% preset, up to 350mA with external resistor), up to 40v :https://uk.farnell.com/diodes-inc/bcr420ufd-7/led-driver-linear-1khz-udfn-6/dp/2748559This could also work but you may have to put it on a tiny pcb and then solder pcb to lm317 footprint on old board.

author: 1sciguy
author_rank: Contributor
timestamp: March 22, 2019, 06:48:36 pm
content: I think this will be the final fix for the long term. I have reels of BSS123, so easy to make current mirrors. R1 sets the current for the green string based on 5V out of microcontroller. R4 sets it for the red string. No voltage regulator on top of the strings.. just rely on the current mirrors to set the currents. Anybody see anything wrong? Switch 1 is there to turn off some lettering on a display by shorting some red LED's out. Have not checked the proper value of R1 and R4 yet, but I think I'm in the ballpark. I have traditionally tried to minimize component count because I was hand placing parts, but now I have a pick-n-place machine, so part count isn't a big deal.

author: 1sciguy
author_rank: Contributor
timestamp: March 22, 2019, 06:53:01 pm
content: Interesting chip..

author: nctnico
author_rank: Super Contributor
timestamp: March 22, 2019, 06:54:52 pm
content: I wouldn't make it this way. The variations between the MOSFETs will be too big. You could do a current sink like with an NPN transistor (even less components) but you might see a way to large variation between the devices. I strongly recommend not to go cheap and buy NPN transistors so you can fix the circuit properly and make it reliable. That will probably result in satisfied customers. In the end they'll remember you fixed the problem once and for all.Edit: the NSI50010YT1G could also be a fix of your circuit. Just place it where the LM317 used to be. I'd be worried about power dissipation though. Adding a series resistor which takes care of most of the dissipation might be a good idea.

author: 1sciguy
author_rank: Contributor
timestamp: March 22, 2019, 07:00:36 pm
content: Quote from: mariush on March 22, 2019, 06:44:28 pmWow! Never knew they existed! I can use the 15mA version and be absolutely fine. A little brighter too, without fear of burning out LED's. Thanks! And yes, I use this same layout on two different boards, so that is going to save me from redesigning two 4-layer boards.https://uk.farnell.com/on-semiconductor/nsi45015wt1g/led-driver-55-to-150deg-c-sod/dp/2985371

author: mariush
author_rank: Super Contributor
timestamp: March 22, 2019, 08:06:52 pm
content: Yes, but keep in mind that it's +/- 20% , so you may have up to 18mA ... which should still be fine for modern leds.The 10mA is +/- 30%

author: Datman
author_rank: Regular Contributor
timestamp: March 26, 2019, 01:58:20 pm
content: You could drive the LM317 by the Adj, making PWM by it. Put a resistor in series with the Adj: when you short Adj to Gnd, you obtain only 1.25V at the output.

author: Zero999
author_rank: Super Contributor
timestamp: March 26, 2019, 02:18:04 pm
content: The LM317 shouldn't be used for such low current designs. Use the LM317Linstead. It has a lower minimum operating current and even if it goes out of regulation, the maximum surge will be limited to 220mA, rather than the >2.2A permitted by the LM317. It also has a much smaller output transistor, so should respond more quickly.

author: David Hess
author_rank: Super Contributor
timestamp: March 26, 2019, 06:09:54 pm
content: Do not blame the LM317 operating as a current source as shown before measuring the actual surge current when coming out of saturation.

author: Zero999
author_rank: Super Contributor
timestamp: March 26, 2019, 11:04:09 pm
content: Quote from: David Hess on March 26, 2019, 06:09:54 pmI agree. I just don't get why people often use the overkill LM317 in applications designed for a few tens of mA. I understand it might make sense for prototyping and to an extent hobbyist use, as stocking only one part is more convenient, than two, but for large production runs it makes more sense to use the smaller and cheaper LM317L. The lower minimum load and current limit are also advantageous, in lower power applications.

author: Yansi
author_rank: Super Contributor
timestamp: March 26, 2019, 11:14:37 pm
content: I don't understand why would one even come up with an N-MOS based current mirror solution. Hell, use a damn NPN with emitter resistance as an constant current sink! Just two simple NPNs driven directly by the logic circuitry, defining the reference voltage for the current sink.

author: David Hess
author_rank: Super Contributor
timestamp: March 27, 2019, 04:16:44 am
content: Quote from: Zero999 on March 26, 2019, 11:04:09 pmI have had to use the TO-220 package 317 even at low currents sometimes to meet power dissipation requirements. A TO-220 package without any heat sinking is good for 2 watts versus 625 milliwatts for the TO-92 317.

author: Zero999
author_rank: Super Contributor
timestamp: March 27, 2019, 12:34:01 pm
content: Quote from: David Hess on March 27, 2019, 04:16:44 amThat would make sense, but we're talking about 12mA here. Unless it's very hot, the voltage would have to exceed the LM317L's maximum rating to even get close to the rated power dissipation.

author: 1sciguy
author_rank: Contributor
timestamp: March 31, 2019, 06:37:25 pm
content: Quote from: Zero999 on March 26, 2019, 11:04:09 pmI used it because I already had a whole reel of them on my pick-n-place machine from another higher current application. Yes, I realize now it was a bad choice, and the LM317L would have also been a bad choice for this application because of my PWM dimming scheme. Just tested the NSI45015WT1G as others suggested and it works beautifully. And indeed it fits perfectly on the old LM317 surface mount footprint. Even though this was "production", we aren't talking millions of copies. I sell about 200 a year of this particular card, so I wanted to use up my reel of unused LM317's. Again, poor choice.