The Best Possible Cheap and Easy Switch Debounce and Noise Immunity Technique - Simply Put

preview_player
Показать описание
All you need to debounce a switch is a resistor and a capacitor, but even though it works generally just fine, it isn't as good as I'd like it. By attaching that debouncer to a 555 timer you not only sharpen the signal's rise and fall to the point that it's almost impossible for any microcontroller to misread it, you also gain strong noise immunity because of the timer's 2/3 and 1/3 Vcc activation thresholds, making any physical switch as crisp and clean as a microcontroller-generated signal itself.

Рекомендации по теме
Комментарии
Автор

A nice technique and I too am a big believer in adding the resistor on the switch. Eventually, the massive currents, even as brief as they are, will pit the plating on the switch contacts. I typically use 100 ohm but anything from 10 ohm to about 1/10th the pullup (or pull down) resistor will work fine. I've seen 220 ohm used a lot too.

But as others have pointed out below, I feel the Hex Schmitt Trigger IC makes more sense in many environments. I have been using it for almost five decades in industrial designs as well as hobby use for myself. You get up to six channels or can use any leftover inverters to invert the switch signal or even use them as general-purpose inverters in other parts of the circuit (they are a tad slower than a typical inverter using the same process however). And in the case of a CMOS Schmitt trigger, power consumption is very low, and they work well with 3.3V (and lower) logic. And they are very inexpensive, probably in the same cost area as a single 555 and likely cheaper than CMOS variants of the 555. On a CMOS IC like the 40106 or 74HC14, the very high input impedance allows for larger resistors and smaller capacitors. The same may apply to a CMOS 555. The Schmitt trigger also has a rail-to-rail output but of course a much lower logic low output current than the 555. And you only need a power supply bypass cap to use it (in addition to the 2R and 1C for each switch).

I do of course agree that many times you have to use what you have, but for me, the Hex Schmitt Trigger is a required part to keep on hand in quantity. It is perhaps the most used logic part I have designed in for the past 40 years. In the hex format and the 1, 2 and 3 gate Tiny Logic versions. It also makes for a very simple RC oscillator as well. But if the choice is available, I prefer to do debouncing in software when possible.

One other thing to mention, switch bouncing will usually get much worse as a switch ages. While a new switch may complete bouncing within 10mS, a worn one might be 20 or 30mS. Beyond that, they are usually unusable. In an industrial product, switches get abused and evaluating product repairs has allowed me some great insight into just how noisy switches can get, which in turns has allowed me to fine tune debouncing over the years.

Too often I see the RC or RRC circuit used with the switch fed into a standard (i.e. non Schmitt Trigger) input. While it may work in some cases, it is not a good practice. Most chips have a minimum rise time on the inputs (again, except for Schmitt Trigger inputs). Doing so can cause instability, can cause the input stage to oscillate or ring and can lead to excessive current consumption that can damage the input transistors in the chip. So, using a technique like shown will definitely make for a more robust circuit design and I would not consider that overkill.

It is always good to hear a technique explained well with great examples of what is happening. I thought the explanations were very clear and concise. My only disagreement is the "Best Possible" part as I feel all the advantages of the Schmitt Trigger IC are better. My opinion of course. But it is still a great video!

joelstyer
Автор

Many 555s make poor denouncers because, ironically, they may have ringing in the output switching transitions that will cause false triggering. The best debouncer is a switch with a
pull-up (or pull-down) resistor, followed by a R-C integrator, followed by a hysteretic inverter such as one section of a CD40106 Schmitt trigger.

arthurharrison
Автор

Great video! You just invented the Schmitt Trigger! :-) Just kidding. The 555 timer is able to act as a Schmitt Trigger, yes. But you can also use one (or two) inverters with Schmitt Triggers as available in 74HC14 or CD40106, by combining two inverters you have one single buffer behavior. In that ICs there are 6 of those available each.

mad_circuits
Автор

Excellent explanation. I'm using 555 ic debouncer for many years in industrial heavy noise environments.

francoisdastardly
Автор

for a shift register I recently created that simple solution with only capacitor and resistor is definetelly not enough! It counts at least a few pulses! To check I hooked it up into the pulse generator with very clean CMOS signal and it worked perfectly so I am looking for precise solution at least similar to my keyboard I am writing it on ..

grzesiekx
Автор

Thank you for the reminder, i used the 555 to clean up a 60hz signal, more then 2 decades ago. Old tech for the win!

suzysheer
Автор

Schmitt trigger inverters are made to interface slow rising or slow falling signals to digital systems and have built-in hysteresis for better noise immunity at the logic thresholds. I use them for my switch debouncers.

jessstuart
Автор

You can also use a schmitt trigger to debounce, it does the same as your example with the 555 chip

RicardoPenders
Автор

Omg, tysm for this vid, I was struggling with a push button bouncing a lot and this saved me :))

Corein
Автор

Love the way you are straight up with your knowledge and no bullshit and always want better first video of yours and I am not even to the point of owning an oscilloscope or anything more than a analog not so multi meter and I have a lot of things to study and learn but I have never been so informed about things that I was not aware I was curious about to this point but I’m liked and subscribed and hit the bell for all notifications and I can’t wait to get all of your research in such an amazing way to never waste our time with non logical things that make us feel like these are not happy times but you are definitely a breathe of fresh air in a muddled environment of YouTube information air seems logical you shall be seeing me as I you! Thank you!

metalman
Автор

I like using Schmitt trigger inverters for debouncing. You will get 6 of them in one 7414 or 40106 and it's simpler than setting up a 555.

dentakuweb
Автор

Thank you for such detailed explanation!!! Now I understood the capacitor’s role ! Big shout from Brazil 🇧🇷

dosbrodinhos
Автор

The extra chip is not 3 cents. It's another point of failure, the cost of procurement, the cost of assembly, and the cost of board space. This can add up to quite a bit when you bring a product into production.

makerspace
Автор

Wow man, I’ve learned a lot today with this vídeo - thanks!!!

GeekDetour
Автор

How can you have a video about hysteresis without mentioning the word hysteresis? Looks like I'm going to get me some 555s to play with... Thanks for the great vid.

holymoly
Автор

Pretty creative. I can hear many asking about why not using Schmitt triggers which might be valid question but if you have only one or 2 inputs to deal with, why not using 555. Many spares in the toolkit.

bertrandlapointe
Автор

Great Video! Very informative on first viewing, and I keep coming back for the simplified image near the beginning. Helpful stuff.

marshallhaynes
Автор

I like you. You are my type of guy and thanks for the debounce. In the future is there a barber found there?

alvinp.schmitt
Автор

Great video. Schmitt triggers and monos are good however, one engineer said two inverters, cross coupled input to output can eliminate the pull up/down resistor. Ofcourse, I have yet to find where I left his design. Often RC differentiators are used on timer trigger inputs. You could show us some spikes on that pretty Oscope.

garydirkse
Автор

Initially, I though the debound signal was caused by the conservation of momentum and the coefficient of restitution between the surfaces. Though after some contemplation it would appear that the noise comes from dielectric breakdown between contacts, as the switch closes there are tiny arcs between them. The sparking allows the switch temporarily discharge, which decreases the field as charge is depletes.

sadface