Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

how to make a debounced push button???

Status
Not open for further replies.
Hi,
Google "switch debounce circuit" and you'll find plenty. There are various ways to do it. I used a 7414 IC for a couple of switches for my PIC projects. The SN 7413 is obsolete but the 7414 works very well.
Hope this helps.
Barry.
PS When using 7414, I only used pin 12 as the output. (Check out the datasheet for the 7414)
 

Attachments

  • debouncing_2520circuit_1_.gif
    debouncing_2520circuit_1_.gif
    4.4 KB · Views: 2,049
What are you sending the signal to?? Debouncing strategy changes depending on what you're trying to do. On a microcontroller, you'd do it in software, for example.
 
there are two types of debouce strategies. one is the software technique (specially if you have lots of spare clock cycles in a uC) and the other one is hardware.

for a software debouncer, a certain amount of "delay" is called by the program afterwhich it checks the state of the "pressed" switch. if it is still the same, then it would proceed to the intended operation, otherwise, no.

for the hardware debouncer, on semi and maxim offers debouncer ic's. just check their website for the details about these ic's. another approach would be the use of an rc network that is further "enhanced" by a schmitt trigger. another approach is the use of a monostable mulitvibrator (can be done with 555). for spst switches, an rs flip-flop would do the trick.
 
If you can use a pin with ST input. I have also used a RC type circuit, that smooths out the bounce of the switch.
Hook a .1uF between the pin and Gnd, and a 100 ohm res between pin and switch.

Hope this helps
Kent
 
Hello all,
Oznog. I presume your query was addressed to me? I connect this circuit to a decade counter through a resistor and also to my PIC when I need to count a certain number of pulses before a certain event is triggered. Depending on the amount of pulses to be counted, I also make use of a pulse generator I built. The pulse is just +5V and connected through a resistor works very well.
Barry.
 
With a PIC, you're going to want to debounce it in software. Basically, you're going to use a timer to ignore any additional edges until a certain time has elapsed. I just ran the input as an external interrupt and have a timer which interrupts every 1/10 of a sec and decrements a counter if the counter s greater than zero AND the pin==1. There will be a bounce full of both low-to-high AND high-to-low when you let off the button, so you need to wait until the pin==1 before beginning the debounce delay. If the wire went high-to-low (button pressed) and the counter is zero, take it and make the counter=5. Otherwise ignore the interrupt and clear the flag.

Why do you need the decade counter when you've got a powerful PIC right there? A PIC can act as a decade counter without consuming 0.1% of its resources. Software can engineer a far better (and easier to construct) debounce than the hardware RC stuff.
 
switch debounce methods

A small correction to Spyghosts' helpful post.

There are two distinct methods of debouncing, though the difference is based on switch topology, not implementation. The first method depends on time (SPST), the second on hysteresis (SPDT).

1) SPST (single-pole, single throw) switch

Whether it's a RC delay in hardware or counting clock cycles in firmware (RC, resonator or crystal timebase), the idea is the same, to intoduce a time delay greater than the bounce time of the SPST switch. All SPST switches depend on the time-delay method for proper deboucing.

2) SPDT (single-pole, double throw) switch

Here, a R-S flip-flop does the job, no time delays involved. Physically, the switch lever travels a much greater distance between contacts than the small distance it travels during bounce (important concept - the lever can't bounce all the way back to the other contact), and a R-S flip-flop provides the necessary hysteresis.

Btw, most pushbutton switches today are of the SPST variety, and a well done firmware time delay costs very little. Cheap & effective wins every time. - Claude
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top