# How to RC debounce toggle switch?

I'm trying to understand if the following debounce circuit works. I want a logical HIGH when the switch is closed and I want to smooth over bounces by means of a low-pass filter.

When the switch is open, C13 charges up in time R23*C13 (1ms). When switch closes C13 discharges through R3 in same time. I now have proper debouncing, right?

Can I omit R23? Or will that momentarily short Vcc to GND?

Edit: updated schematic

The debouncing is not correct in this circuit. The capacitor is not doing anything.

When the switch is open the capacitor is charged to Vcc. When the switch closes, the capacitor will pull up the signal harder rather than slow down the signal like you would want.

You should move the capacitor to the base of the transistor to make it act as a debounce

• A Schmitt trigger inverter can give you better performance and will probably end up costing less than two transistors and two resistors.
– vir
Apr 2, 2021 at 20:56
• i see! if i put the cap at the base, will the charge time then be C13*(R23+R3)? and discharge will be C13*(R4+R2)?
– htor
Apr 3, 2021 at 10:00

No, when your switch closes nothing happens, because nothing is connected to OUT. There is no path for current to flow to discharge the capacitor. This will likely still be the case if you connect OUT to the input of a logic gate or microcontroller.

If you omit R23 then OUT will always have the same voltage as VCC.

There are many online resources regarding switch debouncing, so you should be able to find a better circuit without too much trouble.

• you're right. i updated the schematic to include the surrounding circuitry.
– htor
Apr 2, 2021 at 18:46

It's not a debouncing circuit. All it does is briefly provide more current when the switch is first closed (for some reason). With 5 volt Vcc it would start with about 1/2 milliamp into the base of Q1, which would subside to 1/4 milliamp as long as the switch was closed. Both levels saturate Q1, and make OUT high, so long as GATE IN at J1 doesn't go negative by hundreds of volts.

If Vcc is the logical HIGH for the signal you want, you get that at OUT, but it's not debounced. Are you sure you need it to be?

If you meant "replace with a jumper" by "omit" R23, you won't be shorting Vcc to ground. You'll just be undoing whatever the circuit was intended to do. If you meant "remove" Elliot Alderson's answer is correct.

You need to provide more information if you want a useful answer. "What are you trying to do?" and "What's GATE IN?" lead the list of questions you should answer.