Arduino – Drive P channel MOSFET with Arduino, unable to get desired behaviour (LOW pin, MOSFET ON)

arduinomosfet

After hours of building a circuit on a perfboard, I discovered that Vgs is not easy with P-MOSFETs.
After searching I figured out that I need to use either a N-MOSFET or a BJT (NPN) to bring the source voltage to the gate in order to turn the MOSFET OFF.

It is very important to me that when the Arduino pin is LOW, the MOSFET stays ON. This is to provide current to the Arduino itself if the system behind has no power left (not relevant to the circuit here).

Because of this limitation, circuits like this:

will turn off the MOSFET when arduino input is LOW. (To my understanding)
I have tried to provide the voltage to the gate using an N-MOSFET on the HIGH side, see this screenshot (apologies for not using a proper circuit software):
enter image description here

Despite having the N-MOSFET shown as in saturation, only 3.32V gets on it's source, not enough to trigger fully the P-MOSFET's gate.

My short knowledge of electronics has been beaten, as I cannot wrap my head around this. It would be logical to me that the N-MOSFET would apply the full drain voltage on it's source, given that the gate voltage is high.

While primary interested in a solution for this circuit here, tired of spending time on this, an explanation on to why my knowledge is flawed would be welcome.

Thanks for your time, I'll update the post if I am missing something

Best Answer

Ok, so assuming the requirements are:

  • Arduino GPIO Low (0V): PMOS Switch ON (Load voltage = 12 V)
  • Ardunio GPIO High (5V): PMOS Switch OFF (Load voltage = 0)

This circuit would work:

schematic

simulate this circuit – Schematic created using CircuitLab