I want to make an input for an ESP32 using a MOSFET for active low. Will this schematic work?

enter image description here

The source is from a 5 V digital pin. I use a DMG1012UW MOSFET.

  • \$\begingroup\$ What happens when the source pin is at 0 V? You need a pull-up resistor on the ESP32 pin to 3.3V, or activate the ESP32's pin's internal pull-up, if any. \$\endgroup\$
    – ocrdu
    Nov 20, 2022 at 11:00
  • \$\begingroup\$ Why don't you just use an inverter that is capable of handling 5 volt inputs? \$\endgroup\$
    – Andy aka
    Nov 20, 2022 at 12:29
  • \$\begingroup\$ @ChristopherMoore You're right, my brain misread R23 as 100k, not 100R. Deleted. \$\endgroup\$
    – TypeIA
    Nov 20, 2022 at 21:51


Your Answer

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

Browse other questions tagged or ask your own question.