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


HID Only






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

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

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)


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


Trackbacks / Pingbacks

  1. Fixing the control scheme for an aftermarket headlight assembly | Hack-a-Day
  2. Hack Your Car Lamps | HACKOLOG - Amazing Hacks and Mods

Warning: count(): Parameter must be an array or an object that implements Countable in /homepages/46/d285670699/htdocs/bill/wp-includes/comment.php on line 879
  1. 22 Comments.

    • […] The headlight enclosures on [Bill Porter's] 2004 Passat had yellowed with age and were not outputting the kind of light they should. He decided to replace them with some aftermarket modules that also incorporated LED strips. When they arrived he was surprised at how easy there were to drop into place. But when testing he was certainly not satisfied with how they worked. The day-driving mode used the HID bulbs at full power, where the factory assembly had dimmed them during the day. He set out to alter the electronics to work as he prefers. […]

    • NeilNo Gravatar says:

      Where did you get the aftermarket headlights. The yellow lenses on my 03 Jetta are driving me crazy. I’ve polished them, but they go back to yellow after about 3 months now. If I’m going to replace the whole unit, I’d like to do something similar to what you did, but I don’t think the Passat lights will fit a Jetta; maybe A4 units will?

    • iamshayanNo Gravatar says:

      LOL this is dumb, you know you can program this with VCDS (volkwagen/audi, comunications, diagnostics, system.) takes about 5 minutes.

      • BillNo Gravatar says:

        Following the wiring diagrams in my service manual, not only are the LEDs in my fixtures hard tied to the running light circuit, but the running light circuit is controlled by my mechanical light switch. So if programming can physically alter my car’s wiring to isolate my LEDs from my running lights, I’d be impressed.

      • Bob SpanglerNo Gravatar says:

        Sorry, but you are incorrect on this one. The B5/ B5.5 Passat platform does not have the ability to change this behavior with VCDS or VAG-COM, or any software for that matter. The provisions (electronically) are simply not installed in the car. Please, if you’re going to call something dumb, you should at least know what the hell you are talking about.

    • Bob SpanglerNo Gravatar says:

      This is one well thought out way to get the job done, although there is another, simpler (to some people) approach. The output from the stock DRL relay passes through a light pink connector in the passenger side kick panel, which is where the resistance wire responsible for providing reduced voltage is inserted into the circuit. Simply unplugging the connector and running a lead from this connector to the LED’s would give the exact same result, and doesn’t require relays in the engine compartment, or any relays at all for that matter. I’d suggest using a fuse and diode for protection on the new lead, but the circuit is already fused for DRL mode. Added advantage (if you prefer this) is that you get DRL mode at 100% power, and not reduced voltage. If you simply want to remove the reduced voltage DRL mode (keeping your low beams as DRL output, for instance), you can also unplug the connector and insert a jumper.

      My only concern with Bill’s version is if there is a failure with the relay, such as burnt contacts, corrosion on the leads, or similar, the potential exists to compromise the function of the low beam since it’s power source has been interrupted in order to pass through the relay. Also, if you’ve been around electrical tape at all, you know that the glue becomes compromised in heat, allowing the tape to move or even fall off. Not the best method of protecting electrical components under the hood of a car!

      Please don’t misunderstand me- I’m not knocking Bill’s work here, he’s done a fine job, and has thought up an effective way to get the results he’s looking for. I was going to do something similar myself, until I discovered the pink connector in the passenger side kick panel. Made the process much simpler in my case, since I simply wanted to get 100% voltage to my HID’s when in DRL mode.

      And @Bill, if you haven’t discovered passatworld.com or TDIclub yet, check them out. A wealth of information about Passats exists on those 2 sites. I’ve saved literally thousands of dollars in repairs by being able to diagnose and perform repairs myself, plus have been able to do all kinds of fun mods to the car!

      • BillNo Gravatar says:


        If I understand you correctly, your way would mean when the ignition was off, but the headlights on, the LEDS would be off since the DRL circuit would be off. I would not want this and still prefer my way. I like having my LEDs tied to my running light circuit, except during daytime operation. I didn’t want my HIDs on at all, an wanted my LEDs to act like DRL. Also I used Vinyl electrical tape, rated to 220F, and that’s only backup for the heatshrunk crimp connectors.

        I’ve been lurking TDIclub since 05 when I got the car. Recently found Passatworld, but was rather put off by the registration process that took several days to register my first posts and let me ask questions. There’s other, less annoying, ways to fight spam. Also bought the service manual for my car and trying to teach myself the wiring diagrams.

        • Bob SpanglerNo Gravatar says:

          Interesting. I’ve only had the B5 version of the Passat, and not the B5.5, and the headlights won’t turn on at all if the ignition is turned off – running lights only. It seems that the behavior has changed on the B5.5 platform. I can see how your method would make better sense in that case.

          Sorry to hear about your signup experience with Passatworld. The site was bought out about a year ago, and the new powers in charge have been slowly changing stuff, much to the chagrin of many of the members. I’ve been on the site for maybe 6 or 7 years now, so I haven’t personally experienced the new way of signing up. It’s still a great community of people there, so it may prove worth the initial signup hassle!

          • BillNo Gravatar says:

            My OEM (or these) headlights would not turn on, but the little ‘night lite’ running lights in the fixtures would. These new fixtures have the LEDs wired to the circuit the little night light in the old fixtures were wired too, so they will come on with the ignition off and the head light switch on. I wanted to preserve that but alter the DRL so that the LEDs were the DRLs during the day, and running lights at night if that makes any sense.

      • BillNo Gravatar says:

        BTW Bob, the reason I want to preserve the running light connection to the LEDs is my next planed mod is to create a module that snoops the convenience CAN bus looking for the unlock command from the key fob and turns on my running lights when it sees it. I’d like my LEDs to come on with my running lights when I unlock my car remotely.

        • Bob SpanglerNo Gravatar says:

          Oh man, I’d love to build one of these modules! I haven’t ever had the chance to dig into the CAN BUS at all, I don’t have access to the goodies necessary to interface with it and read signals, etc. You could potentially just look at the input to the door lock mechanism, since it’s just traditional switched, momentary 12VDC to the lock solenoid. You’d just need to pick up the signal between the electronics on the window motor and the lock mechanism itself.

          • BillNo Gravatar says:

            That’s true, but it’s also a project excuse to play with the new 32bit ARM Cortex processors with built in CAN interface. And have a MCU of my own design sitting on the Convenience CAN opens the door to future fiddling. Maybe remote start with certain keypress sequence on the key fob? Open all windows with another?

            • Bob SpanglerNo Gravatar says:

              Gosh, you’re getting me wound up! I’m gonna have to go get some goodies, I guess! I have done the windows up/down with remote mod- it takes some basic changes to the coding of the CCM to make it happen, but it’s a fairly straight forward process. I’ve had it on my Passat for the past 5 years now, and I still love it every time I walk up to the car in the summer, and let the windows down to cool down the interior a bit before getting in! Plus the look on the faces of those walking to the car with me is always priceless!

              I’d really like to find a method of interfacing the the old (slow) and new (fast) versions of CAN BUS used in the VW’s. I’ve got a few different projects that would benefit from being able to have a “new” device be able to at least “hear” the old devices – think a newer cluster fitted in an older CAN BUS car, for instance. The cluster does all the chimes for lights left on, door open, etc. but the cluster doesn’t ever know that the door was opened, without also having to update the window motors and CCM to the higher speed counterparts.

            • BillNo Gravatar says:

              Yeah, I’ve read before it was possible to do the remote window mod by changing CCM code but haven’t looked into it. I also don’t have a CCM talking capable diagnostic cable yet, just the cheap bluetooth one for checking on the engine.

              If the difference in the buses is just CAN bus speed, I see no reason why a simple buffer (with basic collision detection) couldn’t be built to bridge the gap. Do you have any details on the difference? I haven’t found much info in the bentley manual on the CAN bus at all, except the wiring. I was going to logic analyze it one day to get the specs.

            • Bob SpanglerNo Gravatar says:

              The last time I looked around, I could find very little info on the CAN BUS protocol as it’s implemented in VW’s. I had notes on the speed differences, but I recently moved and they seem to not have been un-earthed just yet. If I can remember correctly, the slow speed was something like 83K, and the new speed is up at 500K or something like that. I tried to get the guys at Ross Tech to chat with me about it on the side, but the one guy who really knows what he’s talking about wasn’t very forthcoming with information! I do have access to both the old and new versions of the CCM, window motors, and cluster, so I suppose I can do some probing around, if I can scrounge up some hardware to tie in and have a look…

      • Bob SpanglerNo Gravatar says:

        Oh, and @Coligny – Using relays under the hood to control the headlights might’ve been the universal defacto standard up through the 80’s and into the 90’s, it’s old news and hasn’t been done for more than a decade now on the majority of vehicles, at least without a reliable method of protecting the relay from the elements, such as an enclosed box, etc. I’ve personally replaced loads of relays in my lifetime that have failed due to corrosion, etc. on the contacts from being in the environment under the hood. There’s a good reason that it has NOT been the standard for more than a decade now.

    • BenNo Gravatar says:


      I just purchased these same lights and, while I love them, I was also disappointed in how they are wired. LED should be DRL no exceptions. I am interested in your wiring mod. Would you be willing to publish specifics on parts and perhaps a specific wiring diagram? Nice job…I’m impressed.

    • […] Don’t worry. You can set it right all by yourself. The following project shows a way to hack the car headlamps, in case they need a […]

    • MarwanNo Gravatar says:

      Hi, I know this post is a few years old but I am having the same issue. In addition to the issue, I am also getting an error in my dash saying the parking light bulbs are out. I am trying to get my head around how you actually solved the problem. If there is a chance I could call you to get clarity that would be so helpful. or i can give you my number via email. I would be grateful for any help you could provide. Thank you

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.