Hi,
I'm super new and I would like to know if it is possible to use an Arduino Uno to control the speed of these fans.
To be sure that I'm not looking at this the wrong way, I will write here what I think I know, just in case someone spots a red flag, potential hazard or misunderstanding on my part.
They have 3 wires. If I understand correctly, the third wire is not for control, but for measurement of the RPM.
They run on 12V, which means that I can't power them using the Arduino Uno itself, I will need an external power supply.
Now from what I read, the speed of these types of fans can be controlled using either voltage control (supplying less than 12V) or using PWM (turning it on and off quickly or slowly). Am I correct here?
Now for the PWM method, I have started reading about Mosfets and transistors and would like to try testing, but I'm not sure I understand which one and what model to get. This forum post seems to suggest that I could use a bipolar junction transistor like this BC337 guy, which is an NPN BJT rated at 50V and 800mA.
Should I get that transistor or is there other simpler ways? Is this model of
Thanks in advance
The easiest way is the NPN BJT transistor.
Your research is correct. Here's how you wire it:

Some notes:
- The NPN transistors emmiter has to be connected to GND, this is called "low side" switching. "high side" switching is when you connect a PNP to the power source and your load is connected to GND.
- The diode is called a flyback diode and is used to prevent the fan rotation from creating an opposite current and damaging your circuit.
- The base resistor is mandatory and prevents your transistor from shorting. 1k Ohm is a good value.
Connect the "Fan control" point specified in the diagram to an arduino pin, apply analogWrite() on that pin and watch your fan speed change.
More notes:
- Only certain Arduino pins have pwm functionality.
- When you control your fan speed you'll realize it is making an annoying noise, that's because the pwm is making it oscillate and create sound. To eliminate this noise increase the pwm frequency to above 20kHz which is above human hearing range.
Thanks a lot for your answer, this helps me a lot.
I went and read a bit about flyback diode on wikipedia, and now I see that it's purpose is to make sure that the current only flows one way. For the purpose of confirming that I understand correctly, and for future reference if someone else stumbles on this thread, here is what I learned. A fan, because it works with a coil of wire to produce the magnetic field, is an inductive load, and these need a diode to stop the spikes of current running the other way.
But I don't know which one to get/use. Does it matter, or can I just use any? I have this IN5819 Schottky diode at home but I don't exactly know what it does. Can I use that?
knotanumber:
I don't know which one to get/use. Does it matter, or can I just use any? I have this IN5819 Schottky diode at home but I don't exactly know what it does. Can I use that?
Yes that will do. It doesn't really matter what kind of diode you use, all it's supposed to do is to not let the current flow in the wrong direction and all diodes do that. If your motor is bigger it will produce more current and will need diodes that can handle that kind of surge current. With your 12v DC fan that shouldn't be a problem. The one you linked can handle up to 25A of surge current. That's plenty for this application.
It's working!
Took me some time to realize that both the GND of the Arduino and the GND of the 12V PSU had to be connected.
pourduino:
More notes:
[...]
- When you control your fan speed you'll realize it is making an annoying noise, that's because the pwm is making it oscillate and create sound. To eliminate this noise increase the pwm frequency to above 20kHz which is above human hearing range.
What do you mean when you say to increase the PWM frequency to above 20kHz? From what I see on the Arduino documentation, it seems that the pins cannot go over 980 Hz. What am I missing?
Thanks again
Ok nevermind my last reply I ended up finding my answer for that and it's super cool:
If someone gets here with the same questions as me, here is how you modify the frequencies of the internal timers of an Arduino!
I'm happy you were able to get it to work.
Sorry for my late answers, this forum doesn't even notify you when you're quoted. I actually had to search my browser history to find this thread to check it up.