# Designing a MOSFET circuit for low pass filtered PWM operation and with saftey considerations

I am designing a circuit at the moment and, as part of that, I need to be able to run 4 12VDC fans (which i will run in parallel) with an operating current of 150mA and a starting voltage of 4.5V. My problem is that my supply rail is 24V.

At the moment I am thinking of using a 5V PWM signal from my microcontroller to control the gate voltage of a MOSFET. With a 50% duty cycle, I should achieve an average votage of 12V. However, PWM is noisy and it would be nice to be able to smooth the output voltage with a Low pass filter. It would be nice to put the filter between the micro and the MOSFET gate, I just have to make sure that the gate voltage is above the threshold voltage.

Here's my question: is something like this suitable? Also, how do I protect against anything that might go wrong? For example, if the fans short etc, I don't want to start a fire if the MOSFET is dissipating high amounts power.

Here's my thought process for choosing the MOSFET

• $V_{GS(th)}$ = $0.67 V$ which is greater than the expected 'off' voltage from my PWM pin
• $V_{GS(max)}$ is $8V$ which is less than my $5V$ max PWM output
• Max continuous drain current is $6.3A$ which is greater than my 4 fans ( $4 \cdot 0.15 = 0.6A$)
• With $V_{GS}$ at 2.5V (5V at 50% duty) I can supply over 20A. I don't understand this bit because the datasheet says a max Drain current of 20A pulsed. I guess that I can only do this for a very short amount of time?)
• Max $V_{DS}$ is 30V, greater than my 24V
• $R_{DS(on)}$ is typically 0.038Ohms at 4.5V gate voltage. At ($4\cdot 150mA =$) 600mA power dissipation is 22.8mW which I guess is low enough.

Here's my Schematic. What can I do to improve it and/or protect against anything that might go wrong?

• You have defeated the object of using PWM by filtering it before the mosfet - the mosfet will get warm and your fan voltage will be unpredictable. Commented Jul 16, 2013 at 9:49
• "PWM is noisy" - not necessarily, with good decoupling and board layout. Have you measured the noisiness? Commented Jul 16, 2013 at 10:32
• Are you sure that your fans can be driven by PWM? Many 12V fans have BLDC motors, and driving them with PWM will just confuse the controller, not control the speed. Commented Jul 16, 2013 at 12:34
• Or, maybe you know this, and your intent was to not pulse the voltage to the fans, but rather burn up the excess voltage in Q2? Commented Jul 16, 2013 at 12:39
• Hi @PhilFrost, my intent was to use the capacitor so that the the output voltage would be smooth, well smoother than PWM anyway, I just thought I could do it on the gate side. The fans I'm using are from Sunon and use a maglev motor . This guy says that I can't use PWM with the maglev fans but he says that a cap between the terminals works (sometimes). I guess I'll have to look at smoothing on the high voltage side, I'd say it'll have a bit of ripple however, will this case issues? Commented Jul 24, 2013 at 7:27

As Andy correctly points out (+1) you are driving the MOSFET into a power dissipating region by adding the filter and its getting warm. The Capacitor C1 is holding the voltage long after the pulse has turned off and will discharge (slowly) through R1 and R12.

To make the MOSFET switch OFF quickly you need to discharge the gate-source capacitor. A much lower resistance for R12 is required. Also the 10k input resistance (R1) will charge the gate capacitor more slowly - as the gate is essentially a small capacitive load you need a small resistor.

24V supply, 12V fans:

If the fans are all the same type you could drive them in series/parallel so that they only see 12V each. This will also reduce the maximum amount of current the MOSFET needs to handle.

Now you can run your PWM speed control up to 100% without worrying about exceeding the voltage/current on the fans (or if you just want to run at full speed/turn off just use a digital I/O line)

Overcurrent protection:

Simplest way is to put a fuse in series.

• I know what you mean, but I think "linear region" is a confusing choice of words here. Commented Jul 16, 2013 at 14:52
• @PhilFrost ok - will edit that out Commented Jul 16, 2013 at 17:11
• Hi Jim, thanks for the help. Part of my idea was to smooth the Gate voltage so the output voltage would also be smooth. I guess I'll try placing a smoothing cap on the drain (apparently the fans I have don't run with PWM). Do you know of some other safety circuits (or resources where i could read about some) that don't use a fuse on the PCB? It'd be nice if I didn't have to open my box to change it. I have a fuse by the input power. Would something similar to the circuit here work with my set up? Commented Jul 24, 2013 at 7:36
• Sir, can you help me with this question electronics.stackexchange.com/q/313330/115973 Commented Jun 30, 2017 at 12:16

I would find another solution because your system is not fail safe. Never rely on software for the integrity of your hardware. If your MCU crashes, or stops for whatever reason, your system may stop with the MOSFET always on. That could destroy your fans. I would add an over-voltage protection at the output of your system that switch off the MOSFET in case of over-voltage or triggers a crowbar & fuse or whatever.

• Why would the MOSFET will be always ON? Because of the charge stored in the capacitor at gate, C1? Commented Jul 16, 2013 at 13:00
• If your MCU crashes, it could be be that it's when the IO that drives the MOSFET is high. Such a crash or a bug in software can stop the timer that drives the PWM as well. Thus your MOSFET is stuck in a always conducting state. But that's not an issue if your hardware system is designed to sustain such a condition. Commented Jul 16, 2013 at 13:08
• Oh, I see. Could you add some information to your answer so that you will show some methods of sustaining such condition? Commented Jul 16, 2013 at 14:18

Use a push pull stage with a PMOS and an NMOS. In theory you can connect both gates together and drive them with the same pwm signal. In practice you probably want to use an MCU with complementary pwm support so you can control the timing.