# How do I add LEDs and Buttons to InkyPHAT?

**URL:** <https://forums.pimoroni.com/t/how-do-i-add-leds-and-buttons-to-inkyphat/11585>\
**Category:** Support\
**Created:** [September 8, 2019, 2:19pm UTC](https://forums.pimoroni.com/t/how-do-i-add-leds-and-buttons-to-inkyphat/11585 "2019-09-08T14:19:24Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![NIS3R](https://avatars.discourse-cdn.com/v4/letter/n/3be4f8/32.png) [@NIS3R](https://forums.pimoroni.com/u/NIS3R)\
**Post date:** [September 8, 2019, 2:19pm UTC](https://forums.pimoroni.com/t/how-do-i-add-leds-and-buttons-to-inkyphat/11585/1 "2019-09-08T14:19:24Z")

</div>

I’ve already managed to fry two Pi B+s so I figured it was time to ask for help! :s

I’m working on a little box that my mom can hook the InkyPHAT up to and hold a button to track her exercise and physio.

So far I have the python code figured out so it displays a random background and prints a progress bar based on the amount of walking she does vs her goal.

Everything was going great until I tried to add more than just the screen.  
I used the pin out info that Pimoroni points to on the product page ([https://pinout.xyz/pinout/inky\_phat#](https://pinout.xyz/pinout/inky_phat#)) and hooked up these pins hoping to use the other pins for buttons and LEDs.  
1 - 3v  
2 - 5v  
11 - BCM 17 - chip busy  
13 - BCM 27 - chip reset  
15 - BCM 22 - chip command  
19 - BCM 10 - MOSI  
23 - BCM 11 - SCLK  
24 - BCM 8 - chip select

With all these pins hooked up I can’t get the display to load and I think I managed to cross some wires when working with the bread board and have managed to burn out 2x Raspberry Pi’s and I’m starting to get worried.

What pins am I missing?  
Is there a better way to add LEDs and buttons as well as the display?  
Is there a safer way to test this so I can stop ruining my Raspberry Pis?

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [September 8, 2019, 3:49pm UTC](https://forums.pimoroni.com/t/how-do-i-add-leds-and-buttons-to-inkyphat/11585/2 "2019-09-08T15:49:41Z")

</div>

You also need to wire up all those Ground pins with the black border around them to get the inky working.  
Are you using series resistors with the LED’s?

---

<div class="post-metadata">

**Author:** ![NIS3R](https://avatars.discourse-cdn.com/v4/letter/n/3be4f8/32.png) [@NIS3R](https://forums.pimoroni.com/u/NIS3R)\
**Post date:** [September 8, 2019, 4:18pm UTC](https://forums.pimoroni.com/t/how-do-i-add-leds-and-buttons-to-inkyphat/11585/3 "2019-09-08T16:18:30Z")

</div>

Ok thanks! I’ll try that out on my Pi Zero when I get a chance tomorrow!

I’m using 200ohm resistors with some small LEDs (I think they are the resistors that came with them). Should I be using more than one resistor in series?

For the first one I had the InkyPHAT on a bread board with a breakout cable and all the buttons and LEDs where I wanted them. It stopped working so I assumed I had crossed the wrong wire somewhere and moved onto my second one (my Retro Pi setup)

For the second one I thought I would be a bit more careful and start with just the screen. I wasn’t able to get anything to load to it (I’m assuming because I had one ground hooked up at most, and I have proven out just the display used as a hat on the pi so I know that it does work) but without any LEDs or buttons I still managed to but my second Pi out of commission.

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [September 8, 2019, 7:23pm UTC](https://forums.pimoroni.com/t/how-do-i-add-leds-and-buttons-to-inkyphat/11585/4 "2019-09-08T19:23:48Z")

</div>

On the Pi itself, all those ground pins are common. They are all connected to each other. On a Hat its not always possible to link all the ground pins together. That happens when you plug it into the Pi’s GPIO so its not a big deal. Not until you try to wire it up with jumpers. And its not always obvious that those black markers on the pinout mean those ground pins are used.  
Be careful with the 5v and 3.3V, short the two together and its by by Pi. The 3.3v regulator gets killed in the process.  
One resistor should be fine. The GPIO have a max current that they can supply, an LED by itself will likely draw to much current and damage the GPIO pin output.

I’ve used Proto Hats on a few of my Pi’s.

> **[Adafruit Perma-Proto HAT for Pi Mini Kit – Pimoroni Store](https://shop.pimoroni.com/products/adafruit-perma-proto-hat-for-pi-mini-kit?variant=1038451613)**
>
> Design your own Pi HAT, attach custom circuitry and otherwise dress your Pi 3, 2, A+ or B+ with this jaunty prototyping HAT kit.

  
Use a 11mm stacking header and you can plug a hat on top of it.  

> **[2x20 pin Female GPIO Header for Raspberry Pi – Pimoroni Store](https://shop.pimoroni.com/products/2x20-pin-gpio-header-for-raspberry-pi-2-b-a?variant=1132812269)**
>
> Connect your project directly to your Pi with these 2x20 pin GPIO headers!

  
Then wire your buttons and LEDs to the proto hat.

 ![DSCF1433](https://us1.discourse-cdn.com/flex016/uploads/pimoroni/original/2X/f/fe62acbb579ef21599e176f8c817fc4b7923a496.jpeg)

---

<div class="post-metadata">

**Author:** ![NIS3R](https://avatars.discourse-cdn.com/v4/letter/n/3be4f8/32.png) [@NIS3R](https://forums.pimoroni.com/u/NIS3R)\
**Post date:** [September 9, 2019, 10:41pm UTC](https://forums.pimoroni.com/t/how-do-i-add-leds-and-buttons-to-inkyphat/11585/5 "2019-09-09T22:41:12Z")

</div>

I think I must have crossed the 5v and 3.3V on both of them :s  
So just to confirm if pins 1 and 2 are connected it ruins the entire Raspberry Pi?  
They seem dangerously close together! I’ll have to be a lot more careful with these little guys!

Those Proto hats look great I’m definitely going to grab a few! Thanks for the recommendation! :D

I’m trying to get this ready for my mom’s b-day this month and wont be able to get the proto hat in time so I decided to skip messing around with trying to separate the GPIO pins and found a hard drive cable that splits them nicely!  
I soldered the GPIO header to the Pi zero upside down because I didn’t need them in order for the project I was planning on use it for. Turns out that it works great with the hard drive cable and I can just plug the InkpPHAT right in with a set of male header pins because they are already flipped!  
[![Imgur](https://us1.discourse-cdn.com/flex016/uploads/pimoroni/original/2X/3/314234b7332686297d61c0f0d886a5f9f73d27bd.jpeg "InkyPHAT ribbon cable breakout") ](https://imgur.com/FNGzShK)

---

<div class="post-metadata">

**Author:** ![NestBoxTech](https://avatars.discourse-cdn.com/v4/letter/n/ad7895/32.png) [@NestBoxTech](https://forums.pimoroni.com/u/NestBoxTech)\
**Post date:** [September 9, 2019, 11:24pm UTC](https://forums.pimoroni.com/t/how-do-i-add-leds-and-buttons-to-inkyphat/11585/6 "2019-09-09T23:24:06Z")

</div>

shorting 5v to GND will also kill it. As I discovered.

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [September 10, 2019, 8:52am UTC](https://forums.pimoroni.com/t/how-do-i-add-leds-and-buttons-to-inkyphat/11585/7 "2019-09-10T08:52:11Z")

</div>

You can use both Pin 1, 3.3v and pin 2 or 4, 5V at the same time. Just don’t connect the 5V “to the” 3.3V. That blows the 3.3V regulator and you lose the 3.3v. It will measure zero volts once the regulator is blown.  
On any Pi “except the 4B and the Zero”, there is a poly fuse between the 5V in and the 5V pin on the GPIO. If you short the 5V on a Pi with a poly fuse it will most times recover. The poly fuse heats up and becomes an open circuit. Once it cools down it goes back to normal and the Pi will work again. Takes hours to recover though.

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [September 10, 2019, 9:01am UTC](https://forums.pimoroni.com/t/how-do-i-add-leds-and-buttons-to-inkyphat/11585/8 "2019-09-10T09:01:52Z")

</div>

There is also this,

> **[Mini Black HAT Hack3r – Pimoroni Store](https://shop.pimoroni.com/products/mini-black-hat-hack3r?variant=19448026055)**
>
> Need to detach or debug your HAT? Then the Mini Black HAT Hack3r is for you!

  
If you solder a female GPIO header on the bottom side of a Pi Zero, you can plug it in just like a pHat and skip having to use the ribbon cable. I used 90 headers on the ends here so my Pi Zero stands up.  
 ![DSCF1161](https://us1.discourse-cdn.com/flex016/uploads/pimoroni/original/2X/f/f5b4d23cb70ad1dfb6741b989d96a3c51492c035.jpeg)

---

<div class="post-metadata">

**Author:** ![NIS3R](https://avatars.discourse-cdn.com/v4/letter/n/3be4f8/32.png) [@NIS3R](https://forums.pimoroni.com/u/NIS3R)\
**Post date:** [September 10, 2019, 4:18pm UTC](https://forums.pimoroni.com/t/how-do-i-add-leds-and-buttons-to-inkyphat/11585/9 "2019-09-10T16:18:13Z")

</div>

Yikes! I’ll be a lot more careful in the future! I see now I’ve been a bit rough on them! :s

That hat looks great thanks for the recommendation! The ribbon cable is working for now but I would like something a bit nicer once its all proven out!  
Thanks for all the help and recommendations! Really appreciated!

ps. If you don’t mine me asking what are those little “cars” your working on?

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [September 10, 2019, 7:09pm UTC](https://forums.pimoroni.com/t/how-do-i-add-leds-and-buttons-to-inkyphat/11585/10 "2019-09-10T19:09:27Z")

</div>

Two wheel drive rovers. There is a caster under the Pi.

> **[Mini Robot Rover Chassis Kit - 2WD with DC Motors](https://www.adafruit.com/product/2939)**
>
> Unleash your inner Mad Max and make your vehicle dreams a reality with the Mini Robot Rover Kit.This kit gives you everything you need to build the shell of a 2-wheel-drive Robot Rover! ...

I use explorer pHats to drive the motors. There is also a powerboost and LIPO battery for power.  
Full build pictures are here  
[https://1drv.ms/u/s!AjOYwiwlwDtpgrNiqCtc4AVnuaCHYw?e=XacSXb](https://1drv.ms/u/s!AjOYwiwlwDtpgrNiqCtc4AVnuaCHYw?e=XacSXb)

All my Pi build pictures are here  
[https://1drv.ms/u/s!AjOYwiwlwDtpgUN1cjVt4KIi3T7H?e=s9fpUm](https://1drv.ms/u/s!AjOYwiwlwDtpgUN1cjVt4KIi3T7H?e=s9fpUm)
