Pages: [1]   Go Down
Author Topic: Safely detecting 12v on/off in car  (Read 496 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 43
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Guys

I need to detect whether several wires in a car are "on" or "off". I'm concerned about connecting up to 15v (max I measure on my car) directly to an analog input. What's the safest/simplest way to determine if wire is hot or not

Thanks

mark
Logged

SE USA
Offline Offline
Faraday Member
**
Karma: 40
Posts: 3783
@ssh0le
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

opto-isolator is the best bet, or a resister + zener diode

have the current come in and hit a resistor (1k?) so there is not much current, then use a 5 volt zener to drop the voltage to safe levels and feed into normal digital input

dont feed the arduino anything over 5 volts, especially the analog channels. There is the argument that the AVR has input protection diodes, but I made a device that sniffed 24 volt lines to see if they were on or off, and I grabbed the wrong diodes off the rack, got 24 volt zeners instead of 4.7 volt zeners (the part number on the reel was 1 number difference)

it lasted about 2 days before acting weird, then about a week later it was stone dead, kind of suprised it didnt sneak back up the ftdi cable and mess with the USB port
« Last Edit: April 14, 2013, 08:21:53 pm by Osgeld » Logged


Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 170
Posts: 12487
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

+1 for optocoupler

you may also google for ruggeduino...
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

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

Thanks Osgeld

Sounds like a good plan. Would rather use digital if it's easy to do, and definitely don't want to risk blowing anything up.

I calculated this as about 120mA, is that correct. Anything specific I need to look for in the diode specs other than 5v and 120mA?


Would these do the trick?

http://www.radioshack.com/product/index.jsp?productId=2049726

One last thing, do I need a load resisitor? I read somewhere that you need a seires and a load resistor, or can I just connect the top to the digital input and ground to ground?

Regards

Mark
Logged

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

Thanks Rob

Think I'll pick up a ruggeduino for testing!

Any suggestions on a part no/source for an opto coupler? (Not too sure what attributes I should be looking for)
 
Regards

Mark
Logged

Pages: [1]   Go Up
Jump to: