Is this an acceptable circuit for debouncing a Raspberrry Pi input pin?

You are correct about R3. However, R2 is not necessary: when the button is released, the capacitor will charge slowly due to the resistance of R1. When the button is pressed, it will discharge slowly due to the resistance of R3. In fact, R2 can even cause a problem: with the button pressed, the capacitor voltage will not reach ground (since R2 and R1 will form a voltage divider).

As for the time constant, it should take all resistances "seen" by the capacitor terminals into account. When the button is pressed, this is \$(R_1 + R_2) || R_3\$ (found by shorting power to ground and solving for the equiv. resistance between the two capacitor terminals).

When the button is released, the time constant for charging is based on the resistance \$(R_1 + R_2)\$. As you can see, even with R2 gone, inrush is limited by R1.

There is another issue here: the steady-state voltage when the button is pressed. This voltage will not be ground, but rather is \$\frac{R_3}{R_1 + R_3}\$ (ignoring R2). This voltage will be far too high with your choice of R3. You can get rid of R2 and R3 altogether: the capacitor will charge rapidly from the button, but this inrush is generally acceptable at the size you mention, while the pull-up resistor's current will still be acceptable to avoid GPIO damage.


You do not need R2. If you want to include R3, traditionally it is on the other side of the switch, so both the switch and the capacitor are connected directly to GND. Yes, it's a series circuit and it doesn't matter, but that is the way most designers think.

R1 - 100K

R3 - 1K (optional)

The only reason for R3 is to limit the peak current through the switch contacts when they close around a fully charged capacitor. If this were a 2 minute timer with a 1000 uF capacitor, then there would be an issue. But a doorbell switch can handle a 1 amp inductive load, so I don't think R3 is necessary for a capacitor as small as yours.