# RGB LEDs in automotive environment with fluctuating voltage

I'm hooking up an Arduino to an automotive power supply which fluctuates between 12 and 14.4 volts. I'm also hooking up RGB LED light strips in this circuit as well, now I'm not afraid of the 14V frying the LEDs, but I do not want the brightness of the LEDs to fluctuate with the voltage. Is there anything I can do to prevent this besides an inefficient 12 V linear regulator?

simulate this circuit – Schematic created using CircuitLab

This is a good first cut. The Arduino output is assumed to be 3.3 volts, and the total of 33 k load on it should not change that appreciably. C2 gives a turn-on/turn-off time of a millisecond or so. OA1 is a single-supply, rail-to-rail opamp. With 1 volt on the + input, it will drive enough current through Q1 to produce 1 volt across R2, which in this case will be 10 mA. You can change the LED current by changing R2. The R5/C1 network will keep noise on the 12V line from upsetting the op amp.

The opamp should not draw much current, and the Q1/R2 combination is no less efficient than a simple resistor.

• OP is using a 12v RGB led strip. Three channels of multiple parallel segments of 3 diodes + resistor. Can you adjust your schematic for that? May 22, 2014 at 1:54
• Maybe. The first thing to do is replace the transistor with something that can handle the currents required, as well as provide a proper heat sink. A power MOSFET might be better. The input voltage divider should probably be changed to give a lower ON command voltage, and the current sense resistor reduced proportionately. The problem is that, with an included resistor, for low supply voltages the strip will provide slightly lower output, since the Q1/R2 combination will drop some voltage. Otherwise, no major change. May 22, 2014 at 3:21

If you want the LED brightness to be independent of the supply voltage, then you need to drive it from a constant current source. A constant current supplies/regulates a constant current to the load as long as the voltage is high enough that it is theoretically possible to generate the desired current. There are two methods of making a constant current source:

• A linear constant current source, such as that proposed by Whatrouchbeast. This is simple, but it is inefficient. Q1 is acting as a linear series regulator, burning power.
• A switched mode current source. These are efficient, typically >95%, and are essentially buck, boost or similar switched mode power supplies that are controlled in constant current mode. For powering a single LED from a 12-14V source in an efficient manner, a buck based (step down) switched mode LED driver such as the LM3409 from Texas Instruments would do the job nicely, because the voltage from a single LED is around 3.6V, i.e. always less than the supply voltage.

In automotive body controllers1 the lighting is run on PWM circuits, and the PWM control has two inputs, one is the desired brightness setting, the other is the vehicle voltage.

PWM is used to dim the lighting so it is as though it's run on 11.8v regardless of the actual vehicle voltage. This is done primarily for regulatory reasons regarding headlight bulb brightness, but they extended it to the rest of the vehicle lighting because there was no additional cost to do so for PWM lights, and it prevents lighting flicker or dimming regardless of the engine and alternator situation.

So if you have a modern (2009 or later, probably) vehicle, and your lighting will only be one when existing vehicle lighting is on (parking lights, headlights, etc), and your lighting is relatively low current, you could simply tap one of the existing lamp wires and you'll probably find your brightness doesn't fluctuate. A large load may cause problems though, since these controllers also monitor current draw to detect bulb outages or shorts, so you might be better off making your own voltage independent supply if you're drawing more than a few watts.

A linear current regulator, similar to another answer here, will certainly work, and is relatively simple to construct.

A linear voltage regulator with suitable resistors will also work. You can get a low drop regulator fairly inexpensively that doesn't require a lot of support components.

Doing what the automotive companies do and simply PWMing the existing voltage at a rate dependent on the voltage will also work, and will save energy.

There are many, many LED drivers available in the market, though, that make it easy to design something. I can't recommend one, though, as you haven't explained you experience and how far down this rabbit hole you want to go. If it's a cheap one-off, I'd consider a simple PWM driver with mosfets controlled by a microcontroller, and figure out the correct pwm voltage correction empirically and be done with it.

If you need to solve this for a product that you'll produce in the hundreds or more, then you'll want to research LED driver products from the major semiconductor suppliers to find a solution that meets all your needs.

1 The body controller typically handles all the lighting and most of the creature features, etc - separate from the engine, traction control, and airbag controllers.