Forget Aftermarket Switches and Use an Arduino to Add Functionality to Your Car




People love modifying their cars, and there is likely no aftermarket industry as large as the one for the automotive market. Some people like to increase their engine’s power, while others like to swap in neighborhood-shaking stereos. The problem is that many aftermarket parts require switches or buttons for control, and just slapping those somewhere on the dashboard can really ruin the look of your vehicle — sometimes decreasing its value significantly. Fortunately you can ditch the aftermarket switches altogether and use an Arduino to add whatever control you require through the factory buttons.

Let’s say you have a truck built for off-road use, and you want to add an LED light bar to illuminate the trail at night. Most people will do one of two things to turn on that light bar: drill a hole and add a switch to the dashboard, or connect it to the factory high beam switch. The first solution looks ugly, and the second solution makes it impossible to use your high beams without also turning on the super-bright light bar. A much better way to control the lights is to use an existing button or switch, but expand its capability to handle both its original function and the new lights.

To do that, you’ll need an Arduino and a car with a CAN bus — as all cars have for decades. The Arduino connects to the CAN bus and monitors it for a message corresponding to a specific button press in the car. For example, pushing rear defroster button will show a unique message. This hack simply watches those messages, and then responds to them in certain scenarios. So, you could double tap the rear defroster button to turn on your light bar, or hold it down to lower your air suspension. What you choose to do is completely up to you, but it’s a really elegant solution for adding aftermarket control without sacrificing the aesthetics of your car.


Forget Aftermarket Switches and Use an Arduino to Add Functionality to Your Car was originally published in Hackster Blog on Medium, where people are continuing the conversation by highlighting and responding to this story.





Original article: Forget Aftermarket Switches and Use an Arduino to Add Functionality to Your Car
Author: Cameron Coward