Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

PWM safe for PC fans?

Status
Not open for further replies.
Using a microcontroller to do PWM to a MOSFET driving a PC fan, I'm curious if this is considered the proper and safe way to do it?

If I want to drive the fan very slowly, can I safely do that in this manner? Will it damage the motor if it receives a pulse so infrequently that it is not enough to keep it running, or perhaps barely enough to keep it turning? In general, is this something I should not be doing?
 
PWM is fine for PC fans. Purpose built control chips use PWM. The only issue is that when you cut power to the fan it cuts power to the RPM signal so it can screw up speed reading. The chips I've used have used ways to get around this like checking RPM during 'on' periods.
 
PWM is fine for PC fans. Purpose built control chips use PWM. The only issue is that when you cut power to the fan it cuts power to the RPM signal so it can screw up speed reading. The chips I've used have used ways to get around this like checking RPM during 'on' periods.

Perhaps there is a library for measuring the speed in Arduino, even when doing PWM?
 
Perhaps there is a library for measuring the speed in Arduino, even when doing PWM?

Hello there,

The PWM should be high enough in frequency to be sure the fan does not keep starting and stopping repeatedly. Over time the bearings wear more unevenly if you dont.

The fan speed can be easily measured with a three wire fan, where one wire is the 'tachometer' output. It is just an open collector transistor that turns on and off one to four times per revolution.
You can also sense fan speed by looking at the current pulses to the fan, but that may be harder to do when also using PWM as you might have to filter the PWM first.

The Arduino sketch that measures RPM is not complicated. If all you are doing is measuring speed, just count the pulses over say 1 second, then multiply by 60, then divider by the number of pulses per revolution (usually 4). The result is then in RPM and you can send to an LCD display or use the IDE built in Serial Monitor.


For example start with this:
unsigned long ms, mss=0, count=0, RPM;

then in your in your void loop() something like this:
ms=millis();
count+=1; //count ticks from fan
if (ms>=mss) //if we have clocked 1 second real time then do another calculation and display it
{
RPM=count*60/4; //compute RPM from count
Serial.println(RPM); //display the RPM
count=0; //clear the count
mss=millis()+1000; //set next 1 second timing period
}
 
Last edited:
Using a microcontroller to do PWM to a MOSFET driving a PC fan, I'm curious if this is considered the proper and safe way to do it?

If I want to drive the fan very slowly, can I safely do that in this manner? Will it damage the motor if it receives a pulse so infrequently that it is not enough to keep it running, or perhaps barely enough to keep it turning? In general, is this something I should not be doing?
Hy halleffector,

This just answers your question and does not counter the information provided in the other posts.

No you will not damage the fan, so long as you do not exceed the voltage rating of the fan by more than about 25%.

Basically, there are two ways to damage any motor: over-temperature and over-voltage (gross simplification).

Over temperature changes the structure of the motor material: melts, burns, etc, and over voltage breaks down the insulation of the wire making up the field or armature. As a PC fan motor is brushless, it uses uses switching electronics which can also be damaged by over voltage.

There is a danger when switching a motor that the motor inductance will generate a damaging back EMF (voltage). To protect from this, simply use two catching (snubber) diodes (rectifier diodes). Take a motor being driven from 5V:
(1) Diode 1. Connect the anode to the output of the switching element and the cathode to the 5V supply line.
(2) Diode 2. Connect the cathode to the output of the switching element and the anode to the 0V supply line. As you are using a MOSFET this second diode will not be necessary because a MOSFET has a substantial Schotkky diode connected between its source and drain as a consequence of its fabrication process.

For a PC fan a 1Amp IN400x (x= any number) rectifier diode will be adequate.

Incidentally, if you would like to see the innards of a PC fan just peel the label off from the hub and remove the circlip and any washers. The fan assembly will then slide off the central shaft.

You can also quieten a noisy fan by lubricating the bearing (plain or ball bearing). First clean out the bearing with paraffin, lighter fluid, etc then lubricate with engine oil or, better still, lithium molly grease. And if you want to get really fancy you can add washers to remove any end float which also helps quieten a fan (if necessary file the washer to get a good engineering fit).

I had a Dell tower PC that was always a bit noisy, even from new and after three years it developed an annoying screech and the fan wasn't rotating at full speed. After the above treatment it was smooth and silent- better than when new.

spec
 
Last edited:
Hy halleffector,

No you will not damage the fan so long as you do not exceed the voltage rating of the fan by more than about 25%.

Basically, there are two ways to damage any motor: over temperature and over voltage (gross simplification).

Over temperature changes the structure of the motor material: melts, burns, etc, and over voltage breaks down the insulation of the wire making up the field or armature. As a PC fan motor is brushless it uses uses switching electronics which can also be damaged by over voltage.

There is a danger when switching a motor that a back EMF will be generated which will not only stress the insulation of the motor, but will also stress the switching element, MOSFET in your case. To protect from this simply use two catching diodes (rectifier diodes). Take a motor being driven from 5V:
(1) Diode 1. Connect the anode to the output of the switching element and the cathode to the 5V supply line.
(2) Diode 2. Connect the cathode to the output of the switching element and the anode to the OV supply line. As you are using a MOSFET this second diode will not be necessary because a MOSFET has a substantial Schotkky diode connected between its source and drain as a consequence of its fabrication process.

spec


Hi there spec,

Note in my post i included a note about the bearing wear with low frequency pulses. The jerking of the motor causes the bearing to wear in specific locations. How much this affects the lower power fans could be less than the higher power fans, but i have a 120mm computer 'case' fan here that takes 3 amps :)

If you like you could take a look at the code in that post and see if it seems to work out ok. That particular code is not tested but looks simple, but sometimes the simpler stuff is harder to do :)
The code is for measuring and displaying the RPM of the fan.
 
You'll need ti give the fan a 'shove' at start up to get it going then slow it down.
 
There is kind of a "standard" that most fan drivers seem to follow with a minimum speed fixed.

I posted about it somewhere. When coming back home I will try to retrieve that, if you do not find it before.
 
I'm no expert on this, however you can get 'quiet' fans that run slower, one of these might be more suitable for low speed.
Quiet fans sometimes have reverse profile blades so you wont be able to get much more airflow out of them than they were designed for.
 
The fan speed can be easily measured with a three wire fan, where one wire is the 'tachometer' output. It is just an open collector transistor that turns on and off one to four times per revolution.

That doesn't work with PWM and 3 wire fans, Once the power is cut to the fan by the PWM the tach wire disables and gives a false signal.

Pommie has a good suggestion. Haven't worked with PC fans in a while, but the 4 wire fans are made specifically to counter this. They have one always on power wire that allows the tach to not give false signals when the PWM is triggered.
 
Hello there,

The fan speed can be easily measured with a three wire fan, where one wire is the 'tachometer' output. It is just an open collector transistor that turns on and off one to four times per revolution.
You can also sense fan speed by looking at the current pulses to the fan, but that may be harder to do when also using PWM as you might have to filter the PWM first.

That doesn't work with PWM and 3 wire fans, Once the power is cut to the fan by the PWM the tach wire disables and gives a false signal.

Pommie has a good suggestion. Haven't worked with PC fans in a while, but the 4 wire fans are made specifically to counter this. They have one always on power wire that allows the tach to not give false signals when the PWM is triggered.


Hello,

Thanks for the informative reply. I was trying to suggest that sometimes the PWM needs filtering so i quoted that whole section here.
PWM filtering reduces jerks to the motor also, which could help with bearing life.
 
Airflow vs. speed is very non-linear, and increases/decreases rapidly.

I remember seeing somewhere that at 50% of rotation speed the airflow has dropped to about 1/6 of rated volume. So you don't want to go slower than that. You won't be pushing any air at all.
 
You'll need ti give the fan a 'shove' at start up to get it going then slow it down.

This is an important point.

Any mechanical device needs more power to get it moving than to keep it moving. This is because of two factors:
(1) Inertia. The weight of the moving assembly
(2) Sticktion. Rather like surface tension which need s to be broken.

Temperature controlled fans often start and run at full speed for a few seconds and then revert to temperature control. This is to overcome inertia and sticktion as mentioned but also to blow away any debris (dust and fluff). Our plasma TV does this when first turned on. On low temperature equipment the initial high speed rotation also warms the lubricant.

spec
 
Here are the fan dependencies: https://en.wikipedia.org/wiki/Affinity_laws

I think that the airflow for a given fan is directly proportional to rotational speed.

This has been my experience too.

Losses are proportional to rotational speed raised to some power- I can't remember which power though.

Fan speed in basically limited by the propagation speed (molecule mobility) in its medium. In air it is the speed of sound. In water a propeller is limited by cavatation.

spec
 
Spec
you are correct, I was confusing pressure with flow.

"Fan speed in basically limited by the propagation speed (molecule mobility) in its medium. In air it is the speed of sound."

After the end of WW2, airplane design had reached the point where the propeller's tip was already reaching the speed of sound.
The Republic XF-84H "Thunderscreech" was one of such aircraft, and the noise from the propeller was such, was powerful enough to knock a person down.
 
Last edited:
Spec
you are correct, I was confusing pressure with flow.

"Fan speed in basically limited by the propagation speed (molecule mobility) in its medium. In air it is the speed of sound."

After the end of WW2, airplane design had reached the point where the propeller's tip was already reaching the speed of sound.
The Republic XF-84H "Thunderscreech" was one of such aircraft, and the noise from the propeller was such, was powerful enough to knock a person down.

Yeah, the pressure and flow thing was getting me confused too. It was the limitations of the prop, among other things, that speeded the demise of piston power. Funnily enough, the compressor on a jet engine is only a multibladed prop stuck in a case, and the new high efficiency high bypass jet engines get most of their thrust from the front fan.

If you want to hear a prop tip breaking the sound barrier, just listen to a helicopter rotor. :happy:

spec
 
Hi,

There's a rough relationship between RPM and voltage too, between about 1/2 speed and full speed. It's roughly linear, but i've only been able to test three fans so far.

I'll also be testing my 'monster' fan which is 12v at 3 amps (36 watts) to see how that fairs.

Many of the larger fans like 250mm turn much slower, like 600 to 800 RPM, while the 120mm turn at around 1500 to 2000 RPM, except the high powered ones which can go 4000RPM and ive see some that go to 6000 RPM.
 
Years ago I played around with the whole fan speed control concepts and 3 wire fans with the tachometer out. I ran into a small caveat. When using PWM to control fan speed with a 3 wire fan the tachometer out will bounce around. Typically with 12 VDC applied (no PWM) most small PC type fans output 2 pulses per revolution. The problem or caveat when we use PWM is the fan power is being turned on and off at the PWM rate. The fan is only powered when a voltage is present on the power pin. When the PWM is at zero volts the tachometer out is also at zero volts. It looks a little like this:

Tach%20Signal.gif


Would this need to be considered?

Ron
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top