Friday 12 June 2015

debounce - Debouncing and hysteresis questions about a Schmitt trigger circuit


enter image description here


Above is a switching sensor which outputs ON OFF pulses by the 33k pull-down resistor. V2 and R_SW models the switching. The sensor output is needed to be measured between 1Hz upto 150Hz. I'm planning to use a Schmitt trigger circuit which can sharpen this sensor output pulses without letting switch bouncing effects.


Below is the circuit in LTspice where the sensor is coupled to the Schmitt trigger circuit at 1Hz sensor output(please left-click to enlarge images):


enter image description here


Here is at 100Hz (red is the circuit output):


enter image description here


Here is at 500Hz:


enter image description here


My idea was to prevent bouncing at the switching input, and I wanted to filter it by R1 C1 values. So 47k and 10nF gives 339Hz cutoff frequancy. But as you saw in above figure circuit passes 500Hz pulses as well.



My first question is:


What R1 C1 combination could be used to prevent bouncing? I emprically dont know what would bouncing frequency be when switching. I only know the pulse inputs will be between 1Hz and 150Hz. So if I set the bouncing cut off at 340Hz then at 1Hz input if I have 10Hz bouncing pulses it will still be problem. At this point I'm confused. Is there a typical remedy for this situation?


My second question is about the hysteresis amount and the voltage level at point B (inverting input). As you see in the waveforms above, the green waveform represents the voltage at the point B(inverting input), the blue one represents the voltage at point A(non-inverting input), and the red one is the output voltage. Here I set up the resistors such that the voltage at point B is almost half the voltage at point A. And I set the hysteresis limits between 5.5V and 7V. Is there a rule of thumb or logic to set these levels for a better result? I mean is setting point B voltage to the half of point A is correct? And is 2.5V hysteresis good? How about to setting hysteresis to 1V to 10V limit? Im asking because I couldn't find practical info about these issues in books?


I would appreciate your suggestions about this circuit.




No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...