There are certain lines in my car which I want to detect when hot. My initial thought was to hook a voltage divider to drop from 12v (or ~14 rather) to 3.3 and feed it to my pi but I soon realized that I'm probably going to have a bad time due to fluctuations and stuff.
Would it be enough of a safety precaution if instead I use an optocoupler such as 4n25 and feed the IRLED from the line I want to monitor via a 1.3k resistor to get about 10mA?
Additionally would changes in the voltage of the electric system (and therefore the line I'm feeding the LED from) cause changes in the voltage of the transistor side of the 4n25? Or in other words does the brightness of the IRLED(?) affect the state of the transistor or is it stable once it reaches a certain threshold?