LED constant current source scheme

Ron H

Joined Apr 14, 2005
7,063
I use the MC33174 to replace the lousy old LM324, the MC33172 to replace the lousy old LM358 and the MC33171 to replace the lousy old LM321.
They have exactly the same low power supply current, the same input that works down to the negative power supply voltage (ground if a single supply), the same output that can go to ground if a single supply and the same 3V minimum allowed supply voltage.

But these Motorola/ON Semi opamps do not have the horrible 3% crossover distortion (it is only 0.03%) and have a full output bandwidth that is 35 times more (to 35kHz) than the lousy old ones. Their max allowed power supply voltage is 44V which is 12V higher than the lousy old ones.
No doubt LM324 is a piss-poor op amp for dynamic applications, but this is a DC current source, and LM321/324 should be more than adequate. If MC33171 is more readily available and inexpensive, I would say go for it.:)
 

GioD

Joined Mar 20, 2009
30
I try the circuit with op amp. It work good, I changed R8 to 6K8 to have 20mA on led. There are some things that I don’t work as I want.
1. The soft start work , but the trimmer don’t have effect. I change the capacitor to 1uF, in order to have 1 second time.
2. I need a soft start on power up, in this circuit the soft start work only driving the ON/OFF input.

Regards
 

Ron H

Joined Apr 14, 2005
7,063
I try the circuit with op amp. It work good, I changed R8 to 6K8 to have 20mA on led. There are some things that I don’t work as I want.
1. The soft start work , but the trimmer don’t have effect. I change the capacitor to 1uF, in order to have 1 second time.
2. I need a soft start on power up, in this circuit the soft start work only driving the ON/OFF input.

Regards
You have something wired wrong. The pot will change the soft start time if wired correctly, both when power is turned on and when the ON/OFF is used. 1uF is too low to give you 1 second soft start with the resistor and zener values shown.
You should also not need to change R8 to 6.8k. The circuit is designed to provide 20mA LED current, ± some percentage due to component tolerances (resistors and zener, mostly).
Check all your component values. measure the zener voltage.

EDIT: In order for the soft start to work when the power is turned on, the ON/OFF input must be grounded through a low impedance, such as a switch, or the output of a logic gate or a microcontroller.
 
Last edited:

GioD

Joined Mar 20, 2009
30
You are right. The current depend on the zener voltage’s and my zener don’t do the expected voltage. The soft start work good at power supply, only if I give a 0V to the input. The circuit is very good and stable, but there is another thing that disturb me. When the leds are off usign the control input, they are flowed by a 0,065mA current, that turn they light on. Is possible to completely shut off the leds ?


You have something wired wrong. The pot will change the soft start time if wired correctly, both when power is turned on and when the ON/OFF is used. 1uF is too low to give you 1 second soft start with the resistor and zener values shown.
You should also not need to change R8 to 6.8k. The circuit is designed to provide 20mA LED current, ± some percentage due to component tolerances (resistors and zener, mostly).
Check all your component values. measure the zener voltage.

EDIT: In order for the soft start to work when the power is turned on, the ON/OFF input must be grounded through a low impedance, such as a switch, or the output of a logic gate or a microcontroller.
 

Ron H

Joined Apr 14, 2005
7,063
You are right. The current depend on the zener voltage’s and my zener don’t do the expected voltage. The soft start work good at power supply, only if I give a 0V to the input. The circuit is very good and stable, but there is another thing that disturb me. When the leds are off usign the control input, they are flowed by a 0,065mA current, that turn they light on. Is possible to completely shut off the leds ?
Why does 65uA concern you? I can't believe it's visible.
The reason the current does not shut off is the finite Vce(sat) of the control transistor. When the transistor is on, a few millivolts remain on the + input of the op amp. If it really needs to be fixed, you can add the two resistors shown in the attachment. This will prevent the -input of the op amp from going below 20mV. The op amp output will then go to zero when the control input is high, turning off the current sinks completely.

BTW, you can also use half of an LM358, which is a dual op amp. You need to connect one input of the unused section to ground if you use this part.
 

Attachments

GioD

Joined Mar 20, 2009
30
Great Ron,
now the circuit is perfect!!! I very estimate and appreciate you. I design electronics boards, but I’m not very able with unusual configurations of transistor and op amp.

Thank you very much



Why does 65uA concern you? I can't believe it's visible.
The reason the current does not shut off is the finite Vce(sat) of the control transistor. When the transistor is on, a few millivolts remain on the + input of the op amp. If it really needs to be fixed, you can add the two resistors shown in the attachment. This will prevent the -input of the op amp from going below 20mV. The op amp output will then go to zero when the control input is high, turning off the current sinks completely.

BTW, you can also use half of an LM358, which is a dual op amp. You need to connect one input of the unused section to ground if you use this part.
 

GioD

Joined Mar 20, 2009
30
Only the last question, How can I calculate the value of this two new resistors ? Whats happen if I change R10 to 100ohm ?

Regards

GioD
 

Ron H

Joined Apr 14, 2005
7,063
Only the last question, How can I calculate the value of this two new resistors ? Whats happen if I change R10 to 100ohm ?

Regards

GioD
It works like this: The voltage on the op amp +input ramps from a few millivolts when the control is high to about 440mV when the control is low. The voltage divider consisting of R9 and (R10+R2) sets a threshold on the -input of the op amp. LED current will be zero until the +input ramps above the -input. The threshold voltage is

Vth=Vcc*(R10+R2)/(R9+R10+R2).
For Vth<<Vcc, R9 looks like a constant current, in your case Ith=24V/100k=240uA. So you can just assume that

Vth=(R10+R2)*240uA.

I set Vth at about 20mV, to allow for "worst case" values of Vce(sat) of Q5 and op amp input offset. Remember that Vce(sat) gets reduced by the voltage divider consisting of R11 and R8.
If you change R10 from 62 to 100, the threshold will change from 20mV to about 29mV. Not a big deal. It will work fine.
 

GioD

Joined Mar 20, 2009
30
:confused:

I realize the board with the final circuit, connecting 10 transistor as led driver. I see that there is an oscillation at about 280Khz. I see that it isn't dependent to the transistor number, but to the traces length. In my board the trace is 1,3 meter long. I try to mount some capacitor, the oscillation change but don’t stop.
 

Ron H

Joined Apr 14, 2005
7,063
:confused:

I realize the board with the final circuit, connecting 10 transistor as led driver. I see that there is an oscillation at about 280Khz. I see that it isn't dependent to the transistor number, but to the traces length. In my board the trace is 1,3 meter long. I try to mount some capacitor, the oscillation change but don’t stop.
Try cutting the trace between the op amp output and the transistor bases, and put 1k across the cut. Also add a capacitor between the op amp output and and its inverting (-) input. Try 1nF, 10nF, and 100nF. Hopefully, one of these will stop the oscillation.
See attached modified schematic.
 

Attachments

GioD

Joined Mar 20, 2009
30
Dear Ron, I try with the 1K resistor and the 1,10,100 nf capacitor, but the circuit ever oscillate. Now the oscillations are at 73Mhz. I don't understand why it continue to oscillate. The Q2 transistor is now used to drive 5 leds and is near to the opamp. The long trace is only to connect the other transistor. Have you any idea ? :confused:



Try cutting the trace between the op amp output and the transistor bases, and put 1k across the cut. Also add a capacitor between the op amp output and and its inverting (-) input. Try 1nF, 10nF, and 100nF. Hopefully, one of these will stop the oscillation.
See attached modified schematic.
 

Ron H

Joined Apr 14, 2005
7,063
Dear Ron, I try with the 1K resistor and the 1,10,100 nf capacitor, but the circuit ever oscillate. Now the oscillations are at 73Mhz. I don't understand why it continue to oscillate. The Q2 transistor is now used to drive 5 leds and is near to the opamp. The long trace is only to connect the other transistor. Have you any idea ? :confused:
The 280kHz oscillation was probably an oscillation of the feedback loop. I think you solved that. The 73MHz is probably transistor oscillation. BJTs with lots of base inductance, such as your 1.3M trace, will oscillate. Try a 100Ω resistor in series with each base, mounted as close as possible (< 1cm) to the base.
 

doug3460

Joined Oct 19, 2008
87
Hi all. Would appreciate a review of this re-draw of Ron's plan.

I want to use it on my motorcycle, so really all I've done is substituted the parts I have on hand, changed the supply to 12V, & included the LED string connection terminals (closest match I could find in Eagle). Please see attachment 1.

Only thing not shown is a miniature H\(\tiny_2\)O proof switch (appropriately rated) mounted in the cockpit. I use a fused, ignition activated, busbar to run all my farkles, so the power will come off that to the switch to the board.

Background: I use a lot of LEDs on my bike(s). While not the greatest, I like the T1 3/4 (5mm) Superbrights. The typical Vf is 2.1V, but sometimes it is higher when I use blue, UV (yes, UV, but that's another story ;)), etc.. Naturally, the number of LEDs in a string are adjusted appropriately. I have yet to run any of the LEDs at their max amps, 18mA is nominal. A good example is the license frame. These are typically at 5mA in the run mode, & boost to 18mA when the brake is activated. I use 3000mcd Reds in this application & they are attention getters. I have a major supplier near where I live & the price is right. I typically make my own housings/mounts. Sgt Wookie (especially) & many others on this forum, have assisted me in the past with the two methods shown in attachments 2 & 3, & they work very well (but they have drawbacks which have been discussed in other posts).

Attch 2 is used to activate combination running/brake LEDs mentioned above. Usually these are on the license plate frame & bags/trunk. Attch 3 is for constant running lights. Sometimes I also use Atch 3 following relays to twinkle running-lights with my turn-signals.

Anyway, if a look-see can be had for my re-draw of Ron's design, I'd appreciate it. Thanks for your invaluable assistance & time.

OT: I did learn how to print-screen into MS Paint. Now if I could just learn how to insert it into the darn text. :rolleyes:
 

Attachments

Wendy

Joined Mar 24, 2008
23,797
A suggestion, start a new thread and refer back to this one.

What kind of power supply fluctuation are we looking at (voltages)?
 

Ron H

Joined Apr 14, 2005
7,063
In attachment 1, +12V on the pot will turn off the LEDs. They will turn on when 0V is applied.
For your long wires, put them between the collectors and the LEDs. The control circuitry (op amp and all transistors) need to be in a compact arrangement with short traces.
Your LEDs don't seem to connect to +12V.
Change R2 in your schematic to 300 ohms, 1/4W.
 
Last edited:
Top