Arduino Mega, Nidec UltraFlo Fan, 4 Wires

Hello,
im trying to run this fan " NIDEC W12E12BS11B5-57 12VDC 1.65A 4pin PWM "
but cannot get it to work.

Here is the code

const int pwmPin = 9;  // PWM control pin connected to the fan's control wire (Blue)

void setup() {

  // Set the PWM pin as output
  pinMode(pwmPin, OUTPUT);

  // Turn the fan on
  analogWrite(pwmPin, 120);

}

void loop() {

}

the fan is not moving an inch, this is the smallest possible code to run a fan with 4 wires,
by using an external power source 12V DC, grounds connected with the arduino board, and the blue wire to control the speed over PWM.

Can anyone tell me if this is possible or not.
Thank you.

btw i cannot find any more informations about this product.

Post your project wiring schematic.

Hi, @ezyBot. As @ruilviana said it's good to provide us with your actual schematic instead of explaining it to us in words.

I guess you can't find data because if I understand correctly it's a PC fan. See specifications from Intel. According to their requirements, the PWM must operate at 25kHz with some variation in frequency being acceptable. You didn't say what Arduino you are using but on the UNO/Nano the frequency is 490 or 980 Hz depending on which pin you are using and maybe that's why the fan doesn't start. Try changing the PWM frequency of the Arduino to be as close as possible to the requirements.

https://www.intel.com/content/dam/support/us/en/documents/intel-nuc/intel-4wire-pwm-fans-specs.pdf

Thats a good point, i also tried to check the frequenzy of the PWM output.
By using this code:

volatile unsigned long lastInterruptTime = 0;
volatile unsigned long pulseWidth = 0;
volatile bool pulseReady = false;

const int pwmPin = 9;  // PWM output pin
const int measurementPin = 2;  // Pin for measuring PWM signal frequency

void setup() {
  Serial.begin(9600);
  
  pinMode(pwmPin, OUTPUT);
  pinMode(measurementPin, INPUT);
  
  // Generate a PWM signal with a 50% duty cycle
  analogWrite(pwmPin, 127);  // 50% duty cycle (127 out of 255)
  
  // Set up external interrupt on the measurement pin
  attachInterrupt(digitalPinToInterrupt(measurementPin), measurePulse, CHANGE);
}

void loop() {
  delay(1000);
  if (pulseReady) {
    pulseReady = false;
    
    // Calculate the frequency
    unsigned long frequency = 1000000UL / pulseWidth; // Frequency in Hz
    Serial.print("Frequency: ");
    Serial.print(frequency);
    Serial.println(" Hz");
  }
}

void measurePulse() {
  unsigned long currentTime = micros();
  
  if (pulseReady) {
    pulseWidth = currentTime - lastInterruptTime;
  }
  
  lastInterruptTime = currentTime;
  pulseReady = true;
}

result of the output is:

Frequency: 984 Hz
Frequency: 984 Hz
Frequency: 976 Hz
Frequency: 984 Hz
Frequency: 976 Hz
Frequency: 976 Hz
Frequency: 984 Hz
Frequency: 976 Hz
Frequency: 976 Hz
...

by increasing the PWM value to 250, the output is:

Frequency: 25000 Hz
...

by increasing the PWM value to 255, the output is:

Frequency: 4294967295 Hz
...

what is quite odd, in my opionion, but im also not really skilled with frequencies.

by running " analogWrite(pwmPin, 250); " i should have the frequency of 25.000 Hz (25khz)
but nothing is moving.

The second parameter to analogWrite() is duty cycle, not frequency.
As a simple test you can use the tone() function to produce a 25kHz signal at 50% duty cycle on any chosen pin.

It was a nice idea, and something i didnt know exist, but sadly it did not work.
I have the feeling these fans are just garbage.

const int pwmPin = 9;  // PWM output pin for fan control

void setup() {
  Serial.begin(9600);
  
  pinMode(pwmPin, OUTPUT);

  // Set up the PWM signal
  // analogWrite(pwmPin, 250);  // 50% duty cycle (127 out of 255)
  tone(pwmPin, 25000);  // 25 kHz frequency

}

void loop() {
  // You can add code here to change the duty cycle based on user input or other conditions
  
  delay(1000);  // Just a placeholder for your main loop
}

A faulty product is always a possibility, however, did you confirm with a meter that the red and black power wires to the fan are supplying 12 volts and that the polarity is correct. You are feeding the two power connector blocks with red wires which may have caused some confusion.

Here is some general information about 4 wire type fans: https://noctua.at/pub/media/wysiwyg/Noctua_PWM_specifications_white_paper.pdf

Yes i have a multimeter, and i also checked the voltage on the board of the fan. AND i also have more than 2 fans tested.

I also tripple checked every connection to the DC supply.

thank you for the info paper i will check it out.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.