OnOff Shim (PIM269) Questions / Support

Have some questions about the OnOff Shim and hoping the community can help.

My intended set-up is thus (in stack order from top to bottom):

OnOff Shim
Speaker Bonnet
Servo Bonnet
Pi 3B +

My questions are:

  1. Is it okay to have the On/Off Shim at the top of the stack? Physically, this is how it fits best with the other components, but I’m not sure if it will affect performance.
    2.I plan to us an external button - specifically (Rugged Metal Pushbutton with Blue LED Ring [16mm Blue Momentary] : ID 481 : $4.95 : Adafruit Industries, Unique & fun DIY electronics and kits). Is there a guide on how to connect the momentary switch to the shim? Any suggestion on where I can connect the LEDs on this button? Perhaps somewhere on the Pi itself?

I recognize these are fairly rudimentary questions, but I’d like to know I’m getting it right rather than risk frying something. Also recognize I’m asking in tangent about an Adafruit product. Love you both equally ;-) Appreciate any support.


hello, "in stack order from top to bottom " what stack are you referring to,

so to setup the on off shim just follow instruction lower down the products page
It mentions the use of the use of a external button, checked mine and there is 2 solder points under the off button , good luck

the one line installer , curl https://get.pimoroni.com/onoffshim | bash

There will likely be more knowledge post now that I posted , ;)

Thanks, Caperjack. The “stack” I’m referring to is the order in which the bonnets/hats are stacked on top of the Pi. My plan is to have the OnOff shim be the top-most device in the stack on the GPIO pins. Specifically: Pi —> Servo Bonnet —> Speaker Bonnet —> OnOff shim. It is my understanding that the shim is meant to solder directly to the Pi, but that doesn’t really work for my configuration. Really just want to confirm this is not going to be an issue. I don’t think it is, but I’m not versed enough to be certain.

Regarding installation, I’m comfortable with setting-up the software, etc. and can see where the external button connects, what I want to confirm is how it connects. I have a momentary button with three pins (normally-open, normally closed, and common). The shim has two unlabeled breakout pins to connect the external button, so I’m not entirely clear on how it connects. My inclination would be to simply test different configurations, but since I’m actually working with the power supply to the system, I want to be cautious about frying anything.

yeah, I have 2 of them only 1 in use , its soldered flat down over the gpio pins on Pi zero with a pHat Dac ,i just push it to shutdown … ,you might be better off using a pHatStack .i have one in use with a, Pi Zero ,speaker phat, pianiHat and DrumHat ,all usable at the same time ,I followed this to set it up, I didnt use the ribbon cable as show, I soldered header out the back so the pizero ends up on the back,use a lipo battery and it portable…i dont thik u will be able to stack it all on the pi’s gpio pins much like this Build an Itty Bitty Beat Box - Pimoroni Yarr-niversity

you can check pHat Stack Confiigurator to see if the hats and such will stack together with out conflict , pHAT Stack Configurator this mini hat hack3r could be an options too Mini Black HAT Hack3r – Pimoroni

I’d make sure none of the other Hats / phats are using GPIO 4 pin 7 or GPIO 17 pin 11.
The On off shim uses those for shutdown control and power button signals to the Pi.
OnOff SHIM at Raspberry Pi GPIO Pinout

It watches the state of BCM pin 17 and, when pulled low (pressed), it initiates a clean shutdown. Last thing, just before your Pi shuts down, BCM pin 4 is pulled low to completely cut power to your Pi.

1 Like

Thanks. Yeah, I think I need to check the pin usage of the other hats before I finalize the build. I was able to get the switch wired-up and working, so I am able to confirm that the shim seems to function as expected when stacked above the pi with several hats in between. Better, the other hats seem to be performing as expected so I don’t think there are any conflicts, but it doesnt hurt to confirm the pinouts.

For those also wondering how to wire this up to a momentary switch (I’ve seen the question asked a few times), here’s what worked for me:

From your Momentary Switch, wire the NO (normally open) pin and the Common pin to the two external pinouts on the shim. It’s that simple.

If your switch is illuminated, you can wire the + pin to an open 5v or 3v pin on the Pi (or on a Hat) and the - pin to an open Ground pin.

What could happen, if something else pulls GPIO 17 low, is an un commanded shutdown. Thats wouldn’t hurt anything, it would just be dammed annoying.
Or the power gets killed when GPIO 4 is pulled low. That will likely corrupt your SD card, not good.

I think I’m good. One bonnet only uses the SDA/SCL pins and power. The other uses pins 18(GPIO24), 19(GPIO10), and 21(GPIO9). I believe this leaves me in the clear with the shim. Appreciate you pointing me in the right direction to confirm and avoid any potential issues.

This site comes in handy for figuring out what boards use what pins.
There are quit a few listed.
Raspberry Pi GPIO Pinout
And the main page will show you what pins are used for SPI etc. Just click SPI over on the top right of the window.
Raspberry Pi GPIO Pinout

i2c is a shared bus, multiple devices can be wired to SDA / SCL. As long as no two devices have the same address.
sudo i2cdetect -y 1 will show you what ones are in use.
SPI can have multiple devices as well, providing they each use a different CS pin.
GPIO 9 and 10 etc are SPI0.
Your speaker bonnet is likely using i2s.
Keep in mind that a lot of the GPIO pins can do 2 or three different things, depending on how things are configured. If your not using SPI for example, those pins can be used to do something else. Having a look see at your config.txt can often tell you what’s been enabled. You will see entries for i2c and SPI there.