GrixSilva
Posts: 10
Joined: Thu Aug 15, 2019 11:42 pm

4 pin momentary switch

Thu Sep 12, 2019 2:09 pm

Hi!

I would like to add a power button to my raspberry pi.
I made some research and I know i need to connect um pin to the ground and another one to 5v gpio pin.
My problem is I bought some momentary switch with 4 pins, something like this one:

https://images-eu.ssl-images-amazon.com ... ZZZZZ_.jpg

I would like to know witch pins I need to connect to my pi.

Thank you in advance!

hippy
Posts: 5757
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: 4 pin momentary switch

Thu Sep 12, 2019 2:47 pm

GrixSilva wrote:
Thu Sep 12, 2019 2:09 pm
I made some research and I know i need to connect um pin to the ground and another one to 5v gpio pin.
No, not quite. Don't do that, it could well damage something.
GrixSilva wrote:
Thu Sep 12, 2019 2:09 pm
My problem is I bought some momentary switch with 4 pins, something like this one: ...

I would like to know witch pins I need to connect to my pi.
Usually on miniature push-button switches there are two pairs of connected pins. A continuity meter will determine which pairs are connected. AFAIR -

Code: Select all

    .-----------------.
    |                 |
   [|--.--------------|]
    |  |     _        |
    |  |   _|_|_      |
    |  `---O   O---.  |
    |              |  |
   [|--------------^--|]
    |                 |
    `-----------------'
Or, if it doesn't work, rotate 90-degrees and it should. Note the legs may not be on a square pitch but can be coerced to fit.

pcmanbob
Posts: 6619
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: 4 pin momentary switch

Thu Sep 12, 2019 2:53 pm

I made some research and I know i need to connect um pin to the ground and another one to 5v gpio pin.
I don't know what you think you have researched but should never connect 5v to any gpio pin the gpio is not 5v tolerant , and if you connect ground and 5v to the switch you have linked to you would short 5v to ground , which would certainly cause you pi to stop dead , and possibly damage it.

I suggest you either do some more research or show us what research you have that says connect 5v to ground .

Image

pin out bottom right
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

GrixSilva
Posts: 10
Joined: Thu Aug 15, 2019 11:42 pm

Re: 4 pin momentary switch

Thu Sep 12, 2019 4:17 pm

I may be confused about connecting the power button pins to my pi.
I need to be more careful with my research.

Thank you for your replies!

Return to “Other projects”