Electronic – MOSFET for 5V high-side switch

mosfet

I have a 5V logic signal coming from a pin on my microcontroller. I would like to use this to turn on and off another circuit which also runs at 5V. i. e. the logic level is the same, but I need to switch more current than the microcontroller pin can source.

I started with this circuit by Jon Watte, for using a P-channel MOSFET as a high-side switch for 12V:

original 12V circuit

I tried using this same circuit, but running it at 5V instead of 12V. It worked, but when I started to draw more than a few mA of current, the voltage starts to sag towards 4V and even lower.

I thought the problem was that the IRF9530 has a drive voltage of 10V, so at 5V it isn't fully turning on.

So, I tried replacing the IRF9530 with a NDP6020P, which has a drive voltage of 4.5V. I thought that ought to fix the problem:

my new 5V circuit

However, that did not fix the problem. The voltage doesn't sag quite as much quite as quickly as with the IRF9530, but it still gets lower than I would like. (The voltage drops to 4.3V at 150 mA.)

LCD display of variable load

Why didn't this work the way I thought it should? What are the "engineering calculations" I need to perform to choose a MOSFET that will make this circuit behave properly as a switch?

Edit: Here is how I'm performing measurements:

measurement methodology

I've connected the output to a SparkFun Variable Load. The variable load acts as an electronically-controlled variable resistor. It also measures the current going through the resistor (MES3), and measures the voltage across the terminals (MES2). I also have a separate voltmeter connected directly across the power supply (MES1).

The 5V supply, depicted as a battery in the schematic, is actually a 5V, 2A USB wall adapter.

As the load increases, the voltage measured at the output (MES2) decreases. However, the voltage measured at the power supply (MES1) also decreases. This would seem to suggest the power supply can't handle the current.

However, if I connect the variable load directly to the power supply, I can draw significantly more current without the voltage sagging by any significant amount.

load connected directly to power supply

So that would suggest there is not an issue with the power supply. This seems very weird.

Conclusion: I never did figure out what was wrong. But I rebuilt the same circuit on a new breadboard, and it seems to work as expected now. So obviously I messed something up before, but the design itself seems to work.

Best Answer

This arrangement of 2 fets is only needed because 12V is higher than 5V, and Q1 is needed to level shift.

You only need a PFet connected directly to your micro, when they run from the same (5V) supply.

schematic

simulate this circuit – Schematic created using CircuitLab

You could also use a pnp transistor (BC337). There is no issue with VGS, but there is base current used when turned on. That is what I would use for switching the LCD backlight led, for example.