PWM of 12v Fan using TIP120?

Hello, still new and looking to understand something a bit better. I am interested in fan speed control utilizing the PWM pins of the Arduino. I have poured through the forums and found a few different ways of doing this.

I have seen some fans with a 3rd PWM wire connected directly to the Arduino (as well as a 12v power source) and other diagrams utilize a darlington TIP120 (again in addition to the power source) connected to the Arduino to modulate fan speed. Is there an advantage to one method over the other or is this simply a different layout if your particular fan does not have a speed control wire?

Thank you!

Computer fans have either 2, 3, or 4 wires.

2 wire ones just spin.

3 wire ones have an extra wire carrying a speed measurement (I suspect this is logic level, or open drain, or something like that, pulsing once per revolution)

4 wire ones add a PWM speed control line, which can be controlled with logic level signal. These are marked as PWM speed control fans.

PWM speed control fans are of course the most desirable, having no external components needed to change speed. These require no external components other than the power supply. Just connect the grounds, and PWM the signal pin.

You can also PWM the normal ones using an external transistor, though I'd expect it to break their speed readout, and you need a flyback diode (if it's not integrated - it may be), and I don't expect the PWM duty cycle vs fan speed curve to be linear.

The TIP120 is an acceptable transistor, but it's a darlington BJT, which is kind of old hat. Modern MOSFETs perform much better, with less switching loss and on-state voltage drop.

NPN BJT vs N-Channel mosfet wiring as switch, simplest case. BJT vs FET Emitter / Source goes to ground. Collector / Drain goes to negative side of load. Base / Gate controls it.

On BJT, the base is connected to the arduino pin through a resistor (to limit the base current, while providing enough current to saturate the transistor)

On FET, the gate is connected to the Arduino pin directly, and the gate is also connected to ground through 10k, to keep the gate at ground when the input is tristated.

Horribly long link - any of these MOSFETs will work, and are in easy to use TO220 package.

http://www.digikey.com/product-search/en?pv7=62&pv7=3&pv7=197&pv7=2&pv7=6&pv606=19&pv606=22&pv959=5&pv959=7&pv959=8&pv959=9&pv959=10&pv959=11&pv959=13&pv959=14&pv959=12&pv959=18&pv959=15&pv607=3&pv607=112&pv607=21&pv607=4&pv607=22&pv607=5&pv607=77&pv607=91&pv607=6&pv607=23&pv607=85&pv607=7&pv607=25&pv607=26&pv607=27&pv607=28&pv607=8&pv607=86&pv607=29&pv607=9&pv607=92&pv607=30&pv607=31&pv607=32&pv607=33&pv607=34&pv607=35&pv607=36&pv607=120&pv607=37&pv607=39&pv607=124&pv607=41&pv607=42&pv607=103&pv607=99&pv607=87&pv607=43&pv69=80&pv1291=42&pv1291=31&pv1291=1967&pv1291=2813&pv1291=6141&pv1291=1555&pv1291=872&pv1291=81&pv1291=602&pv1291=2399&pv1291=2586&pv1291=146&pv1291=7591&pv1291=7589&pv1291=3008&pv1291=1543&pv1291=791&pv1291=346&pv1291=78&pv1291=3009&pv1291=1509&pv1291=2322&pv1291=1519&pv1291=1544&FV=fff40015%2Cfff8007d&mnonly=0&newproducts=0&ColumnSort=0&page=1&stock=1&quantity=0&ptm=0&fid=0&pageSize=500

+1 Some extra tips. 4-pin fans (with inbuild electronics), also known as CPU fans, need a 25Khz PWM signal. Not just because it's above human hearing. If you use a 2- or 3pin fan with external mosfet/transistor, you should use a ~30herz switching frequency. Just below the human hearing. Using the Arduino's ~500hz default PWM could make your fan "sing" at low RPM. 4-pin fans, controlled with 25Khz are potentially less noisy. They don't "knock", like 30hz controllers do, at low speeds. Leo..

Thank you both very much for your replies. It does seem like the MOSFET is a route I should be going. I did a bit of digging and found a few diagrams. I think that the MOSFET's support for a larger current is something I will require, but had not previously considered. If I use the MOSFET in a configuration with an external 12v power supply to the component the MOSFET is controlling am I correct in my understanding that the power supplied from the Arduino itself to the MOSFET via the PWM pin is minimal? I ask because I will require more PWM pins than are available, i have seen breakout boards and shields that are designed to increase the number of PWM pins for LED configurations but I require more PWM pins to control more MOSFET's. Would these still be an acceptable option?

Mosfets require NO drive power when "on" or "off". They only use power when switching. When their gate capacitance has to be charged/discharged. Wise to have a 220ohm between Arduino pin and Mosfet gate. Also wise to have a 100k resistor from gate to ground in case the Arduino is still tristating e.g. during bootup. Only "logic" Mosfets can be used. How many fans do you need. The Mega has 15 PWM outputs. You can expand that with e.g. this to ~1000 fans. Leo..