-
Using a MOSFET to provide/cut off supply to a circuit
Posted by
kian0079
on 23 Jun, 2023 07:26
-
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!
-
-
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.
-
#2 Reply
Posted by
kian0079
on 23 Jun, 2023 07:53
-
Thanks. I presume you are referring to a circuit that looks like this:
https://www.next.gr/circuits/switches-MOSFET-as-a-switch-l26103.htmlWhat 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.
-
-
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.
-
#4 Reply
Posted by
magic
on 23 Jun, 2023 08:42
-
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.
-
#5 Reply
Posted by
kian0079
on 23 Jun, 2023 09:18
-
-
#6 Reply
Posted by
ArdWar
on 23 Jun, 2023 10:32
-
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.
-
-
-
-
Save yourself the pain and use a "Load Switch" eg TPS22919
-
#9 Reply
Posted by
Zero999
on 23 Jun, 2023 13:05
-
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.pdfhttps://www.diodes.com/assets/Datasheets/DMP1045U.pdf
-
#10 Reply
Posted by
kian0079
on 24 Jun, 2023 00:50
-
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.pdfI 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
-
#11 Reply
Posted by
MathWizard
on 26 Jun, 2023 11:54
-
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.
-
#12 Reply
Posted by
magic
on 26 Jun, 2023 13:54
-
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.
-
#13 Reply
Posted by
MathWizard
on 26 Jun, 2023 20:29
-
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.
-
#14 Reply
Posted by
magic
on 26 Jun, 2023 21:55
-
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?
-
#15 Reply
Posted by
avaqsemi
on 27 Jun, 2023 06:58
-
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.
-
#16 Reply
Posted by
magic
on 27 Jun, 2023 07:04
-
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
-
#17 Reply
Posted by
Smokey
on 27 Jun, 2023 07:53
-
-
-
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.
-
#19 Reply
Posted by
kian0079
on 28 Jun, 2023 09:42
-
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.
-
#20 Reply
Posted by
magic
on 28 Jun, 2023 12:44
-
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).
-
#21 Reply
Posted by
rhodges
on 28 Jun, 2023 23:28
-
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.