# LED constant current source scheme

#### kaushizcute

Joined Feb 16, 2012
24

#### abeychandran

Joined Feb 7, 2012
17
120ohm each

#### kaushizcute

Joined Feb 16, 2012
24
How did you calculate?

#### Wendy

Joined Mar 24, 2008
23,317
Rsense will have 1.25VDC across it. The LM317 can not do anything else. So Rsense is the programming resistor for the current. The transistor is a simple switch in this mode, allowing Rsense to be the current feed back for the LM317. If the current goes to zero due to an open LED the transistor circuit opens, that leg is switched out of the circuit, and that Rsense in not part of the LM317 current programming.

So the formula is ILED = 1.25V / Rsense

It is similar to the base LM317 operation.

I tend towards these kinds of circuits myself.

It has the advantage of extremely low insertion with good regulation. The circuit can drop as little as 0.2V and still regulate well.

#### John P

Joined Oct 14, 2008
2,013
I think for .02 amps/leg, you want a 68 ohm resistor. But try it and see what the current is.

The interesting difference between the two circuits is that in the one from ON Semiconductor, the LM317 regulates the current, and in Bill Marsden's one, the transistors do it.

#### crutschow

Joined Mar 14, 2008
33,318
...........................

I tend towards these kinds of circuits myself.

It has the advantage of extremely low insertion with good regulation. The circuit can drop as little as 0.2V and still regulate well.
One disadvantage of current mirrors is that you waste current through the LM317 leg of the mirror. But that's likely only of concern if the circuit is battery operated.

#### bountyhunter

Joined Sep 7, 2009
2,512
One disadvantage of current mirrors is that you waste current through the LM317 leg of the mirror. But that's likely only of concern if the circuit is battery operated.
You can reduce the current in the LM317 leg by running the current mirros "unbalanced" by adjusting the resistor values in the emitters. You can run 10 mA in the 317 leg and run higher value in the LED strings just by reducing their emitter resistors. There is no law that says those currents all have to be equal.

#### Ron H

Joined Apr 14, 2005
7,014
The advantage of the onsemi circuit is that if one string opens, the other strings will run at essentially the same current as before. The disadvantage is that all strings need to have the same number and types of LEDs. Otherwise, currents will be different in different strings. In fact, if the forward voltages of each string are not identical, the currents will be different. This is per simulation.
The advantage of your circuit is that the number of diodes in each string can be different, and currents will still be equal. The disadvantage is that if one string opens, the current in the other strings will drop by about 20% (again per simulation).

#### Ron H

Joined Apr 14, 2005
7,014
You can reduce the current in the LM317 leg by running the current mirros "unbalanced" by adjusting the resistor values in the emitters. You can run 10 mA in the 317 leg and run higher value in the LED strings just by reducing their emitter resistors. There is no law that says those currents all have to be equal.
But the temperature coefficient of led current will increase by a small amount - probably not an issue in most cases.

Alternately, you can also put LEDs in series with the LM317 if the supply voltage will permit it.

#### bountyhunter

Joined Sep 7, 2009
2,512
But the temperature coefficient of led current will increase by a small amount - probably not an issue in most cases.
True, slight difference there. You can adjust the amount of resistor in the emitter to make that effect negligible.

#### kaushizcute

Joined Feb 16, 2012
24

#### Ron H

Joined Apr 14, 2005
7,014
i guess the equation Iout= (1.25V + Vsat)/R1 will work here to find the resistance value.
The value of Vsat can be found out by looking at the MPS2222 datasheet page2
No, because the collector current is much lower than the specs on the datasheet. Vce(sat) will be on the order of tens of millivolts - pretty much insignificant relative to 1.25V.
The collector current of each transistor is nominally equal to Iadj of the LM317, divided by the number of transistors.
To ensure transistor saturation, you should set Ib≈Ic/10.
Iadj=100uA max, 50uA typical. If you use Iadj=100uA, and have two transistors (Ic=50uA each), then the base current should be Ib=Ic/10=50uA/10=5uA.
Ib=(1.25V-Vbe)/Rb. Using Vbe=0.6V,
Rb=(1.25-0.6)/5uA
Rb=130k

This value is non-critical. You can use any value between 10k and 130k, and it should work just fine.

#### Wendy

Joined Mar 24, 2008
23,317
Which brings us to the formula I showed. The transistor is a simple on/off switch, as I explained.