Hacking My Car’s Headlights

Posted in Projects by Bill
10 Jan 2012
Hacking My Car’s Headlights

I have two loves. The first is my geeky fiancée, the second is my 2004 Volkswagon Passat TDI. Recently the headlights on my Passat have been yellowing and physically breaking down and it was time for new ones. Instead of buying OEM parts, I decided to pay a little more for an aftermarket brand (Spyder) with fancy LED ‘eyelids’ and HID low-beams that I added. I can’t resist things with pretty LEDs on them. But when I installed them I discovered they didn’t quite work they way I wanted…

When I received my new fixtures in the mail I set out one weekend to install them and they went in without a hitch. Aftermarket fixtures were a perfect fit and plugged into the existing harness; kinda took the fun out of it. Waited for the sun to go down so I could see my car in it’s new glory. That’s when I discovered the new fixtures in combination with my car’s original wiring and headlight functions just didn’t make much sense. The car’s original headlights had a Day Time running mode that was just a reduced brightness low-beam. When you turned the headlights on, the low-beams went to full brightness and the running lights came on. The LEDs in the new fixtures were tied to the running lights, and the HIDs were tied to the low-beams. This meant my HIDs were on at full brightness all the time (the resistive means of dimming the old bulbs doesn’t work on the HID ballasts), and my LED eyelids only came on when the head lights were turned on. How silly! However if the ignition was off and the headlights left on, then only the LEDs were on and I did like that mode.

I did not want my HIDs on and burning out bulbs all the time, I’d much rather have the LEDs on and the HIDs activated by the switch in the cabin. Time for some hacking.

This is the truth table for my car’s headlights without modification:

Ignition Switch Headlight Switch Result
ON

OFF

HID Only

ON

ON

BOTH ON

OFF

ON

LED Only

Alright, approaching this like an Electrical Engineer, I see two outputs (HID and LED) and two inputs (Ignition and Headlight switches). Let’s look at the truth table again.

Ignition Switch Headlight Switch LED HID
H L L H
H H H H
L H H L

The second and third states from the top are ok, just the first one doesn’t make sense.  I’d like the outputs flipped like this:

Ignition Switch Headlight Switch LED HID
H L H L
H H H H
L H H L

I needed to come up with a way that only alters the first state but not the other two. Looking at the truth table, it’s easy to see the LED output is an OR function. If either switch is on, the LEDs should be on. The HID output is an AND function. I only want the HIDs to be on if both the ignition and the headlights are turned on.

It’s easy to create an OR gate with diodes. Here’s an example circuit from Wikipedia:

If either input (terminal 3 or 4 in the picture) is high, the output (terminal 1) is high. This works for power distribution as well. However, the diode version of an AND gate does not work well for power transmission so I had to think of something else. I also had to take into account that the HIDs drew more power then the LEDs and only the wires for the low-beams could support the current. No matter what hair-brained scheme I thought of, only the wires for the low beams could power the HIDs. With that in mine, I realized a relay was perfect. Let’s take a look:

If I connected the relay so that the running light circuit was powering the coil and the low beam circuit was interrupted by the contacts, it would give me my AND function. Both the running lights had to be on to energize the coil and the low beams supplying power to the HIDs. This combined with the diode OR gate for the LEDs could give me the functionality I want. Then I realized there was one simplification I could make by using a double throw relay instead:

This circuit, with just two parts, will produce the modified truth table I want. Remember, the HIDs were originally just connected to the low-beams and the LEDs to the running lights. Now when just the HIDs used to be on, the LEDs get the power instead. The diode (D1) prevents the current from flowing into the relay coil and activating the relay. When I turn my headlights on, the running lights come on energizing the relay to switch the low-beam power to the HIDs, and the LEDs stay on by now getting power through the running light circuit. If I leave the headlights on with the ignition off, the relay stays energized and LEDs powered, but the HIDs get no power from the low-beam circuit and turn off.

With my plan seemingly perfect, I bought a few automotive relays and some diodes and modified the wiring harness of the new fixtures: (click to enlarge)

Relay

Notice the diode?

Close up

Zoomed out

After the pictures were taken, I wrapped up the relay and crimp connectors with a generous amount of electrical tape and tucked the harness away from moving parts. The result is headlights that now behave the way I’d like them too.

V Dubs in the House

Share