3
\$\begingroup\$

I am controlling a MOSFET and LED from the same PWM output from a PIC. The MOSFET is driving a fan, while the LED is used as rough visual indicator of the speed. The circuit is below and it seems to work and I have not experienced any problems yet. But, I am unsure if this is recommended.

enter image description here

Edit1:

Looking at the suggestions, I made the following changes.

  • added diode to fan
  • replaced R21 and with R22 and LED1

enter image description here

\$\endgroup\$
3
\$\begingroup\$

The MOSFET takes no significant current from the output pin and the 2k2 in series with the LED will not pull the voltage down. Q2 should be a digital type (turn on 5V). The 10K could be lowered to discharge the gate-source charge more quickly and I would add a (snubber) diode across the fan just in case of spikes when it is turned off.

It works!

\$\endgroup\$
3
  • 2
    \$\begingroup\$ R21 might as well be replaced with the LED and R22. Then you get faster turn-off and waste less current. \$\endgroup\$
    – Phil Frost
    Jul 6 '13 at 20:46
  • \$\begingroup\$ @PhilFrost Very true Phil - well spotted +1 \$\endgroup\$ Jul 6 '13 at 20:49
  • \$\begingroup\$ @PhilFrost I was going to recommend the same thing! \$\endgroup\$ Jul 6 '13 at 22:05
2
\$\begingroup\$

I'm sure your circuit will work fine but one problem you may get with driving a MOSFET from an MCU pin is not getting the rise times and fall times you think you should get. Imagine the MCU is driving the gate - the drain is conducting current to the source beautifully and all is well.

When the MCU pin tries to turn the FET off, because of the parasitic capacitance between drain and gate AND the inability of the MCU to drive "hard" gate voltages, the MOSFET may (will) take longer to turn off due to the rising voltage on the drain coupling to the gate and "defeating" the "demand" from the MCU pin.

I note that you have 10 ohms feeding the gate and this will exacerbate the effect on some high power MOSFETs. Because you didn't specify the MOSFET, you can't be sure that a PIC will be able to cleanly do the job.

Same argument for turning on the FET; the MCU drives high, the FET starts to turn on and couples back to the gate a falling edge due to the drain voltage falling.

Like I say, almost certainly it won't be a big issue for your circuit but it's worth checking on a scope and if it is giving a problem then maybe choose a FET with lower C(DG).

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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