How to Switch SIM800L Modem On/Off with ESP32-CAM Without a Relay

esp32mosfet

I would like to turn a SIM800L modem on/off (to save battery), controlled with GPIO 16 on an ESP32-CAM, without a relay.

It was working OK with an electromagnetic relay, but I'd like to avoid the noisy clicking sound, so I'm trying to use some kind of BJT transistor or MOSFET based approach.

It might be relevant that pin 16 has a 10k pull up resistor.

(This is part of a more complex setup, and I only have pin 16 left.)

There is 5v on the breadboard power rail, and 3.3v appears on the output pin when turned on HIGH.

Maybe could work

I tried using and NPN transistor (2N2222A) as a switch, but that didn't turn on the SIM800L.

I was following this kind of setup and maybe that wasn't suitable?

Approaches that didn't work

IRF530N MOSFET

As @vir explains: The 3.3V from the module is not enough to turn on the IRF530, which has a threshold voltage of 2-4V.

I wired it up like below, but HIGH on GPIO 16 doesn't turn on the SIM800L.

Can this possibly work?

There was another question where someone got a similar mosfet to work, and I saw a breakout-board with this on/off function which used an IRF520.

This guide also indicates some techniques but honestly it's over my head how the pieces might have to fit together to make it work.

esp32 with mosfet

I was following this tutorial where he includes this diagram:

enter image description here

Best Answer

The 3.3V from the module is not enough to turn on the IRF530, which has a threshold voltage of 2-4V. 5V should be enough, which gives you options. You could change the IRF530 for another device (BJT, 3.3V logic level MOSFET) that will work directly from a 3.3V signal or add in a cheap gate driver chip that will apply 5V to the gate of the IRF530. It might not be a great idea to low-side switch the SIM800L so a small SSR or PMOS with appropriate gate driver could be indicated here.