Author Topic: Using a MOSFET to provide/cut off supply to a circuit  (Read 1967 times)

0 Members and 1 Guest are viewing this topic.

Offline kian0079Topic starter

  • Contributor
  • Posts: 41
  • Country: sg
Using a MOSFET to provide/cut off supply to a circuit
« on: June 23, 2023, 07:26:24 am »
Hi all,

My applications uses a MCU that is connected an audio chip. In order to save power while the audio chip is not in used, I have put the MCU into deep sleep. However the audio chip itself consumes about 30mA in the idle state and the audio chip doesn't come with a power down function. When the audio chip is driving a speaker load, its VCC pin (3.3V) consumes up to about 400mA.

Is it possible that I connect a MOSFET to the audio chip VCC supply pin and use the MCU to turn on/off the MOSFET such that I can cut away the supply to the audio chip when the MCU is in deep sleep? I have searched on the internet, but there are so many ways to connect the MOSFET and I am confused on which one is a better/good implementation.  Should I be using a NMOS or a PMOS (example in this article: https://diyodemag.com/education/mosfet_drivers_why_you_need_them). In some example circuits, 2 MOSFETs are used (example: https://www.onelectrontech.com/mosfets-load-switch-pmos-nmos-on-resistance-inrush-current-applications/)

Which circuit should I be using in my application? Hope to get some advise on this. Thanks in advance!

 

Offline shridmaster

  • Contributor
  • Posts: 22
  • Country: us
Re: Using a MOSFET to provide/cut off supply to a circuit
« Reply #1 on: June 23, 2023, 07:39:09 am »
Generally speaking you want to use a PMOS. PMOSes are "worse" in general than NMOS, but this is a high-side switching application (meaning the switching is at the positive end instead of the negative).

You would have the MCU pin go out to an NMOS, tie the NMOS's drain to a pull-up resistor, and then connect the drain to the gate of the PMOS that supplies the audio circuit. This is the safest way to do it to protect your MCU. When the NMOS gate is low, the drain is a high voltage, so the PMOS is off. When the NMOS gate is high, the drain is switched low, so the PMOS is on and current goes to the audio chip.
 

Offline kian0079Topic starter

  • Contributor
  • Posts: 41
  • Country: sg
Re: Using a MOSFET to provide/cut off supply to a circuit
« Reply #2 on: June 23, 2023, 07:53:29 am »
Thanks. I presume you are referring to a circuit that looks like this:

https://www.next.gr/circuits/switches-MOSFET-as-a-switch-l26103.html

What should the considerations for the values of R1 and R2?

Generally speaking you want to use a PMOS. PMOSes are "worse" in general than NMOS, but this is a high-side switching application (meaning the switching is at the positive end instead of the negative).

You would have the MCU pin go out to an NMOS, tie the NMOS's drain to a pull-up resistor, and then connect the drain to the gate of the PMOS that supplies the audio circuit. This is the safest way to do it to protect your MCU. When the NMOS gate is low, the drain is a high voltage, so the PMOS is off. When the NMOS gate is high, the drain is switched low, so the PMOS is on and current goes to the audio chip.
 

Offline shridmaster

  • Contributor
  • Posts: 22
  • Country: us
Re: Using a MOSFET to provide/cut off supply to a circuit
« Reply #3 on: June 23, 2023, 08:25:05 am »
Exactly that, yes.

If you go too low, then when the NMOS is on it pulls a lot of current and wastes power. If it's too high, the leakage current can pull enough current when it's off that it actually never fully turns off.

It's fairly arbitrary, but anywhere between 10k and 100k is generally what you want based on Ohms law and power consumption. 49.9k is a common value as well.
 

Offline magic

  • Super Contributor
  • ***
  • Posts: 6779
  • Country: pl
Re: Using a MOSFET to provide/cut off supply to a circuit
« Reply #4 on: June 23, 2023, 08:42:35 am »
Since the supply you want to switch is only 3.3V, and the MCU probably also runs on 3.3V, you could simply use a single MOSFET and control it directly by MCU pin. No further components required, no extra power wasted.

400mA is not a lot of current, even a small 0.1Ω RDS(on) MOSFET will only drop 40mV under full load. And there surely are better ones available if you want. However, you will need so-called "logic level MOSFET", one which can be switched by low gate voltage. Older FETs may require 5V or more gate voltage to reach their rated RDS(on).

NMOS vs PMOS:
If you disconnect ground with NMOS, outputs of some chips may go to 3.3V, possibly causing problems if there are loads directly connected to ground on those pins.
If you disconnect the supply, outputs of the chip will go to ground. Possible problems if there are loads on those pins connected to the positive supply (you could turn off such loads together with the chip, if they are on the same 3.3V rail).
N channel tend to be better, cheaper and more common.
 

Offline kian0079Topic starter

  • Contributor
  • Posts: 41
  • Country: sg
Re: Using a MOSFET to provide/cut off supply to a circuit
« Reply #5 on: June 23, 2023, 09:18:54 am »
I am using a DMC2400UV in another part of my circuit. Its used for a battery level monitoring application. I wonder if another DMC2400UV can be used? I really don't know how to spec out the MOSFET for my application.

https://datasheet.lcsc.com/lcsc/2201121900_TECH-PUBLIC-DMC2400UV_C2940616.pdf
 

Offline ArdWar

  • Frequent Contributor
  • **
  • Posts: 373
  • Country: sc
Re: Using a MOSFET to provide/cut off supply to a circuit
« Reply #6 on: June 23, 2023, 10:32:22 am »
For simple switching you usually try to get RDS(ON) as low as possible. Other "dynamic" specs don't really matter. Of course look for appropriate VDS rating, and for this situation keep VGS(TH) well within the voltage drop your MCU (and supply) can generate.

The 300-600mR RDS(ON) of your P-MOSFET will drop 120-240mV at 400mA. That's a bit high IMO for 3.3V supply. Depends on the audio IC, the output signal quality might get affected.
 

Offline larsdenmark

  • Regular Contributor
  • *
  • Posts: 138
  • Country: dk
Re: Using a MOSFET to provide/cut off supply to a circuit
« Reply #7 on: June 23, 2023, 12:01:40 pm »
There are specialized ICs that can take care of the switching:
https://www.ti.com/power-management/power-switches/load-switches/overview.html?DCMP=loadswitch&HQS=loadswitch

Rds(ON) can be very low. E.g. 5-15 mOhms.
« Last Edit: June 23, 2023, 12:04:48 pm by larsdenmark »
 
The following users thanked this post: Nominal Animal

Offline Terry Bites

  • Super Contributor
  • ***
  • Posts: 2393
  • Country: gb
  • Recovering Electrical Engineer
Re: Using a MOSFET to provide/cut off supply to a circuit
« Reply #8 on: June 23, 2023, 12:42:45 pm »
Save yourself the pain and use a "Load Switch" eg TPS22919
 
The following users thanked this post: Nominal Animal, DarkMode

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19527
  • Country: gb
  • 0999
Re: Using a MOSFET to provide/cut off supply to a circuit
« Reply #9 on: June 23, 2023, 01:05:15 pm »
Thanks. I presume you are referring to a circuit that looks like this:

https://www.next.gr/circuits/switches-MOSFET-as-a-switch-l26103.html

What should the considerations for the values of R1 and R2?

Generally speaking you want to use a PMOS. PMOSes are "worse" in general than NMOS, but this is a high-side switching application (meaning the switching is at the positive end instead of the negative).

You would have the MCU pin go out to an NMOS, tie the NMOS's drain to a pull-up resistor, and then connect the drain to the gate of the PMOS that supplies the audio circuit. This is the safest way to do it to protect your MCU. When the NMOS gate is low, the drain is a high voltage, so the PMOS is off. When the NMOS gate is high, the drain is switched low, so the PMOS is on and current goes to the audio chip.
The IRF530 and IRF9530 are unsuitable for 3.3V operation.

Just use a sinlge P-MOSFET and make sure it can pass he full 4A, with a gate drive of just 3V.

A couple of examples: SSM3J328R and DMP1045U.
https://www.mouser.co.uk/datasheet/2/408/SSM3J328R_datasheet_en_20211022-1916357.pdf
https://www.diodes.com/assets/Datasheets/DMP1045U.pdf
 

Offline kian0079Topic starter

  • Contributor
  • Posts: 41
  • Country: sg
Re: Using a MOSFET to provide/cut off supply to a circuit
« Reply #10 on: June 24, 2023, 12:50:17 am »
Thanks guys! I learned a lot from your comments.

I don't know that there are specialised ICs that can take care of the switching. They are classified under Power Distribution Switches on LCSC website. They can go as low as US$0.05 each at low volume. The cheapest one on LCSC website is this:

https://datasheet.lcsc.com/lcsc/1809291208_XI-AN-Aerosemi-Tech-MT9700_C89855.pdf

I am already using a DMP1045U in another part of my circuit, so probably I can consider using another DMP1045U for switching this 400mA load. Thanks @Zero999
 

Offline MathWizard

  • Super Contributor
  • ***
  • Posts: 1431
  • Country: ca
Re: Using a MOSFET to provide/cut off supply to a circuit
« Reply #11 on: June 26, 2023, 11:54:49 am »
I've seen on modern motherboards, they will use an upside down, pretty generic Nch MOSFET, so S on Vdd, Drain as output for 3.3V and 5V, like to a USB port, so at least 0.5A.

Those load switches mentioned above look nice too, and they have some built in protections.
 

Offline magic

  • Super Contributor
  • ***
  • Posts: 6779
  • Country: pl
Re: Using a MOSFET to provide/cut off supply to a circuit
« Reply #12 on: June 26, 2023, 01:54:20 pm »
N-ch power MOSFET has P-doped body internally shorted with the source. So there is a straight PN diode from the source terminal to the drain (which is N, of course).

I don't know what you have seen, but this isn't going to work for the OP.
 

Offline MathWizard

  • Super Contributor
  • ***
  • Posts: 1431
  • Country: ca
Re: Using a MOSFET to provide/cut off supply to a circuit
« Reply #13 on: June 26, 2023, 08:29:43 pm »
They weren't JFET's, and they were turned on/off with the 5V on the gate, I'll see if I can it, but I'm sure it was Nch, upside down

I'll have to find it on the circuit, now I don't believe it myself, but I'm sure I saw an upside down Nch, on a motherboard somewhere, acting as a pass element/switch.
« Last Edit: June 26, 2023, 08:55:12 pm by MathWizard »
 

Offline magic

  • Super Contributor
  • ***
  • Posts: 6779
  • Country: pl
Re: Using a MOSFET to provide/cut off supply to a circuit
« Reply #14 on: June 26, 2023, 09:55:23 pm »
It could be used for switching USB between 5V and 5Vsb (when the computer is off).

Body diode forward biasing is not a problem, because the USB rail is always powered up from one source or another.
When main 5V is down, the "backwards" orientation of the FET ensures that USB is not backfeeding it.

Not sure how they drive the gate of the 5Vsb FET when 12V is down? :-//
Maybe it's a P-ch in this position and N-ch only on the main 5V rail?
 

Offline avaqsemi

  • Newbie
  • !
  • Posts: 5
  • Country: hk
Re: Using a MOSFET to provide/cut off supply to a circuit
« Reply #15 on: June 27, 2023, 06:58:42 am »
To control the power supply to the audio chip using a MOSFET, you can use either an N-channel MOSFET (NMOS) or a P-channel MOSFET (PMOS). Both options can work, but the specific choice depends on your requirements and constraints. Here's an overview of each option:

N-channel MOSFET (NMOS):

Advantages: NMOS typically has lower on-resistance (RDS(on)) and can handle higher currents compared to PMOS. It is commonly used for high-side switching in low-voltage applications.
Implementation: To use an NMOS for high-side switching, you'll need to add a level-shifting circuit between the MCU and the MOSFET gate, as the MCU operates at a lower voltage than the audio chip's VCC. This level shifter can be implemented using additional components, such as a voltage divider or a dedicated level-shifting IC.
P-channel MOSFET (PMOS):

Advantages: PMOS can directly switch the high-side power supply without the need for a level-shifting circuit. It is suitable for high-side switching in applications where the MCU and the audio chip share the same voltage level.
Implementation: To use a PMOS for high-side switching, you connect the source terminal to the VCC of the audio chip and the drain terminal to the positive power supply rail. The gate is controlled by the MCU.
 

Offline magic

  • Super Contributor
  • ***
  • Posts: 6779
  • Country: pl
Re: Using a MOSFET to provide/cut off supply to a circuit
« Reply #16 on: June 27, 2023, 07:04:59 am »
Are you a spammer or what's your problem?
Your description of PMOS wiring is backwards and I'm dying to know how you would level shift the drive to a high-side NMOS with a voltage divider :popcorn:
 

Offline Smokey

  • Super Contributor
  • ***
  • Posts: 2593
  • Country: us
  • Not An Expert
 

Offline Doctorandus_P

  • Super Contributor
  • ***
  • Posts: 3365
  • Country: nl
Re: Using a MOSFET to provide/cut off supply to a circuit
« Reply #18 on: June 27, 2023, 03:18:50 pm »
As an alternative, you can also use an extra voltage regulator with a built in on/off switch.

If the biggest load is handled by this voltage regulator, you can also use a small voltage regulator with a low quiescent current for the uC itself.
 

Offline kian0079Topic starter

  • Contributor
  • Posts: 41
  • Country: sg
Re: Using a MOSFET to provide/cut off supply to a circuit
« Reply #19 on: June 28, 2023, 09:42:38 am »
If using a single PMOS for loading switching, the gate needs to be logic 1 to turn off the PMOS. In this case, the microcontroller has to output a logic 1. Would this drain excessive current from the microcontroller then? Since the PMOS is intended to be off most of the time.
 

Offline magic

  • Super Contributor
  • ***
  • Posts: 6779
  • Country: pl
Re: Using a MOSFET to provide/cut off supply to a circuit
« Reply #20 on: June 28, 2023, 12:44:40 pm »
Quite unlikely. All modern microcontrollers are CMOS, the outputs are driven by MOSFETs which connect the pin either to the supply rail or to ground. Power consumption is essentially zero, regardless of output state, unless the output is driving external load (e.g. a resistor to ground).
 

Offline rhodges

  • Frequent Contributor
  • **
  • Posts: 306
  • Country: us
  • Available for embedded projects.
    • My public libraries, code samples, and projects for STM8.
Re: Using a MOSFET to provide/cut off supply to a circuit
« Reply #21 on: June 28, 2023, 11:28:01 pm »
Maybe a P AO3401 would be a good choice if the MCU and audio chip are the same voltage?
It claims up to -30V, 4A, at 0.085 ohms with a gate of -2.5V.
I bought 50 for $1.70 in 2019.
As our friend magic noted above, the MCU output pin will drive the gate with nearly zero current, after reset and sleep.
Currently developing STM8 and STM32. Past includes 6809, Z80, 8086, PIC, MIPS, PNX1302, and some 8748 and 6805. Check out my public code on github. https://github.com/unfrozen
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf