Electrical – Soft power-off (latching?) with ESP8266

esp8266

I'm trying to build a simple IOT push-button with the ESP-01. My goal is to have it powered by 2 coin-cell batteries (3v), so I want it to power up when I push the button, and then power itself down.

I was advised on reddit to use a P-channel mosfet to allow the ESP to power itself by holding the gate low via a GPI0 pin, then setting it high to power it down. I'm struggling to get this working. I have it wired up like so:

enter image description here

But as soon as I release the button, the ESP shuts off immediately (it doesn't seem to draw any power through the mosfet). I tested my code by hooking ESP's 3v3 pin directly to battery+, and used a voltmeter to measure at the mosfet's drain pin. When it boots up, the voltmeter almost immediately reads ~3.3v, my code makes a successful HTTP request, and then voltmeter drops ~0v, as expected.

However, when I wire the ESP's 3v3 pin back where the voltmeter was (on the drain pin), the ESP shuts off as soon as I release the button.

What am I missing? I've seen other schematics for "soft-latching" circuits that include an additional NPN transistor, but I'm not sure whether or not that applies to my situation.

Best Answer

The ZVP3306A is designed for 10V Gate drive. Its threshold could be as high as 3.5V at 1mA, which means it probably won't turn on hard enough to power the ESP8266 at 3V.

enter image description here

You need a FET which is designed for 2.5V Gate drive, eg. IRLML6402.