Arduino digital input pullup pin protection

Hey Guys, want to somewhat resurrect my old post here :slight_smile:

As mentioned my Smajdalf, in the article, there are two schemes, second one is noted as "bit overkill" but lets focus on that. I'm for overkill here :slight_smile:

My problem now is well... the value selection and poor knowledge of component notations.
For D5 I guess its bidirectional TVS diode, right? And D3 and D4 - Zenner diodes, right?
If so, what sort of values should be chosen for the components to protect 3v pin, ir max (theoretical) input from user is up to 20 volts? (max is a guess, if someone would for example provide pin with supply voltage by accident).
D3 and D4 should be 3v then, right? R1 I presume 20k. C1 as a filter 100pf"ish? For R2 I've seen somewhere in the internet 10 ohm, not quit sure what would that do thou. D5 - no clue.

Any help appreciated :slight_smile: And yes, I did some research based on my limited understanding, and feel a bit stuck, so any advices are super duper welcome.

In given context it is better to use unidirectional TVS diode as D5. It works as an ordinary diode for undervoltage and as a Zener for overvoltage. The bidirectional TVS provides only half of the protection.
D3 and D4 are Schottky diodes.
The passives in the input protection makes a low pass filter. If they are too large (electrically, not physically) it will limit the input signal speed. If it is a simple button input you do not care but for something faster it may be a problem and you need to know the requirements - to large passives will limit the wanted signal while too low won't provide enough protection.

A 22k resistor in series would limit protection diode current (with 20V and Arduino unpowered) to 0.9mA.