A Zener is worthwhile.
I've a Mega32 running at the moment, 2 pins on pushbuttons with pullups
enabled. The pullups measure out at 35K ohms.
These will cope with normal amounts of "static" discharges. This leaves the
lighning jolt to the pin when you walk across a nylon carpet and touch the
pin connected wire. The Zener will help, as also a 100nF cap connected (at
the chip) from the pin to 0V.
Really good idea to guard against ESD. Also, you might want to add a
series resistor after the zener and the cap to limit the current
flowing into the pin in the event of overvoltage, like this (view in
fixed font or M$ Notepad):
| |
| |
| ___ |
| o----o-----o----|___|-----o
| | | 1K |
| /-/ --- |
| ^ --- | Atmel uC
|1N4733A | | 100nF |
| === === |
| GND GND |
| |
| |
| |
| |
| '----
|
|
(created by AACircuit v1.28.6 beta 04/19/05
www.tech-chat.de)
A zener-based protection scheme has benefits over diodes to each
supply rail. The speed of the diode isn't significant -- in fact,
you're adding the 0.1uF cap in parallel with the diode. And if
there's a positive-going spike, the charge will flow to the +5V rail
with the two diode scheme, which may make it exceed maximum spec for
the uC as well as other components, depending on trace inductance, the
ESR of the caps from the +5V supply to GND, and other considerations.
Also, you may end up with a situation where your power supply voltage
regulator may have its output at a greater voltage than its input,
which can be a disaster for certain regulators.
Now, you have to attend to the layout here either way, so try to have
a good, low inductance, low resistance path for the ESD charge to
travel without creating a spike on the GND lines. But from a
beginner, hobbyist perspective, a zener/cap combination with a series
resistor is a great start to preventing your uC from getting smoked by
a 100pF cap namely the user) discharging a few KV of potential to GND
through your project.
Cheers
Chris