Questions tagged [debounce]

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.

Filter by
Sorted by
Tagged with
32
votes
7answers
21k views

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 ...
19
votes
5answers
5k views

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 ...
19
votes
1answer
33k views

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 ...
13
votes
3answers
1k views

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 ...
11
votes
5answers
2k views

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 ...
8
votes
2answers
2k views

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, ...
8
votes
4answers
1k views

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 ...
7
votes
5answers
2k views

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 ...
7
votes
3answers
699 views

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 ...
6
votes
4answers
2k views

Software Debouncing to detect if switch has been pressed for T seconds

I need to detect if a switch has been pressed for longer than a set time, without using any Timer registers in my embedded code. I am using software debouncing in the following manner to detect a ...
6
votes
3answers
224 views

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 ...
6
votes
1answer
2k views

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-...
5
votes
4answers
3k views

Which diode to use on my RC switch debounce circuit?

I am choosing parts to build an analog RC switch debounce circuit. I plan to implement the circuit described here: http://www.ganssle.com/debouncing-pt2.htm (see "An RC Debouncer"). RC debouncer ...
5
votes
1answer
278 views

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?
5
votes
1answer
200 views

Induced power supply noise on switch contact

I have a circuit that has a 24V section and a 5V section, separated by opto-isolators and an isolated DCDC converter. Both sides of the DC-DC have decoupling caps, and the MCU has one per Vcc pin. ...
4
votes
3answers
3k views

Is this a good way to debounce a switch?

There are plenty of debouncing circuits on the internet, but I couldn't really find one that fitted my needs / available parts, so I came up with my own, from what I had. There's nothing special about ...
4
votes
4answers
14k views

Understanding interrupts and software button debounce

I'm quite new to AVR programming (avr-gcc). To react on button-press, I am using a PCINT ISR with the internal pull-up resistor enabled like this: ...
4
votes
2answers
1k views

How to eliminate the forbidden state in an SR latch?

I'd like a latch where the output only changes when both inputs have changed. If only one input has changed, the latch output should stay constant. Here's the state table I want: ...
4
votes
2answers
10k views

VHDL debouncer circuit

I'm working in a digital engineering lab and I'm trying to figure out how this debouncing circuit works. It's provided as-is by Xilinx but I'm not quite sure why it does what it does. Any pointers, ...
4
votes
1answer
1k views

Choosing transistor for a raspberry pi switch

I'm trying to design a circuit that will control the power to a raspberry pi with a button. The basic usage is: first button press-> rasp powers up. second button press-> rasp continues with power ...
4
votes
2answers
3k views

How can a shift register be used to debounce a switch?

This is the problem: This is the proposed solution: What I don't understand: The button bounces in the setup/hold time of the input of the circuit, making the FF go into a metastable state whereby ...
4
votes
2answers
442 views

Adding switch debounce to discharge circuit

We use the attached circuit for some diagnostic timing prior to doing experiments. Basically when the momentary switch is closed, from a location away from the generator box, the left side of C2 is ...
3
votes
4answers
366 views

Question about debouncing - delay of state change

I have a very simple project where I needed to debounce a button (in software). Logically, my thought process is: If the state's been stable for a while, and it changes, then immediately signal an ...
3
votes
3answers
1k views

Can I debounce after a shift register?

I am rewiring a cheap old organ for digital and want to use shift registers to read all the keys. Is it possible to debounce the keys after the shift registers, or do I need to do it before? Either ...
3
votes
3answers
333 views

Calculating R and C for schmitt trigger debouncer

I've been looking all over the internet to try to figure out the optimal values for R1, R2, and C but couldn't find info. I'm trying to ideally make a debouncer that will work with any button on the ...
3
votes
2answers
5k views

Checking for short vs long press with debounce

I'm a complete beginner with Arduino but have done quite a bit of searching and can't seem to fix this problem. I'm trying to create a procedure that is repeatedly called in the main ...
2
votes
2answers
1k views

Do I have to debounce MCU reset pin?

I have it only tied to switch via a pull-up resistor on a pic. I'd like to not perform any hardware debouncing to save on costs, but I'm wondering if this could lead to a higher fail rate of ...
2
votes
4answers
824 views

A question about a debouncing circuit

I was reading a tutorial on debouncing the outputs of a rotary-encoder which are read by a micro-controller. Below is the circuit given: The writer of the tutorial claims the following: "In the ...
2
votes
3answers
726 views

Where to place debouncing circuit for remote mounted buttons and rotary encoders

I have an application where a push button and mechanical grey-code rotary encoder(user inputs) need to mounted away from main pcb. 24" - 48" away. This is for space and packaging reasons. Is it OK to ...
2
votes
5answers
334 views

MUX input debouncing?

I am using a CP2103 to interface with a simple 74HC4051 MUX. I want to use 3 of the I/O ports on the CP2103 to control the input pins of the MUX. The 4th I/O port is being used for something else. The ...
2
votes
3answers
2k views

Switch Debounce Topology for Rotary Encoder [duplicate]

I'm looking to debounce the output of a rotary encoder I'm using as a switch to ground with a pull-up. Looking online I saw the debouncing circuit in Figure 2 and read about it here. However, I also ...
2
votes
3answers
1k views

Counting number of push button press by external interrupt

It's a requirement that I should count the number of button press by external or any other interrupt. So when I use the external interrupt to increment the counter by 1, it sometimes is crease by 2 ...
2
votes
2answers
86 views

Wires not making proper contact/interfering

I want to register button presses via a Python program I wrote with a Raspberry Pi 3. My buttons are connected both connected to ground and GPIO pins 22 and 27. However, when the buttons are pressed, ...
2
votes
1answer
504 views

Spartan-3E to PIC16f887

I am a beginner wanting to know how to interface the spartan 3e board with the pickit2- PIC16F887. I have so far connected j2- pin a6(spartan) to port a Pin1 on the PIC, the ground Pins and j2 pin e7 ...
2
votes
1answer
172 views

Switch bounce vs LC Spike Voltage

For my EE lab, our professor wants us to show switch bounce, and then eliminate it using hardware, and software debouncing. However, I seem to be stuck on finding the switch bounce in the first ...
1
vote
3answers
9k views

AVR Button Interfacing

I am a beginner of the micro-controller and I have the kit for AVR. I am currently using an ATMega16 to learn the basics. I have tried a few simple experiments with this micro-controller using LED's. ...
1
vote
1answer
1k views

debounce filter vs glitch filter [closed]

What is the difference between debounce filter and glitch filter on a mcu? I'm trying to implement a hardware debounce filtering on a ATSAM4S4C (ATMEL SAM CORTEX-M4 - PAGE 575. http://ww1.microchip....
1
vote
3answers
878 views

Counter in assembly, using interrupt to prevent multiple counts with single push?

I am completely new to assembly, and I must develop a counter using PIC16F628A, a push button, and a display. Additionally it there will be an external oscillator (555). I made some progress on this, ...
1
vote
1answer
363 views

How long should I drive the coil of a latching relay?

I have inherited a project that uses HFD2/005-S-L1-D single coil latching relays. The datasheet is here. It lists 4 parameters which may be what I want: Operate time: 4.5ms Release time: 3.5ms Set ...
1
vote
3answers
3k views

Debouncing this Rotary Encoder Switch

I have this rotary encoder and I am not quite sure how to debounce the internal push button switch (shown in the SW02 diagram). Any help would be appreciated, I'm a noob with this stuff. EDIT I ...
1
vote
2answers
188 views

Time parameters of pressing a tact button by people

Sorry for bad English. How fast people can press a tact button? I.e. what is minimal time of holding a button pressed people can get? What is typical bouncing time when people press tact button? I ...
1
vote
1answer
85 views

Debouncer with LED inside

How It's possible to add a LED to a line that it's debounced (switch) with an RC circuit. If I place 2 LED, one on ground and one on VCC to know button position. Will they remove my charge/discharge ...
1
vote
2answers
421 views

Debouncing Circuit with Schottky Diode

I found the following circuit interfacing with a GPIO input on an MCU that has an internal pull up resistor. The GPIO is being used to detect the state of the push button. I have two questions ...
1
vote
1answer
1k views

Encoders debouncing with 7414 at 3.3V

I'm trying to make a small module that has 2 rotary encoders (both have build-in push buttons), hardware debouncing circuit and have to be compatible with both 5.0V and 3.3V microcontroller logic ...
1
vote
2answers
1k views

Push button debouncing circuit without extra IC? Possibly RC based?

I have a push button that I would like to debounce. I only care about the first rising edge of the signal which is connected to an Arduino's GPIO. After reading on the web about hardware debouncing, I ...
1
vote
1answer
835 views

How to write a counter in verilog for debouncing an input?

I am trying to write a module counter to debounce a input coming from mechanical buttons. The module should be controlled by the 4x4 matrix button module when to start or stop debonce. This is my ...
1
vote
1answer
220 views

USB and button power on solution

I've a circuit that have one input pin that should go LOW if one of two conditions is accomplished: USB is connected; Button OR Switch is pressed/slided; If USB is connected Button or Switch is ...
1
vote
2answers
72 views

Power Off and Capacitor Discharge

Could someone tell me where this diode (highlighted part) would be added and the orientation? https://www.maximintegrated.com/en/app-notes/index.mvp/id/287
1
vote
1answer
445 views

RC debouncer circuit does not work

I tried two circuits below, none of them seems to be working (I used 74LS04 and 74LS00), the output doesn't change when I press the switch. I found that the voltage at point "A" doesn't drop below 0....
1
vote
1answer
1k views

How to add bouncing to a switch in LTspice?

Is it possible to add bouncing for a switch in LTspice? Below is a reed relay simulated in LTspice. I can set the on and off resistances but is there a workaround to create bouncing as well? With no ...