Checking for 12 Volts

Quote from: dc42 on December 01, 2012, 11:57:09 AM
The pin protection diode will protect the mcu, and the 100K resistor limits the input current to a safe value.

ya know, I just dont trust those things

I'm with you on this.

If the input is a known voltage, then a voltage divider as described works fine. If the
voltage can be about anything > 5V, within reason, a resistor [10K, 22K, etc] feeding
onto a zener diode is probably better. For something dangerous, like 120VAC, I'd go with
a properly designed optoisolator ckt.