Alright so I wanted to make myself a Deskfan using Arduino and a potentiometer. The reason for using arduino is that I want to display the current temperatur and the fan speed either through rpm or with %. Currently it seems to work fine using the potentiometer to control the pwm. But either i'm just not believing that it works correctly or it really isn't. My only problem is that I think the fan is not outputting 100% of its power with the pwm signal. Maybe about a few % less. But I don't really know if there is something that I am missing or if it really is outputting 100%. The fan in question would be a Noctua NF-A14 5V PWM (+-1500 MAX).

Edit: Is it possible that I'm not using full 100% of the fan? If so what would I need to change if that were the case. I heard something about changing to 25khz pwm but yeah..

Here is my code without the lcd stuff.

void setup() {
  // put your setup code here, to run once:
  pinMode(9, OUTPUT);

void loop() {

  int potValue = analogRead(A5);

  int newpotValue = map(potValue, 0, 1023, 0, 255);
  analogWrite(9, newpotValue);
  • do you have a question? ....you made some statements about what you are doing, but you did not ask a question.
    – jsotola
    Aug 3 '18 at 4:47
  • Sorry I didnt make my question clear i am a bit tired atm. I just edited it in :) Aug 3 '18 at 4:52
  • "I think" is not very scientific... Why do you think it is not behaving correctly? In any case, make measurements. Use an oscilloscope and verify the PWM output. If the output is a constant +5V wave, you can't accelerate more. If it isn't, maybe the pot is not at its max value. Try with analogWrite(9,255); and see if this changes anything.
    – frarugi87
    Aug 3 '18 at 8:49
  • It seems I get about 240-250 so about 96% of the fan is used. Thinking about just using an if statement to push it to 255 if above a certain level. Sorry i'm kinda new to this stuff but wanted to try it out nonetheless. Aug 3 '18 at 13:37
  • Try printing the analogRead value you get to the serial console, and check the range of the potentiometer. If you don’t get fully up to 1023, then lower the 1023 in the map function to something lower.
    – Gerben
    Aug 3 '18 at 14:28

According to Your Fan Datasheet its 1.3 W/5V Fan... That means its nearly consume 3 A current which cant be supplied directly from arduino pins... so you have to use PWM converter ... it almost solve your issues...

  • 1
    How did you get 3A from 1.3W and 5V? And I assume he is using the dedicated PWM control input, so it shouldn't use a lot of current.
    – gre_gor
    Aug 3 '18 at 13:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.