Raspberry Pi / Arduino Button GPIO pins

gpioraspberry pi

I got myself a little button to start playing around with. Attempting to hook it up to a Rpi.

What I wanted to confirm was the purpose and pins for each wire. The button I got is http://www.robotgear.com.au/Product.aspx/Details/782-Button-Module-with-cable

Some confusion was caused for me by G V N S….. I'm guessing G=Ground V=Active N=Neutral S=Dito
Close up with GVNS http://www.robotgear.com.au/Cache/Files/ProductImageOriginals/2233_Button%20module%20with%20cable.jpg

After speaking with a friend who has more experience with this stuff. We're assuming this configuration

G = Pin 6 Ground
V = Pin 4 5V
S = Pin 11 or GPIO

Best Answer

Edit: As commented, the Raspberry Pi GPIO pins are NOT 5 V tolerant. Use the switch on the 3.3 V rail only.

From the top view I can see a resistor that ties S to V and to capacitors that are probably for decoupling.

So the pin out would be...

  • V = Voltage In (3.3V from RPi)
  • G = Ground (0 V of RPi)
  • S = Signal / Switch (the signal that changes when you push the button)
  • N = Not Used

How this works...

When connected, the voltage at S will be pulled up through the resistor (aka a pull-up resistor) to 3.3 V from the Pi. You can confirm this by measuring the resistance between V and S (maybe about 10 kOhms). Additionally, The Pi can only drive 50mA from the 3.3 V rail so make sure that the resistance between V and S is greater than 66 Ohms.

When you press the button, the connection at S is shorted to G. You can confirm this by pressing the button and checking continuity from S to G. There will be no continuity when you let go.

You can connect S to a GPIO on the Pi so when the button is not pressed, S will be at the rail voltage (3.3 V) and when pressed, S will measure 0 V relative to ground of the Pi.