# LED Driver for Tail/Brake lights

Discussion in 'The Projects Forum' started by Peregrine, Aug 25, 2009.

Not open for further replies.
1. ### Peregrine Thread Starter Member

Aug 25, 2009
23
0
Hello,
I'm wondering if someone can help me with my project. I already did a ton of research on it, and I still can't find everything I need. I searched through this forum, and I found some info but it's still a little ambiguous for me.

I'm doing a circuit that will use LEDs in car taillights. So the input power will be a standard automotive 12V battery, which usually has a voltage that varies between 11V -14V. The LEDs will have 2 stages: full brightness when in stop light mode, limited brightness when in parklight mode. There'll be 4 identical lights, so let's concentrate on only 1:

The driver for each light will accommodate 2 series (in parallel) of 4 LEDs in each serie. So 8 LEDs total. The following are the LEDs I'll be using:

Red 1W LED, 2.1v-2.3v, 300mA

I started basing my circuit on this instructable: http://www.instructables.com/id/Super-simple-high-power-LED-driver
Using this circuit: http://www.instructables.com/files/deriv/F3Y/Z7FX/FDYPTCX3/F3YZ7FXFDYPTCX3.MEDIUM.jpg

Following that,

4 of the above LEDs in serie is (2.2 x 4) + 3 = 11.8v necessary to support the LM317 regulator.
Since there will be 2 of those series in parallel, it will require 1.25v / (0.300A + 0.300A) = 2.08ohms resistor (I believe closest is 2.1).

This would be perfect if I didn't need a dual stage brightness. Initially, I thought I was gonna just do 2 inputs on the regulator separated by diodes, and one input would be with some resistor that would cause the LEDs to be dimmer, but I'm not sure if that would work because I don't know how the regulator would affect that. So the next thing I found was this:
http://www.instructables.com/files/deriv/FXF/H3K6/D55EWIFO8K4/FXFH3K6D55EWIFO8K4.MEDIUM.jpg
except I'd still use LM317 instead of the LD... regulator there, and I don't need R4 to be adjustable (just need to find 1 resistor high enough to lower the brightness to meet standard parklight luminosity - this I can play with at the end).

But I can't figure out some of the parts and the author of that circuit is no longer active.

I also found this on this forum, made for a similar application but with different LEDs: http://forum.allaboutcircuits.com/attachment.php?attachmentid=4112&d=1218471331
but this one is not using a regulator, so I'm not sure if that's the best solution in my case.

Maybe someone here could help me figure this out. I also read somewhere that I should use TVS diodes somewhere in the circuit so the LEDs wouldn't be affected by the dirty power that an automotive battery tends to supply.

Any help would be greatly appreciated.
Thank you.

Last edited: Aug 25, 2009
2. ### jj_alukkas Distinguished Member

Jan 8, 2009
753
8

A better solution than using an LM317 would be to use a LM7809 to first make the voltage stable at 9V. Then use 2 resistors per LED, one for full brightness and other for medium. Then wire one resistor of all LED's together for brake and the other resistors together as another for parklight.

This circuit is not suitable for your application. If your remove R4 while the circuit is light up or powered, the output voltage on LM317 will be = Vcc-(~3V)= around and over 10V and all your LEDS will burn. Such a condition is necessary to use it both as a brakelight as well as parklight.

Otherwise you should use 2 LM317 chips with outputs tied together ( only in Voltage regulator mode)

3. ### Peregrine Thread Starter Member

Aug 25, 2009
23
0
I don't get it, why would I "risk damaging" them in series? That's a perfectly good solution. If you want me to connect 8 LEDs in parallel, you're telling me to multiply the current rating, which for 8 x 0.3 would now be 2.4A. And that would now require 33.6 Watts of power per light, whereas an incandescent bulb only takes about 25 Watts. Really a bad solution. And then you're telling me to stabilize the voltage to 9V and connect each LED on the 2 resistors, but they would still be then powered by 9V, and that would definitely blow each and every LED since they're rated at only 2.1-2.3V.

Please, let's not stray away from the original idea. I already have that set and calculated: 2 series of 4 LEDs, in parallel, totaling 8 LEDs.
Thanks.

4. ### jj_alukkas Distinguished Member

Jan 8, 2009
753
8
When In series, all the devices used must be of the type drawing same current. Under ideal conditions, this is possible. But practically when you use LED's even from the same batch, they'll have slightly different current draw and voltages.

So the voltage gets splitted unevenly resulting in higher voltages to the ones pulling lower current. Over time, as this LED burns quicker than the rest, it keeps on pulling more and more current and will finally blow out. This inturn gives more voltage for the rest to handle, burning one after the other resulting in a chain reaction.

This situation is not seen immediately, but after a few hours of use. I have suffered it myself and have seen lots of threads on this forum dealing with the same and everyone recomending not to run LED's in series.

I too wanted a solution once for my car and powered 24 normal blue led's using LM317 in constant voltage mode (which is much different than your situation I agree) at a very low voltage ~2V. It works since a year till date and I have lew only 2 leds so far. I also learned that it is not a good solution but it did its job.

If you run 1 LED per LM317 in constant current mode, i can gaurantee that your LED's will be safe, but thats not econocmical.

An LM317 is one of the most inefficient chips on this planet though very useful. i personally like it, but it has its own applications.

You told about wasting power, by connecting them in parallel. 2 identical devices in series and parallel draws the same current, provided they are resistive loads. Only power is wasted on resistors. Did you know that LM317 wastes almost the same amount?

You might still have an advantage of easy building but power usage is the same. ALso I suggest you to build this circuit without LED's and try removing the resistors and observe Vout from LM317.

You said your battery voltage drops to 11V, how will you provide 11.8V along with the extra ~3v used by LM317?

These are just my thoughts.

5. ### Peregrine Thread Starter Member

Aug 25, 2009
23
0
Joseph, you're just confusing me there. Let's just say I can afford blown LEDs. They'll be easy to replace in my application, and they will not be used for long periods of time at full power, anyway. The parklight is limited brightness, so the LEDs will be getting much less than they're spec'd at. They'll be at full power during brake light mode, which may only become an issue if I sit in traffic for a long time. Let's leave it at that.

I really want 2 series of 4 LEDs, in parallel.
The power source would drop to 11V if the engine is off and accessories are draining the battery. In that case LEDs would just become a little dimmer. Really nothing to be concerned about.

6. ### SgtWookie Expert

Jul 17, 2007
22,201
1,809
An LM317 has a dropout voltage of approximately 1.7v from the input to the output terminals. It also has a reference voltage (called Vref in the datasheet) measured from the output terminal to the adjust terminal that is nominally 1.25v, but may be anywhere from 1.2v to 1.3v and still be within the manufacturer's specifications. So, when you are using an LM317 in current regulation mode, the total minimum voltage drop across the regulator is 1.7v+1.3v = 3v (nominal).

Since you want the circuit to function normally when the system voltage is as low as 11v, then 11v-3v=8v remaining for your LEDs.
8v/2.2v = 3.636... LEDs. You take the integer remainder, which is 3 LEDs in series.

If you wish to power four LEDs in series, then 4x2.2v+3v=11.8v is your minimum supply voltage.

You will need an LM317 regulator for each string. You cannot use one regulator in current regulation mode for two or more parallel strings. If you attempt this, one string will receive more current (as LEDs have slightly different Vf's) until it burns up, and then the other string will rapidly burn up. Since you are talking about tail lights, this is a critical safety item that must be reliable. It would be foolish to try to save a dollar or two for something that may very well cost you your life.

The color of brake lights in the US is not red (630nm-640nm), it is a red-orange (620nm-626nm wavelength). If you use true red LEDs for your brake lights, they will not be in compliance with DOT regulations, and you will likely receive citations (tickets) from law enforcement.

The angle of dispersion (viewing angle) is another problem to be considered. Ideally, it should be an oval pattern; wide horizontally and narrow vertically.

You haven't explained how your existing lights are wired. Is the brake light switched ground, or switched hot? If it's switched ground, the solution can be fairly simple. If it's switched hot, the solution can also be simple, but using an LM337 regulator instead, which is the negative complement to the LM317.

7. ### jj_alukkas Distinguished Member

Jan 8, 2009
753
8
Sorry if I went too deep. I told all this to you only because it was all the reasons and replies I got when I asked exactly the same question 1 month back.

You can drive your LED's in Voltage regulator mode of LM317. This is the basic circuit. If your add an NPN, transistor to the Adj pin of Lm317, you will get 2 output voltages switchable with your brake and parklight switches. I hope that answers atleast part of your question. This attachment might also help.

File size:
62 KB
Views:
98
• ###### Untitled.gif
File size:
5.1 KB
Views:
568
zhezhoo likes this.
8. ### SgtWookie Expert

Jul 17, 2007
22,201
1,809
Joseph,
That's not going to work very well for the LEDs that our OP wants to use, and for his application, which requires two distinct light levels.

9. ### Peregrine Thread Starter Member

Aug 25, 2009
23
0
Thank you.
The 11.8V minimum is not a problem. As I said in post #5 "The power source would drop to 11V if the engine is off and accessories are draining the battery. In that case LEDs would just become a little dimmer. Really nothing to be concerned about." The normal operating voltage for automotive battery is usually around 13-14V.

The color is not an issue. These are the same LEDs used in plenty other LED light bulbs offered by various sellers for tail and brake light applications. Red is red. Nobody will be measuring wavelengths of my lights.

As far as the angle, I'm using 60 degree collimators (one for each LED). Again, this is not where I need help. Please.

The brake and parklights are switched positives.

10. ### Peregrine Thread Starter Member

Aug 25, 2009
23
0
Coincidentally, for satisfying all safety issue questions, I do also have a standard 3rd brake light that will not fail in an event anything goes wrong.

11. ### Gustav180 Member

Aug 25, 2009
17
0
Hello Peregrine

I must tell you that te car voltage is not between 11 to 14 V. I have designed equippments for vehicle and the rule is from 5 V to 35 V for a 12 V battery equipped car. 5 V is when you use the start engine (crank) and 35 V when the battery is in charge and if the connection is lost (Load dump). You must design your circuit for this circumstance.

I think LM317 can bee used, the max input voltage is over 35 V. But instead of a linear regulation you can use a PWM on the adjust pin. This will decrease the power dissipation in the IC. Adjust it for about 8 to 10 V output and you can design serial resistors for the light for brake. For parking you apply a PWM signal i.e. 30% dutycycle, I think you must test for a relevant light. The PWM fq must be so high that you not see the flashing, around 100 Hz. The low voltage output in the PWM must not turn off the LEDS at all, an off current around 0.5 to 1 mA will increase the LED lifetime.

A capacitor on the output of the LM317 will increase the times on rising and falling edge of the output PWM. This will reduse the EMI and smotly turn the LED:s on and off.

Best regards
Gustav

12. ### Peregrine Thread Starter Member

Aug 25, 2009
23
0
That sounds really good, but it's above what I can comprehend I'm sorry, I just don't know anything about PWM. Would it be too much to ask for some schematic and parts specs? If possible?

13. ### Gustav180 Member

Aug 25, 2009
17
0
Yes I can, but I think this is your project and as an old teacher in electronics design, you have to lern a lot if you design it yourself. I can give you some feedbacks if you want, but not until Wednesday next week. I am on a journey.

PWM means Pulse With Modulation and I think you can find how it works. I hardware tip is to use the well known IC 555.

Best regards
Gustav

14. ### SgtWookie Expert

Jul 17, 2007
22,201
1,809
OK, here's the simple way with one LM337 regulator and two 4.2 Ohm 1W resistors per string of four LEDs:

[eta] The schematic is a bit counter-intuitive, as the regulator's output and ADJ terminals are connected to the PARK and BRAKE input via resistors - but it will work this way.

As shown, the LEDs will get about 150mA current when the parking light switch is on, and about 300mA when the brake light switch is on.

Digikey carries 4.3 Ohm 1W resistors for \$0.16 each, or \$0.116 each when you buy 10 or more. 4.3 Ohms is close enough for your purpose.
http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=4.3W-1-ND
They also carry the LM337 for \$0.60/ea:
http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=LM337TFS-ND

A constant-current switching regulator would be best, but considerably more complex.

• ###### LM337 Brakelight.PNG
File size:
6.5 KB
Views:
517
Last edited: Aug 26, 2009
15. ### Peregrine Thread Starter Member

Aug 25, 2009
23
0
Thank you very much Gustav, I will do some research on it, but I'm sure I'm going to have plenty of questions before I could present that back to you the way you envisioned it.

And great thanks to SgtWookie. This is really great info. So you're saying the connections of the LM337 are counter-intuitive because normally the input should be on the IN terminal and the LEDs should be on the OUT, right? Any reason why you connected it in reverse?

Also, now with the extra info from Gustav about the automotive battery working at a much higher range than I initially thought, do you think it would be wiser to use PWM as he suggested? If the IC555 is used, can I then run the 2 series of LEDs in parallel off of the same regulator? Not a bid deal if not, but I just wanted to optimize this as much as possible.
Thank you again.

16. ### SgtWookie Expert

Jul 17, 2007
22,201
1,809
The LM337 is normally used to regulate a negative voltage with respect to ground. However, I used it to regulate current with two positive inputs at different locations.
Go to National Semiconductor's site:
http://www.national.com
I didn't connect it in reverse. It's connected as how it needs to be in order to function when used in this manner. It simply "looks" backwards until you understand what it's doing.

It may be easier to start with the LM117/LM317 datasheet, and then go on to the LM137/LM337 datasheet. Read them both through several times.

Sure, you can use PWM. Unfortunately, I really don't have the time to go through it with you.

17. ### Peregrine Thread Starter Member

Aug 25, 2009
23
0
I looked at the data sheets. Unfortuantely, I can't make much out of that. I don't really have a lot of electronics background. I was studying electronics 20 years ago, and since then only dealt with basic stuff such as diodes, resistors and relays. My background is more in criminal justice and computer science. So I understand you may not have time to help. But if anyone else is willing to, I'd really appreciate that. I've given back a lot of my time and work to the community as well, but only in what I have experience with. I'm a technical admin on TSXClub.com. So it's not like I'm just a lecher looking for a free hand-out. But the reason I'm asking for more help is because I'd have to seriously spend days studying more electronics before I could fill in the holes in my project. So if anyone already has that knowledge and is willing to share, it'd be really appreciated. I'm not doing this project for any monetary gain. I want to simply do this in my car, and then share the results with the rest of our community.

I trust SgtWookie that the LM337 is correctly wired, as he says, but when I checked on the differences between LM317 and LM337, what I got out of it mostly is that LM317 is for positive regulating, while LM337 is a negative regulator. I must have this backwards, but a negative regulator to me implies that the it's negative switched? While my project has the power supplied by positive switching.

I still need to find out more about the PWM (how, where to connect it), if I need a capacitor, rectifier and TVS diodes, and if I can connect 2 series of 4 LEDs in parallel if I used the PWM method.

Anyone willing to help, please let me know.
Thank you,
Peter

18. ### SgtWookie Expert

Jul 17, 2007
22,201
1,809
Peter,
Do you remember the first computer program that you ever wrote?

"Hello, World!"

This is sort of the electronic equivalent of the "Hello, World!" program.

The two main goals here are "What will work?" and "Successful completion of the project."

Right after your safety, of course.

I kept the circuit deliberately simple. It should be quite reliable if it is assembled properly from the recommended components.

Automotive environments are particularly brutal on electronic components. They have to function under some of the most adverse conditions on the planet; extremes of heat, cold, shock and vibration. When you add complexity (component count) to circuitry, you increase the likelihood that a component will fail. When the fact that an electronics novice is performing the assembly, simplicity of construction and troubleshooting is a huge plus, and likelihood of success is much greater.

The LM337 is a linear regulator; thus it is quite easy to troubleshoot with just an inexpensive DMM (digital multimeter). If you are trying to build a PWM circuit and run into problems, you will need an oscilloscope to troubleshoot it - and know how to use it.

Being successful on a simple project will be far more of a confidence builder than failing at a moderately complex project.

Besides, you say that you don't quite yet understand how the regulator operates. These regulators are normally used in one of a hobbyists' first projects; building an adjustable power supply.

19. ### Peregrine Thread Starter Member

Aug 25, 2009
23
0
I have to say that writing my first program was much easier than this. And that's because someone explained it step-by-step to me and I was able to follow examples. So knowing each step of the program, it was easy to understand the entirety.
This is a little more complex, because there's so many different parts that everyone is suggesting to use differently. Not understanding exactly the internals of how these parts function, it's really frustrating trying to understand how the entirety will work.

I'm not a novice in assembly and wiring. I've been installing automotive electronics (alarms, remote starts, etc.) for years (can't even remember how long), but like I said, I never really had much experience with transistors, capacitors, PWM, etc. What I studied about electronics 20 years ago I can't remember

Having that said, I have no problem assembling anything you throw at me. I just want that to be the optimal solution. So if PWM is in fact safer and more economical for power use, that's better. I'm one of those anal ppl that prefer to make a good plan before executing it
I read up on PWM and now I understand it a little better. I guess I'd have to use the "astable" mode for my application? But I still don't know how to combine the PWM with your diagram.
As far as the regulator, I understand roughly how it functions (monitors input and adjusts it so the output is stable), but I don't understand why the IN and OUT are reversed in your diagram, and the datasheet didn't really help me understand that. That's ok, though, I trust you
I'm trying to put a diagram together so it includes the PWM, but it's not easy. I'm pretty sure once you see it you'll laugh. Oh well, I'm trying though...

20. ### SgtWookie Expert

Jul 17, 2007
22,201
1,809
Well, that's the thing - there is no need to use PWM with the circuit that I posted.

If you DID go the PWM route, you would need to use components that are designed for automotive environments.