# How to connect 5 buttons to Explorer Hat PRO

**URL:** <https://forums.pimoroni.com/t/how-to-connect-5-buttons-to-explorer-hat-pro/9713>\
**Category:** Support\
**Created:** [January 21, 2019, 4:30pm UTC](https://forums.pimoroni.com/t/how-to-connect-5-buttons-to-explorer-hat-pro/9713 "2019-01-21T16:30:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![alan412](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alan412/32/5109_2.png) [@alan412](https://forums.pimoroni.com/u/alan412)\
**Post date:** [January 21, 2019, 4:30pm UTC](https://forums.pimoroni.com/t/how-to-connect-5-buttons-to-explorer-hat-pro/9713/1 "2019-01-21T16:30:55Z")

</div>

We have a project where we need to connect 5 buttons to the Explorer Hat PRO.

(simple push buttons that are either connected or not.)

4 of them we have connected to the input pins and they work like champs. what is the easiest place to connect the 5th one to? (I know I could make my own pull-ups or pull-downs and use the analog inputs but I am wondering if there is a simpler way.)

Thanks in advance,

Alan

---

<div class="post-metadata">

**Author:** ![gadgetoid](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/gadgetoid/32/13_2.png) [@gadgetoid](https://forums.pimoroni.com/u/gadgetoid)\
**Post date:** [January 22, 2019, 11:48am UTC](https://forums.pimoroni.com/t/how-to-connect-5-buttons-to-explorer-hat-pro/9713/2 "2019-01-22T11:48:50Z")

</div>

If you use the Pi’s onboard pull-up then you can connect a button between any of the 3v3-only pins and ground. Granted the best choice is probably the “PWM” pin which corresponds to BCM18 on the Pi.

---

<div class="post-metadata">

**Author:** ![alan412](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alan412/32/5109_2.png) [@alan412](https://forums.pimoroni.com/u/alan412)\
**Post date:** [January 22, 2019, 1:02pm UTC](https://forums.pimoroni.com/t/how-to-connect-5-buttons-to-explorer-hat-pro/9713/3 "2019-01-22T13:02:04Z")

</div>

How do I access the BCM18? I am guessing I look through the explorer hat source code to see how the other ones work. Do I have to do anything special to turn on the onboard pull-up for BCM18?

Thanks in advance,

Alan

---

<div class="post-metadata">

**Author:** ![gadgetoid](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/gadgetoid/32/13_2.png) [@gadgetoid](https://forums.pimoroni.com/u/gadgetoid)\
**Post date:** [March 13, 2019, 5:06pm UTC](https://forums.pimoroni.com/t/how-to-connect-5-buttons-to-explorer-hat-pro/9713/4 "2019-03-13T17:06:34Z")

</div>

Under the hood, Explorer HAT uses the `RPi.GPIO` library which is pretty well explained here - [https://raspi.tv/2013/rpi-gpio-basics-6-using-inputs-and-outputs-together-with-rpi-gpio-pull-ups-and-pull-downs](https://raspi.tv/2013/rpi-gpio-basics-6-using-inputs-and-outputs-together-with-rpi-gpio-pull-ups-and-pull-downs)

You’ll be using something a bit like this:

```auto
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(18, GPIO.IN, pull_up_down=GPIO.PUD_UP)
button = GPIO.input(18) # Read button value

```

You may want to investigate RPi.GPIO’s interrupt functionality for handling a button press, though.
