Drive P-mosfet from MCU - Page 1
Forum section: electronics / beginners

author: Jr.Maxwell
author_rank: Contributor
timestamp: July 28, 2020, 09:52:21 pm
content: Hello nice people,I'm trying to build my own projects and learnI've been trying to use a P channel mosfet as a switch to power my 12v circuit. The idea is that the gate of the mosfet is connected to the MCU and it switches the mosfet on/off. See attachment "pic-1.png".My problem. The MCU has a maximum output voltage on P1 of 3.3V but the input on the Source of the P channel mosfet is either 12/24V. I can't find a P channel mosfet with a VGS_th that suits this schematics. How would I solve this problem so that I can switch the mosfet on with a 3.3V MCU output pin voltage?

author: MasterT
author_rank: Frequent Contributor
timestamp: July 28, 2020, 10:47:16 pm
content: Something like voltage translator:Customize resistors to your voltage range

author: Unixon
author_rank: Frequent Contributor
timestamp: July 28, 2020, 11:06:58 pm
content: Quote from: MasterT on July 28, 2020, 10:47:16 pmWhy not N-MOSFET and zener diode?

author: Whales
author_rank: Super Contributor
timestamp: July 29, 2020, 12:36:57 am
content: QuoteUnfortunately you can't drive your P-fet in the way you are thinking.Common N & P channel mosfets are (approximately) turned on and off by changing the voltage between their Gate and Source pins. When Vgs = 0 the P-fet will be off and when Vgs is more than a few volts your P-fet will be on.In your circuit this means you need to drive your P-fet's gate with about 12 or 24V to turn it off (because that's the only way of getting Vgs ~= 0). Note that if your IC outputs either 0Vor3.3V then the P-fet will be on regardless (because Vgs ~= -9 to -12V, or -21 to -24V, which are all above the VgThresh of almost all mosfets).There are many ways of "level shifting" your 0-3.3V signal into something more like 0-12/24V. Use those keywords. Also lookup "gate driver" if you need something with higher performance (eg rapid switching).

author: Whales
author_rank: Super Contributor
timestamp: July 29, 2020, 12:44:31 am
content: Quote from: MasterT on July 28, 2020, 10:47:16 pmThoughts: R1 can be omitted (shorted out) if you are only using 12V. If you are using 24V then some value of it will probably be needed to avoid going past the Vgs(max) of the mosfet.

author: David Hess
author_rank: Super Contributor
timestamp: July 29, 2020, 02:34:55 am
content: I do not really recommend this but you could reference the microcontroller to the positive supply instead of negative supply. So ground or "common" becomes the positive supply and the microcontroller circuits run on -3.3 volts. Now it can drive a p-channel MOSFET directly just like a microcontroller referenced to the negative supply can drive an n-channel MOSFET directly.

author: Ian.M
author_rank: Super Contributor
timestamp: July 29, 2020, 05:50:08 am
content: That's a perfectly valid approach. The problems only start when there is some other ground referenced part of the circuit that needs to interface to the MCU.If the supply is lower than Vgs_max of the P-MOSFET by an adequate margin, you can also use a 'dumb' low-side gate driver IC intended to drive a N-MOSFET gate (near) rail to rail, with a ground referenced logic level control input. However the 'sense' of its input will be inverted - if logic '1' = On in its intended application, with a P-MOSFET, '1' = Off. Avoid smart gate drivers e.g. ones with UVLO, gate voltage limiting etc.

author: Faranight
author_rank: Unknown
timestamp: August 22, 2023, 09:44:40 am
content: Quote from: MasterT on July 28, 2020, 10:47:16 pmI know this is a rather old thread, but...I've seen circuits like this that use a NPN transistor (with base resistor), and I've seen circuits that use a N-channel enhancement mosfet in its place to drive a high-side P-MOS switch.What is the benefit of using a NPN BJT (Q1) over a N-MOS in this circuit?

author: David Hess
author_rank: Super Contributor
timestamp: August 23, 2023, 08:53:16 pm
content: Quote from: Faranight on August 22, 2023, 09:44:40 amThe bipolar transistor works with lower base drive voltages, and is likely less expensive.