4 pin PC PWM fan not behaving as expected.

Hi,

I realise theres a lot of threads about this but I cant seem to find anything that fixes this. **Im trying to control the speed of my 4-pin Intel stock fan by means of the PWM signal.**

Diagram:

Code:

#include <PWM.h>


#define fanPWM 9

const int32_t frequency = 250000; //frequency (in Hz)


void setup() {
  Serial.begin(9600); // serial monitor

  // Initializing Pins
  pinMode(fanPWM, OUTPUT);


  // Adjusting PWM frequency for Fan pins
  InitTimersSafe();
  if(SetPinFrequencySafe(fanPWM, frequency)){
    Serial.println("success");
  } else{
    Serial.println("failed");
  }

  analogWrite(fanPWM, 255);

}

void loop() {

}

My approach is as follows,

  • Change the PWM frequency to 25kHz by using the PWM library.
  • Provide a 0 PWM value to give a 0% duty cycle meaning the fan should switch off. Provide a 255 PWM value to give a 100% duty cycle mean the fan should be at max RPM.

The problem that I am having is that the fan doesnt seem to respond well to the analogWrite PWM values. For example if I give a 255 analogWrite the RPM goes quite low but with a value of 0, it goes faster but still nowhere near its max RPM capabilities. Anything in between doesnt seem to be scaling at all. Its almost as if it has two states, one super low and one low. I cannot figure out why this is happening? Perhaps Intel has some sort of IC built into this making it a smart fan?

FShiwani:
Perhaps Intel has some sort of IC built into this making it a smart fan?

The 'smart fan' part is correct. Only a 3-pin fan needs external mosfet control.

Remove the fet.
Connect the PWM pin from the Arduino directly to the PWM pin of the fan.
Leo..

Wawa:
The 'smart fan' part is correct. Only a 3-pin fan needs external mosfet control.

Remove the fet.
Connect the PWM pin from the Arduino directly to the PWM pin of the fan.
Leo..

Just tried that. Its working slightly better. If I set a PWM value of 0, the fan goes super quiet but still doesnt turn off. A PWM value of 10 and its the exact same as 0. A PWM value of 20 and it definitely increases in speed. And a PWM value of anything from 30-255 is slightly louder but definitely not at max. A value of 30 and 255 sounds the exact same. Not sure whats happening. I don`t have an oscilloscope to check the PWM signal with.

I know the PWM frequency change worked fine because the code outputs a success.

try this one, check behavior of the LED then use ledPin = 3 to control your motor

http://www.arduino-tutorials.com/arduino-pwm/

The 4-pin fans I tried work fine with Arduino’s default PWM fequency (use pin 5 or 6).
Try that first, before you use Intel’s recommended 25kHz.

4-pin fans are designed to spin faster at bootup before slowing down,
and they don’t turn off with 0 PWM.
Leo…

Wawa:
Plugging your own webshop without adding useful information is not very helpful, and is a quick way to get banned from the forum.
Leo..

Not to mention I only found 1 fan returned from a search.. (and it wasnt a 4 wire fan)..

Spamming your site URL and nothing more. (not even related to the topic/question at hand)

(sigh)

The fan specification makes 30% RPM the minimum under PWM control. To get to zero, you must turn off the 12V power.

You should have no problem with 100% RPM however. That is a problem to be solved.

I just tried it with some older Intel 4 pin fans from the Core 2 Duo era, at a PWM value of around 20(not 20%) or higher they spin to max RPM but anything lower than that and it goes quite low. Using any value from 20 to 255 gives the same RPM.

Same results with using default frequency.