I'm trying to create an Windsim setup with een Arduino Uno and Two Noctua 12v fans. Based on this video / tutorial:
That tutorial shows this setup /pin layout.
I can't get that fans running, I tested the fans by testing them in my PC, and then the fans are running. The 12v power supply is 100% ok, I've tested that with a multimeter.
I tested the Arduino and the PWM ports, by using a LED and let them fade in and fade out. That works oke.
int ledPin = 11;
// Voer uit bij de start van programma
void setup() {
// Initialiseer digitale pin ledPin als een uitvoer
pinMode(ledPin, OUTPUT);
}
void loop()
{
// Fade in
for(int ledVal = 0; ledVal <= 255; ledVal +=1) {
analogWrite(ledPin, ledVal);
delay(15);
}
// Fade uit
for(int ledVal = 255; ledVal >= 0; ledVal -=1) {
analogWrite(ledPin, ledVal);
delay(15);
}
// Pauzeer voor 1 seconde
delay(1000);
}
After this I tried again with the Noctua fans. But the fans keep turned off. I used this script
int fan_control_pin = 9;
void setup()
{
pinMode( fan_control_pin, OUTPUT);
analogWrite(fan_control_pin, 0);
}
void loop()
{
// Just an example:
for(int pwm = 0; pwm <= 255; pwm +=51) {
analogWrite(fan_control_pin, pwm);
delay(5000);
}
After this I tried with a script for 25k Hz frequenty that's used by the Noctua fans. But still the same result, the fans stays off.
//PWM output @ 25 kHz, only on pins 9 and 10.
// Output value should be between 0 and 320, inclusive.
void analogWrite25k(int pin, int value)
{
switch (pin)
{
case 9:
OCR1A = value;
break;
case 10:
OCR1B = value;
break;
default: // no other pin will work
break;
}
}
void setup() // Configure Timer 1 for PWM @ 25 kHz.
{
TCCR1A = 0; // undo the configuration done by...
TCCR1B = 0; // ...the Arduino core library
TCNT1 = 0; // reset timer
TCCR1A = _BV(COM1A1) // non-inverted PWM on ch. A
| _BV(COM1B1) // same on ch; B
| _BV(WGM11); // mode 10: ph. correct PWM, TOP = ICR1
TCCR1B = _BV(WGM13) // ditto
| _BV(CS10); // prescaler = 1
ICR1 = 320; // TOP = 320
// Set the PWM pins as output.
pinMode( 9, OUTPUT);
pinMode(10, OUTPUT);
}
void loop()
{
// Just an example:
for(int ledVal = 0; ledVal <= 320; ledVal +=10) {
analogWrite25k(ledPin, ledVal);
delay(250);
}
// Fade uit
for(int ledVal = 320; ledVal >= 0; ledVal -=10) {
analogWrite25k(ledPin, ledVal);
delay(250);
}
for (;;) ; // infinite loop
}
Does anyone any idea what my problem could be?