Connecting a fan to Raspberry Pi 4B

I want to connect two fans to my Raspberry Pi, but when I power the device on, the fans don’t spin.
As shown in the picture attached with this post, the fans are plugged in to GPIO pin 4 (and 6, ground).

I’ve tried the following:
-Open GPIO pin with “echo 4 > /sys/class/gpio/export”, etc. (direction and value)
-Set a DT overlay (…,“gpio-fan,gpiopin=4,temp=40000” is the value under ‘define DT overlays’ in the configuration of the device at Balena Cloud)
-Set GPIO pins (also at ‘Device Configuration’): I put the following: “gpio=4=op,dh”

Am I overseeing anything or making any mistakes?
Thanks in advance,
Thomas

Hi,

It’s a bit difficult for me to see which pins you connected to your fan.
To me it looks you have only connected the bottom row, 2nd and 3rd pins from right?
These are +5V and GND respectively and might be enough to drive your fan (not 100% sure how much current may be drawn from the +5V).

If you have also connected the 4th pin from the right, that would be GPIO 14, rather than GPIO 4 (top row, 4th from right).
GPIO14 is also used for UART, which may conflict with your control.

1 Like

The fans are indeed connected to the bottom row pins; GPIO pin 4 and 6. (I used the pin layout scheme on Ground at Raspberry Pi GPIO Pinout )
I have not connected the 4th pin from the right, the fans only have two cables (power and ground).
Maybe as for supplemental information, the site where I bought the fan-case also provided a tutorial video. Attached with this reply is a screenshot of that video :slight_smile:

Hi,

You are confusing the GPIO numbers with the pinheader numbers.

GPIO 4 is present on pinheader pin 7.
So when you are changing GPIO 4 in software, that’s the physical pin that will be affected.

If you have only connected the power, things should “just work”.
The power supply you use for your Raspberry Pi will affect how much current you can draw.
This includes the power consumed by the Pi itself and everything connected to it.

1 Like

Alright, thank you for your help! I was indeed confusing both items.

Even though I have connected a 3A power supply, the fans still don’t spin.
Nevertheless, I’m marking your reply as the solution since it’s probably because of a hardware issue (defective fan or something else).

With only Power and Ground, those fans should be spinning, yep. I have a single fan, certainly not the same as your 2-fan setup, but with no device tree alterations, it “just works” on my Pi4 + balenaOS, on the same physical pins you are using, 4 and 6.