Gadget999:
would a zener diode also work to protect the input on the arduino ?
Yes that is another method, one say 4.7vdc zener diode and one current limiting resistor would 'chop' the +12vdc signal to a 0 - 4.7vdc signal.
what would happen if the 12v signal went to say 100v by accident
If using a voltage divider a 100vdc could cause destruction of the arduino chip. If using the zener maybe nothing or destruction of the series current limiting resistor.
I like the zener + resistor solution over the two resistor divider solution.
I like the zener + resistor solution over the two resistor divider solution.
Ok, if it will protect my arduinos input it is maybe the way to go. So here's another newbie question:
I should connect the Zener in parallel with the input and ground. But where should I place the resister? And how will I calculate the value of the resistor?