Pi Zero On/Off Shim

Just starting my adventure in Raspberry Pi Zero.
Soon realized I would need a way of starting it up & shutting it down safely with no GUI attached. The On/Off Shim seemed like a good option. But it does not perform as advertised. I am considering the Shim to be a piece of rubbish and a waste of money.

When power is connected via the USB on the shim, the Pi boots immediately.
(web info says it should not, says the button must be pressed to start the Pi)
Then pressing and holding the switch shuts down the Pi, which then immediately boots again.
I have to physically pull the USB plug to shut it down. I can see corrupted SD operating systems happening.
Using the GUI Shutdown or Terminal poweroff does exactly the same thing. The Pi does not shutdown.

When powered by the normal Pi Zero USB power port, the Pi boots immediately. Ok with that.
Pressing and holding the Shim button shuts the Pi down correctly, requiring removal of the USB cable and reattachment of it, to power the Pi on. Ok with that.
Pressing the Shim button when powered down just lights the Shim LED, does not power up the Pi. Indicating the board still has power but the processor is not being powered or something else.

In my opinion the ON/Off Shim will not do what I want, and I have no intention of buying any more. There are no product reviews so I have no confidence anyone else has had success with it. I cannot find a circuit schematic for it; Pimoroni don’t have any on their web site. Core Electronics & Adafruit web pages are just a repeat of the Pimoroni web page. (with a schematic I may be able to work out what is happening)

Has anyone got one of these to work as an On/Off switch ?? (maybe mine is faulty, unsure)

Thinking I might design my own as I understand what the software is doing with GPIO pins 4 & 17 and the cleanshutd service. Just need the hardware to work properly. Have tried reinstalling a number of times, no change. (reverse engineer the Shim will be fun, NOT, lol)

1 Like

I am going to leave my original post because it is what I experienced. But I have the solution, so soon after the original post.

I was running the Pi Zero with HDMI and USB hub connected.
If I run it with just the power to the Shim; the Shim works correctly as the web site says.
Also ran correctly with HDMI connected but not with USB Hub…
(Might be helpful if the On/Off Shim web site mentioned this wrt Pi Zero)

The Pi Zero is a reduced design of the Pi, some of the USB port power direction stuff has been removed. (the Pi Foundation will not release full schematics) But both USB port +5V pins buzz out at zero ohms, so they are connected directly. The Shim USB +5V is NOT connected directly to the Pi Zero +5V bus.

You can easily power the Pi Zero via either USB port. In my case the USB HUB was powering the Pi making it restart when the Shim cut its power. (cheap hub, bad hub, haha)

So, the conclusion is my final circuit design will work with the Shim, no usb Hub, no HDMI. All good.
But would have been better if that information had been on the Pimoroni web site.

1 Like

Well, today I have a different situation. same hardware same software but different results.

On/Off Shim powers off correctly, WITH USB hub and HDMI connected.
Why does that work today and not yesterday ???

But the shim powers up immediately a cable is plugged it.
Is it supposed to work this way ??? (not enough information from web pages)
I thought it only powered up yesterday when I pressed the switch.

I tried out the camera V2 I bought and it seemed to have trouble working with the power through the Shim, yesterday. But not today, it works with either power now.
I had a second problem with the camera, it would not work on initial power on, a restart fixed it. Unable to duplicate this problem today.

All of this does not give me confidence in the Raspberry Pi compared to my experience with the Arduino.

Can anybody comment on this from their own experience, is it just me, learning or what ???

(hopefully all I bought is good quality, as I have come to expect from Core Electronics)

1 Like

I have no experience with the On/Off Shim. However I’ve noticed that a Pi (Zero or 3B) does not shutdown when USB power is cut to it if there is an HDMI connection to my HDMI switch.

Similarly my ROCK64 (a Pi alternative) running as a TVHeadend back end with 2 or 3 DVB-T USB TV tuners attached via a USB hub remains powered until I disconnect the USB hub.

Good luck.


Thanks John.

I am beginning to suspect the On/Off Shim I purchased has been faulty from the start. It exhibited different behaviour because what ever was faulty, was kinda working yesterday, but today definitely not. It draws 54mA all the time, even when the Pi Zero is powered off. It draws this power with only +5V and GND connected. With this test there was no current initially but after a few seconds it increased. In my opinion this is not normal. If I had a circuit diagram I could confirm which part on the board is faulty. I would return the product but the cost of postage would override any benefit. Only option is to buy another and hope it works correctly. (if I still want to use it)

BTW the Pi Zero draws 39mA when powered off; powered up it draws 125mA when idle. (the Pi is not a device that would work long term on batteries without a recharge circuit)

What on the Shim would be drawing that much current ??? Have done some reverse engineering, but not much.

1 Like

Hi James,

Just wondering if you had installed the software to support the on/off Shim, this can be done with the command:
https://get.pimoroni.com/onoffshim | bash
Are you also able to post some photos of the board?

If you are interested in building your own Rpi on/off button we have a tutorial for making an off button and one of the comments on it has how to make a really easy on/off button (it is done with a B+ but will also work for a zero).

1 Like

Thanks for your reply Clinton.

Software install all good. Only issue with that was update of Raspbian first. (sudo apt-get update etc) NOOBS was a little out of date, 40 packages needed updating. I used the purchased copy, could have used the downloaded one.

I have checked out the Tutorial, the On/Off Shim appeals to me because of the On function as well as the safe shutdown.
Using the Shim; it powers the Pi as soon as the USB cable is plugged in. Once booted, press and hold the button for about a second, the LED blinks and the Pi shuts down. So the Shim is working as far as shut down is concerned and the software is doing what it should. It just should not boot immediately the cable is plugged in. Well that is my understanding from what Pimoroni told me. (and yes I am using the shim USB not the Pi USB) My other concern is the current usage when not doing anything, 54mA sounds way to high to me.

Anyway, thanks for your reply, I have ordered another and will see how it goes. If it works the same as the first one then I guess they are both ok, but not doing what Pimoroni say they should.


1 Like

HI Jim,

The comment I made on the thread at the bottom of the tutorial had how to make it on/off

if you wire the button to GPIO3 and add
to /boot/config.txt it will give you a safe shutdown and start up again.

It sounds like there may be a short from the 3.3V to the wake-up pin if you are able to post a photo of the board and the solder joints we may be able to diagnose it.

Did some reverse engineer of the circuit. Think I have a reasonable idea of what the design is, just dont know what the 3 pin & 5 pin devices are. The middle 3 pin device is faulty, 2 pins short together, but if left unpowered for some time become unshorted. Connecting to Pi causes them to short again.

Thanks for your response Clinton.
GPIO3 is not used, and not shorted to +3.3V.

As far as I can tell the LHS 3 pin device (KFH 742) connects +5V from the USB port to the Pi +5V bus. The RHS 3 pin device (SS T) provides the trigger to the LHS device. The trigger comes from GPIO4.

GPIO17 senses the switch pressed low and begins shutdown, GPIO4 is taken low at the end to switch LHS 3 pin device off. When the switch is pressed again it momentarily connects USB power to the +5V bus and GPIO4 pulled high keeps the power on by keeping the LHS device on.

Please note the 2 pins in the image, they become shorted when power connected to the Pi. If tested immediately upon removal they are shorted. After a few minutes they are open. Without knowing what the device is it is hard to determine if this is correct operation. My guess is not.


Hey James,

I’m fairly certain that is a transistor based on the three pins and how it functions. With the second and third pins in the top row it looks like there could be a bit of solder touching between them?

Thanks for your response Clinton.

The top row pin 2 is +5V, pin 3 is GND. In the pic it looks shorted, but it is not. Its just solder flux I didn’t remove. Attached is the schematic I have been able to trace out so far. The 3 pin devices look like MOSFETS considering the wiring. (like what I have included lower left) The green labels are voltages I measured when the Pi was operating.

Don’t put too much more effort into this, it has been an interesting side project for me, reverse engineering the circuit. I will see what happens with the new one I have purchased.


1 Like

Received another ON/OFF Shim today and it works exactly as expected.
Powers on when the button is pressed not as soon as power is applied to the Shim Micro USB socket.

The first was either faulty when I purchased it or I may have damaged it, but cannot think how.

Happy that this device will do exactly what I want.

Pimoroni say they will send me a replacement for the first one.

1 Like

Final Update.
Pimoroni sent me a replacement On/Off shim for the first one I received that was faulty. (excellent)

The following information is provided to assist anyone else using this device. Most of this is me finding out what is possible and how to use the device in future projects.

1. Power via On/Off Shim. Keyboard and mouse connected to Pi USB socket.
Pi will reboot when shutdown, not what you want. Removing keyboard and mouse fixes this. Most likely a keyboard and mouse will not be used in final design.

2. Power via Pi USB power socket. Keyboard and mouse attached.
Shutdown works correctly, but power on does not (obviously; no power through On/Off Shim).
Can use the Run pins to restart Pi. Note: the Run pins are a hard reset.

3. Power measurements.
When shutdown.
Power via On/Off Shim, 0.56uA.
Power via Pi USB socket, 37mA. This is much too high for battery operation. Not knowing what the circuit is makes it hard to determine why current drain is so high and can anything be done about it.
The USB Power socket +5V is NOT connected to the USB socket +5V. There must be some circuitry in between.

Disabling the USB drops current drain by about 39mA. HDMI power drain is next to nothing.
The best I could get was around 96mA drain when idle.

The Pi Zero will mostly be used in a headless configuration, WiFi used to access it. Probably never use battery as the power drain is simply too high.