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!
@arthurharrison1345 Жыл бұрын
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.
@mad_circuits4 жыл бұрын
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.
@simplyput27964 жыл бұрын
Yep, the schmitt trigger is something I investigated, but I'm a big fan of "easy to remember catch-all and simple" subcircuits, and the great thing about the timer is it's a single component with no accessories needed, and can even be reconfigured in some ways (such as changing comparison voltage range, and switching between active-low and active-high) STILL with no additional components. "Best" means different things to a hobbyist v. a professional.
@markcummings1503 жыл бұрын
I’ve always used Schmitt trigger inverters as you suggested, but I totally overlooked the humble 555 which may be a bit smaller device if you’ve only got one switch to debounce. On the 74c14 you just bung it through a second inverter to get your non-inverted output back if that’s what you need. Size also depends on how many extra passives you need for a 555 vs. a 74c14.
@keiichicom7891 Жыл бұрын
Does that really work:two Schmitt trigger inverters in a row or shouldn't you do this 74HC14-->74HC04 instead for a buffer?
@edgeeffect Жыл бұрын
Yeah... it's a "stupid" example but isn't the real world just a huge conglomeration of stupid examples? ;)
@alchemy12 жыл бұрын
Yea just tell that to the computer science nerds with thier two distinct binaly values, no such thing as wiggle or transition.
@grzesiek1x Жыл бұрын
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 reaaaaaly precise solution at least similar to my keyboard I am writing it on ..
@adrianw2972 Жыл бұрын
Hex Schmitt? Cheaper, more in a package, also with built in hysteresis, probably has lower power needs too. Interesting though, and a good tutorial on contact mechanics/behaviour. Personally, I denounce in code, never seen an issue.
@holymoly23534 жыл бұрын
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.
@simplyput27964 жыл бұрын
Because the actual word hysteresis is way more complex and complicated than just this concept, and I have yet to actually learn it. Just saying this is hysteresis is blowing past so many details it's not even useful.
@rpasco93522 жыл бұрын
Why are there no switch(es) debouncer(s)/switch(es)+debouncer(s) modules available ANYWHERE ???
@francoisdastardly44052 жыл бұрын
Excellent explanation. I'm using 555 ic debouncer for many years in industrial heavy noise environments.
@makerspace53311 ай бұрын
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.
@Corei5n3 ай бұрын
Omg, tysm for this vid, I was struggling with a push button bouncing a lot and this saved me :))
@radman99916 күн бұрын
Overkill for a production product. You can clean up some in the code using just the existing circuit.
@metalman57982 жыл бұрын
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 KZbin information air seems logical you shall be seeing me as I you! Thank you!
@arpitsahni72623 жыл бұрын
Can we use Schmitt trigger here?
@vegansynths7757 Жыл бұрын
Hahahahahahahahahahahahaha!!!! minute 10:30 best quote: "cuz that is just plain gross." You are fantastic. Truly.
@PinoyTechTutorials2 ай бұрын
thank you sir!
@xshounakАй бұрын
Super explanation. One question- what to do if my microcontroller is configured for double click and press and hold functions of the button. The reset time in your video will function as ‘press and hold’
@RicardoPenders4 жыл бұрын
You can also use a schmitt trigger to debounce, it does the same as your example with the 555 chip
@simplyput27964 жыл бұрын
Yep, but I like this because it's a little more flexible and configurable, plus easy to have a box of them lying around. Plus, you can just implement the 555 circuitry yourself externally, which I do to create a tri-state detecting output display board (to be shown in a future video).
@davidjones97304 жыл бұрын
Simply Put ‘Implement externally’ can you explain what you mean? I used quad Schmitt triggers chips can debounce 4 switches with one chip. Like your videos, very clear explanations, thanks.
@winsrrow81252 жыл бұрын
So... Why don't use a schmitt trigger chip directly? If i remember correctly the cd40106 its a inverting 6 schmitt trigger chip, and works well as far as i tested.
@irgski Жыл бұрын
Problem is, the 555 timer costs abt $1.00! Nvr have understood why.
@garydirkse9900 Жыл бұрын
Found the info on the hyper quick, 10 ns, debouncer using 74LS inverters. must test and comment again with credit for design engineer and editor etc. later
@billbyrd98452 жыл бұрын
I have a rather lengthy question about switch bounce. Are you open to a private message using your KZbin business address? Thank you. Never mind. I see that there is no address. I guess KZbin did away with that.
@axelanderson2030 Жыл бұрын
you are like electronics wizard lmao thanks for the videos btw your headphones have holes in them where the earcups should be
@curtmayer10702 ай бұрын
the 555 gives the wrong polarity. so i need another inverter, right? almost all reset in micros are active low.
@CuriousAldo7 ай бұрын
How about a Schmitt Trigger? Isn’t that the same?
@kaybhee63 жыл бұрын
keen..... what about main power ac switch bounce,,, power supply ,,etc
@petermuller6088 ай бұрын
Nice idea! However, I never got all this effort doing denounce in hardware instead of software
@cphank37225 ай бұрын
You have created a Schmitt trigger. It has hysteresis.
@alvinp.schmitt5424 Жыл бұрын
I like you. You are my type of guy and thanks for the debounce. In the future is there a barber found there?
@rleonmx5 ай бұрын
sacan de onda sus audífonos, pareciera que tiene un agujero en la cabeza
@RandallStephens397 Жыл бұрын
I love your Data poster
@GeekDetour3 жыл бұрын
Wow man, I’ve learned a lot today with this vídeo - thanks!!!
@dentakuweb4 жыл бұрын
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.
@simplyput27964 жыл бұрын
True, but 555s are cheap and incredibly flexible, and one of the first things a hobbyist will acquire a box of, whereas I still don't even own a schmitt trigger chip (eventually I will, of course). And they're fun!
@dentakuweb4 жыл бұрын
@@simplyput2796 Look around on some old electronic and you will probably find a 7414 because they're very common. They're also perfect for making very simple oscillators. All you need is a capacitor and a resistor/potentiometer.
@parapos4 жыл бұрын
great video, thank you.
@bertrandlapointe64792 жыл бұрын
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.
@jessstuart74953 жыл бұрын
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.
@timsanders91112 ай бұрын
Thank you. Did Data tell you how to do this? :)
@elektron2kim666 Жыл бұрын
What is the "standard" for high/low? You say switch on = 0.
@amitkhulbe2 жыл бұрын
Why not use a opamp smitz trigger
@Karl_Levine4 жыл бұрын
This is f****ng great. You're great! 👍
@sadface74574 жыл бұрын
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.
@simplyput27964 жыл бұрын
Oh that's definitely a chunk of it, but there're a whole host of things that can cause a goofy signal. Use two alligator clips as a switch, hold them tightly together, and then rub them together without breaking contact, and you'll get a horrible waveform. Contact bouncing is the electronic equivalent of a seizure.
@mr.satishfy2 жыл бұрын
Is it termed as parasitic R L C. As
@SteveRaynerMakes Жыл бұрын
A fantastic idea to slow things right down. It made it really easy to see what was happening. Is this the same idea as using a schmit trigger inverter?
@noname-gp6hk2 жыл бұрын
Damn dude, thanks for the advice. This just solved a problem I was working on.
@suzysheer662 жыл бұрын
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!
@AnimilesYT2 жыл бұрын
Do I need a 555 timer for every button? I want to create something in a limited space, so I'm not sure if I have the space for a lot of those timers ':)
@dalenassar91522 жыл бұрын
At about timestamp 3:55 when you add the resistor, aren't you creating a voltage divider whenever the switch is closed, thus bringing the logic low level output a wee bit high?
@dosbrodinhos2 жыл бұрын
Thank you for such detailed explanation!!! Now I understood the capacitor’s role ! Big shout from Brazil 🇧🇷
@joseponce62502 жыл бұрын
thanks
@marshallhaynes86583 жыл бұрын
Great Video! Very informative on first viewing, and I keep coming back for the simplified image near the beginning. Helpful stuff.
@RealThunder813 жыл бұрын
exchange the 555 timer with a schmitt trigger? actually the way it ment to be
@NicholasRadina Жыл бұрын
Excellent! Thank you!
@garydirkse9900 Жыл бұрын
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.
@makerspace53311 ай бұрын
That only works if you have a SPDT switch.
@markchristophergemzon10523 жыл бұрын
Thanks for this quick and informative lesson. Helped me solve my problem. Hmm, what is with the hole in your headphones?
@stevegoodjob59022 жыл бұрын
That's a trade mark! Which I approve 👍🏻
@leandrosouza61882 жыл бұрын
Cool. Thanks from Brazil.
@k.chriscaldwell41412 жыл бұрын
Superb. Thanks.
@radovanthefoley2 жыл бұрын
Golden! Answer to my challenge: barebone rotary encoder in combination with arduiono interrupt. Only latching and pretty decent deadzone in between could save me. Many thanks!!!
@Cassiusisback2 жыл бұрын
read out data pin on rising and falling of the clk pin. if the data pin changed value between rising and falling clock, it was a valid input, otherwise it was just a bounce. no hardware needed. if(digitalRead(enc_check_pin)==HIGH) last_encoder_count=1; else last_encoder_count=0; while (digitalRead(pulse_pin)==LOW) { //wait for clock rising again } switch (last_encoder_count + digitalRead(enc_check_pin)) //1 means valid, 0 or 2 means bounce { case 1: if(last_encoder_count == 0) encoder_count++; else encoder_count--; break; default: break; }
@adrianw2972 Жыл бұрын
Noooooo! Do not denounce, getting it right for all speeds does not work! The correct way is to create an inturupt driven state machine. Since the output pattern can (in an ideal world) only change in a known order, denouncing is automatic as the output pattern is as expected or not. Even cheap and nasty rotary encoders can work beautifully!
@ZookeeperJohnG2 жыл бұрын
Well explained!
@keithking19854 жыл бұрын
im really glad you made this video because iv came across this problem before giving me false positives when trying to turn things off and on.. can't remember what it was doing it on it was before i started learning this stuff. by the way that pure genius using the trigger & the threshold pins on the 555. . YOU SHOULD DONATE YOUR BRAIN TO SCIENCE..((& how doesn't have a 555 in their parts box)).. oh & ya know how you said that made you happy!! it made me HAPPY TOO. class idea, & class video : ) P.S. ya hook up pin 8 & 1 on the 555 to power it yeah?? "I know the answer is yes but i have a habit of doubting myself alot". which i should stop doing!! thanks again best you-tuber without a doubt ; )
@simplyput27964 жыл бұрын
You'd have to refer to your datasheet. I'd never trust one universal "this is always pin X no matter what" no matter how old the chip design is.
@keithking19854 жыл бұрын
@@simplyput2796 is that the 555 datasheet your referring to???
@simplyput27964 жыл бұрын
Yes, look at the top of your chip and note down the actual part number (NE555P for the ones I have) and look up the specific datasheet (e.g., google "ne555p datasheet pdf") to double check. You never know when you'll end up with some random chinese knockoff that moved the pins around.
@keithking19854 жыл бұрын
@@simplyput2796 thanks for that bud!! my 555's are "NE555P" too.. ill do that anymore!! look up the datasheet for any chip i get and not take it for granted that it is just generic!! so thanks again, your the best : ) P.S. whats your first name by the way( you don't have to let me know if you don't want, or if you prefer to keep privet. i would understand that & i wouldn't take it bad if that's the case)
@endspiel4 жыл бұрын
thx for this
@ReptarKingoftheBrozone3 жыл бұрын
Thank you for the thorough explanation. I was curious how to calculate the Farad value for the capacitor? Would a 1uF or a 10uF capacitor be better?
@ericgroen2532 жыл бұрын
the value of the capacitor can be multiplied by the value of the resistor. It is called the RC time. IE: 10uF x 100K ohm (0,000010 F x 100000 Ohm) = an RC of 1 second After 1 RC (also known as Tau) the Capacitor has lost 63% of its value. Or loaded up to 63% of its value, depending on the way of the circuit. In this manner 1 second. If you change the R or C value, therefore the RC time, the time in which the 63% point is reached, can be changed.
@prvashisht2 жыл бұрын
@@ericgroen253 Thanks. How is the 63% values meaningful here? Something like an element's half life or just an arbitrary number?
@SilverRyuu Жыл бұрын
@prvashisht Late response, but maybe someone in the future will find this useful. Knowing that the current in a capacitor is equal to C*dv/dt you can solve the differential equation for an RC circuit and find that both charging or discharging a cap is an exponential function. The math works out so that you get something like V(t) = Ve^(-t/(RC)) for a discharging capacitor and where V is the voltage at t = 0. Plugging in RC for t will give you Ve^-1, and e^-1 is approximately 0.36. So after time RC (also called tau) you're left with 0.36 of your initial voltage or a 63/64% decrease in Voltage
@ericgroen25310 ай бұрын
@@prvashisht It is science... Every RC time, the actual value is dropped by 63%. So 63% of 63% of 63% of 63% of 63% is near to 0. (Sorry for the late response)
@keithking19854 жыл бұрын
putting this in my favorites
@arpitsahni72623 жыл бұрын
Same!!
@ericgroen2532 жыл бұрын
A very clear explanation! Keeping it simple and understandable.