1
\$\begingroup\$

I am trying to implement something similar to this: https://youtu.be/nbMfb0dIvYc?t=4m27s

Basically, the idea is that the microcontroller (a Wemos D1 Mini in my case) is powered up by an external switch. As soon as it starts up, it sets up a MOSFET so that it can keep its power connection until it finishes whatever job it is set up to do. In the end, it "kills itself" by cutting of the power through the MOSFET.

The problem? The original design uses a P-channel MOSFET. Since I had no P-channels on hand, I tried to implement something using an N-channel MOSFET (IRZL34N). Here is my schematic:

enter image description here

However, no matter what pin I tried to use to control the MOSFET, there is always some residual voltage on the pin. For example, using D8, I'm getting about 2.2V on the pin (and the MOSFET gate) - enough to keep the MOSFET open.

Now according to the Wemos D1 Mini Schematic, that pin only has an external pull-down resistor. So whatever current makes it through does so through the internal ESP8266 circuitry. And I have no idea what the schematic is (and even if I could find it, I would probably not be able to understand it :) ).

Anyway, to make a long story short - is there any way to implement this using low-side switching (with an N-channel)? Or is my time better spent just going out and buying a P-channel MOSFET?

I did find another similar question on the site - but the only solution there is... well... "use a P-channel"! :)

Thank you!

\$\endgroup\$
  • 1
    \$\begingroup\$ I think this is inevitable; you are breaking the ground connection to the MCU and still expecting it to hold the gate low... how exactly? All the leakage from +5V through the micro ends up across R1. If you have 2 NMOS FETs you could have the MCU command a gate high for "off" (making an inverter to control the gate of this one). Details left sa an exercise... \$\endgroup\$ – Brian Drummond May 4 '18 at 9:18
  • \$\begingroup\$ I was expecting the MCU to at least leave the gate floating (so that the pull-down resistor can pull it to ground). However, that does not seem to be the case. I will try to build the circuit you suggested, and see how that works - thank you! \$\endgroup\$ – Bogd May 4 '18 at 9:50
  • \$\begingroup\$ Based on @BrianDrummond's suggestion, I went ahead and bought a P-channel MOSFET. That created a whole new set of questions - but rather than completely change this question (including the title :) ), I decided to ask a new one. So see here for the rest of the story: electronics.stackexchange.com/questions/372589/… \$\endgroup\$ – Bogd May 5 '18 at 19:21
  • \$\begingroup\$ @BrianDrummond - if you post your comment as an answer, I will gladly accept it. Once again, thank you for your help! \$\endgroup\$ – Bogd May 8 '18 at 11:24
  • \$\begingroup\$ The PMOS approach introduces an exactly symmetrical problem, as well explained by anrieff. I can't do better than that answer. \$\endgroup\$ – Brian Drummond May 8 '18 at 11:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.