I am switching a circuit with a resistive and inductive load that is supplied with 12V using a p-channel mosfet. I already have the option to switch the p-channel mosfet with a mechanical switch (SW3) and have added a solder-jumper to an esp32wroom I/O in the design (JP3).

The p-channel mosfet gate is pulled high in the default state (Q19 does not conduct) and can ideally be pulled low with the switch aswell as the esp32wroom I/0 27. Since this is already on a pcb, i can only change the resistance of R23 and/or add another small component bridging the solder-jumper JP3.

Can I safely connect the 12V gate to the esp and use it to pull it low if i adjust the resistance/add another resistor at JP3? If so, what do I need to do ?

Clarifications to understand the image:

  • Load is between +BATT and GND
  • label power_switch is connected to esp32wroom I/0 27
  • JP3 is an smd jumper pad that would fit a 0805 component

enter image description here


1 Answer 1


No because the pullup will subject the ESP32 output to 12V. This will cause the upper ESD protection diodes to conduct the 12V to the VCC rail and probably completely destroy the device.

The standard method is to use a bipolar or n channel mosfet to drive the gate.


simulate this circuit – Schematic created using CircuitLab

M2 needs to be a logic level gate NFET and M1 needs to support a Vgs of 12V (which shouldn't be an issue).

  • \$\begingroup\$ I agree that this method is recommended. It is not for sure that ESP32 would be damaged with the other circuit, though, since the 10K resistor would limit the amount of power that could be dissipated in ESD protection circuit. But, the gate WOULD be pulled down by that ESD circuitry, probably to around 4V thus turning on the p-channel FET. \$\endgroup\$
    – Troutdog
    Commented Jun 26, 2023 at 15:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.