I am trying to design a circuit to debounce an input switch on a Raspberry Pi. The switch is for a doorbell, so it doesn't need to register multiple valid presses that are close together in time. There will be at least a second between any two actuations.
I have done some research, and the thing that confuses me, is that I'm not sure if both R2 and R3 are required, or just one (and in that case, which one). My understanding is that a value of 300nF for the capacitor, and 100k for the resistor, to give a time constant of 30ms, should be ok.
(Where R1 is the internal pull up resistor)
As I understand it, removing R3 would make the switch short the capacitor, which breaks the debouncing effect. Remving R2 would mean that when the switch is released, there willl be a large inrush current from the pin into the capacitor (which might damage the pin?). The thing I don't understand, is whether the time constant calculation should reference R2, R3 or both.
(I know I could just copy this from somewhere, but I would like to learn.)