user7572: At work, I have connected an Arduino to a security key (which has a 12v power supply) in order to give us a more versatile door lock.  Unfortunately, people keep removing the key pad, disconnecting the wires and re-connecting them (defective keypad I guess.)  In the process, I am afraid that they will accidentally send 12v into the Vcc, ground, digital in, and/or analog in pins.  What is the best way to protect my Arduino from the 12 volts?  I really need a component or two that I can to my pins.
Edit: it is difficult for me to describe this problem without mentioning the danger to all components.  Please describe ways to protect digital outputs HERE

user10794: There are some suggestions at Protecting Inputs in Digital Electronics .
Amended answer
Testing of my earlier answer involving clamping diodes gave unsatisfactory results. Due to the small current flow the diodes allowed a considerable voltage to reach the input pin (like, 9 V).
The amended circuit below, tested with 12V input, satisfactorily keeps the Arduino input pin to 4.9 V, even with 12 V from the device. The current through R1 is around 7 mA which is what you would expect:
I = V / R
I = 7 / 1000
I = 7 mA

The 1N4733A is a 5.1 V, 1 W zener diode which can therefore handle dropping 5 V at 7 mA.
In case you are wondering where the number 7 comes from in the calculations above:

The input voltage is 12 volts
The desired output is 5 volts
Therefore we need to drop (12 - 5) volts over the resistor
Thus 7 volts are dropped over the resistor



Further reference material:

10 Ways to Destroy An Arduino
Protection
Microcontroller Input Protection Techniques


7572: <p>At work, I have connected an Arduino to a security key (which has a 12v power supply) in order to give us a more versatile door lock.  Unfortunately, people keep removing the key pad, disconnecting the wires and re-connecting them (defective keypad I guess.)  In the process, I am afraid that they will accidentally send 12v into the Vcc, ground, digital in, and/or analog in pins.  What is the best way to protect my Arduino from the 12 volts?  I really need a component or two that I can to my pins.</p>

<p>Edit: it is difficult for me to describe this problem without mentioning the danger to all components.  Please describe ways to protect digital outputs <a href="https://arduino.stackexchange.com/questions/13150/best-way-to-protect-a-digital-output">HERE</a></p>
 10794: <p>There are some suggestions at <a href="http://www.digikey.com/en/articles/techzone/2012/apr/protecting-inputs-in-digital-electronics" rel="nofollow noreferrer">Protecting Inputs in Digital Electronics </a>.</p>

<p><em>Amended answer</em></p>

<p>Testing of my earlier answer involving clamping diodes gave unsatisfactory results. Due to the small current flow the diodes allowed a considerable voltage to reach the input pin (like, 9 V).</p>

<p>The amended circuit below, tested with 12V input, satisfactorily keeps the Arduino input pin to 4.9 V, even with 12 V from the device. The current through R1 is around 7 mA which is what you would expect:</p>

<pre><code>I = V / R
I = 7 / 1000
I = 7 mA
</code></pre>

<p>The 1N4733A is a 5.1 V, 1 W zener diode which can therefore handle dropping 5 V at 7 mA.</p>

<p>In case you are wondering where the number 7 comes from in the calculations above:</p>

<ul>
<li>The input voltage is 12 volts</li>
<li>The desired output is 5 volts</li>
<li>Therefore we need to drop (12 - 5) volts over the resistor</li>
<li>Thus 7 volts are dropped over the resistor</li>
</ul>

<hr>

<p><img src="https://i.stack.imgur.com/SkcmD.png" alt="Input pin protection"></p>

<p>Further reference material:</p>

<ul>
<li><p><a href="http://www.ruggedcircuits.com/10-ways-to-destroy-an-arduino" rel="nofollow noreferrer">10 Ways to Destroy An Arduino</a></p></li>
<li><p><a href="http://www.thebox.myzen.co.uk/Tutorial/Protection.html" rel="nofollow noreferrer">Protection</a></p></li>
<li><p><a href="http://www.kevinmfodor.com/home/My-Blog/microcontrollerinputprotectiontechniques" rel="nofollow noreferrer">Microcontroller Input Protection Techniques</a></p></li>
</ul>
