Pages: [1]   Go Down
Author Topic: 12V automotive project  (Read 906 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 16
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm planning to make a controller for my car's daytime running lights which will automatically sense the battery voltage to turn on and off the daytime running lights, and it will also have to monitor the sidelights to turn off the DRLs when the other lights are turned on.

I know what the arduino supply voltage range is, but can someone tell me what voltage range can be applied to the digital and analogue input pins?

I'm curious to know if I can simply apply the 12V from the sidelights to an digital pin. (I'm guessing it can't be done, but am curious about the arduino limits).

Cheers,
Brian
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 178
Posts: 12288
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm curious to know if I can simply apply the 12V from the sidelights to an digital pin.

Only if you want to turn the digital pin into slag.

Quote
(I'm guessing it can't be done, but am curious about the arduino limits).

Good guess.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 16
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yep, as I thought  smiley
Logged

Montreal
Online Online
Edison Member
*
Karma: 23
Posts: 2487
Per aspera ad astra.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You can try with resistor in series, as long as current below 1mA should be safe.
12 V - 5 V / 1 mA = 7 kOhm,  >10k to be sure.
Logged

Offline Offline
Faraday Member
**
Karma: 60
Posts: 3242
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

A 7805 would do the trick: >5v in, 5v out. Wastes power though because the current is the same on both sides, so (Vin -5)i is lost. Might need a heat sink....
Logged

Retired from Arduino.
PMs are set to ignore all.

0
Offline Offline
Newbie
*
Karma: 0
Posts: 16
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

My current thought is to use the guts of a 12V cigarette lighter to USB power adaptor to provide 5V dc  for the Arduino, and either a transistor or relay to isolate the sidelights 12V from the digital input, but my issue is with how to safely monitor the battery voltage to control when to turn the running lights on and off.

When the engine is not running, the battery voltage will be lower than when the engine is running and the alternator is charging the battery. If I can monitor this voltage, I can set a mid-point voltage which the Arduino will switch on the lights when the engine starts, and off when the engine stops.

The voltage range will be from 12.5V (engine off) to 14V (engine on), so a mid point would be about 13.2V
Logged

Pottstown, PA
Offline Offline
Sr. Member
****
Karma: 4
Posts: 299
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
When the engine is not running, the battery voltage will be lower than when the engine is running and the alternator is charging the battery. If I can monitor this voltage, I can set a mid-point voltage which the Arduino will switch on the lights when the engine starts, and off when the engine stops.
Isn't that the same as simply detecting the engine running?

As for the side lights, an opto coupler could be used.

- Scotty
Logged

Offline Offline
Faraday Member
**
Karma: 60
Posts: 3242
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Isn't that the same as simply detecting the engine running?

I was thinking that too, but wasn't sure if I was following the story properly....
Logged

Retired from Arduino.
PMs are set to ignore all.

0
Offline Offline
Newbie
*
Karma: 0
Posts: 16
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes I agree about detecting the engine running. That is exactly what I want to do, but this method would not require additional wires to other parts of the car electrics, as I would be using the battery voltage as the indicator.
Logged

California
Offline Offline
Sr. Member
****
Karma: 2
Posts: 433
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I made a brake light for a motorcycle. In order to detect when the brakes were being pressed I used a voltage divider. But I think If I were to do it again I would use a transistor and attach the 12v to the base with a large valued resistor and have the transistor pull the arduino pin to ground. That way if there is variation in the vehicle voltage, the pin still either sees 5v or 0v. My voltage divider would go from 3-5v depending on the motorcycles voltage. Works great but I think the transistor is a better idea. I guess the voltage divider would be good if you wanted to actually see about what the cars voltage was.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 29
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You're overthinking this...  Use the ignition to supply power to the Arduino via a power regulator (since you need to make one anyways).  That way, the Arduino turns off when you turn the key off.

There is also a way to use a photocell to signal the Arduino to turn the lights on and off.  Not much harder than a voltage switch, and WAY less possibility of hurting the Arduino.  You will still need to use a relay of some sort to trigger the lights, however.
« Last Edit: February 02, 2013, 08:50:40 pm by martianent » Logged

Offline Offline
Faraday Member
**
Karma: 60
Posts: 3242
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

One of the power lines for accessories will already be hooked up to the car in a way that puts it off when the power is off- check the wires for the audio system
Logged

Retired from Arduino.
PMs are set to ignore all.

Pottstown, PA
Offline Offline
Sr. Member
****
Karma: 4
Posts: 299
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
The voltage range will be from 12.5V (engine off) to 14V (engine on), so a mid point would be about 13.2V

Not so sure this is correct. I think the voltage range for battery readings is 12.5 (when the the alternator is not recharging the battery) to 14.5, when the alternator is recharging the battery; not necessarily the readings you may get when the engine is running or not. The engine may be running but the alternator may not be called upon to recharge the battery, thus a reading of 12.5 with the engine running. You may want to check that out. - Scotty 
Logged

Pages: [1]   Go Up
Jump to: