[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Debouncing question

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 17
Thread images: 2

File: bouncing.png (19KB, 1322x1069px) Image search: [Google]
bouncing.png
19KB, 1322x1069px
Hello /diy.

I'm turning to you after google failed me. I'm planning to make a board with some Cherry MX switches and when I played around with my scope and probes I noticed that they bounce sometime.

I would like to get rid of it, and I kind of did with some simple RC filter. The bounces are nearly gone and very rarely reach a suspicious value.
I did my RC with 10kOhms and 100nF and I would like to know if the values or R and C matter, outside the fact that the RC time should stay the same. If I had used 100k and 10nF what would be the consequences ?

Thanks for your help.
>>
It would change the rise and fall timing but keep the same pulse duration. Overshoot and drop will come into play when you get to either extreme.
>>
You can software debounce by sampling a few points in time near eachother and once all of them are 'near' eachother in value you can say the signal is settled and legit.

If try to smooth it with caps im pretty sure its gonna make your signal climb slower but seem smother. But isnt is likely that its gonna fuck your threshold voltage values up since it wont climb as rapidly?
>>
>>1107056
Who can it change the rise and fall time without changing the pulse duration ?
The only difference I see is the amperes passing through but the tension will be the same (or look identical) if the RC time is the same.
>>
>>1107078
I would like to keep away from software debouncing for now. If I have to I'll but I find hardware debouncing more appealing right now.
>>
>>1107039

RC with Schmitt kinda sorta works, but you need quite a lot of RC time to get the bounce amplitude under the Schmitt hysteresis.

What you really want is a circuit which disallows the output to go low after it went high for x ms.

It's easiest to just do it in software instead of hardware.
>>
File: debouncerrc2.jpg (13KB, 416x336px) Image search: [Google]
debouncerrc2.jpg
13KB, 416x336px
>>1107039

If you really want to do it with RC, you can also add a Schottky diode. This makes the RC time for turn on almost the same as for turn off regardless of the pull up/down resistor value.

http://www.ganssle.com/debouncing-pt2.htm
>>
>>1107133
Yup, I have some 74HC9114 and breadboards to test them and I plan to use some in my current design.

The main reason for not wanting to go software is that it makes the code harder to read (I will test about 40 buttons) and maybe slower (I will poll at 1kHz).
I understand than in hardware deboucing will maybe not be enought, but I still want to gather some knowledge about it.

And I'm still clueless about R value and C value.
I want RC to be about 1ms but other than that ...
>>
>>1107137
>http://www.ganssle.com/debouncing-pt2.htm
Wow this is a good trick, I skimmed through this some times but you made me realise "why the diode".
>>
>>1107039
Yes of course for every r value there is a c value to give any time constant.
What you need to bear in mind is the resistance value and it all depends on what comes after, the input will have an impedance value you should be slightly concerned about. The smaller resistance will allow more current through which you might need to actuate whatever you are actuating but more current makes it use more energy and you know, smaller resistance means less current, more efficient but needs more sensitive detector.
In reality this is a whole bunch of pish, pretty much any reasonable value you pick will"do". Just pick something cheap that you can reliably get your hands on. If in doubt start at 10k or 1k and work from there until the current and capacitance is sensible. Make sure the power dissipated isn't to high for your passives
>>
>>1107039
If these switches are inputs to a microcontroller, it's far easier to do your debouncing in software.
>>
I cured my key bounce with AutoHotkey, and then later on I just physically switched the offending key (n) with one I don't use often (F12)
>>
can you use an SR latch to debounce your switches???
>>
>>1107137
That's a wonderful read. It's so rare to find good information with proper explanations without it being an academic bloat.
>>
OP here.

>>1107528
Though AutoHotKey would be a cleaver trick, its needed on every computer I plan to use my board so I'm not taking it into consideration.

>>1107531
A Cherry MX switch is not an inverter, only 2 pins, so from what I understand SR latch is a no go.

From what I read everywhere, here included, I'll probably implement a software part as well.
>>
I read a comment about a danger involved in not debouncing with hardware

Something about slew rate damaging the MCU

is this true
>>
>>1107560
if you use an RC circuit for debouncing, the rise time will be very slow. Unless the input has a schmitt trigger, the signal will linger in the undefined range and cause unpredictable behavior.
But I've never head of any damage happening from that.
Thread posts: 17
Thread images: 2


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.