Go Down

### Topic: 12V automotive project (Read 3599 times)previous topic - next topic

#### Brian in NZ

##### Feb 02, 2013, 12:46 am
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

#1
##### Feb 02, 2013, 12:51 am
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.

#### Brian in NZ

#2
##### Feb 02, 2013, 12:53 am
Yep, as I thought

#### Magician

#3
##### Feb 02, 2013, 03:04 am
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.

#### JimboZA

#4
##### Feb 02, 2013, 05:41 am
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....
Johannesburg hams call me: ZS6JMB on Highveld rep 145.7875 (-600 & 88.5 tone)

#### Brian in NZ

#5
##### Feb 02, 2013, 05:55 am
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

#### scottyjr

#6
##### Feb 02, 2013, 02:46 pm
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

#### JimboZA

#7
##### Feb 02, 2013, 03:06 pm
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....
Johannesburg hams call me: ZS6JMB on Highveld rep 145.7875 (-600 & 88.5 tone)

#### Brian in NZ

#8
##### Feb 03, 2013, 01:29 am
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.

#### stoopkid

#9
##### Feb 03, 2013, 02:18 am
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.

#### martianent

#10
##### Feb 03, 2013, 02:38 amLast Edit: Feb 03, 2013, 02:50 am by martianent Reason: 1
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.

#### JimboZA

#11
##### Feb 03, 2013, 05:26 am
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
Johannesburg hams call me: ZS6JMB on Highveld rep 145.7875 (-600 & 88.5 tone)