Forum >Replies by neo888
userhead neo888
Replies (4)
  • You Reply:

    can you give me news? now it's working? I have the same problem

    Thanks

  • You Reply:

    I use arduinoIDE 2.3.3

  • You Reply:

    Hi, I found my problem : not the same ground between fan and esp32. now it's working good!

  • You Reply:

    Hi,

    thanks for your answer.But for the moment  it's not working (is the same with all digital pin D2/D9 and all). I don't see why! the mofset working good but normally, when pwm>30 fan must turn slowly, and it turn fast.

    for example : 

    #define fanChannel 0             

    #define fanResolution 8   

    #define fanFrequency 10000   

    #define fanPin 2                           //D9  

    int pwm = 0;

     

    void setup(){

    Serial.begin(921600);

    ledcSetup(fanChannel, fanFrequency, fanResolution);

    ledcAttachPin(fanPin, fanChannel);

       

    pinMode(12,OUTPUT);   // fan power with mofset on the pin12

    digitalWrite(12, LOW);

    }

     

    void loop(){

    digitalWrite(12, HIGH);

    for(pwm = 0; pwm <= 255; pwm++){  

    Serial.println(pwm);

     ledcWrite(fanChannel, pwm);

     delay(250);

      }

     

     digitalWrite(12, LOW);

     delay(5000);

    }

     

    I tested with 2 fans : noctua NF-A12x15pwm and NF-P14r redux-1500pwm