I am trying to create a Raspberry Pi Hat which has my usb hub and a mosfet which turn on and off the power on individual port.

There are different way to do this: Transistor, Mosfet, Relay, but I have chosen Mosfet for the lower consumption if the usb has to be on for a long time ( everything runs on battery ).

Unfortunately my knowledge of mosfet made the pcb not working as I was hopping, so I tried to add a transistor PNP and buying different rate ( 500ma, 1A ), the transistor worked but didnt let pass enough current even if it says 1A.

I am a bit confused on what I have made wrong and if my idea to use the VCC rather than GND line is correct. I do understand that PNP should be use on the positive line and NPN on negative lines, right?

This is my schematic: enter image description here

My temporary solution is to connect a relay to switch on and off, which works, but I want to make my pcb as small as possible by using a mosfet ( smd ).


Might want to swap the source and drain on those P channel mosfets, the source should connect to Vbus and the drain to the port (Otherwise the body diode will conduct).

Also what exact part number is the mosfet? You need a logic level part, because you only have 5V Vgs available.

  • \$\begingroup\$ I tried to use this mosfet link but I suppose what you said is that I cant trigger with a 3.3V. In the other hand, I am using a expander IO which can operate at 5V, so I could potentially use that 5V output to connect my mosfet. \$\endgroup\$ – max246 Oct 8 '16 at 13:48
  • \$\begingroup\$ The mosfet will switch on if the gate is more then 500mV below the source, so you need 5V if you are switching a 5V rail. Pulling the gate low will switch on the mosfet. \$\endgroup\$ – Dan Mills Oct 8 '16 at 14:52

The P-Channel MOSFETs require a high side driver, since your GPIOs on the RPi can only go up to 3V3. You need to go up to 5V to switch the MOSFETs off completely.

  • \$\begingroup\$ So what is the alternative here? Transistor? \$\endgroup\$ – max246 Oct 8 '16 at 13:44
  • \$\begingroup\$ One N-Channel logic level mosfet and one resistor to drive the p-channel gate. \$\endgroup\$ – Turbo J Oct 8 '16 at 14:13
  • \$\begingroup\$ any suggestion? I think I need to find something which can handle up to 1A. I will try to find something and might post here to double check. \$\endgroup\$ – max246 Oct 8 '16 at 14:16
  • \$\begingroup\$ Sopping questions are off topic here. \$\endgroup\$ – Turbo J Oct 8 '16 at 14:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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