I found this debouncing circuit with no component values.
I tried guessing values for R1, R3, and C1 since I have no idea on how to choose the values correctly.
Also, I am uncertain if the parameters of the PULSE controlling the voltage controlled switch will be like the situation in switch bounce.
Could you please guide me to find correct values for my components? Also kindly help in choosing the correct parameter for the PULSE.
In that case, you're values look good. You have a time constant around 25mS and that should take care of most (all except a wire and nail) switch bounce situations.
I thought the values are somewhat incorrect.
As we can see from the waveforms, V(n003) shows a switch bounce. From 5 volts, it goes down to 0 volts for about 2mS.
What I expect is that V(out) will remain at 5volts even there was a switch bounce but the waveform says my expectation is wrong.
The time constant R3C1 needs to be increased by a factor of ~100, e.g. make C1 = 470n. Your simulated switch bounce would be more realistic with at least ten cycles each having a period of, say, 2ms instead of 10ms.
Changing C1 to 470n and the PULSE, the output remained at 0 volts.
What I am expecting is that the moment the switch is turned on, the output will be at 5 volts.
Even when bounce occurs, the output will still hold a value of 5 volts.
Why the diode? I would lose the diode and make the resistor ratio higher, ie 1k and 47k. That will also slow down the time constant ie now 47k:4n7. GOing slower still won;t hurt, you could increase the cap size.
My mistake. The circuit I have posted was wrong.
The inverter should be an inverting schmitt trigger.
Starting with the switch open.
The capacitor C1 will charge via R1 and D1.
In time, C1 will charge and Vb will reach within 0.7V of Vcc.
Therefore the output of the inverting Schmitt trigger will be a logic 0.
Now close the switch
The capacitor will discharge via R2.
In time, C1 will discharge and Vb will reach 0V.
Therefore the output of the inverting Schmitt trigger will be a logic 1.
Now, could you please guide me on properly simulating the circuit and what proper values to place? Many thanks.
So why is the diode needed? With a big enough ratio between the two resistor values, there will be roughly the same time constant for cap charge as for cap discharge, which gives a perfect debouncing effect, and no diode is needed. I've never seen diodes in commercial debounce networks in products.
Yes sir. The reason why there's already +1 below is that I tested it and it worked.
I'll try MrRB's approach. Losing the diode would be more economical as long as the desired effect is fulfilled.
@eTech: Thanks for the sim. Your test is more realistic bounce than what I posted. However, I'm still trying to learn the PWL. I have not much experience in simulations. As a matter of fact, the reason why R2 is not present is that I used a resistor as the switch when I first simulated the circuit.
The Schmitt inverter circuit, without diode, is discussed under RC Debouncer beginning on page 13 of the first link. It is also discussed in the second link.
John
Oops, how times change. I guess the original is no longer up. Both links I gave go to the same place now. Forget the page reference; just go to the RC Debouncer section.
So why is the diode needed? With a big enough ratio between the two resistor values, there will be roughly the same time constant for cap charge as for cap discharge, which gives a perfect debouncing effect, and no diode is needed. I've never seen diodes in commercial debounce networks in products.
Here's an excerpt from the ganssle doc linked in post 16:
"The diode is an optional part needed only when the math goes haywire. It's possible, with the wrong sort of gate where the hysteresis voltages assume other values, for the formulas to pop out a value for R1 + R2 which is less than that of R2. In this case the diode forms a short cut that removes R2 from the charging circuit. All of the charge flows through R1. The previous equation still applies, except we have to account for drop across the diode. Change Vfinal to 4.3 volts (5 minus the 0.7 diode drop), turn the crank and R1 pops out. "
It just needs the resistor ratio to be high enough ie >10:1 and it should always work with no diode needed.
With a ratio >10:1 you can virtually ignore the effect of the smaller value resistor so your RC time constant is almost totally dependent on the larger resistor and the cap.