I just tried to control a F12 PWM by PWM. I tried a Nano and an ESP32.
The wiring was:
of fan to + of 12V DC power supply
of fan to GND of 12V DC power supply
GND of controller to GND of 12V DC power supply
PWM pin of controller to PWM pin of fan
I powered the controller via USB from my MacBook and the fan via a 12V DC power supply.
I also tried replacing the fans power supply by using my cars cigarette lighter.
The code ended up very simple after I ran in the same problem after a lot of trying and minimizing the code:
const int pwmPin = 5;
void setup() {
pinMode(pwmPin, OUTPUT);
digitalWrite(pwmPin, LOW);
}
void loop(){
digitalWrite(pwmPin, LOW);
delay(2000); // even with this delay the error keeps occurring
}
But even with this simple code the fan repeatedly turns on for like half a second and turned off again for about 3 seconds.
Even after I removed the power of the Arduino this problem keeps on occurring.
Does someone have an idea what the problem could be?
Hi,
Can you post a circuit diagram please?
Have you got the specs for the fan, it should tell you what frequency the PWM signal should be?
Tom..
PS, As most of the forum members are located all overt the world, 24hours to wait for an answer can at times be typical.
What is a "Arctic F12 PWM PST" ??????
A better worded subject might have helped.
If this is only issued by the frequency, why is the problem still occuring when I remove the power supply for my Arduino? Actually there shouldn't be any PWM signal, right?
And controlling the speed with analogWrite(pin, dutyCycle) works properly, only dutyCycle=0 is problematic.
alve89:
Does someone have an idea what the problem could be?
This is not a problem, but a feature.
Computer fans are supposed to run all the time.
The intelligence inside the fan tries to re-start the fan when it's not running.
Less than 20% PWM is AFAIK not specified in the original Intel 4-pin fan specification.
If you want the fan to stop, then use a 'dumb' 3-pin fan, or use a 4-pin fan that is specified to stop. Some Noctua document, page7.
Leo..
In another thread of this forum I read I should GND the emitter. So I did as seen in the attached circuit.
When I don't plugin the PWM wire (green, from D5), the transistor properly toggles the fan on / off. But when I plug it in, the transistor is constantly "switched on". I don't see what I'm doing wrong here... do you have an idea?