Pages: [1]   Go Down
Author Topic: Using PWM to control the speed of a computer fan = ok?  (Read 2269 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 18
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey everyone,

I've been messing with a 12v computer fan recently and need to control it's speed.
I'm currently using PWM from the Arduino with a transistor to gate the 12v line. It's working fine, but when I'm not in 100% duty cycle (sending 255 through the PWM port), the fan start to produce a high pitched noise, that gets higher as I slow down the fan. Why am I hearing that noise and should I be worried about it? Is it because I'm using PWM instead of a regulated voltage?

Thanks in advance,
Fergo.
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It would help if we had some idea which fan you were controlling (whether it is meant to be PWM'ed for instance), which transistor you are using (is it capable of switching as fast as the Arduino switches), and how the transistor, fan, and Arduino are wired.
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17259
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Here is a motor drive circuit for fans that are not happy using simple PWM switching.

http://ruggedcircuits.com/html/circuit__10.html
Logged

Humboldt, CA
Offline Offline
Full Member
***
Karma: 2
Posts: 223
Arduino BBB
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If it is a PWM fan, you'll need to change the Arduino's PWM frequency:  Very few fans are built to accept a ~500Hz PWM signal.  The standard for PC PWM fans is 25kHz!  ~30khz works fine too, and the Arduino can put that out.

If it is a non-PWM fan, that's a different setup altogether.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Some computer fans are brushless DC motor with internal drivers. It won't work properly if driven by PWM signal
Logged

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 597
Posts: 33296
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Many fans work by generating there own PWM current pulses. By giving it an external PWM you are in effect chopping of the voltage when it needs it. The result is that the two frequencies beat with one another to produce the noise you here.
Should you be worried about it? It depends on your application. The fan will not last as long in this mode but it is hard to say by how much.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 18
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the answers.

The fan is a cheap 12V DC computer case fan, like this one:


I've used PWM because I couldn't think of a cheap & easy way to output a controlled voltage varying from 0 to 12V using the Arduino, so I'm running a 12V line where the fan and the transistor are wired and I'm connecting pin 11 of the Arduino to the gate of the transistor, so I can have a 12V PWM signal. Here's the basic circuit:

Code:

                   +12V

                    |
                   .-.
                   | |
                   | |  Fan
                   '-'
                    |
  Pin 11 - PWM      |
                  |/
          o-------|
                  |>
                    |
                    |
                    |
                    |
                   ===
                   GND

Thanks
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Let's go back to the beginning. Why do you want to control the speed of the fan using PWM? What is the fan doing that requires varying the speed?
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 18
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Let's go back to the beginning. Why do you want to control the speed of the fan using PWM? What is the fan doing that requires varying the speed?

I don't want to control the fan speed using PWM, I want to control the fan speed (PWM was simply the easiest way I found to do it).

This is my prototype:

You can't hear the high pitched noise that I mentioned because I've added a piece of paper into it for demonstration purposes, as it would be hard to see the fan speed changing.
Logged

West palm beach, FL
Offline Offline
Sr. Member
****
Karma: 1
Posts: 325
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

its like the wind blows in his face as he goes faster!!
Logged

I could print the Arduino logo on a box of cereal and sell it as "Arduin-O's"

0
Offline Offline
Newbie
*
Karma: 0
Posts: 18
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

its like the wind blows in his face as he goes faster!!

Yeah, that's the idea smiley
I mostly use my Arduino for simracing gadgets. You can check the other videos on my channel for some other dashboard stuff etc.
Logged

Offline Offline
Jr. Member
**
Karma: 1
Posts: 95
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If the fan isn't designed for PWM control, you can always make a simple low pass filter to turn the PWM into a pseudo analoge output.
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
If the fan isn't designed for PWM control, you can always make a simple low pass filter to turn the PWM into a pseudo analoge output.
Presuming, of course, that the fan works at varying voltages.
Logged

Humboldt, CA
Offline Offline
Full Member
***
Karma: 2
Posts: 223
Arduino BBB
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That it should do, the most common computer fan controllers out there are simple resistors to act as a voltage drop, the vast majority of fans will run till at least 7v, most will run till 5v if already turning.  Starting takes more voltage though.

The low pass filter has to be able to smooth the voltage for a draw somewhere between .1 and 4 amps depending on the fan, if it's on the chunkier end of things that can be an issue.
Logged

Pages: [1]   Go Up
Jump to: