Re: Fan SHIM for Raspberry Pi


David Ranch <dranch@...>
 


Hey Larry,

Thanks for the comprehensive post!

I've been thinking of buying one of these units too but the use of the I2S pin is a killer for me as I need that bus for the FePi HATT.  So, I guess I'm back to square one trying to find an intelligent fan for the Raspberry Pi.  I'd personally like to see an Rpi cooler that uses a three our four pin fan and I can monitor it's RPM via the I2C bus.  This should be pretty simple using something like a Micrchip EMC2301 ( https://www.mikroe.com/fan-click ) but I haven't found anything that's pre-made and something very small like the Fan SHIM.  I know I could do something like this via an Arduino and I've done something similar showing the RPM on an LCD display but not putting the data into an I2C bus but that's all too "big" and I'm again looking for something just as small as a Fan SHIM.

Maybe someone else on the list has found something like what I'm looking for?

--David
KI6ZHD




On 10/06/2019 10:33 AM, Larry Dighera wrote:
I want to report that the inexpensive Pimoroni FanSHIM performs very
well in preventing the RPi4 from CPU throttling due to excessive heat.
The supplied Python-based software
https://github.com/pimoroni/fanshim-python implements temperature
control of the fan in proportional response to CPU temperature.  If
you prefer a full time daemon to control the fan, that is included as
well.

CONS
Incompatible with I2S HATs.
Booster Header https://shop.pimoroni.com/products/booster-header
required for some GPIO use.
Moving parts.
Button needs a pending GPIO Zero software update.



30mm no-solder, controllable CPU fan with RGB LED and tactile switch
£9.60
https://shop.pimoroni.com/products/fan-shim

Features
30mm 5V DC fan
4,200 RPM
0.05 m3/min air flow
18.6 dB acoustic noise (whisper-quiet)
Friction-fit header
No soldering required
RGB LED (APA102)
Tactile switch
Basic assembly required
Compatible with Raspberry Pi 4 (and 3 B+, 3 A+)
Python library and daemon
Pinout
Kit contains
Fan SHIM PCB
30mm 5V DC fan with JST connector
M2.5 nuts and bolts
Assembly
Assembly is really easy, and will take less than two minutes.

With the component side of the PCB facing upwards, push the two M2.5
bolts through the holes from below, then screw on the first pair of
nuts to secure them and act as spacers.
Push the fan's mounting holes down onto the bolts, with the cable side
of the fan downwards (as pictured) and the text on the fan upwards.
Attach with another two nuts.
Push the fan's JST connector into the socket on Fan SHIM.
Software
Our Python library lets you control the fan (on/off), RGB LED, and
switch. There's a handful of examples to show you how to use each
feature, and a script to install a daemon (a service that runs in the
background) that runs the fan in automatic mode, triggering it on or
off when the CPU reaches a threshold temperature, with a manual
override via the tactile switch.

Tutorial
You can read our Getting Started with Fan SHIM tutorial for a really
detailed guide on assembling Fan SHIM and installing the software,
with photos for each step of the assembly.

Notes
When mounting or detaching the fan, or assembled Fan SHIM, do not push
on the fan itself, as it is liable to break.
Be careful to mount your Fan SHIM on the correct pins on your Pi, with
the Pi shut down and power disconnected. Shifting it left by one pin
or down a full row of pins could cause damage to both the Fan SHIM and
the Pi. Check out the photos in our tutorial if you're not sure.
?Not heatsink-compatible!
Because Fan SHIM uses pin BCM18 to control the fan, and this pin is
also used by I2S audio devices, you won't be able to use I2S DACs like
pHAT DAC, pHAT BEAT, and the IQAudio boards at the same time as Fan
SHIM
Dimensions: 45x39x11mm


Benchmarking the Raspberry Pi 4
https://medium.com/@ghalfacree/benchmarking-the-raspberry-pi-4-73e5afbcd54b


Raspberry Pi 4 Cooling Review: Pimoroni Heatsink and Fan Shim Tested
https://www.tomshardware.com/reviews/pimoroni-fan-shim-heatsink-raspberry-pi-4,6219.html
By default, the Fan Shim spins up to its full 4,200 RPM as soon as the
Raspberry Pi is switched on. In this mode, its cooling performance is
extremely impressive: the SoC idles at around 37 degrees Celcius in a
24.5 degrees Celcius ambient environment, and remains below 55 degrees
Celsius throughout the test. This is well below the 80 degrees Celcius
throttle point of the Raspberry Pi 4’s BCM2711B0 SoC, so no throttle
operations are recorded - the CPU runs at its full 1.5GHz throughout.
There is a cost, however: the fan pulls an additional 0.6W from the
power supply while running.

The Fan Shim has another operating mode, however: software control via
a Python-based application programming interface (API). Using this,
it’s possible to turn the fan on and off - though not to vary its
speed, other than by turning it on and off in rapid succession to
simulate a pulse-width modulation (PWM) signal - and to make use of
the tactile switch and RGB LED.

A sample program is included which sets an upper temperature limit and
a hysteresis temperature, which Pimoroni recommends be set at 65
degrees Celsius and 5 degrees Celsius respectively. When running with
these settings, the fan switches on - and the RGB LED toggles from red
to green - at 65 degrees Celsius then cools until 60 degrees Celsius
is reached before turning off and waiting for the temperature to rise
again.

Here the Raspberry Pi idles at the same temperature as its uncooled,
stock incarnation: around 50 degrees Celsius. The fan doesn’t spin up
until the temperature hits 65 degrees Celsius, and then spends the
rest of the test toggling on and off in order to keep the Raspberry Pi
4 below its target temperature. It does so admirably: as with the
always-on mode, the SoC is kept far from its throttle point, and the
ten-minute test completes without a single throttle operation being
recorded. The same is also true when overclocked, though the fan will
kick in more quickly and more often to compensate for the additional
heat.

Combined Cooling
Most desktop and laptops computers don’t rely on only a heatsink or
only a fan; they use a combination of both, and it’s possible to do so
with the Fan Shim and heatsink too - though it is not recommended by
Pimoroni itself, which carried out its own testing and
counterintuitively found the combination cooled less effectively than
simply using the Fan Shim alone.

There’s only one way to verify that, mind you: to carry out the same
test ourselves. The Pimoroni heatsink with Fan Shim connected on top
is a combination which really necessitates the installation of pin
extensions or Pimoroni’s Booster Header to the GPIO header; without
them, there’s not enough pin for the Fan Shim to grip and it runs the
risk of falling off - potentially shorting out the GPIO pins on its
way, damaging the Raspberry Pi 4.

For this test, the Fan Shim is left in software-controlled mode with
the same temperature target of 65 degree Celcius as before. The result
is a graph looking remarkably similar to using the Fan Shim alone,
only stretched: the heatsink effectively stores up the heat generated
by the SoC, slowing down the time until the Fan Shim needs to switch
on; the downside is it also slows down the time it needs to switch off
again afterwards. In terms of actual performance, though, there’s
little difference: once again the SoC is cooled to the point where it
doesn’t need to throttle the CPU to protect itself.

The Performance Impact
Being able to prevent your Raspberry Pi 4 from throttling has a
measurable impact on performance, though how measurable will depend
entirely on how badly it’s throttling. In our test environment, which
was at a stable 24.5 degrees Celcius throughout, the throttling wasn’t
terrible: while the CPU did frequently drop to 1GHz under sustained
load, it would quickly pop back up to 1.5GHz again. In a warmer
environment the throttling would happen sooner and be sustained for
longer, meaning the cooling accessories would have a greater impact on
measured performance.

For this test, the Raspberry Pi 4 is instructed to compress an 8GB
file stored on a USB 3.0 SSD, using the multi-threaded lbzip2
compression utility, while the time it takes is measured. Compressing
such a large file on the Raspberry Pi 4 typically takes around twenty
minutes, roughly double the synthetic load from the throttle testing,
and on an uncooled Raspberry Pi triggers thermal throttling.

There’s not a huge amount between them, but the Fan Shim definitely
has an impact: the compression operation took 22 minutes and 14
seconds on an uncooled Raspberry Pi 4 but completed in 20 minutes and
four seconds with the Fan Shim attached, saving over two minutes -
just shy of a ten percent performance gain. Had the operation gone on
longer, or taken place in a hotter environment, the difference would
be greater.

For those who don’t like the idea of adding a spinning fan to their
Raspberry Pi 4, the heatsink is a realistic alternative: with just the
heatsink attached the benchmark completed in 20 minutes and 23 seconds
- a respectable eight percent boost over uncooled stock, lagging just
slightly behind the Fan Shim. Unlike the Fan Shim, though, the
heatsink is unlikely to offer the same gains in a hot environment,
where it can’t bleed off the heat it is conducting quickly enough, or
for sustained workloads in excess of twenty minutes.

The combined Fan Shim and heatsink option, meanwhile, performed within
the margin of error identically to using the Fan Shim alone - meaning
unless you want to reduce the amount of time the fan spends toggling
on and off, which you could also achieve in software by increasing the
hysteresis temperature, there’s little real-world point to combining
the two.

Bottom Line
If your Raspberry Pi 4 is used for sustained workloads, you’re going
to need some form of cooling to get the most out of it. While the
passive heatsink option is simple and cheap, it’s only a partial
solution; the Fan Shim, by contrast, solves the problem completely -
or, at least, mostly.

The caveat which prevents it from being truly “completely” solved: the
Fan Shim is only effective in a relatively open environment, or when
used with cases like Pimoroni’s own Pibow which keep it uncovered. If
installed in an enclosed case like the Official Raspberry Pi 4 Case,
the Fan Shim can only do so much and throttling under sustained
workloads may still be a problem. The solution: look for cases with
ventilation, or take a drill to the Official Case to create your own.

Certain heavy workloads and enclosed environments aside, though,
neither active nor passive cooling accessories are strictly necessary
on the Raspberry Pi 4: even when hitting its thermal throttle point
it’s still an impressively powerful upgrade from its predecessors, and
running hot is unlikely to do the boards any permanent damage - the 80
degrees Celsius throttle point being comfortably below the components’
maximum rated operating temperatures.

Join RaspberryPi-4-HamRadio@groups.io to automatically receive all group messages.