Can the Arduino internal pull-up resistor be used with a Mosfet?

I'm powering the Arduino Classic Nano with 2 18650 batteries in series for a nominal 7.2v. I want to completely cut the power to the Nano when reaching 6.2v. I've learned that the exit(0) function does not shut the Nano down resulting in loosing a couple of batteries due to excessively low voltage.

What should be used is a P-Channel MOSFET, I've learned. Everything I read indicates that a Pull-Up Resistor should be used. So my question is:

"Can I use the Nano's internal Pull-Up Resistor or must I use an external resistor?"

Thank you

Ask yourself what happens to the internal pullup when the Nano shuts off.

1 Like

No. When you shut off power to the Nano, the resistor will no longer be pulling up. In fact, as Vcc drops to zero volts, the protection diode to Vcc on the GPIO pin will pull the mosfet gate down, thus turning it back on.

If you want the Nano to be able to turn itself off, you need an NPN transistor controlled by the Nano, which in turn controls the gate of the mosfet. The extra stage means the Nano has to actively power the NPN to keep the power on. So when it stops doing that, power will turn off for good. You would also need a pushbutton or some kind of switch to temporarily power up the Nano.

You can but they will actually drain the battery.

You pull the gate to the source to turn it off. If you're switching the positive voltage to the Nano, a P-channel MOSFET is the simplest solution. Place a 10K resistor between the source and gate. Then, connect whatever is controlling it to the gate, driving it low when you want it to turn on.

Thank you all for responding so quickly and thoroughly. So the external resistor is necessary to keep the Mosfet powered (High) so there is no current flowing.

Did I get that right?

That's right, but if the Nano's IO pin is also connected to the gate, that will prevent the power from shutting down.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.