12V PC fan voltage control

I fooled with an array (4) 120MM fans on a full H-Bridge motor controller (Pololu brand) and the PWM wouldn't work... Maybe I needed to set the PWM pulse speed lower (less than the 20kHz)? I don't know, but I'd just like a simple way to switch the supply voltage lines without having to rig up a bunch of relays or anything eccentric like that. Maybe a 5-pin relay or something? Mmm... The fans will always be on, so it's not like I need 12V, 5V and Off... They could always run at 12V and be switched to 5V when needed.

If I use a 5v relay with both N.O and N.C outputs, I can put a pot on one of the outputs... Any idea's for doing this solid state, such as a transistor or mosfet that has 2 separate outputs depending on control signal?

"The frequency of the PWM signal is approximately 490 Hz."

Maybe those 20KHz were actually too high...

That's my thoughts... Lower the PWM freq. or I might use a different way.

less than the 20kHz

Yes, like < 100hz.

If the PC fan really does have has a brushed motor, then you can just control it with PWM. However, all the PC fans I have come across use brushless motors, which don't work very well if you PWM the supply voltage.

You can buy PWM-controllable PC fans. They only cost a little more than regular PC fans. The specification says you should PWM them at 25KHz, which can be done using an Arduino, although most will probably work over a wider PWM frequency range than the spec says.

Thanks dc42, I know of those pwm-capable fans, but I'm prototyping and I already have a bunch of fans laying around from a previous project and I'm trying to not blow my budget with buying things I already have. Any thoughts on how I can just switch the voltage going to them? I'm using a PC power supply, so I'll have 5V and 12V readily available and it would be great if I could switch between 5v and 12v rather than doing a variable control.

** I thought brushed motors were more difficult to control through PWM than brushless... Maybe they are brushless then, I'm not sure. I just remember that I tried it before and they didn't slow down or respond to the PWM control through the motor controller at all.

Since the load is small a relay is probably sufficient... Can't understand why you keep running away from pwm though...

they didn't slow down or respond to the PWM control through the motor controller at all.

Brushless motors are easy to tell: if you rotate the blades effortlessly, they are brushless motors.

dhenry:

they didn't slow down or respond to the PWM control through the motor controller at all.

Brushless motors are easy to tell: if you rotate the blades effortlessly, they are brushless motors.

I have a pc fan that reads:
"DC brushless, model AD0612MS C70GL 12V 0,13A ADDA CORP."
but if I turn it when it's off I can feel "magnetic force hills" so to speak. Even if I give it a spin, it oscillates a little around a precise position just before totally stopping. Every 360° turn sees 4 distinct poisitions (4 poles ?).
I can control this fan with a transistor and an arduino pwm pin (i.e. standard analogWrite() call).
Is this "real" brushless or what ? I'm confused. Thanks for any hints!
(ps: I've looked for a datasheet but couldn't find nothing but endless part lists...)

but if I turn it when it's off I can feel "magnetic force hills" so to speak.

That's a brushless motor.

Then the fact that I could vary its speed with just an analogWrite() and a couple of transistors seems to contradict what dc42 said earlier... ?-|

tuxduino:
Then the fact that I could vary its speed with just an analogWrite() and a couple of transistors seems to contradict what dc42 said earlier... ?-|

How wide a speed range did you get? Come to think of it, I've heard of people PWMing brushless PC fans before. I remember they had problems with the tacho output.

This particular fan I have has only two wires: black and red.

The control range I had was quite narrow: IIRC from about 50% upward. At lower pwm values the fan would just "play a note" :wink:
Once started though, the lowest acceptable pwm value decreased. Start inertia, I guess.
If I have a minute I'll rewire the thing and note down the exact values.

Here's the sketch I wrote to control the fan. It's simply parsing integers from the serial line and analogwriting them directly to pin 6.

int cnt = 0;
char buf[100];
int pin = 6;

void setup() {
    Serial.begin(115200);
}


void loop() {
    if (Serial.available() > 0) {
        char ch = Serial.read();
        if (ch == 0x0D || ch == 0x0A) {
            if (cnt > 0) {
                buf[cnt] = 0;
                int value = atoi(buf);
                analogWrite(pin, value);
                Serial.println(value);
                cnt = 0;
            }
        }
        else {
            if (cnt < 100-1) {
                buf[cnt++] = ch;
            }
        }
    }
}

Pin 6 goes to a 1k resistor which goes into a bc237b base. bc237b collector to +5 and emitter to a 1k resistor, to bd135 base.
Fan red wire to +12v, black to bd135 collector. bd135 emitter to gnd.

When the fan is stopped, it only starts with values 120 and above.
When it's running, I can go to as low as 25 without it stopping.
When running under 150 I can clearly hear a sort of note.

When the fan is stopped, it only starts with values 120 and above.
When it's running, I can go to as low as 25 without it stopping.

That's perfectly normal.

I'll give Tuxedo's transistor setup a try... Should work. The PWM freq. from the Pololu motor controller was too high, that's why the fans didn't respond. PWM would actually be the preferred method so I can set different fan speeds for different temperatures.

** What radioshack friendly transistors could I use to setup a pwm circuit like the one Tuxedo mentions

Pin 6 goes to a 1k resistor which goes into a bc237b base. bc237b collector to +5 and emitter to a 1k resistor, to bd135 base. Fan red wire to +12v, black to bd135 collector. bd135 emitter to gnd.

?
Again, sorry for lacking so much electronics knowledge lol I knew more a few months ago when I was learning something new every day, but then I stopped working on Arduino projects for a few months and now I'm back to stupid.

                     5V                12V
                     |                  |
  +------------------+                  +-------Fan red wire
  |                  | 
  |                  |                  +-------Fan black wire
--+--+               |                  |
A    |     1k        C                  |
R  6 |---/\/\/----B     Q1   1k         C
D    |               E-----/\/\/-----B     Q2
U    |                                  E
I    |                                  |
N    |                                  |
O    |                                 GND
--+--+
  |
 GND

FAN = 12V 0,13A brushless PC-type fan
Q1 = BC237
Q2 = BD135, no headsink required

I hope some kind hw-sould will step in and correct any silliness I've written... :stuck_out_tongue:

Q1 in that circuit is redundant, because of the value you have chosen for the base resistor of Q2. You could just as well drive Q2 from the Arduino pin through a 1k base resistor. Although I would reduce the base resistor to about 470 ohms, to make sure that Q2 turns on fully.

dc42:
Q1 in that circuit is redundant, because of the value you have chosen for the base resistor of Q2. You could just as well drive Q2 from the Arduino pin through a 1k base resistor. Although I would reduce the base resistor to about 470 ohms, to make sure that Q2 turns on fully.

TBH that circuit comes from an experiment I made (too) many years ago... I was using the parallel port of 286 and writing to it with qbasic 50-or-so lines "program" :stuck_out_tongue_winking_eye:

I'll try your suggestion.

Thanks!