12v Automotive voltage as input to Arduino: Optos or SSR?

I am working on an automotive project. I want to use 12VDC outputs from the car (which means it can peak at around what…15VDC?), meaning when a circuit is made. I want to read those outputs as inputs to an Arduino. Or to put it another way, when I switch on my headlights, I want to know that they are switched on by reading the 12VDC at the headlight as an input to the Arduino pin.

My options, from some research is to either use an opto (nice article here of someone also needing the 12VDC as input):

Or go with SSR. I am assuming, even though SSR’s will be more expensive, they will be easier to implement since I’ll purchase the SSR I need, then place it in the circuit.

Thus my question, which would be the elegant solution, the more robust solution?

I’ll have to figure out which SSR to go for if I do, but I am sure that won’t be too difficult. Although, I’m not always sure what is meant by it all. Merely found this one based purely on price at a glance and the 15V.

Thank you kindly for your experienced advice.

The automotive electrical environment is extremely harsh and all electronics, including the inputs to optoisolators and SSRs, need to be protected against transients that can exceed 100 V.

I’ve attached a good all-around circuit. (The surge Zener on the input costs about $0.25 and can pass nearly 100 amperes). Also see the links in the following thread for more information. http://forum.arduino.cc/index.php?topic=219048.0


Thank you jremington. Much appreciated.

Actually, for an SSR all you need is a surge Zener, like the 1.5KE18 shown. Most SSR inputs tolerate a wide voltage range, typically 3-32 V. For the optoisolator, you need to look at the specs for the device you've chosen. The coil and caps are intended to reduce noise in the audio and radio frequency ranges, which shouldn't affect your circuit. Have fun!

jremington: I've attached a good all-around circuit.

So if all OP (or another poster...) wanted to know was whether the 12v was on or off, one could take the clean 12v output of your "good all-around circuit" into the base of an appropriate transistor switching 5v and read that output with a microcontroller?