1

I recently got a Noctua Redux PWM fan and hooked it up to my Raspberry Pi and tried to control it via PWM signals.

I tried as many Python scripts online as I could find, modifying the frequency and changing the pin. My fan is hooked to GPIO 18 (pin 12) and I am using the following code:

import RPi.GPIO as GPIO
PWM_FAN = 18
RPM = 0

GPIO.setmode(GPIO.BCM)
GPIO.setup(PWM_FAN, GPIO.OUT)
fan = GPIO.PWM(PWM_FAN, 25000)
fan.start(0)
fan.ChangeDutyCycle(RPM/30)
if RPM == 0:
    fan.stop()
GPIO.cleanup()

How can I get this code to control the fan correctly?

EDIT: I tried controlling an LED with PWM and it fluctuated properly, but the fan still refuses to respond to PWM signals.

3DCoded
  • 13
  • 1
  • 6
  • So what is your question? – Ovski Nov 10 '22 at 17:07
  • How do I get this code to control the fan correctly? – 3DCoded Nov 10 '22 at 17:10
  • What does it actually do? The code as you have it sets the speed to 0. – Tim Roberts Nov 10 '22 at 18:49
  • Right now the fan just turns on as soon as I plug it in to power. I'm trying to turn off the fan as I don't want it on 24/7 and then I'll turn it on when a specific event occurs. – 3DCoded Nov 10 '22 at 19:42
  • The fan runs at full speed when there's no PWM signal, so I'd start by looking at the PWM output with a scope. Also, you chose 25KHz, so I assume that you've read this, but I'll link it anyway https://noctua.at/pub/media/wysiwyg/Noctua_PWM_specifications_white_paper.pdf You could also start smaller by trying to dim an LED. – picobit Nov 10 '22 at 22:52
  • Thank you for the suggestion. I will try an LED tomorrow. – 3DCoded Nov 11 '22 at 00:09
  • I tried an LED and it fluctuated properly, but the fan still refuses to respond to PWM signals. Should I try a normal Noctua Fan (not Redux)? – 3DCoded Nov 15 '22 at 12:32

0 Answers0