I want to dim an LED and have connected a P-channel MOSFET to switch the high side. I added a N-channel MOSFET as a driver. The schematic is attached below. I'm applying a PWM sine signal from an STM32.

Problem: If I measure the voltage on the drain of the N-channel SI2302 to ground, I see that the voltage is increasing from 0 to around 1.5 V and after that it's saturated at 5 V for the rest of the cycle until the duty cycle drops again. So instead of a nice oscillating sine curve from 0 to 5 V, I get a partial sine curve which is somehow clipped... The voltage between drain of the P-channel MOSFET and ground is always at 5 V except for a short drop to 0 V.

How do I prevent the circuit from saturating?

enter image description here


1 Answer 1


That 10 kΩ pull-up resistor (R29) is too high value for any somewhat high frequency switching.

A MOSFET has some gate capacitance, that must be charged/discharged for the device to switch on/off. Charging that capacitance takes some time, and with low enough drive capability, pretty long time.

With low PWM frequency and lower value of R29 you could possibly get away with driving the MOSFET like this. For less heat losses in the P-MOSFET and/or for higher PWM frequency, you should use proper push/pull driving for the gate of Q7.

  • \$\begingroup\$ Thanks a lot! You were right, decreasing the pullup to 1k and decreasing the PWM frequency to ~1kHz fixed the problem! Thanks also for the additional hint for higher frequencies, I'll keep that in mind for future projects. \$\endgroup\$
    – lazerlini
    Commented Jan 18, 2022 at 16:24
  • 1
    \$\begingroup\$ @lazerlini for a proper push-pull driver with a discrete components you can take a look at this Q: electronics.stackexchange.com/questions/281295/… or you can get a driver IC instead, which basically does the same. \$\endgroup\$
    – NStorm
    Commented Jan 18, 2022 at 17:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.