Guide: Fan control based on temperature


I was looking to add a fan to one of my setups. Maybe it’s not needed, will see if the temperature goes up after multiple hours of playing (see this to check the temperature of the board:

As you can’t use raspi-config, I looked around and could only find python scripts (most didn’t work) but then stumbled on this and it worked so I thought I should share a how to. (source:

This has worked with hifiberry Amp 2 and Pi Zero W but will test with other setups, it depends on pins availability I think. This is the fan I’m using, you need the software part (third wire) for this:

  1. SSH into the pi (look here if you don’t know how to:
  2. Once you’re in: sudo nano boot/userconfig.txt (As to be userconfig so it doesn’t get deleted when Volumio updates)
  3. Add dtoverlay=gpio-fan,gpiopin=14,temp=50000 and save. I haven’t tried with other gpio
  4. Reboot. You can test it by lowering the temp to 20000.

That’s it. Hope it helps

1 Like

Now whether that will make bring interference to the sound I don’t know! This is for my kitchen set up so I don’t really mind but I haven’t plugged the speakers in yet as well.