# LED driver using LM317T in the CC mode

#### atanumukerji

Joined Apr 1, 2011
18
Friends,

I am designing an LED driver, along with other associated circuitry - like charge controller and deep discharge protection. In a sense, this gives you an idea of my application.

As mentioned above I use a LM317T in the standard CC (Constant Current) mode. I use it to drive two parallel channels, each comprising of 1W HB LED. I use the variation given in the application note AND8109/D of ON Semiconductors. The app note is attached.

My component values are R-sense = 4.3R and the base drive is 1K Ohms. The transistors I have tried are 2N 5551 and 2N 2222.

I notice that the LED drive currents in both arm vary, rather significantly. For eg., the battery current drawn is 420 mA while the two arm draw currents of 140 mA and 180 mA each. I have tried changing the LEDs and the transistors, the other component values are quite closely matched or almost equal.

Can you please help explain the discrepancy or a way of working around this issue? This is causing a difference in illumination levels of the two LEDs, hence the question.

Any help is greatly appreciated.

Regards
AM

#### Attachments

• 30.9 KB Views: 91

#### debjit625

Joined Apr 17, 2010
790
This is causing a difference in illumination levels of the two LEDs.
I think you mean,difference in illumination levels of the two channels or LED strings,If you use a single string ie.. LED channel then the total current will be shared equally between the LEDs i.e.. the case of series circuit.

#### ErnieM

Joined Apr 24, 2011
8,010
Your transistors are not fully turned on.

From your choice of the sense resistor looks like you want around (1.25 + .1) /4.7=290 mA for each LED.

I believe you need a smaller value of base resistors (R4, R5 and R6 in the app note). With 1K you only have (1.25-.7)/1000 = .55 mA into the base. A 2N2222 needs 5-10 mA to fully saturate for a 290mA load.

Try changing the 1K to 50 to 100 ohms.

When the circuit is working you should see around .1 V C to E on the transistors.

#### Wendy

Joined Mar 24, 2008
21,914
LM317 are cheap enough I would use one per leg if it were a problem. You can get them in much smaller packages, with less current drive. There is also a new generation of voltage regulators that drop much less voltage overall.

If you are going to have transistors in there anyway skip the LM317 altogether, as transistors (by themselves) make fine constant current sources. It is a fundamental characteristic for a BJT transistor.

.

The first circuit will provide around 17ma, the second is variable up to 0.5A for high power LEDs. If you have a large number of LEDs you can replace the two diodes and the 1KΩ resistor with a LM317 without any biasing resistors, where it is a 1.25V regulator. This is because the current is only as stable as the voltage reference.

I just did a major search looking for my drawing of the LM317 as a 1.25V regulator. I missed it, but if you need a drawing I'll recreate it.

Last edited:

#### atanumukerji

Joined Apr 1, 2011
18
Yes, Debjit625, I was referring to the two LEDs in the two strings. I agree that the current would be shared if I drive the LEDs in series, but I do not have enough voltage head to do that. I am using a 6V, 4.5 Ah battery.

Thanks for the suggestions, Ernie. I will try your suggestion of changing the base resistors to a lower value of around 47Ohms and see the result. Will get back to the forum with my findings.

Bill, excellent options. Will surely try and work out the options and see if they can be used.

Bye for now! Thanks again.

#### atanumukerji

Joined Apr 1, 2011
18
Bill,

While I understand the first circuit and its design as a current source, I do not think it will serve my purpose as my current requirement is higher.

I think the second option is more suitable for my purpose. Could you please elaborate a little more on how the base drive is decided by the variable resistor and the two diodes 1N4001s? Thanks in advance.

Rgds
-AM

#### THE_RB

Joined Feb 11, 2008
5,438
Bill's circuit shown in post #4 will work fine.

The 2 diodes acts as a regulated voltage about 1.3v. Like a 1.3v zener diode.

The transistors need about 0.6v to turn on, so there will be 0.7v on the current set resistors when it is operating.

I = E/R = 0.7v/38 ohms = 18mA

(or transpose it)
R = E/I = 0.7v/0.018A = 38 ohms

R = E/I = 0.7v/0.300 = 2.33 ohms

Use transistors good for 500mA or higher with a decent amount of gain. It will be easy to find some transistors with a gain of about 100 at these currents so it will draw 6mA total from the diodes circuit, so you need to make the 1k resistor pass more than 6mA, say 10mA at all times (which means at your "worst case" lowest battery voltage of 6.0v)

So that is 6.0v-1.3v = 4.7v across resistor, need to ensure at least 10mA;
R = E/I = 4.7v/0.010A = 470 ohms.

Hope that helps.

#### atanumukerji

Joined Apr 1, 2011
18
Thanks for the detailed explanation. It surely helped. The circuit works like a charm. I need to validate my circuit again tomorrow. But I used the circuit #2 and your explanation was related to cct #1, if I am not mistaken. Let me know if I missed anything.

Also I used a current limiting resistor in series with the LED, connected on the collector arm of the transistor. I am sure if it is truly required, but added that as a precaution.

Will update later tomorrow on any further changes I make and will update my results as well.

Thanks again THE_RB!

Last edited:

#### THE_RB

Joined Feb 11, 2008
5,438
The LED will not require a current limiting resistor once the circuit is operating properly.

Please post your schematic and your parts values you have at the moment (just a crude sketch will do) and we can help suggest parts values that might improve it.

#### Ron H

Joined Apr 14, 2005
7,014
Your transistors are not fully turned on.

From your choice of the sense resistor looks like you want around (1.25 + .1) /4.7=290 mA for each LED.

I believe you need a smaller value of base resistors (R4, R5 and R6 in the app note). With 1K you only have (1.25-.7)/1000 = .55 mA into the base. A 2N2222 needs 5-10 mA to fully saturate for a 290mA load.

Try changing the 1K to 50 to 100 ohms.

When the circuit is working you should see around .1 V C to E on the transistors.
The transistors only share the ADJ pin current (nominally 50uA total), and they run saturated. I believe the base current resistor values are noncritical, but should all be the same value.

#### atanumukerji

Joined Apr 1, 2011
18
Ron,

I think maybe what you say is correct, since I tried reducing the base resistor as suggested by Ernie earlier, however it did not seem to make any difference. The values of collector current through either arm continued to remain skewed.

Cheers!
-AM

#### atanumukerji

Joined Apr 1, 2011
18
Here is my circuit along with the component values, in the attached word file. Any suggestions to enhance the circuit and to make it more robust will be greatly appreciated.

-AM

#### Attachments

• 174 KB Views: 42

#### Ron H

Joined Apr 14, 2005
7,014
Ron,

I think maybe what you say is correct, since I tried reducing the base resistor as suggested by Ernie earlier, however it did not seem to make any difference. The values of collector current through either arm continued to remain skewed.

Cheers!
-AM
I ran some simulations on the ONsemi circuit. If the LED strings have different forward voltages, they will run at different currents (unless you adjust the sense resistors). I suspect your two LEDs have different forward voltages.
The intent of that circuit was to allow multiple strings to be driven, and maintain the same current (and brightness) if one string were to experience an open circuit. I don't think it is ideal for what you are trying to accomplish. I think you are on the right track with your current (no pun intended) approach.

#### Wendy

Joined Mar 24, 2008
21,914

You do not need R3 and R4, the emitter resistors combined with the transistors form the current limiting resistors. They are a constant current source, which is why I posted them. R5 and R6 program the exact current along with the voltage on the base of the transistors, but the current will not vary once set. A 2N2222A is only capable of handling around 600mw, you may want beefier transistors.

Of course, if the power supply voltage is stable you don't really need a constant current source, a stable power supply only needs current limiting resistors. Are you planning on using batteries?

.

#### Attachments

• 8.1 KB Views: 159
Last edited:

#### atanumukerji

Joined Apr 1, 2011
18

You do not need R3 and R4, the emitter resistors combined with the transistors form the current limiting resistors. They are a constant current source, which is why I posted them. R5 and R6 program the exact current along with the voltage on the base of the transistors, but the current will not vary once set. A 2N2222A is only capable of handling around 600mw, you may want beefier transistors.

Of course, if the power supply voltage is stable you don't really need a constant current source, a stable power supply only needs current limiting resistors. Are you planning on using batteries?

.
Agreed. R3 and R4 are redundant. Will remove. Maybe I was being over-conservative hahaha!!

In my circuit, I have tried to limit the current to around 200mA in each arm. With that in mind, do you still think I need to go for a beefier transistor than 2N2222A? The lower current is a trade-off with lower illumination and longer battery life. Any other suggestions are welcome..

That also answers you last query. I do not have a stable voltage source. I am using batteries.

#### Wendy

Joined Mar 24, 2008
21,914
That explains the need for a constant current source, it is a form of regulator.

The transistor will be absorbing most of the power here. If the transistor drops 2.5V (which is very likely) at 200ma then it will be at the max rating of the 2N2222 (0.2A * 2.5V = 0.5W). There are many transistors designed for a heat sink though, which is a plus for this kind of design. I'd move up to a beefier higher wattage transistor and inclue the heat sink.

#### atanumukerji

Joined Apr 1, 2011
18
Which transistor would you suggest? I would not be able to mount a transistor on the cabinet of the system, hence transistors like 2N3055 may not work for me.

-AM

#### Wendy

Joined Mar 24, 2008
21,914
I'm assuming you are thinking of a TO3 case. Think TO220 instead, something like a TIP31 instead.

#### THE_RB

Joined Feb 11, 2008
5,438
In the interest of simplicity, you could use one 3pin low-dropout 5v regulator which is good for 1 amp, and just 2 resistors (one for each LED).

As your LEDs take about 3.3v you need resistors to suit 1.7v @ 300mA, or 5.6 ohm resistors.

Sorry if that is getting off topic!