How to program a CAN-BUS arduino shield to control the car's headlights?

My project is to control car headlights using voice recognition. I have successfully controlled some LED's using the EasyVR arduino shield and an arduino MEGA. Now I want to take control of the lights using the CAN-BUS arduino shield.

Because the car that I own doesn't have an OBD-II connector, I am using two arduinos with two CAN-BUS arduino shields making one a sender and the other a receiver. Now I don't know how to program the CAN-BUS arduino shield to make a simulation of the car's headlights ?

CAN-BUS shield that I am using : https://www.sparkfun.com/products/10039

Arduino mega : https://www.sparkfun.com/products/11061

Hi,

Are you sure your car controls its headlights using CAN bus? I'd heard of bulb failure detection using CAN bus so are you sure your car has that capability to tap into? If your car doesn't have an OBD-II connector is it new enough to be running a CAN bus system? If not, a simpler method using MOSFETs to control the headlights is possible.

Cheers ! Geoff

No I am not sure if the headlights is controlled by the CAN BUS. However, could you please tell me more about the MOSFETs method you are talking about ? Thanks in advance

mkaz12321: could you please tell me more about the MOSFETs method you are talking about ?

Hi

What I meant was you can use a logic-level MOSFET to control the kind of power needed to be switched for your headlight circuit. That would be best I think if you're completely rewiring your car's lighting circuit. Another way would be to activate the existing headlight relay on the trigger side using a transistor or MOSFET. That method will be better if you're keeping the existing driver controls for lighting intact.

Perhaps if you describe what you're looking to achieve it will help zero in on the better solution?

Geoff

Most devices that can directly write to registers on the ECU through the canbus / obd port are very expensive.

There are cheaper software alternatives that do work over bluetooth obd dongles, but are extremely limited due to the fact it's usually one person doing the programming and ecu's are extremely well engineered items that have many reverse engineering protections built in.

I have a setup that allows me to toggle individual solenoids on the engine and transmission, fuel system solenoids and fuel pump, and I cannot even turn headlights on. I'm sure some of the newer units most likely can to check wiring systems or computer output pins (since they're directly controlled by the ecu on 2010+ (depending on make), but they are most likely $3,000+ handheld systems (Snap On's hardware, which I know can, costs over $8000 USD).

The cheapest, easiest way to do what you would like to do is NOT REINVENT THE WHEEL AND REVERSE ENGINEER 5,000 engineer's work. Take 12v to a relay shield, and run it to the lowbeam or highbeam of the headlights. If you're worried about ecu protection throw in some beefy diodes to protect the ecu from reverse polarity.

Most car headlamps (not HID) are 55W each, so 100W total (100w/12v = 8.33 A), so even small relays should be rated for that. Most automotive grade relays are rated for 12v 20A or 12v 30A, but their actuation current (and voltage) is too high for the arduino without another step (such as a mosfet driver or another relay).

Almost every company sells a small relay shield, or relay board. The wiring for the car would be extremely easy to run inside the car, and be remarkedly similar to installing a set of fog lights as far as what you have to do (and the wiring would be close).

Then you can simply work on the software, and a simple pin high would actuate the headlights.

strykeroz:

mkaz12321: could you please tell me more about the MOSFETs method you are talking about ?

Hi

What I meant was you can use a logic-level MOSFET to control the kind of power needed to be switched for your headlight circuit. That would be best I think if you're completely rewiring your car's lighting circuit. Another way would be to activate the existing headlight relay on the trigger side using a transistor or MOSFET. That method will be better if you're keeping the existing driver controls for lighting intact.

Perhaps if you describe what you're looking to achieve it will help zero in on the better solution?

Geoff

Hello,

Yes the second method is what I am looking for because I don't want to rewire any circuit in the car. Simply what I am looking to achieve is controlling the headlights of the car using voice recognition (An Arduino mega with an EasyVR shield). This is as a start then I want to control the windows, wipers, air conditioner and the radio, but I see that they are all the same idea, if I managed to control the headlights I could control the rest, am right or not ? Also does the Arduino board capable of controlling these equipment or not ?

Thanks

Read my reply.

You can either use a relay shield to trigger the existing Headlight relay (if equipped with mechanical relays), or if ECU controlled, you have to run wiring from the headlights to the inside of the car (tap into them).

It's easily capable of what you're asking

Ok I got it, thank you all for your efforts I really appreciate that. I will now begin to work on the relay thing and hope it works :D

mkaz12321: Ok I got it, thank you all for your efforts I really appreciate that. I will now begin to work on the relay thing and hope it works :D

No need to hope - it's sure to.

All the best with your project - Geoff