![]() which created /sys/class/pwm/pwmchip0/pwm0/: $ ls /sys/class/pwm/pwmchip0/pwm0/Ĭapture duty_cycle enable period polarity power uevent Got a Noctua NF-A4x10 5V PWM hooked up to the 3.3v pin (pin 1), ground (pin 6), and the PWM signal line to GPIO 18 (pin 12) on a Raspberry Pi 4.Īdded dtoverlay=pwm,pin=18,func=2 ( pwm/pwm-2chan docs) in my /boot/config.txt & rebooted to route hardware PWM channel 0 to GPIO 18 & enable the Linux kernel PWM driver sysfs interface.Īt that point /sys/class/pwm/pwmchip0 existed and I 'exported' PWM channel 0 via: # echo 0 > /sys/class/pwm/pwmchip0/export ![]() All you need to control a 4-pin fan is 1 (or maybe 2) pullups of around 10kOhm. If the voltage on the PWM pin is within you logic level you're fine.Īlso, unlike mentioned in a comment, you don't need an ADC to read the tacho signal: it's a pulse signal (also open collector signal) that generates to drops to GND per revolution. There are many products on the market and to be absolutely sure if your individual fan is fine to work with in this way, you should connect PWM to ground through a large resistor (10kOhm) and measure the voltage at the PWM pin when the fan is connected to 12V and GND. ![]() In their newer PC fan specification Intel suggests that fans should be made compatible with 3.3V logic and manufacturers seem follow this direction as many modern fans of reputable brand are explicitly compatible with 3.3V logic. I don't agree with the other answers, which all mention to keep Vcc within the logic level of the Pi, which from my experience is not neccessary! Fan controllers in 4-pin fans have an open collector input for PWM control and thus are made to be controlled by typical logic levels. You can typically simply connect the PWM input to a GPIO providing a 25kHz PWM signal.
0 Comments
Leave a Reply. |