5

I am able to trigger my Raspberry Pi 3B's fan to turn on at 50 °C with the following line in /boot/config.txt:

dtoverlay=gpio-fan,gpiopin=3,temp=50000

However, it automatically turns off again when the temperature has dropped by 5 °C when it gets to 45 °C. Is there a way to set it to turn off when the temperature decreases by 15 °C instead?

1 Answer 1

4

Yes.

You can find the information on all overlays and parameters in your local filesystem at /boot/overlays/README, or in the "official" repo on GitHub here.

Following is the syntax for the gpio-fan overlay:

Name:   gpio-fan 
Info:   Configure a GPIO pin to control a cooling fan.  
Load:   dtoverlay=gpio-fan,<param>=<val>  
Params: gpiopin                 GPIO used to control the fan (default 12)
        temp                    Temperature at which the fan switches on, in
                                millicelcius (default 55000)
        hyst                    Temperature delta (in millicelcius) below
                                temp at which the fan will drop to minrpm
                                (default 10000) 

The parameter you've not specified - the one to control the temp at which the fan turns OFF - is hyst. The entry you need to turn the fan OFF after it drops by 15 deg C is:

dtoverlay=gpio-fan,gpiopin=3,temp=50000,hyst=15000

Note that units are in millicelsius.

2
  • 1
    Shouldn't the temperature delta in your example be 15000?
    – Paradox
    Nov 5, 2023 at 18:48
  • 1
    @Paradox: Yes ... probably. The wording in the documentation seems a bit squirrely to me, but I think you're correct - thanks!
    – Seamus
    Nov 5, 2023 at 18:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.