# Momentary push button

Can someone help me with this push button?

I want to connect to an Arduino, it works fine with a small one but with this big one it conducts when press and releasing.

The problem is that the push button conducts when pushed and released so 1 push = 2 times conducting. So the Arduino is receiving two signals and turns on and off. I used a debounceing hardware circuit.

• Yeah okay sorry... this is my first question ever i delete the question – Randy Peeters Nov 22 '18 at 21:09
• Don't delete it - improve it :-) Put some detail in there and get yourself an answer that'll help you. The goal of the site is to teach and help. – TonyM Nov 22 '18 at 21:11
• Okay i will delete it for now and make tomorrow a schematic and all information. The problem is that the push button conducts when pushed en released so 1 push= 2 times conducting. So the arduino is receiving 2 signals and turns on and off. I used a debounceing hardware circuit. – Randy Peeters Nov 22 '18 at 21:13
• what is small one and big one ? ............... the comment about the 2 times conducting makes no sense ............. are you sure that the pushbutton does not latch? (press once to switch on, press again to switch off) – jsotola Nov 22 '18 at 22:29

... but the problem is that i receive 2 HIGH signals when i push and release the button.

This is the part that should have been in your question. You are describing switch contact bounce. This is common on all micro-controller switch inputs. You have two choices to fix it.

Figure 1. A switch contact bounce waveform. Source: Lab-book Pages.

1. Add a small capacitor across the switch - 100 nF would do. This will hold the voltage for a little while after the switch makes or breaks - hopefully until the contact has stopped bouncing.
2. Do the debouncing in your program. This means that you need to check that a change of state lasts a reasonable amount of time - maybe 50 ms to 100 ms before you read it as a valid state.

There are thousands of tutorials online on this subject so I won't write a new one here. See the link for one. You can edit your question to explain any further problems you have and someone will respond.

Without seeing the back, I'm going to assume it's a SPDT switch, with a common pin and a normally open and a normally closed pin. As well as two pins for the led cathode and anode.

The switch pins work just like any other momentary button. Just connect the common pin and the desired action. The small switch you described is a basic normally open push button, so use just the normally open pin of the switch, ignoring the other side (as in don't connect it at all).

• Okay sorry i realize that i'm giving not enough info sorry for that. I learned that i need to describe more information... I connected it as you described but the problem is that i receive 2 HIGH signals when i push and release the button... – Randy Peeters Nov 22 '18 at 21:19
• @Randy that's a different issue called bouncing. You either need a denounce circuit or you need to look for denounce code for your input code. – Passerby Nov 22 '18 at 21:23