Sending PWM signal to pin 8

Hello there,

I am running Raspbian 11 Bullseye on Le Potato. I am using it as a Plex server, and while streaming locally is flawless, the CPU temp was hitting the 60C cap consistently. I added a generic RPi 3B+ fan hat from Amazon, and for the life of me, I cannot get the fan to spin at anything other than full speed (I’m assuming it’s not receiving any PWM signal at all). This hat also has LEDs on the underside as well.

I’ve confirmed with a multimeter that the fan PWM wire is connected to pin 8 on the GPIO. Enabling this pin in raspi-config does nothing. I read through “How to Read and Control PWM Fan Speed on AML-S905X-CC” and it seems PWM is not sent to pin 8 at all. When enabling pwm-a and sending values to pwm1, the fan doesn’t react however one of the LEDs on the underside turns on, so that LED is going to pin 33.

I don’t care much about the LEDs, I’m more after controlling the fan speed with PWM signal. I realize it’s probably easy enough to rewire the fan with a jumper directly to pin 33 instead of pin 8 so that it receives the PWM signal. So finally to my question: Is there a way to send the PWM signal from pwm-a pin 33 (or some other source) over to pin 8?

raspi-config’s overlay controls does nothing on our boards.

You have to do software bit-bang PWM with pwm-gpio driver for pin 8. This will use the CPU to flip the GPIO to generate the PWM waveforms. The timing is not perfect and it uses CPU cycles but for fan control, it is sufficient.

Hey thanks, guess I won’t bother with raspi-config anymore.

As for pwm-gpio, is that a Python library? I checked out the wiring tool page, but didn’t see any mention of pwm-gpio (sorry, you have to explain it to me like I’m 5).

pwm-gpio is a device driver. Basically you’re taking a normal GPIO and using the CPU to flip the GPIO once in a while with a Linux kernel driver. So it’s just software GPIO toggling rather than a hardware PWM which has registers that you can program with width, duration, and frequency.