ESP32 - using GPIO 15 as and output

I've built a circuit using and esp32 and have pretty much run out of GPIO's. I'm needing to use one of the strapping pins (GPIO15) and wondering why my circuit will not work when using it as a digitalWrite(15, LOW)? Basically I'm using it in the circuit (see link) to turn off my pherpherial devices (U2, U4, U5, and U6) when putting my circuit to sleep. I'm driving the gate of MOSFET (U7) to do this so that when digitalWrite(15, HIGH) the devices get 3.3V but when put to sleep I call digitalWrite(15, LOW) but it doesn't work. I believe the problem might be that GPIO15 has an internal pullup ? and the pulldown resistor on the gate of my MOSFET is not the correct value to turn the MOSFET off?

  • Always show us a good schematic of your proposed circuit.

  • Show us good images of your ‘actual’ wiring.

  • Give links to components.

  • In the Arduino IDE, use Ctrl T or CMD T to format your code then copy the complete sketch.
    Use the < CODE / > icon from the ‘posting menu’ to attach the copied sketch.

Connect a LED with a series 470R resistor at GPO-15 and check that you can blink it. After that drive the LED by your MOSFET. This way you can spot the problem. //Edit

  • With a series 470R resistor.
1 Like

@GolamMostafa good tip - I will try that.

I've tested with a LED on GPIO 15 using Blink and it does work...

Now, drive the same LED using the same type of MOSFET that you have used in your circuit. Place the LED at the source side with a 470R series resistor.

I see in your referred circuit that both D and S sides of your MOSFET at the GND-point (U7, Fig-1). Thre is no load for the MOSFET. What is the use of it?


Figure-1: