Weird behavior of P-channel MOSFET driven by Arduino - Page 1
Forum section: electronics / beginners

author: czbaterka
author_rank: Contributor
timestamp: March 21, 2025, 10:14:54 pm
content: I was tinkering with P-channel MOSFET for a first time as my ultimate goal is to build buck converter and learn as I go.I got into issue that I dont understand and I hope someone here can help me understand it.I am trying to drive the IRF9540N using BC337 (also tried BC546), which I drive by PWM signal from Arduino's GPIO.But for some reason, I am getting very weird results on my oscilloscope. Mainly, I see the MOSFET switching slowly and recovering even slower. This means that I can switch only at most of ~5kHz and everything above just slowly stops opening the MOSFET.1) ~5.3kHz, Blue is voltage on drain, yellow is arduino's gpio output2) Same as 1), but yellow is MOSFET's gate voltage3) Same as 1), but at 10kHz4) Same as 2), but at 10kHzDoes anyone know whats hapenning? It seems that the MOSFET's gate is "eating" and "smoothing" the amplified PWM and is not able to pull up/down enough to switch the MOSFET.Is this caused by the parasitic capacitance of the MOSFET?PS: If anyone wonders why I have additional 10kOhm resistor between MOSFET Gate and BJT collector, it is because I do not want to exceed the MOSFET's max Vgs which is around +-20V and the 1/2 division should be safe and enough for saturation.

author: Ian.M
author_rank: Super Contributor
timestamp: March 21, 2025, 10:47:19 pm
content: Yes, MOSFETs typically have a large gate charge which takes considerable current to drive into or out of the gate quickly. Specialist gate driver ICs transiently capable of Amps of drive current exist for a very good reason . . .However it is possible to build a fast level shifting gate driver circuit from discretes, its just a lot of work and rather power-hungry to even start to approach the performance of most gate driver ICs. I presented one possible approach (and explained it) here - there are others which may well be preferable for less demanding applications.https://www.eevblog.com/forum/projects/searching-a-high-side-driver-ic-for-a-p-channel-mosfet-do-you-know-any/Keywords to google for deeper understanding:Miller plateau

author: thm_w
author_rank: Super Contributor
timestamp: March 22, 2025, 12:06:06 am
content: You can try replacing R2 with a ~10V zener.Then reducing R1 and R3.See what either of those get you.

author: WillTurner
author_rank: Regular Contributor
timestamp: March 22, 2025, 06:10:59 am
content: Quote from: thm_w on March 22, 2025, 12:06:06 amI think @thm_w means R1.Yes, put a zener in the top leg of the circuit. Remember that everything is inverted for your P-Channel device, so to turn it on, you need to pull it up to your 24V rail. However, if you go in the other direction, you might easily exceed the gate threshold, shortening the life of your device.

author: amyk
author_rank: Super Contributor
timestamp: March 22, 2025, 06:55:49 am
content: That part has up to 61nC of gate charge.

author: BillyO
author_rank: Super Contributor
timestamp: March 22, 2025, 07:23:58 pm
content: Quote from: WillTurner on March 22, 2025, 06:10:59 amNo, R2 is the one. That will limit gate voltage to -14V. If you replace R1 the gate will be floating when the transistor is off. You need to pull itdownto turn it on with a P-ch MOSFET.

author: Zero999
author_rank: Super Contributor
timestamp: March 22, 2025, 09:56:37 pm
content: The output of your driver needs to be push-pull to rapidly charge and discharge the gate.

author: BillyO
author_rank: Super Contributor
timestamp: March 22, 2025, 10:01:25 pm
content: Quote from: Zero999 on March 22, 2025, 09:56:37 pmThat would be best.

author: MarkT
author_rank: Frequent Contributor
timestamp: March 23, 2025, 09:47:14 am
content: You typically want to drive a switching MOSFET's gate with a low impedance source, think more like 10 to 50 ohms, not 10k, if you want crisp switching and low losses. MOSFETs are normally driven with a MOSFET driver chip, which provide this, as well as acting as gate-protection.However if you only switch occasionally, rather than at multi-kHz speeds, the existing circuit will be OK. Best to always have a zener across the gate/source to protect the gate, MOSFETs are so fragile without this.You'll find a lot of high-side gate driver chips are designed for n-channel devices rather than p-channel because n-channel have better performance - to do this they use a charge pump.