Author Topic: Circuit for low-side MCU-controlled soft power switch?  (Read 1470 times)

0 Members and 1 Guest are viewing this topic.

Offline PeabodyTopic starter

  • Super Contributor
  • ***
  • Posts: 2248
  • Country: us
Circuit for low-side MCU-controlled soft power switch?
« on: November 21, 2019, 05:57:05 pm »
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.
« Last Edit: November 21, 2019, 05:58:57 pm by Peabody »
 

Offline MarkR42

  • Regular Contributor
  • *
  • Posts: 139
  • Country: gb
Re: Circuit for low-side MCU-controlled soft power switch?
« Reply #1 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.
 

Offline PeabodyTopic starter

  • Super Contributor
  • ***
  • Posts: 2248
  • Country: us
Re: Circuit for low-side MCU-controlled soft power switch?
« Reply #2 on: November 22, 2019, 04:40:37 pm »
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.

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.
 

Offline MarkR42

  • Regular Contributor
  • *
  • Posts: 139
  • Country: gb
Re: Circuit for low-side MCU-controlled soft power switch?
« Reply #3 on: November 22, 2019, 08:19:15 pm »
Maybe a weak pull-down resistor would enable it to stay off? Like a 33k or something?
 

Offline PeabodyTopic starter

  • Super Contributor
  • ***
  • Posts: 2248
  • Country: us
Re: Circuit for low-side MCU-controlled soft power switch?
« Reply #4 on: December 04, 2019, 05:50:52 pm »
I tested the attached circuit, and it seems to work fine.  With the right mosfet, it also works on a 3.3V controller.

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf