After learning the hard way not to put 12v into an input pin (don't ask. Just a dumb moment) I have found a couple of circuits for input protection. Assuming that its either a 5v data signal or 5v on/off switch would an opto or Zener be the best option?
After learning the hard way not to put 12v into an input pin (don't ask. Just a dumb moment)
Just about everybody I know has done this at least once, :-).
I use small value series-Rs, 270-330 ohms, on the I/O lines to help protect them.
If you want to learn about really hard-core protection, take a look at the info on the ruggeduino site. http://ruggedcircuits.com/html/ancp01.html
The pins have internal protection diodes so all you need to do is limit the amps to something they can handle.
eg. Atmel thinks it's OK to connect mains A/C to a pin via. a resistor: http://www.atmel.com/images/doc2508.pdf
Thanks for both those suggestions. I found the ruggedino one before and that's where I got the Zener idea from. Might run with that.