When a mechanical switch closes it's contacts typically do not close "cleanly" and tend to bounce or chatter. This rapidly switching signal could be misread in certain situations so it is usual to attempt to reduce this bouncing to ensure a clean switch detection. the danger is that if the switch is not de-bounced you can detect multiple events from one opening or closing. Can be accomplished using analog circuits or digital circuits.
Questions tagged [debounce]
164 questions
35
votes
7 answers
Debouncing buttons
I recently read an article about button debouncing and was wondering if I should keep this in mind when working with, for example, an Arduino (ATMega mC)? I assume it is an issue, especially when working with interrupts.
So is it better to detect…

Vincent Van Den Berghe
- 1,290
- 2
- 14
- 21
28
votes
3 answers
Is it possible to use just a capacitor to debounce a button?
I have been wondering: why cannot you just hook up a capacitor to a button to debounce it? I have been figuring out how to reduce the work my microprocessor has to do, but I have very limited space on a PCB I am designing, so I don't want to do a…

Anonymous Penguin
- 3,750
- 8
- 35
- 57
22
votes
5 answers
Why can't I see bouncing of a switch on an oscilloscope?
I'm trying to view the bouncing of a simple switch on an oscilloscope.
I have prepared a simple breadboard circuit (power → switch → resistor → ground). The problem is, it is displayed as a perfect square/rectangle on the scope. I have attached a…

Deniz
- 323
- 2
- 6
13
votes
3 answers
Physics behind switch bounce when opening?
I was surprised to learn that a mechanical switch (SPST) bounces when it is opened. What causes the contact to temporarily return to touching?
Does this phenomenon only happen with certain types of switches (e.g., with sliding switches but not with…

Richard Hansen
- 294
- 2
- 9
12
votes
4 answers
Why does the voltage of the photodiode "bounce"?
I have setup a BPW-21 photodiode as shown below:
The photo-diode is activated by an oscillating laser beam. I expected to get a clean +5V to 0V transition at point A when the laser beam falls on the photodiode and a 0V to +5V transition when the…

Abhishek
- 409
- 5
- 11
8
votes
2 answers
Button debounce ringing
I have a circuit where I am using a tactile switch to pull 3.3v down to ground and investigating debouncing the button. My relevant part of the circuit is
The 100nF cap does work here my signal has ringing that operates in the undefined region…

Glenn Pierce
- 229
- 1
- 6
8
votes
4 answers
Does a switch need to be debounced when opened?
Suppose that an input on a microcontroller has a pullup resistor to 5V and a switch to ground (normally open) connected to it. I know that a switch should be debounced (in my case, in software) when closed, but is debouncing when a switch is opened…

Nate
- 4,496
- 11
- 56
- 75
8
votes
2 answers
Can multiple Schmitt triggers in series fully debounce a switch?
After dealing with software debouncing for a while, I find it takes a huge toll on the system, so I thought of initially making a hardware debouncer with one Schmitt trigger (74HC14), a capacitor, button and resistor as shown below from…

Mike -- No longer here
- 755
- 5
- 20
8
votes
5 answers
Hardware debouncing of key matrix with minimum passive components
I have recently bought this cheap 4x4 keypad matrix. It only has the push-buttons and nothing else therefore I want to add a proper debouncing to it. The debouncing in software is something I want to avoid because it takes some processing power out…

DEKKER
- 755
- 1
- 12
- 23
7
votes
3 answers
Debouncing by ignoring data?
All of the software debouncing routines I've seen involve waiting until some number of sequential reads of a signal return 0 or 1. That makes sense, of course. But it means there's an inevitable compromise between robustness and latency. The more…

Sneftel
- 338
- 1
- 11
6
votes
3 answers
Capacitor and ISP issue
If I remove C5 I am able to use ISP. However, with C5 on board ISP programming fails... Capacitor is for button debouncing.
What is the quick workaround to have debouncing routine and use ISP? I can't change the board because it's already on PCB,…

Pablo
- 1,551
- 3
- 20
- 41
6
votes
3 answers
Is this an acceptable circuit for debouncing a Raspberrry Pi input pin?
I am trying to design a circuit to debounce an input switch on a Raspberry Pi. The switch is for a doorbell, so it doesn't need to register multiple valid presses that are close together in time. There will be at least a second between any two…

Alex
- 195
- 1
- 9
6
votes
1 answer
How is this Pushbutton Debounce code?
I am monitoring a pushbutton with a microcontroller where I am trying to take care of four things together:
50-msec debounce upon push-begin and 25-msec debounce upon push-release
identify a short-press, defined as when button released within < 1…

boardbite
- 4,892
- 11
- 47
- 73
6
votes
1 answer
What is masking-time and chattering in rotary encoders?
In the datasheet of these encoders there is always a chapter mentioning masking-time and chattering.
I couldn't find any tutorial on this. What are these definitions about?

user1245
- 3,955
- 4
- 37
- 87
5
votes
1 answer
Buttons that do not bounce or scopes that pretend to be 100 MHz but actually aren't?
I have bought single push buttons in India for 1 rupee a piece, that's a penny or so. They are seemingly very basic (you can see them around here other question). I might follow up here with more details. I also bought a supposedly 100 MHz digital…

Gunther Schadow
- 1,441
- 7
- 22