Electronics > Beginners

Circuit for low-side MCU-controlled soft power switch?

(1/1)

Peabody:
This relates to the type of circuit in which a momentary pushbutton turns on power, and then the microcontroller takes over and keeps power on by asserting a GPIO pin - until it's ready to turn off its own power.

The circuit on the left in the attached picture uses a P-channel mosfet on the high side to switch power.  I've used it several times, and it works fine.  But I wondered if there was a low-side equivalent using an N-channel mosfet.  The circuit on the right is an attempt to do that, but I don't think it works.

If the power is on, and the MCU attempts to turn it off by bringing the GPIO high, or making it an input, I think current will flow from the 9V rail through the emitter and base of the PNP, into the GPIO pin, and through the upper protection diode to 5V.  If that happens, the PNP will stay on, and the MCU will be unable to do anything to turn it off.

Am I thinking right about this?  If so, how might this be made to work without adding another bipolar transistor?  It seems that to make it really equivalent, you would have to move the regulator to the low side, and make it 4V - not something you see every day.

MarkR42:
I am reasonably sure that you can do the low-side switching without using a 2nd transistor, i.e. just use the mosfet.

Provided it's the correct type of n-channel mosfet, i.e. the gpio is high enough to fully turn it on, then it should work. I've not tried that exact setup myself, but I have done low-side switching of other loads with a n-channel mosfet from a micro.

Peabody:

--- Quote from: MarkR42 on November 22, 2019, 10:19:51 am ---I am reasonably sure that you can do the low-side switching without using a 2nd transistor, i.e. just use the mosfet.

Provided it's the correct type of n-channel mosfet, i.e. the gpio is high enough to fully turn it on, then it should work. I've not tried that exact setup myself, but I have done low-side switching of other loads with a n-channel mosfet from a micro.

--- End quote ---

If you mean just driving the mosfet gate directly from the GPIO pin, I don't think that will work if what you're switching is the MCU's own ground.  If the positive rail is connected, but the processor's GND is not connected to the negative rail, then a GPIO pin will read as 5V, or 9V or whatever, with respect to the negative rail.  And that will turn on the mosfet.  So I think it would try to cycle on and off.

MarkR42:
Maybe a weak pull-down resistor would enable it to stay off? Like a 33k or something?

Peabody:
I tested the attached circuit, and it seems to work fine.  With the right mosfet, it also works on a 3.3V controller.

Navigation

[0] Message Index

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod