1
\$\begingroup\$

I'm not sure if that title explains it well enough, but I have a 12V PWM PC fan which I want to drive using a 5V PIC.

The fan has 4 pins, GND, +12V, PWM and TACH. The TACH is a speed sense pulse from a Hall effect sensor, and I won't be using that.

The PWM is pulled up internally in the fan so that it will run at full speed if that pin is not connected (e.g. for motherboards that only support 3-pin fans). Therefore, to control the speed, I need to drive the fan's PWM pin from the PWM output of the PIC.

When testing with a couple of spare fans, I just applied +12V to get the fan running at full speed and then measured the voltage between the fan's PWM pin and GND. On some fans, it seems to be pulled up internally to 3.3V but on the fan I want to use, it's pulled up to 12V. (So I'm glad I measured it rather than assuming they were all the same).

According to the specifications I've found, the fan's PWM should not source more than 5mA (I measured it at only 0.68mA) but having said that the spec also says that the PWM should be pulled up to a maximum of 5.25V within the fan and I measured 12V. The fan manufacturer gives minimal information.

Can I just drive the gate of a MOSFET directly from the PIC's PWM output and connect the drain to the fan's PWM and source to common ground? Is that the "right" way to do it? Is it appropriate to use a MOSFET rather than a BJT? (I'm thinking of 2N7000, just because I have some handy).

\$\endgroup\$
  • \$\begingroup\$ How about a data sheet for the fan? If you don't have one you can speculate but that's not really an accurate answer. \$\endgroup\$ – Andy aka May 31 '15 at 15:51
  • \$\begingroup\$ @Andyaka I would if I could, but the link I gave to the fan manufacturer's site is all that I can find (that's partly why I'm measuring everything). There are some nice charts showing that you can drive it all at 5V but the speed obviously drops and that's not good enough. \$\endgroup\$ – Roger Rowland May 31 '15 at 15:53
1
\$\begingroup\$

You can easily use a MOSFET if the Fan specifies a weak internal pull-up and a 2N7000 fits a 12V low current application.

Whether you should worry about the fan supplying more than officially specified, is another thing. If you have shorted the pin to ground for your measurement and 0.68mA came out, that's so incredibly well within the reach of a 2N7000 that you shouldn't worry about the FET too much. You're welcome to worry about the Fan itself, if that helps you in any way, but a quick test with an arbitrary PWM signal will show if it is broken, or just built different to (EDIT:) the official prescribed spec.

All in all, I say, go for it. If you are really doubtful, you can limit some FET damage by adding a resistor in the drain path, like so:

schematic

simulate this circuit – Schematic created using CircuitLab

The 2N7000 has an absolute worst case drain-source resistance of 13.5Ohm (the one Fairchild makes, at least) and I expect in your use-case that it will not exceed 3Ohm even when hot.

(EDIT2:

Sunday made my maths go wobbly, changed the voltage drop and the conclusion to it in the following block:)

So at the very worst the resistor and the FET will share the risk, normally the resistor will catch the brunt of it. At 5mA maximum the resistor will only waste 0.05V, which is negligible, you can even increase it to 20 or 30 ohm and it should still be interpreted as low. In the worst kind of failure (PWM shorted to 12V in the fan) the 10Ohm will effectively limit the current through the FET to about 1A (if the FET also is at least 2 ohm then), which is an acceptable very short-term limit. 30Ohm would probably keep the FET fully safe until the resistor itself burns through.

9999 out of 10000 times the resistor is completely redundant and pointless. But it is an option if it helps you sleep better (2 cents for good sleep, I call a steal)

\$\endgroup\$
  • \$\begingroup\$ Thanks, I have plenty of spare FETs if anything goes wrong and I'm comfortable that the fan isn't broken (it's brand new) - I've also found other people reporting that it's pulled up to 12V so maybe the spec has changed (the version I linked is dated 2005). This is a one-off hobby project so I'll probably learn more if it goes wrong! Oh, and I sleep badly anyway so I'd pay more than 2 cents for some zzz's. \$\endgroup\$ – Roger Rowland May 31 '15 at 16:02
  • 1
    \$\begingroup\$ @RogerRowland: I made Edit2 after you looked/thanked, it's a mathematical and conclusion correction. Other than that, I don't think the spec changed, I think the Fan manufacturer decided they didn't want to create an on board 5V and thought "screw it, we'll get away with it if our pull-up resistor is large enough" \$\endgroup\$ – Asmyldof May 31 '15 at 16:04

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.