Maker Pro
Maker Pro

Hardware Debouncing Help

Dylfish

Dec 11, 2012
6
Joined
Dec 11, 2012
Messages
6
Hey Guys,

I've been playing around with my Arduino lately and i want to start playing with interrupts. I've decided I need to use hardware denouncing and I've been trying alot of different methods to no avail.

This below one is currently not working and I'm wondering what I'm doing wrong. I have it connected to a sketch where it is meant to scroll through an array, but it seems to jump on every press leading me to believe I've done something wrong on the circuit for the de bouncing.

This is the circuit I'm using at the moment using a RC filter system and a 74LS14 inverted schmitt trigger. Can anyone see what I'm doing wrong?

1zIJk


Cheers,
Dylan
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,681
Joined
Nov 17, 2011
Messages
13,681
Can you show us the schematic. It is a bit hard to figure it out from the connections.

A very simple and proven debounce circuit is this one using 2 Nand gates.

Using an RC filter, that's what I take from your image, is less stable.
 

duke37

Jan 9, 2011
5,364
Joined
Jan 9, 2011
Messages
5,364
I've never used one of the plastic breadboards, my last breadboard was made of pine with some one inch nails knoched in for connections.

You do not have capacitors before and after the voltage stabiliser. Also, the earth wire seems to go round the long way. This should be as short and direct as possible
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,681
Joined
Nov 17, 2011
Messages
13,681
Use at least a gate with a Schmitt-Triger input, e.g. a 74HC14.
If you don't have one, you can try using two inverters in series (note that this will invert the signal level compared to your circuit) and a feedback resistor from the output of the second inverter back to the input of the first inverter. Make the feedback resistor approx. 10*R2.
(it looks like this circuit where A is the series connection of two inverters and B is the feedback resistor.

Harald
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,681
Joined
Nov 17, 2011
Messages
13,681
You do not have capacitors before and after the voltage stabiliser

I disagree. Generally it is is sound advice to have capacitors at the input and at the output of the voltage regulator. I'd be willing to discuss the need for electrolytics. But most, if not all, datasheets recommend at least 100nF capacitors.

Harald
 

duke37

Jan 9, 2011
5,364
Joined
Jan 9, 2011
Messages
5,364
Yes, there should be capacitors before and after the stabiliser but I do not see them so I said he did not have them.

He said he was using the 74LS14 Schmitt trigger device.

Duke
 

Dylfish

Dec 11, 2012
6
Joined
Dec 11, 2012
Messages
6
Yeah ive got it wired up to a 74LS14. Ive played around with as many values as I can but so far no luck. im not really sure what im doing wrong to be honest =(
 

Dylfish

Dec 11, 2012
6
Joined
Dec 11, 2012
Messages
6
I've never used one of the plastic breadboards, my last breadboard was made of pine with some one inch nails knoched in for connections.

You do not have capacitors before and after the voltage stabiliser. Also, the earth wire seems to go round the long way. This should be as short and direct as possible

is it possible that since the gnd is taking the long way that not all of my "presses" are meeting the required voltage to meet logic 1 and instead falling in the "dead zone" so to speak?
 

duke37

Jan 9, 2011
5,364
Joined
Jan 9, 2011
Messages
5,364
Without capacitors at the input and output of the stabiliser, it can go into oscillation and produce random voltages. Any long connections have significant inductance so earth can not be defined as earth and there may be no 'dead zone'.

As I said, I have not used one of these breadboards. Have you got bypass capacitors close to the regulator?
 

Dylfish

Dec 11, 2012
6
Joined
Dec 11, 2012
Messages
6
I haven't touched it, it is still in the same setup as my first post. il try shorten the grounds.
 

Dylfish

Dec 11, 2012
6
Joined
Dec 11, 2012
Messages
6
this is very odd, but soon as i removed the pullup resistor it started working properly =/
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,681
Joined
Nov 17, 2011
Messages
13,681
Have you got bypass capacitors close to the regulator?
It seems there are electrolytic caps, but I'd recommend additional 100nF ceramic caps.

soon as i removed the pullup resistor it started working properly
That's not logical. Are you sure your setup is identical to the schematic you've shown us? What kind of gate do you use(CMOS; TTL...)?

Harald
 

duke37

Jan 9, 2011
5,364
Joined
Jan 9, 2011
Messages
5,364
Another thought

The chip will contain more than one gate. The unused gates should have their inputs defined to stop oscillation.
 
Top