# Why does powering an ESP32 directly from a power supply work, but when powering through a pMOS it doesn't?

I have this circuit which is used to switch on an ESP32 from another MCU. The GPIO goes on, the nMOS circuit becomes closed and the pMOS gate voltage drops to 0 which then also closes to allow the 3V3 power supply to flow through to power the ESP32. I have tested this circuit with a 10k load, and the logic behind it seems to work fine with ~3V3 measured across the load, but the circuit itself with an ESP32 doesn't work! I have also simulated it in LTspice below to try and understand certain things.

MOSFETS:

• 2N7000: nMOS .model 2N7000 VDMOS(Rg=3 Lambda=1m Vto=1.6 Rd=0 Rs=.75 Rb=.14 Kp=.17 mtriode=1.25 Cgdmax=80p Cgdmin=12p Cgs=50p Cjo=50p Is=.04p mfg=Fairchild Vds=60 Ron=2 Qg=1.5n ksubthres=.1)

• IRF4905S: pMOS .model IRF4905S vdmos pchan VTO=-3.528 RS=0.01341 KP=37.266 RD=-0.0016 RG=11.758 CGDMAX=7.00n CGDMIN=3.00E-10 Cjo=6.85E-10 IS=1.87p Rb=0.0034 TT=8.947e-08 Cgs=2.62n mfg=International_Rectifier Vds=-55 Ksubthres=0.1

I measured the input impedance (R4) of the ESP32 using a multimeter and also approximating it by placing a series resistance infront of the 3V3 pin. Using both methods I am confident in stating that my ESP32's input resistance is 1.851 kOhm. In theory when all MOSFETS work as they are supposed to, the circuit should look like this,

Through the amazing Ohm's law I get a current of 3V3 / 1851 Ohm = 0.001783 A. That's also what I'm getting on my simulation, and when measuring the circuit itself. Have I misjudged my pMOS's ratings for 3V3? How does the power supply reach 0.5 A at times when the input resistance is always fixed? I guess my question is in two parts but this has me very confused.

• Your ESP32 most definitely does not have an input impedance of 1851 ohms. You can't measure it with a multimeter in resistance measurement mode, because it is not a resistance. Commented Apr 3 at 16:56

I'd use something like a AO3401 for the p-channel MOSFET, which has a guaranteed Rds(on) of less than 85mΩ at only 2.5V drive (it will be less with 3.3V drive). It's in an SOT23 package and can easily handle the couple hundred mA peak current of the ESP32.

Note: You cannot simply measure the loading with a multimeter in resistance mode. It does not act at all like a resistor. The standby current may be relatively low (and is also not measurable this way), but when the radio comes on it will draw much, much more current. Maybe 200mA, which would correspond to about a 16Ω resistor, more than 100x lower. If you put the multimeter in current mode in series with the power supply you may be able to measure the average current, but peaks may not be detected properly, and the multimeter voltage drop may affect the results.

Your IRF4905 is in a huge TO220 package, is rated at far more voltage than required and (most importantly) is only specified with -10V Vgs. Even with -4V drive it is only guaranteed to pass 250uA, about 1000x too little current.

Sadly, perhaps, there are few through-hole parts that remotely compare with modern SMT parts, in particular logic level (like 5V or 3.3V or even 1.8V) drive, so you may as well get used to using SMT parts, in an adapter if necessary.

• Thank you for your answer! I shouldn't have only looked at through-whole MOSFETs. Lesson learned. I did put an AM in series to measure the current, but it looked like an old machine so I'm guessing it wasn't accurate. Commented Apr 3 at 18:47

It’s not working because that big PMOS FET has too high of a threshold to be turned on with Vgs of just -3.3V (look at the VTO parameter in the Spice model: it’s -3.528.) 3.3V logic won’t cut it.

What you’re seeing with 10k load is the FET in ohmic region. When you add the real ESP32 load it’s dragging the drain down. (Forget about using an ohmmeter to measure the ESP32 ‘resistance’. You need to use an ammeter to measure its operating current. Or, look at the data sheet.)

The fix? Use a smaller, lower-threshold PMOS. The FDN306P is a decent one that can work with 3.3V logic, which at -2.6A should have more than enough current for your ESP32 which needs only about 0.5A. This FET is in a popular SOT-23 package; you can find many similar pin-compatible ones from many vendors.

Tip: in the unlikely event that you find that a single FET isn't quite enough, you can connect more in parallel.

I’m not sure why you need the 2N7000. Isolation? Anyway, You can control the FDN306P directly with a 3.3V GPIO, or keep the n-FET if you need the inversion.

• The 2N7000 is just a remnant from previous design revisions. Kind of forgot that GPIOs can be initialised to 1 instead of 0...lol. Thanks for you answer! Commented Apr 3 at 18:35
• I know the ESP32's operating current. Is the reason the resistance 'changes' because different modules get turned on/off at different events? Commented Apr 3 at 18:38
• An IC like the ESP32 isn't a simple resistor, it's an active device. Thus, just tying to measure resistance on its 3.3V supply isn't meaningful, because the voltage the ohmmeter is applying isn't known. You need to measure the ESP32 current at 3.3v with an ammeter in-line with the supply. Its current will depend on its operating mode, as shown in the datasheet, but expect somewhere around 200 ~ 300mA typically, depending on what the radios are doing. Commented Apr 3 at 18:47
• If you want to model a load like the ESP32, I suggest a 10 ohm resistor (330mA) to see if your FET is holding up the supply. Commented Apr 3 at 18:58
• Yes. MOSFETs can be paralleled in this way. That said, based on your load requirements this won't be necessary, just choose a FET that has enough current handling capability. Sphero mentioned an AO part, which I've also used, but any suitable ~2A p-FET logic level device will work. Commented Apr 3 at 20:16

The IRF4905 has a threshold voltage of -2 to -4V; your -3.3V is just barely turning it on. You must use a PMOS that can be driven from 3.3V.