Author Topic: When constant current isn't constant.... on LED driver.  (Read 3752 times)

0 Members and 1 Guest are viewing this topic.

Offline 1sciguyTopic starter

  • Contributor
  • Posts: 36
  • Country: us
When constant current isn't constant.... on LED driver.
« on: March 22, 2019, 03:40:47 pm »
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?
 

Offline chemelec

  • Contributor
  • Posts: 33
  • Country: ca
Re: When constant current isn't constant.... on LED driver.
« Reply #1 on: March 22, 2019, 03:53:51 pm »
You should Add Filter Caps to the Regulator's Output.
 

Offline 1sciguyTopic starter

  • Contributor
  • Posts: 36
  • Country: us
Re: When constant current isn't constant.... on LED driver.
« Reply #2 on: March 22, 2019, 04:09:58 pm »
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.
 

Offline duak

  • Super Contributor
  • ***
  • Posts: 1041
  • Country: ca
Re: When constant current isn't constant.... on LED driver.
« Reply #3 on: March 22, 2019, 04:22:59 pm »
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
 

Online Benta

  • Super Contributor
  • ***
  • Posts: 5869
  • Country: de
Re: When constant current isn't constant.... on LED driver.
« Reply #4 on: March 22, 2019, 04:35:13 pm »
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.

« Last Edit: March 22, 2019, 04:41:11 pm by Benta »
 

Online magic

  • Super Contributor
  • ***
  • Posts: 6761
  • Country: pl
Re: When constant current isn't constant.... on LED driver.
« Reply #5 on: March 22, 2019, 04:59:46 pm »
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.
 

Online Benta

  • Super Contributor
  • ***
  • Posts: 5869
  • Country: de
Re: When constant current isn't constant.... on LED driver.
« Reply #6 on: March 22, 2019, 05:06:37 pm »

Simple solution: rewire the LM317 to output constant 24V (or replace with LM7824) and add appropriate series resistors with each string.

How would an LM317 or 7824 output 24 V, when the input voltage is 24 V? Over-unity?
 

Offline 1sciguyTopic starter

  • Contributor
  • Posts: 36
  • Country: us
Re: When constant current isn't constant.... on LED driver.
« Reply #7 on: March 22, 2019, 05:07:18 pm »
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..
 
 

Offline 1sciguyTopic starter

  • Contributor
  • Posts: 36
  • Country: us
Re: When constant current isn't constant.... on LED driver.
« Reply #8 on: March 22, 2019, 05:08:47 pm »
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.
« Last Edit: March 22, 2019, 05:11:33 pm by 1sciguy »
 

Online Benta

  • Super Contributor
  • ***
  • Posts: 5869
  • Country: de
Re: When constant current isn't constant.... on LED driver.
« Reply #9 on: March 22, 2019, 05:15:38 pm »
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.

Not 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.
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 26896
  • Country: nl
    • NCT Developments
Re: When constant current isn't constant.... on LED driver.
« Reply #10 on: March 22, 2019, 05:17:02 pm »
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.
This 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_source
The output from your microcontroller can serve as a constant voltage at the base of the transistor.
« Last Edit: March 22, 2019, 05:20:02 pm by nctnico »
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Online Gyro

  • Super Contributor
  • ***
  • Posts: 9485
  • Country: gb
Re: When constant current isn't constant.... on LED driver.
« Reply #11 on: March 22, 2019, 05:28:47 pm »
I think the 18V  or 19V zener to ground would be the best solution. The zener would never fire unless the diodes are off...

I think that would work fine... at least for now.
Best Regards, Chris
 

Offline 1sciguyTopic starter

  • Contributor
  • Posts: 36
  • Country: us
Re: When constant current isn't constant.... on LED driver.
« Reply #12 on: March 22, 2019, 05:33:55 pm »
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.

« Last Edit: March 22, 2019, 05:48:12 pm by 1sciguy »
 

Offline mariush

  • Super Contributor
  • ***
  • Posts: 5018
  • Country: ro
  • .
Re: When constant current isn't constant.... on LED driver.
« Reply #13 on: March 22, 2019, 06:44:28 pm »
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/1794979

10mA +/- 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 boards

Or 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/2748559
This could also work but you may have to put it on a tiny pcb and then solder pcb to lm317 footprint on old board.
« Last Edit: March 22, 2019, 06:46:49 pm by mariush »
 
The following users thanked this post: 1sciguy

Offline 1sciguyTopic starter

  • Contributor
  • Posts: 36
  • Country: us
Re: When constant current isn't constant.... on LED driver.
« Reply #14 on: March 22, 2019, 06:48:36 pm »
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.
 

Offline 1sciguyTopic starter

  • Contributor
  • Posts: 36
  • Country: us
Re: When constant current isn't constant.... on LED driver.
« Reply #15 on: March 22, 2019, 06:53:01 pm »
Interesting chip..
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 26896
  • Country: nl
    • NCT Developments
Re: When constant current isn't constant.... on LED driver.
« Reply #16 on: March 22, 2019, 06:54:52 pm »
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.
« Last Edit: March 22, 2019, 06:59:58 pm by nctnico »
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 
The following users thanked this post: 1sciguy

Offline 1sciguyTopic starter

  • Contributor
  • Posts: 36
  • Country: us
Re: When constant current isn't constant.... on LED driver.
« Reply #17 on: March 22, 2019, 07:00:36 pm »
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/1794979

10mA +/- 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 boards

Or 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/2748559
This could also work but you may have to put it on a tiny pcb and then solder pcb to lm317 footprint on old board.

Wow!  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
« Last Edit: March 22, 2019, 07:15:03 pm by 1sciguy »
 

Offline mariush

  • Super Contributor
  • ***
  • Posts: 5018
  • Country: ro
  • .
Re: When constant current isn't constant.... on LED driver.
« Reply #18 on: March 22, 2019, 08:06:52 pm »
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%
 
The following users thanked this post: 1sciguy

Offline Datman

  • Regular Contributor
  • *
  • Posts: 108
  • Country: it
Re: When constant current isn't constant.... on LED driver.
« Reply #19 on: March 26, 2019, 01:58:20 pm »
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.
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19494
  • Country: gb
  • 0999
Re: When constant current isn't constant.... on LED driver.
« Reply #20 on: March 26, 2019, 02:18:04 pm »
The LM317 shouldn't be used for such low current designs. Use the LM317L instead. 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.
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 16607
  • Country: us
  • DavidH
Re: When constant current isn't constant.... on LED driver.
« Reply #21 on: March 26, 2019, 06:09:54 pm »
Do not blame the LM317 operating as a current source as shown before measuring the actual surge current when coming out of saturation.
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19494
  • Country: gb
  • 0999
Re: When constant current isn't constant.... on LED driver.
« Reply #22 on: March 26, 2019, 11:04:09 pm »
Do not blame the LM317 operating as a current source as shown before measuring the actual surge current when coming out of saturation.
I 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.
 

Offline Yansi

  • Super Contributor
  • ***
  • Posts: 3893
  • Country: 00
  • STM32, STM8, AVR, 8051
Re: When constant current isn't constant.... on LED driver.
« Reply #23 on: March 26, 2019, 11:14:37 pm »
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.
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 16607
  • Country: us
  • DavidH
Re: When constant current isn't constant.... on LED driver.
« Reply #24 on: March 27, 2019, 04:16:44 am »
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.

I 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.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf