Does zener diode connected at the input pin of a controller affect the controller when internal pull up is enabled at that pin?
No,

A zener diode is not a hysteresis device like a DIAC is. When a DIAC breaks down it will decay to a very low on voltage (by comparison to its breakdown).

When a zener comes into its active region it will start conducting current, but only as much as needed to stay close to its actual value.

Of course the whole truth is very complicated, with advanced graphs and such, but by approximation you can say that a 4.7 V zener will try to keep the voltage across it 4.7 V or less, by conducting as much current as needed to make that happen. (Until you put so much through that it breaks).



Apart from that, the pull-up in a microcontroller is very weak, in the order of 10 kOhm usually, so even if the pin was shorted to ground it would survive. Of course, if you have an output pin set to 1 (5 V), you cannot always short it to ground, but an internally pulled up pin, you can.



So say you have an ideal 4.7 V Zener and 10 kOhm internal pull-up, you would see a current of:

I = V / R = (5 V - 4.7 V) / 10000 Ohm = 0.3 V / 10000 Ohm = 0.00003 A, or 30 &mu;A.

That's (almost) negligible in anything not battery powered.



All of that said, if you are designing something yourself, you can also use a 5.1 V Zener and still have the pin protected, but a much lower leakage current (even a 5.1 V zener at 5 V can leak a little bit - but really really tiny bit with normal small-signal ones).

An MCU input on a controller running at 5 V can handle up to 5.5 V on its input, so 5.1 V clamping is still fine usually, but the datasheet will know more than I do.



Or you can do this:







simulate this circuit &ndash; Schematic created using CircuitLab

Now every time the input wants to go above the supply voltage, the diode will conduct into the supply. Of course, you need to make sure your electronics use a few mA to make sure that energy gets used up.

I used a BAT54, because at low currents (1 mA or less) they have a very tiny forward voltage, so the voltage on the input is very well protected.