Been working on a tilt circuit and ran across the SIGNALQUEST sensors and the data sheet suggests a filter. Simulated in LT SPICE but interpreting the best solution for a clear output with min switch bounce if possible or just do the de-bounce in code but having never used thisd form of filter in LT SPICE not sure if the results are what I need?
Comparing to circuit with out the capacitor. The output is connected to a pic port pin.
GOOD POINT
I want a clean output that the PIC will interpret as one switch closure. Trying different cap values but not even sure the spice sim is set up correctly. Presently using a voltage divider and it appears to work well but can it be improved. The data sheet for the tilt switch suggested using the filter so using LT SPICE I though I would look at what each filter is actually doing in simulation.
This sim indicates that you might want to put a Schmitt trigger with about 1V of hysteresis between the sensor and the PIC port pin. Note that I went to some effort to model a case where the simulated sensor output V(bounces) has several bounces before settling to the other state. The RC filter lets some residual ripple through to the PIC pin, which might see this as multiple transitions through the Vcc/2 nominal trip point.
Interesting the way MikeMI did the switch bounce. I hav't used LT SPICE enough to get all the bells n whistles working.
here is the data sheet for the tilt sensors showing the filter they are suggesting. https://www.electro-tech-online.com/custompdfs/2013/02/Tilt20Switch20App20Circuits.pdf
maybe someone with a better knowledge of filters can explain or ??
I was curious about this request and was wondering if deboucing is really whats needed here,
so I did a little research and found some app notes.
It seems that whatever RC filtering is used, some sacrifice of sensitivity might occur since
the uC relies on the reading of the leading and trailing edges of the input signal (edge triggering) for the detection of motion/tilt. Maybe the filter should be adjustable?
Interesting reading THANKS.
Will have to construct both circuits. Been using a rolling ball sensor which works rather well but $17 each I don't think so. The signalquest sensor is $4.50 each but a min order of 25 is required. Have a sen645 samples but kinda buggie. Need to do more testing.