Author Topic: Help: p-channel MOSFET won't turn off  (Read 31929 times)

0 Members and 1 Guest are viewing this topic.

Offline rea5245Topic starter

  • Frequent Contributor
  • **
  • Posts: 587
  • Country: us
Help: p-channel MOSFET won't turn off
« on: December 16, 2021, 03:58:26 pm »
OK, I know this question has been asked a lot on the web, and I think I might understand the cause of my problem, but I don't know the solution.

I have a microcontroller running at 5V driving the gate of a P-channel MOSFET (an LP0701N3, https://ww1.microchip.com/downloads/en/DeviceDoc/LP0701-P-Channel-Enhancement-Mode-Lateral-MOSFET-Data-Sheet-20005447A.pdf).

The source is tied to 5V and the drain is tied to a load. At startup, the uC pin is high and the MOSFET is off. When I set the pin low, the MOSFET turns on. When I set the pin high again, the MOSFET does not turn fully off.

I've tried some variations. I added a 10K pullup resistor on the gate but that didn't help. Then I changed the uC pin to open drain, hoping that would "help" the pullup resistor some more. That didn't fix it either.

From what I've found on the web, I think the problem is that I need to get the gate a little higher than the source, to get the MOSFET to fully turn off. But how would I do that? 5V is all I have.

Alternatively, is there a different MOSFET that would behave better?

Thank you.

 

Online gamalot

  • Super Contributor
  • ***
  • Posts: 1384
  • Country: au
  • Correct my English
    • Youtube
Re: Help: p-channel MOSFET won't turn off
« Reply #1 on: December 16, 2021, 04:39:05 pm »
If your MCU is powered from the drain of the PMOS it controls, maybe you can consider using a push-pull output GPIO pin to control an open collector NPN transistor to control the gate of the PMOS.

Offline rea5245Topic starter

  • Frequent Contributor
  • **
  • Posts: 587
  • Country: us
Re: Help: p-channel MOSFET won't turn off
« Reply #2 on: December 16, 2021, 04:43:52 pm »
If your MCU is powered from the drain of the PMOS it controls...

It's not. It's powered from the same 5V that the MOSFET's source gets.
 

Offline strawberry

  • Super Contributor
  • ***
  • !
  • Posts: 1199
  • Country: lv
Re: Help: p-channel MOSFET won't turn off
« Reply #3 on: December 16, 2021, 05:01:47 pm »
load have capacitor or
MCU port is not pulling high enough
MOSFET Gate threshold is 0.5V
 

Offline rea5245Topic starter

  • Frequent Contributor
  • **
  • Posts: 587
  • Country: us
Re: Help: p-channel MOSFET won't turn off
« Reply #4 on: December 16, 2021, 05:13:20 pm »
load have capacitor or
MCU port is not pulling high enough
MOSFET Gate threshold is 0.5V

The load is an MCP1700 3.3V regulator, which in turn powers a radio module. As with many voltage regulator circuits, there's a 1uF cap between Vin and GND. That cap is, therefore, between the MOSFET's drain and GND.

Could that be the problem? Why would a 1uF between drain and GND cause this and, more importantly, what can I do about it?

The MCU port is should be pulling to 5V, especially when I set it to open drain and added a 10K pullup resistor to 5V. I can't pull it any higher than that.
 

Offline Terry Bites

  • Super Contributor
  • ***
  • Posts: 2510
  • Country: gb
  • Recovering Electrical Engineer
Re: Help: p-channel MOSFET won't turn off
« Reply #5 on: December 16, 2021, 05:16:06 pm »
This MOSFET has a very low threshold so if your drive pin is only slightly below Vdd the transistor my fail to turn off.
Do you really need a MOSFET here, do not fear the pnp!

Just save yourself the headache and use an LDO with a shutdown pin eg NCP163ASN330T1G
« Last Edit: December 16, 2021, 05:25:14 pm by Terry Bites »
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15324
  • Country: fr
Re: Help: p-channel MOSFET won't turn off
« Reply #6 on: December 16, 2021, 05:25:05 pm »
Yes, the threshold is ultra low for a MOSFET. In the OP's case, it's a drawback more than anything else. Just pick a PMOS with a higher threshold. There are thousands of them.
 

Offline Peabody

  • Super Contributor
  • ***
  • Posts: 2141
  • Country: us
Re: Help: p-channel MOSFET won't turn off
« Reply #7 on: December 16, 2021, 06:10:19 pm »
What does the gate voltage actually measure when it's supposed to be 5V?

How do you know the mosfet isn't turning off?  Is it because the radio module is still on?  Is it possible the mosfet *IS* turning off, but the radio module is being partially powered from one or more GPIO port pins of the processor?

 

Online Doctorandus_P

  • Super Contributor
  • ***
  • Posts: 3848
  • Country: nl
Re: Help: p-channel MOSFET won't turn off
« Reply #8 on: December 16, 2021, 06:12:52 pm »
Start by posting a picture of a schematic.
 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 8766
  • Country: fi
Re: Help: p-channel MOSFET won't turn off
« Reply #9 on: December 16, 2021, 06:22:21 pm »
People again misunderstand what threshold means.

Vgs(th) value given in the datasheet  guarantees the FET is off (meaning, Id < 1mA) when Vgs < -0.5V. Assuming the microcontroller has a CMOS output (which is a very fair assumption in 2021) which can output the full Vcc supply voltage given very high output impedance of the MOSFET gate, there is no issue here.

The problem has to be elsewhere. A schematic and/or a photo would help narrow things down.

Measure Vgs (directly across the MOSFET pins) with a multimeter when it is wrongly in the on state.
 

Offline rea5245Topic starter

  • Frequent Contributor
  • **
  • Posts: 587
  • Country: us
Re: Help: p-channel MOSFET won't turn off
« Reply #10 on: December 16, 2021, 06:34:22 pm »
Here's the schematic (from before I added the pullup resistor).

 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 8766
  • Country: fi
Re: Help: p-channel MOSFET won't turn off
« Reply #11 on: December 16, 2021, 06:37:32 pm »
Schematic lacks the interesting parts, what is driving "Radio Power On" net, and is it powered by the same +5V net.

Measure Vgs with multimeter when erroneously on and post the result.
 

Offline rea5245Topic starter

  • Frequent Contributor
  • **
  • Posts: 587
  • Country: us
Re: Help: p-channel MOSFET won't turn off
« Reply #12 on: December 16, 2021, 07:04:47 pm »
Schematic lacks the interesting parts, what is driving "Radio Power On" net, and is it powered by the same +5V net.

"Radio Power On" is driven directly by a microcontroller pin on a Microchip PIC18F47K42. No pullup resistor. The uC is powered by the same 5V that's on the MOSFET's source.

Measure Vgs with multimeter when erroneously on and post the result.

Vgs is -0.009V. Voltage at the drain, relative to ground, is 0.781V.
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15324
  • Country: fr
Re: Help: p-channel MOSFET won't turn off
« Reply #13 on: December 16, 2021, 07:11:44 pm »
Voltage at the drain, relative to ground, is 0.781V.

And from that, you concluded that the MOSFET is not off... ::)
 

Offline rea5245Topic starter

  • Frequent Contributor
  • **
  • Posts: 587
  • Country: us
Re: Help: p-channel MOSFET won't turn off
« Reply #14 on: December 16, 2021, 07:25:09 pm »
Voltage at the drain, relative to ground, is 0.781V.

And from that, you concluded that the MOSFET is not off... ::)

Well... um... uh... you make an interesting point...

But the thing is, before I turn the radio on the first time, the drain voltage is a rock-steady 0V. Then I turn the radio on and off, and the drain stays at 0.781. And the reason I care is that it causes some sound to come out of the speaker.

 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 8766
  • Country: fi
Re: Help: p-channel MOSFET won't turn off
« Reply #15 on: December 16, 2021, 07:50:06 pm »
Sounds being emitted means significant power being leaked.

Any possibility something else back-feeds power to U1 through the IO pin protection diodes? I.e., external voltage in RadioReset, RadioCS, SCL, SDA..? That would also go though U4 to its input, to be measured by you at Vdrain.

Is that 0.781V reading stable or is it diminishing slowly?

When you read 0.781 at the input of U4, what's the voltage at output of U4, i.e., difference over the regulator?

What happens if you just cut the input to U4 and solder in a fixed load resistor for a simple test?
« Last Edit: December 16, 2021, 07:52:47 pm by Siwastaja »
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15324
  • Country: fr
Re: Help: p-channel MOSFET won't turn off
« Reply #16 on: December 16, 2021, 08:08:04 pm »
It seems likely that you are powering the Mikroe module through one of its IOs from one of the IOs of the MCU connected to it. When powering it off, the MCU will need to switch all its IOs connected to the Mikroe module to 0. The problematic part will still be I2C, since the lines are pulled up. If the MCU has internal pull ups, activate them when the module is powered on, and disable them when it's off, and get rid of any external pull ups. If you can't do that...
 

Offline rea5245Topic starter

  • Frequent Contributor
  • **
  • Posts: 587
  • Country: us
Re: Help: p-channel MOSFET won't turn off
« Reply #17 on: December 16, 2021, 08:29:54 pm »
Since my uC is running at 5V and the MikroE module runs off 3.3V, the four signals going to the module (Reset, CS, SDA, SCL) are all set to open drain on the uC and have external 10K pullup resistors going to 3.3V. That's the same 3.3V that's output by the MCP1700 - which is turned off by the MOSFET.

In other words, the MOSFET powers the 3.3V regulator, which powers the radio module and the pullup resistors for the signals coming from the uC. Since those signals are OD, the module can't be getting power from the uC.

The emitted sounds are soft ticks every 1/2 second.
 

Offline Peabody

  • Super Contributor
  • ***
  • Posts: 2141
  • Country: us
Re: Help: p-channel MOSFET won't turn off
« Reply #18 on: December 16, 2021, 10:00:11 pm »
Then you should be able to disconnect those four lines, one at a time, and the noise will still be present.  And if you remove the mosfet, everything should turn off.  All of that would tend to confirm that the mosfet is the problem.

But if the mosfet is fully off when you power up initially, and turns fully on with no problem, it is highly unlikely there is anything wrong with it.  It seems much more likely the .7V is coming from the radio, flowing backwards though the 3.3V regulator to the drain.  Anyway, if you can, you need to just try removing or disconnecting things until you figure it out. 

It would be helpful if you could measure the voltage at some of the important points, and report what they are when things are still On but should be Off.  Like - those four I/O pins, and the Vcc pin of the radio module.
 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 8766
  • Country: fi
Re: Help: p-channel MOSFET won't turn off
« Reply #19 on: December 17, 2021, 07:34:23 am »
Measured low value of Vd and audible ticks every 500ms sure sounds like this is a very small current leakage which charges up the capacitors, makes the CPU boot and emit sound, again discharging the caps. You can verify this diagnosis by adding additional resistive load, like 1kOhm, in parallel with C2 and/or C3.

You still need to measure where the current is coming from. If nothing else, add a series resistor of a few ohms, or even a few tens of ohms, between Q1 drain and U4 Vin, so you can measure current (be careful to also measure direction of current correctly!).
 

Offline rea5245Topic starter

  • Frequent Contributor
  • **
  • Posts: 587
  • Country: us
Re: Help: p-channel MOSFET won't turn off
« Reply #20 on: December 17, 2021, 03:45:12 pm »
The radio module is socketed, so I can just pull it out. That will eliminate any possibility of the four signal pins leaking back to the 3.3V.

With the module out, the initial state is 0V on the MCP1700's Vout. When I turn it on, Vout is 3.29V. When I turn it off again, Vout is 1.09V. Vin (which is also the MOSFET's drain) is 0.7V.

If I short the drain to gnd, Vout drops to 0.395V, but as soon as I remove the short, Vout goes back up to 1.09V.

If I short Vout to gnd, then remove the short, Vout goes back to 1.09V.
 

Online AndersJ

  • Frequent Contributor
  • **
  • Posts: 411
  • Country: se
Re: Help: p-channel MOSFET won't turn off
« Reply #21 on: December 17, 2021, 04:06:06 pm »
Make sure you have more load than a high-z multimeter.
"It should work"
R.N.Naidoo
 

Offline rea5245Topic starter

  • Frequent Contributor
  • **
  • Posts: 587
  • Country: us
Re: Help: p-channel MOSFET won't turn off
« Reply #22 on: December 17, 2021, 04:15:12 pm »
Make sure you have more load than a high-z multimeter.

Are you thinking there's some capacitance holding a charge? I shorted the drain to gnd and I shorted the MCP1700's Vout to gnd. As soon as I removed the shorts, the drain voltage and the Vout voltage went back up.
 

Offline Peabody

  • Super Contributor
  • ***
  • Posts: 2141
  • Country: us
Re: Help: p-channel MOSFET won't turn off
« Reply #23 on: December 17, 2021, 04:16:28 pm »
The radio module is socketed, so I can just pull it out. That will eliminate any possibility of the four signal pins leaking back to the 3.3V.

Are the pullup resistors on the signal lines also removed when you remove the radio module?  If not, then the signal lines could be powering the MCP1700's Out pin through the pullups.  And if you still have voltage there when you ground the mosfet drain, then the current can't be coming from the mosfet.


 

Offline 741

  • Frequent Contributor
  • **
  • Posts: 400
  • Country: gb
    • Circuit & PCB Design (small PCB quantities OK)
Re: Help: p-channel MOSFET won't turn off
« Reply #24 on: December 17, 2021, 04:58:14 pm »
What (if anything) happens when the Mikroe module is powered up stand-alone by 0.781V? I'm simply wondering whether C2's potential comes out unaltered and vaguely powers the radio.


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf