I am trying to detect the presence of +12v on V2 to trigger a digital pin on a micro controller.
I am using an opto isolator as I am under the impression that it is the best way to isolate my circuit from the potentially noisy automotive circuit.
When V2 is activated by the vehicle, it outputs betweeen 9 and 12v, activating the opto and pulls the digital pin low.
However, when V2 is inactive, it is outputting around 2v, which causes the digital pin to read high, with an occasional low. Ideally, I would like to avoid disturbing the vehicle's circuit as much as possible.
How can I ignore V2 unless it is greater than, say, 5v? Is a Zener diode between V2 and R1 the proper way to solve this?