Digital Circuit question - sensing input across power rails using a micro
Remove the connection to 3.3V and simply connect the 12V input to a voltage divider to feed the 3.3V input. For example, 12V input to 9K ohm resistor to 3K ohm resistor to ground. Connect the micro's input to the junction of the two resistors. When the input is 12V, the micro will see 3V (assuming that the impedance of the micro's input is large enough to not disturb the divider).