It doesn't *have* to be there... unless you would like to save yourself from a stupid mistake on a breadboard where you would accidentally cause a short on the PIN and "smoke" it. I have seen designs with other non-Atmel microcontrollers where 200 Ohms is used. In this particular circuit... it's best suited for bread board usage... but when you move to a final PCB where stray wires are unlikely, you can remove it.

So, it's probably "what it is" for the following reasons:

100 Ohm resistor is readily available100 Ohm resistor is "close enough"Many "hobbyists" go on and on about how 40 Ma is just a "line in the sand" set by Atmel as a safety margin and the pin can tolerate 60mA or even 80mA with no ill effects (I'm not one of those) but this discussion continues "ad nauseum" in other threads and does not need to be continued here

If you're trying to limit current flow in & out of the pin, you want the resistor in series with the pin, not pulling up to 5V.See "Protection Details" in the middle of the Rugged Circuits design discussion herehttp://www.ruggedcircuits.com/html/ruggeduino.html

Actually I'd just make both resistors 10k, then you only need to buy one value (or share resistorsin a resistor array) - the protection resistor's actual value isn't important at all so long as its > 200 or soand not so high as to allow capacitive noise pickup by the input pin.

Having a 10k protection resistor also means that if the switch is remote and its cable gets damaged and12V (say) gets onto the switch line, the Arduino isn't going to instantly be fried.

[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

Electronic Technician, Electronic Engineering Technician
I love to build things. Test equipment, replica and original sci fi props and costume pieces, and whatever else I feel like at the time. I have an Ultimaker and a 3D engraver. I rarely put a kit tog