Electrical – P-channel MOSFET high side switching, Arduino 5V pin and Vcc connection

mosfetswitching

In this tutorial,

enter image description here

The author makes this weird(to me apparently) connection of 5V pin of arduino to 12 V power supply, and explains itself by:

You need to have two power sources – one for the Arduino, and a
separate 12V power source for the motor. You cannot connect the
Arduino's barrel jack to the 12V! This will create a common ground
between your Arduino and the 12V power supply. And it would fry the
Arduino when you are creating the common VCC needed for this circuit.
(With an N-Channel MOSFET you don't have this problem since you want
to have a common ground between the power source and the Arduino)

However, I really did not understand why connecting grounds of two power supplies together and then applying HIGH or LOW to the Gate of the p-channel MOSFET does not do the trick.

So, a little bit help on understanding what is going on would be appreciated.

Best Answer

Based on your clarifying comment after your posted question, I think that what you are asking is why you can't connect this differently, so that instead of tying the +5V and the +12V lines together, you tie the grounds together, and then just drive the MOSFET gate with the Arduino HIGH or LOW output.

If that understanding of your question is correct, then the answer is that the MOSFET will never be turned off, because the source terminal will be at +12V and the gate terminal will be at +5V at the highest. So you will have at -7 Volt Gate-Source voltage even when you are trying to turn off the MOSFET, and it will always be on.