LM317 as LED driver with two constant output current selection

Thread Starter

pravardhan

Joined Jul 30, 2009
10
Hi All,

I wanted to have the LM317 as LED driver for the DRL (Daytime Running Lights) in my car.
I want the DRL current to be 200mA and have chosen 6.2 ohms.

Now I want the DRL current to be 50mA when I switch on the Fog lights, hence I have chosen 25 ohms (if this is non-standard then I will use the nearest value say 27 ohms).

I need your help in selecting the 50mA current when the fog lights switch ON. Below is the partial circuit what I have come up with.

LM317-Select.png

I want the LM317 to select the 200mA current resistor always when the 12V-14V at J1 is present, which means Q1 transistor must be ON.
Later when I switch ON the fog lights, the 200mA current resistor have to be disconnected & 50mA current resistor to be connected there by reducing the brightness of the DRL, which means Q2 transistor must be ON.

So please guide me in completing the above circuit. I want to keep this design with minimum number of components and I don't want to use any relays here.
Also let me know if I have made any mistake in this circuit.

Thanks & Regards,
Pravardhan U.S
 

ElectricSpidey

Joined Dec 2, 2017
2,757
Question, before you go any further...

Did you test this part of the circuit yet?

You may be able to simplify what you already have by using a transistor to bypass a resistor with another resistor and not provide two separate paths. Then you could just use a simple logic gate to control.
 

crutschow

Joined Mar 14, 2008
34,280
What provides the signal to S1 and S2?

Do you want S1 and S2 to also control when the DRL is on?

R4 is too large for Q1 to saturate on when carrying 200mA.
 
Last edited:

Ian0

Joined Aug 7, 2020
9,667
Just a bit of a snag - The LM317 requires 3V across it to work, then there's another 1.2V across the sense resistor, then 9.3V across the LEDs. That's 13.5V, which is getting very close to the battery voltage when the engine is running and is higher than the battery voltage when the engine is stopped.
You might be better off designing a circuit with transistors which has a lower dropout voltage - you can achieve <1V.
 

crutschow

Joined Mar 14, 2008
34,280
is higher than the battery voltage when the engine is stopped.
Do you need to be concerned about the running light voltage when the engine is stopped?

The normal voltage when the engine is running is about 14V, so that should be sufficient for the LM317 circuit.
 

Thread Starter

pravardhan

Joined Jul 30, 2009
10
Hi All,
Many thanks for the reply.

@ElectricSpidey
I have not yet tested the circuit.
And I did not understand your last statement.
J1 is the supply to the DRL from an already rigged up comparator circuit which will be monitoring the battery voltage.

@crutschow
S2 (transistor Q1) should be active whenever supply is there at J1, so that the DRL will be on with more brightness.
S1 & S2 are to be controlled to select the two different resistors.
Both S1 & S2 supply range will be same as J1. All the external supply will be coming from the car battery (with alternator)
R4 is to be tweaked later. I have calculated a minimum base current of 2mA

@Ian0
The DRL will be ON only when the battery voltage is above 13.8V.
The DRL I want to use is taking 8.4V for 300mA of current.
I have already rigged up a comparator circuit for this only fine tuning of DRL turn on voltage is required.

@LowQCab
Thanks for the circuit. I need to keep it simple.

So what I require is the control circuit part for Q1 & Q2.

Thanks & Regards,
Pravardhan U.S
 

LowQCab

Joined Nov 6, 2012
4,022
"" So what I require is the control circuit part for Q1 & Q2. ""

Yeah, well, good luck with that.
Don't You think someone would have provided that if it was practical ?
Those Resistors "Float", they are not referenced to Ground or Hot.

It can be done with 2-FETs, and 2- Photovoltaic-Isolators .......... piece'a cake.
You can even make the Brightness "Fade" up or down with just 2 additional Capacitors,
but what You want just won't work.
.
.
.
 

ElectricSpidey

Joined Dec 2, 2017
2,757
Here is my idea based on your starting point, personally I would ditch the constant current because you won't see much difference anyway, then you could use the transistor in switch mode instead of having the load on the emitter. (PNP instead of NPN and no regulator)

AAC_CC.jpg
 

ElectricSpidey

Joined Dec 2, 2017
2,757
Afterthought...

The logic gate in post #11 can be replaced with a PNP in a situation similar to post #12 where the fog lights turn off both transistors. The gate was just my first thought.
 

Thread Starter

pravardhan

Joined Jul 30, 2009
10
Hi All,

Thanks again for the reply.

@KeepItSimpleStupid
Thanks for your idea. I will try to search for some easily available parts which can be used for my application.

@ElectricSpidey
Initially I had the same circuit idea of using single transistor for bypassing the resistor. But I was little confused on how to use it.
So with the NAND gate I need to add a +5V linear LDO regulator for it's supply. Or may be I will try to use discrete components like 2 diodes with resistor and one transistor to implement an NAND gate.

Thanks & Regards,
Pravardhan U.S
 

LowQCab

Joined Nov 6, 2012
4,022
Now you're using more parts than the Circuit I provided earlier.
Here's a different way to do if You just don't "like" my first attempt ...............
.
.
.
Special DRL Dimmer 2 FLAT  .png
 

ElectricSpidey

Joined Dec 2, 2017
2,757
You could use the 4000 series CMOS for the NAND gate, so no need for any extra parts to supply it.

After breakfast I will get a schematic for the more simplified version I mentioned in #13.
 

Thread Starter

pravardhan

Joined Jul 30, 2009
10
Hi All,

@LowQCab
I don't know why your circuit mentions as "going to" fog lights?
Actually I want the fog lights supply for sensing & make the DRL brightness less. Hence fog lights have to be "coming in".

@ElectricSpidey
I am really grateful for your help and eagerly waiting for your simplified schematic.

Thanks & Regards,
Pravardhan U.S
 

Tonyr1084

Joined Sep 24, 2015
7,852
Late entry: Use a DPDT switch to turn fog lights on and off. One leg of the switch controls the lights while the other leg of the switch bypasses R2 when the fog lights are off. R1 is 22Ω and should be a 5W resistor. 200 mA is going to be close to three watts. When the fog's are on then R2 is in circuit limiting current to about 50mA (as requested). With 690 milli watts running through the circuit R2 should be at least 1 watt. I'm "ASSUMING" the forward voltage drop of the DRL (LED's) is 9.3Vf.
1626015237311.png
 

Thread Starter

pravardhan

Joined Jul 30, 2009
10
Here ya go.

View attachment 243184

R3 is just a pulldown to insure Q2 turns off, the value should be 10k or higher.
Hi ElectricSpidey,

I did a simulation of your schematic in circuitlab.com and got the expected result. Thank you very much for your help.
I have attached the screenshots for both the cases:
1. Fog lights off: DRL current is 290mA
2. Fog lights on: DRL current is 46mA

In the actual circuit I will be providing diodes for reverse polarity and also fine tune the resistor values.

Thanks & Regards,
Pravardhan U.S
 

Attachments

Top