...
The output result is probably grossly exaggerated, but this should be appropriate enough to form a comparison with the filtered signal output.
Button Debouncing
Abstract
Switches are not prefect components. Sometimes they "bounce" and their state will not be a single transition from one to the other, but transition multiple times before settling to the new state. This is undesired as they are unpredictable and can cause incorrect readings into our driver input. Thus the objective is the measure the behavior of the button bouncing and develop hardware solutions that will prevent the button readings from bouncing. Software solutions will not be a focus for now.
The Setup
Two types of switches will be used for the measurements: a button switch and a toggle switch. As the basis for the measurements, we will first measure the unfiltered button signal. The schematic shows the initial setup:
Vout is where we connect our oscilloscope probe to provide the measurements.
After the measurements are made, two circuits are tested that are used in attempt to provide debouncing, the schematics show the following solutions:
For this measurement, R1 is a 10k resistor while R2 is a 380r resistor.
The switches that were used are in the following image:
The one on the left is a toggle switch while the one on the right is the button switch.
The capacitor used in this circuit is a 10000Pf capacitor:
Measurements
Circuit 1: Unfiltered Switches
Button
Toggle
These images show the cases when the switches bounced. It should be noted that multiple measurements were made but not all of the measurements showed cases of button bouncing. However the frequency of those bounces are not being recorded for this study.
Circuit 2: Capacitor in parallel with the resistor
Button
Toggle
The addition of a capacitor created a second order RC circuit here. It happened that the system is Underdamped and it is creating these voltage oscillations (this is further studied in ece 240 and in calculus). This is not a desirable result since these voltage oscillations can also cause unwanted readings into our digital circuits or in worse case: damage the input pins by providing a voltage that is too high.
Circuit 3: Additional discharging diode
Toggle
The button measurements for this test are missing. However this measurement shows an issue with this circuit: the bouncing is still prevalent. Perhaps by allowing more current to flow into the capacitor and reducing the current that discharge the capacitor, the results would improve.
Circuit 4: Circuit 3 but with the resistors swapped
Button
Toggle
By having R1=10k and R2=380k the results have definitely improved. The result is a much smoother curve, but we some oscillations are still present in the curve. The circuit could be further improved with the use of a schmitt trigger.