The reason your fan continues to run is because the +5V supply remains connected to your RPi, and therefore to your fan. If you wired the fan IAW the instructions, and executed the setup outlined for the Raspberry Pi Configuration
tool in the instructions, then one of the following is true:
- you are a victim of faulty/shoddy product design by the RPi Organization,
- your fan has failed, or
- you have not allowed sufficient time for your RPi 4B to cool after
shutdown
.
You should know this: Issuing a shutdown
command (or halt
or poweroff
) stops the processor, but it does not remove 5V power from the RPi. Consequently, power is still being consumed by the RPi, and therefore heat continues to be produced.
You may want to return the fan as defective - you may (or may not) get a replacement that functions properly. If you elect to keep this fan, you can cure the "always on" problem as follows:
Follow the schematic below to wire your fan. Note the fan lead connected to the GPIO should be left unconnected - as per the schematic below.
simulate this circuit – Schematic created using CircuitLab
To control the fan, you may use a device tree overlay
which is easily configured in the folder /boot/config.txt
. If you are following the schematic here, you may open the file /boot/config.txt
in your text editor, and add this one line at the top of the file:
dtoverlay=gpio-fan,temp=60000,hyst=5000
Save the file, and reboot
(pull the power plug & re-insert).
The fan will turn on when its temperature reaches 60 deg C, and will remain on until until the temperature falls to 55 deg C. With fan off, the temperature may rise again to 60 deg C - at which point it will turn on again, and the cycle repeats; i.e. the fan is controlled by the temperature of the CPU within a 5 deg C hysteresis loop.
official raspberry pi 4 fan
is there such a thing? where did you find it?turn back on
after issuing ashutdown
. Does the fan remain on - or does it eventually turn off after the RPi has cooled down?