I have a Arduino pro mini that, depending on circumstances, needs to switch power on and off to two Raspberry Pi Zero W's (don't worry I have a shutdown script running before power goes off). The switches need to be independent from each other as there will be the option of having neither RPi on. After much research and googling and youtube clips I have just about grasped MOSFETs, pretty much anyway, and this looks to be the best solution by far! So as I understand it, if I do the following for each RPi, it should work as desired, right? (Please excuse my not-very-technical diagram!)

Bad diagram

Then I just set the pin coming from the pro mini to the gate of the MOSFET to high or low to provide power or cut power to the pi? Have I got that right? Thanks for all your help. I'm looking at this one specifically... CPC product link

EDIT --------------------------------------------------------------------------

OK, so after Elliot's comment I realise my mistake and I'm now looking at pMOS transistors. Looking at the diagram below, this looks to me like it should work:

pMOS transistor diagram

So if I hook up my system as follows (only one Pi shown for simplicity)...

pMOS suggestion

...then it would work as follows:

  1. G goes LOW, RPi has power and boots.
  2. Yellow wire goes LOW to trigger shutdown script in RPi, waits 20 seconds for shutdown to complete.
  3. RPi, listening to pin 12, shuts down.
  4. G goes HIGH, power to RPi is halted.


Is there a reason this wouldn't work? All connections to the RPi from the Arduino, bar the connection to the pMOS gate (just the yellow wire) are LOW when the RPi loses power.

EDIT --------------------------------------------------------------------------

Ok so it would appear I can't get a pMOS TH with the correct V and current values for my project, so looking at the RT9742ANGJ5F USB switch chip as an alternative solution, as suggested by Chris, this is my new proposed solution. Assuming I can nail the SM soldering, does this look like it will work?

RT9742ANGJ5F solution

  • \$\begingroup\$ Comments are not for extended discussion; this conversation has been moved to chat. \$\endgroup\$
    – clabacchio
    Jun 11, 2020 at 12:21

1 Answer 1


You need to use a PMOS transistor as a high-side switch rather than an NMOS transistor, assuming that your Arduino runs at 5V.

Are there any other connections between the Arduino, the two Raspberry Pi modules, and other circuits? Safely switching power to one part of a system is a tricky business. Before trying to turn off the Pi you need to make sure that all of the signal inputs to it are at ground.

  • \$\begingroup\$ Thanks for your answer... the Arduino is a 5V, yes, sorry for missing that out. Each pi has a total of two GPIO to GPIO pin connections to the Arduino and the pi has an interrupt program to monitor them from boot. If connection A goes LOW, it starts the shutdown sequence, and the second connection is the one discussed above. Each pi setup it identical. Does that help? I'm sorry I literally learned about the existence of mosfets today... seemed like the perfect solution? \$\endgroup\$ Apr 30, 2020 at 14:00
  • \$\begingroup\$ Please see my edit Elliot? \$\endgroup\$ May 3, 2020 at 21:54
  • \$\begingroup\$ The challenge then becomes finding a suitable PFET. Most of the options will be surface mount packages. In the realm of TO220's the on Adafruit chooses to carry is the FQP27P06 and looking at the curved in the data sheet it might pass an amp with around -3 volts on the gate. \$\endgroup\$ May 3, 2020 at 22:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.