connecting a 6 Pin PushButton to an arduino

I’m having problem connecting a 6 pin push button to an arduino. Most of the tutorials i found are regarding the 4 pin pushButton.
I’m making a counter using the 7 segment , such that when i push the button “ON” the counter goes to the next digit.

The first thing you need to do is get hold of a DMM and using the ohm function, determine the pins needed.

You probably want a momentary switch so make sure this one doesn’t latch on and off.

This might be a DPDT switch (two switches in one).

1 Like

larryd:
The first thing you need to do is get hold of a DMM and using the ohm function, determine the pins needed.

Also, most DMMs [Digital MultiMeters] have a Continuity setting, and usually, it “beeps” when it senses continuity. In other words, when the meter probes are across something with only a few tens of ohms, the meter indicates continuity–usually with a sound of some sort, and a numeric reading of the number of ohms.
The fact that the continuity setting provides an audible indication, makes it easier to do the kind of testing you need to do to determine the pinouts on that switch. The tone is usually more responsive than the numbers, and you don’t have to watch the meter while you’re fumbling with the probes.

And larryd is probably correct, this is most likely a DPDT [Double Pole Double Throw], which means there are two separate switches that both operate simultaneously when the shaft is pressed*. AND, they are more than likely arranged as one switch per row of pins. In other words, the three closest-together pins on each side are likely the pins for each switch. So, I would start by putting the meter probes across the pins that are closest together [one set at a time], and then press the shaft and see if the state changes [i.e. if it goes from open to closed, or from closed to open].

I tried to find a YouTube video that does a good job of explaining a DPDT switch, but none of the ones I found do the topic justice–each leaves out important details. But, if you watched a number of them, you might get the whole story.

Briefly, a DPDT switch is, essentially, two switches in one [i.e. two *switch units*]. Both switches activate when the shaft is pressed. AND, each switch has two simultaneous states, which is why there are three pins per switch unit. One of the pins, usually the center pin, is the Common pin (or Pole), and the other two are the Throw pins. So, Double Pole means two poles (or two switch units). And, Double Throw means two throw terminals per switch unit. For each switch unit, one of the throw pins will be connected to the pole [i.e. *closed*], and one won’t [i.e. *open*]. When the shaft is pressed [or for toggle switches: toggled], this reverses: the throw terminal that was connected to the pole, is no longer connected, and the throw terminal that was, previously open, is now closed. For a momentary pushbutton switch, this change of state will persist only as long as the shaft is pressed. Once the shaft is released, the switch will return to its normal state. Only momentary pushbuttons switches have a normal state, which is the state when the button is not being pressed.

So, when testing, first use your DMM to find the terminals with continuity [i.e. the ones that read 0Ω or that register a beep]. Between the two terminals, one will be the Pole, and one will be the Throw.

images.png
The above image provides a schematic representation of a DPDT switch.

series-parallel-wiring-diagram-for-4-conductor-humbucker-pickups-picturesque-dpdt-switch.jpg
In the above image, the numbering and connections are typical. Your switch may, or may not, be the same. But, the concept will be the same [assuming what you have, truly is a DPDT]

*Phrases like this, invariably expose the adolescents in the audience ::slight_smile:

1 Like

ReverseEMF:
I tried to find a YouTube video that does a good job of explaining a DPDT switch, but none of the ones I found do the topic justice -- each leaves out important details.

As is so often the case. :roll_eyes:

Wow! I hope you bookmarked that explanation for the next time. Needs to go on the Wiki - but does anyone ever read the Wiki?

I generally don't put in an answer for "one-hit wonders" until they show engagement with the thread (unless it is stale, no answer). Will we know if this one does? There's the question. :grinning:

[excellent description of DPDT switches]

An important thing to learn is that just because your switch has 6 leads, doesn’t mean that you need to connect all 6 leads to your Arduino. Figure out 2 leads that make and break when you operate the switch, and connect it to your arduino as if those were the leads of a two-lead (SPST) switch.

:slight_smile:
Thank you guys, i checked out a couple youtube videos and cross verified them using a DMM .
The attachment below perfectly answers the question.
Thanks for the help.

eureka.jpeg.png

mehra:
Thank you guys, i checked out a couple youtube videos and cross verified them using a DMM .
The attachment below perfectly answers the question.

f2b9474b028110683619bed120c3fe0069aa3d3c.png
OK, so you now know how to use it. One middle pin and the one clockwise to it, between the input pin and ground with pinMode set to INPUT_PULLUP. Connections for a slide switch would be different but for a push switch this is not particularly surprising.

You didn’t confirm that it was a “push-on, release-off” switch, because it looks rather like a “push-on, push-off” type. Maybe it just isn’t long enough to contain the little toggle.

“eureka.jpeg.png” - really?

"You didn't confirm that it was a "push-on, release-off" switch, because it looks rather like a "push-on, push-off" type. Maybe it just isn't long enough to contain the little toggle."

Sorry i should have mentioned... its a "push-on, push off type" switch!

"eureka.jpeg.png" - really?

if i hadnt included that .jpeg, it would have been perfect perhaps.

thanks for the help:)

mehra:
Sorry I should have mentioned... its a "push-on, push off type" switch!

The point is, in regard to your original question, that you need to "debounce" the switch in software (not in hardware, and not by attempting to use interrupts) so that it counts only once per push, and that if the switch stays on with the first push, you could use code to make one count when it is pushed to "on" and another when it is pushed to "off".

Generally of course you use an "intermittent" button to count, which releases after every push and the sort you have is somewhat inconvenient, but - coding will fix it! :astonished:

mehra:
If I hadn't included that .jpeg, it would have been perfect perhaps.

Oh, the image was great - from where did you get it? The funny thing was the double file extension for a graphic - of what sort?

Paul__B:
Oh, the image was great - from where did you get it? The funny thing was the double file extension for a graphic - of what sort?

It's from a YouTube video I found, the connections werent explained clearly but I made it work using the diagram and from the help by this amazing community .
I would personally recommend all the beginners like me to start with a simple 4-pin pushbutton before jumping to DPDT switches :frowning:

Thanks for the help again:)