Some links in this post may be affiliate links. We may get paid if you buy something or take an action after clicking one of these, but without addictional costs for you compared to direct buying.
raspberry-pi-active-cooler-featured-image

Active Cooling for Raspberry PI: What is, Why You Need It, and How to Use

4
(1)

Last Updated on 6th December 2024 by peppe8o

This tutorial will explain the Active Cooling for Raspberry PI to beginners and show you how to simulate the benefits concretely.

This tutorial is specific for Raspberry PI computer boards and will guide you by analyzing what are the use cases where you need a cooling system and testing it with a stress test.

Cooling the Raspberry PI

Like any other electronic device, the Raspberry PI can be subject to intense elaboration processes. When you use it with resource-heavy programs, the Raspberry PI uses more power from its power supply and it transforms the power into heat.

The main parts of Raspberry PI suffering from heating are the CPU (Central Processing Unit), RAM (Random Access Memory), and GPU (Graphics Processing Unit). Depending on the type of program you are running, one or more of these parts may become very hot during the execution and it may bring to irreparable board breakages. For example, Raspberry PI computer boards are generally designed to run with CPU temperatures below 80°C – 85°C. At higher temperatures, the CPU internal parts may fuse and transform your beloved board into an expensive coaster.

At any time, you can check the CPU temperature of your Raspberry PI in 2 ways. The first one, from a bash shell, is by the following command (with the result in milliCelsius):

cat /sys/class/thermal/thermal_zone0/temp

The second way, from a Python program, is by integrating the following lines (with the result in Celsius):

from gpiozero import CPUTemperature
print(CPUTemperature(min_temp=50, max_temp=90).temperature)

By using a cooling system, your Raspberry PI internal temperature will stay at lower values, so enabling you to run resource-intensive programs for longer periods.

There are 2 types of cooling systems: Passive Cooling and Active Cooling.

Passive Cooling

A passive cooling system for Raspberry PI usually consists of heat sinks, made of metal, attached directly to the Raspberry PI’s CPU, RAM, and GPU. They act by naturally transferring the heat from the electronic parts to the air, without using any fan to force the air flow.

raspberry-pi-passive-heat-sink

Usually, you can find them in your local Amazon store with very low prices and they are the basic protection for heating, even if their cooling capability is limited.

Active Cooling

The Active Cooling systems integrate one (or more) heat sink with a cooling fan. The fan forces the air to pass into the heat sink fins, in this way increasing the heat exchange and keeping the Raspberry PI parts at lower temperatures. They also have a small cable to power and activate the fan from your Raspberry PI.

The following image is from the Elecrow Raspberry Pi 5 Active Cooler, which is the cooling system I’m going to use for this test.

raspberry-pi-active-cooler

These cooling systems are the most effective as they can keep the Raspberry PI temperature under control even during very high-intensive programs. They are also simple to mount on Raspberry PI computer boards as they fit specific holes already available in your board. Here are some pictures from mine:

raspberry-pi-active-cooler-mounted
raspberry-pi-active-cooler-fan-cable

As you can see from the following image, the active cooler uses 2 holes already available in your Raspberry PI board. For this reason, I also suggest you check if the cooler you’re going to buy fits your specific Raspberry PI model:

raspberry-pi-active-cooler-mount-points

When You Need Cooling

Typical use cases where cooling is required (or strongly suggested) for Raspberry PI are:

  • Heavy Computational Workloads: for example Machine Learning, AI, data science calculations
  • Gaming: for example with retro-emulators like Retropie
  • Media Centers: for example with OSMC or LibreELEC
  • Overclocking
  • High Environment Temperatures

What We Need

As usual, I suggest adding from now to your favourite e-commerce shopping cart all the needed hardware, so that at the end you will be able to evaluate overall costs and decide if to continue with the project or remove them from the shopping cart. So, hardware will be only:

raspberry-pi-5-model-b-board

Step-by-Step Procedure

In this guide, I will show you how to perform a stress test with your Raspberry PI’s CPU, along with showing the CPU temperature, both without and with active cooling. I will use my Raspberry PI 5 and Elecrow’s Active Cooler.

Prepare the Operating System

Prepare the Operating System and Install Docker

The first step is installing the Raspberry PI OS Lite (please note that we need the 64-bit version) to get a fast and light operating system (headless). In this case, you will need to work from a remote SSH terminal. If you need a desktop environment, you can also use the Raspberry PI OS Desktop, in this case working from its terminal app. Please find the differences between the 2 OS versions in my Raspberry PI OS Lite vs Desktop article.

Make sure that your OS is up to date. From your terminal, use the following command:

sudo apt update -y && sudo apt upgrade -y

To perform the stress tests, we’ll use the stress-ng package, which you can install directly from aptitude:

sudo apt install stress-ng -y

The Stress-ng Command to Test Active Cooling with Raspberry PI

I’ll use the following command. Please note that, without active cooling, it allowed me to keep the CPU temperature of my Raspberry PI 5 model B below the critical value (consider it to be 80°C). With other Raspberry PI models, you could reach it faster. In that case, I suggest you immediately stop the test execution with CTRL+C or unplug the Raspberry PI’s power cable if the terminal becomes unresponsive.

stress-ng --matrix 0 -t 50 --thermalstat 1 --timestamp --tz

In this command:

  • –matrix 0: performs a “matrix” test by using all the available Cores from the CPU (0)
  • -t 50: performs the test for 50 seconds
  • –thermalstat 1: shows CPU temperatures every 1 second on the terminal while executing the test
  • –timestamp: adds a timestamp to every line of the terminal output
  • –tz: collect temperatures from the available thermal zones

Running the Stress Test without Active Cooling

Here we are with the first test. Without any cooling system, I run the stress-ng command in my Raspberry PI 5. I get the following results:

stress-ng: 09:37:14.00 info:  [40136] therm: AvGHz MnGhz MxGHz  LdA1  LdA5 LdA15  cpu_th
stress-ng: 09:37:14.00 info:  [40136] therm:  2.40  2.40  2.40  0.00  0.20  0.61   49.60
stress-ng: 09:37:14.99 info:  [40136] therm:  2.40  2.40  2.40  0.32  0.26  0.63   51.25
stress-ng: 09:37:15.99 info:  [40136] therm:  2.40  2.40  2.40  0.32  0.26  0.63   53.45
stress-ng: 09:37:16.99 info:  [40136] therm:  2.40  2.40  2.40  0.32  0.26  0.63   54.00
stress-ng: 09:37:17.99 info:  [40136] therm:  2.40  2.40  2.40  0.32  0.26  0.63   56.20
stress-ng: 09:37:18.99 info:  [40136] therm:  2.40  2.40  2.40  0.32  0.26  0.63   56.20
stress-ng: 09:37:19.99 info:  [40136] therm:  2.40  2.40  2.40  0.62  0.33  0.65   60.60
stress-ng: 09:37:20.99 info:  [40136] therm:  2.40  2.40  2.40  0.62  0.33  0.65   59.50
stress-ng: 09:37:21.99 info:  [40136] therm:  2.40  2.40  2.40  0.62  0.33  0.65   61.70
stress-ng: 09:37:22.99 info:  [40136] therm:  2.40  2.40  2.40  0.62  0.33  0.65   60.05
stress-ng: 09:37:23.99 info:  [40136] therm:  2.40  2.40  2.40  0.62  0.33  0.65   62.25
stress-ng: 09:37:24.99 info:  [40136] therm:  2.40  2.40  2.40  0.89  0.39  0.67   61.70
stress-ng: 09:37:25.99 info:  [40136] therm:  2.40  2.40  2.40  0.89  0.39  0.67   63.35
stress-ng: 09:37:26.99 info:  [40136] therm:  2.40  2.40  2.40  0.89  0.39  0.67   63.90
stress-ng: 09:37:27.99 info:  [40136] therm:  2.40  2.40  2.40  0.89  0.39  0.67   62.80
stress-ng: 09:37:28.99 info:  [40136] therm:  2.40  2.40  2.40  0.89  0.39  0.67   64.45
stress-ng: 09:37:29.99 info:  [40136] therm:  2.40  2.40  2.40  1.14  0.45  0.69   63.90
stress-ng: 09:37:30.99 info:  [40136] therm:  2.40  2.40  2.40  1.14  0.45  0.69   62.80
stress-ng: 09:37:31.99 info:  [40136] therm:  2.40  2.40  2.40  1.14  0.45  0.69   64.45
stress-ng: 09:37:32.99 info:  [40136] therm:  2.40  2.40  2.40  1.14  0.45  0.69   65.00
stress-ng: 09:37:33.99 info:  [40136] therm:  2.40  2.40  2.40  1.14  0.45  0.69   64.45
stress-ng: 09:37:34.99 info:  [40136] therm:  2.40  2.40  2.40  1.37  0.51  0.70   63.90
stress-ng: 09:37:35.99 info:  [40136] therm:  2.40  2.40  2.40  1.37  0.51  0.70   65.00
stress-ng: 09:37:36.99 info:  [40136] therm:  2.40  2.40  2.40  1.37  0.51  0.70   66.10
stress-ng: 09:37:37.99 info:  [40136] therm:  2.40  2.40  2.40  1.37  0.51  0.70   65.55
stress-ng: 09:37:38.99 info:  [40136] therm:  2.40  2.40  2.40  1.37  0.51  0.70   67.20
stress-ng: 09:37:39.99 info:  [40136] therm:  2.40  2.40  2.40  1.58  0.56  0.72   66.65
stress-ng: 09:37:40.99 info:  [40136] therm:  2.40  2.40  2.40  1.58  0.56  0.72   67.75
stress-ng: 09:37:41.99 info:  [40136] therm:  2.40  2.40  2.40  1.58  0.56  0.72   66.65
stress-ng: 09:37:42.99 info:  [40136] therm:  2.40  2.40  2.40  1.58  0.56  0.72   68.85
stress-ng: 09:37:43.99 info:  [40136] therm:  2.40  2.40  2.40  1.58  0.56  0.72   68.85
stress-ng: 09:37:44.99 info:  [40136] therm:  2.40  2.40  2.40  1.77  0.62  0.74   70.50
stress-ng: 09:37:45.99 info:  [40136] therm:  2.40  2.40  2.40  1.77  0.62  0.74   69.95
stress-ng: 09:37:46.99 info:  [40136] therm:  2.40  2.40  2.40  1.77  0.62  0.74   71.05
stress-ng: 09:37:47.99 info:  [40136] therm:  2.40  2.40  2.40  1.77  0.62  0.74   69.40
stress-ng: 09:37:48.99 info:  [40136] therm:  2.40  2.40  2.40  1.77  0.62  0.74   71.05
stress-ng: 09:37:49.99 info:  [40136] therm:  2.40  2.40  2.40  1.95  0.68  0.76   70.50
stress-ng: 09:37:50.99 info:  [40136] therm:  2.40  2.40  2.40  1.95  0.68  0.76   71.60
stress-ng: 09:37:51.99 info:  [40136] therm:  2.40  2.40  2.40  1.95  0.68  0.76   70.50
stress-ng: 09:37:52.99 info:  [40136] therm:  2.40  2.40  2.40  1.95  0.68  0.76   71.05
stress-ng: 09:37:53.99 info:  [40136] therm:  2.40  2.40  2.40  1.95  0.68  0.76   70.50
stress-ng: 09:37:54.99 info:  [40136] therm:  2.40  2.40  2.40  2.11  0.73  0.78   70.50
stress-ng: 09:37:55.99 info:  [40136] therm:  2.40  2.40  2.40  2.11  0.73  0.78   69.95
stress-ng: 09:37:56.99 info:  [40136] therm:  2.40  2.40  2.40  2.11  0.73  0.78   69.95
stress-ng: 09:37:57.99 info:  [40136] therm:  2.40  2.40  2.40  2.11  0.73  0.78   70.50
stress-ng: 09:37:58.99 info:  [40136] therm:  2.40  2.40  2.40  2.11  0.73  0.78   70.50
stress-ng: 09:37:59.99 info:  [40136] therm:  2.40  2.40  2.40  2.27  0.79  0.79   72.15
stress-ng: 09:38:00.99 info:  [40136] therm:  2.40  2.40  2.40  2.27  0.79  0.79   70.50
stress-ng: 09:38:01.99 info:  [40136] therm:  2.40  2.40  2.40  2.27  0.79  0.79   72.15
stress-ng: 09:38:02.99 info:  [40136] therm:  2.40  2.40  2.40  2.27  0.79  0.79   71.05

As you can see, the temperatures are linearly ascending and going toward the danger values. With my Raspberry PI 5 model B, there was no need to interrupt the stress test as it remained below 80°C during the set test time (50 seconds).

Running the Stress Test With Active Cooling to Raspberry PI

After ending the first test, I shut down the Raspberry PI and placed the Elecrow’s Active Cooler.

Repeating the test, I got the following results:

stress-ng: 09:59:32.50 info:  [893] therm:  2.40  2.40  2.40  0.00  0.06  0.10   46.30
stress-ng: 09:59:33.49 info:  [893] therm:  2.40  2.40  2.40  0.00  0.06  0.10   46.30
stress-ng: 09:59:34.49 info:  [893] therm:  2.40  2.40  2.40  0.00  0.06  0.10   47.95
stress-ng: 09:59:35.49 info:  [893] therm:  2.40  2.40  2.40  0.00  0.06  0.10   49.60
stress-ng: 09:59:36.49 info:  [893] therm:  2.40  2.40  2.40  0.32  0.12  0.12   49.60
stress-ng: 09:59:37.49 info:  [893] therm:  2.40  2.40  2.40  0.32  0.12  0.12   49.05
stress-ng: 09:59:38.49 info:  [893] therm:  2.40  2.40  2.40  0.32  0.12  0.12   50.70
stress-ng: 09:59:39.49 info:  [893] therm:  2.40  2.40  2.40  0.32  0.12  0.12   50.70
stress-ng: 09:59:40.49 info:  [893] therm:  2.40  2.40  2.40  0.32  0.12  0.12   50.15
stress-ng: 09:59:41.49 info:  [893] therm:  2.40  2.40  2.40  0.62  0.19  0.14   50.70
stress-ng: 09:59:42.49 info:  [893] therm:  2.40  2.40  2.40  0.62  0.19  0.14   49.05
stress-ng: 09:59:43.49 info:  [893] therm:  2.40  2.40  2.40  0.62  0.19  0.14   50.15
stress-ng: 09:59:44.49 info:  [893] therm:  2.40  2.40  2.40  0.62  0.19  0.14   49.60
stress-ng: 09:59:45.49 info:  [893] therm:  2.40  2.40  2.40  0.62  0.19  0.14   50.70
stress-ng: 09:59:46.49 info:  [893] therm:  2.40  2.40  2.40  0.89  0.25  0.16   49.60
stress-ng: 09:59:47.49 info:  [893] therm:  2.40  2.40  2.40  0.89  0.25  0.16   50.70
stress-ng: 09:59:48.49 info:  [893] therm:  2.40  2.40  2.40  0.89  0.25  0.16   50.15
stress-ng: 09:59:49.49 info:  [893] therm:  2.40  2.40  2.40  0.89  0.25  0.16   50.70
stress-ng: 09:59:50.49 info:  [893] therm:  2.40  2.40  2.40  0.89  0.25  0.16   52.35
stress-ng: 09:59:51.49 info:  [893] therm:  2.40  2.40  2.40  1.14  0.31  0.19   51.80
stress-ng: 09:59:52.49 info:  [893] therm:  2.40  2.40  2.40  1.14  0.31  0.19   52.35
stress-ng: 09:59:53.49 info:  [893] therm:  2.40  2.40  2.40  1.14  0.31  0.19   51.25
stress-ng: 09:59:54.49 info:  [893] therm:  2.40  2.40  2.40  1.14  0.31  0.19   52.90
stress-ng: 09:59:55.49 info:  [893] therm:  2.40  2.40  2.40  1.14  0.31  0.19   51.80
stress-ng: 09:59:56.49 info:  [893] therm:  2.40  2.40  2.40  1.37  0.37  0.21   52.90
stress-ng: 09:59:57.49 info:  [893] therm:  2.40  2.40  2.40  1.37  0.37  0.21   52.90
stress-ng: 09:59:58.49 info:  [893] therm:  2.40  2.40  2.40  1.37  0.37  0.21   53.45
stress-ng: 09:59:59.49 info:  [893] therm:  2.40  2.40  2.40  1.37  0.37  0.21   53.45
stress-ng: 10:00:00.49 info:  [893] therm:  2.40  2.40  2.40  1.37  0.37  0.21   54.55
stress-ng: 10:00:01.49 info:  [893] therm:  2.40  2.40  2.40  1.58  0.43  0.23   52.35
stress-ng: 10:00:02.49 info:  [893] therm:  2.40  2.40  2.40  1.58  0.43  0.23   53.45
stress-ng: 10:00:03.49 info:  [893] therm:  2.40  2.40  2.40  1.58  0.43  0.23   52.90
stress-ng: 10:00:04.49 info:  [893] therm:  2.40  2.40  2.40  1.58  0.43  0.23   52.90
stress-ng: 10:00:05.49 info:  [893] therm:  2.40  2.40  2.40  1.58  0.43  0.23   51.80
stress-ng: 10:00:06.49 info:  [893] therm:  2.40  2.40  2.40  1.77  0.49  0.25   52.90
stress-ng: 10:00:07.49 info:  [893] therm:  2.40  2.40  2.40  1.77  0.49  0.25   51.80
stress-ng: 10:00:08.49 info:  [893] therm:  2.40  2.40  2.40  1.77  0.49  0.25   53.45
stress-ng: 10:00:09.49 info:  [893] therm:  2.40  2.40  2.40  1.77  0.49  0.25   51.80
stress-ng: 10:00:10.49 info:  [893] therm:  2.40  2.40  2.40  1.77  0.49  0.25   53.45
stress-ng: 10:00:11.49 info:  [893] therm:  2.40  2.40  2.40  1.95  0.55  0.27   51.80
stress-ng: 10:00:12.49 info:  [893] therm:  2.40  2.40  2.40  1.95  0.55  0.27   52.35
stress-ng: 10:00:13.49 info:  [893] therm:  2.40  2.40  2.40  1.95  0.55  0.27   52.35
stress-ng: 10:00:14.49 info:  [893] therm:  2.40  2.40  2.40  1.95  0.55  0.27   53.45
stress-ng: 10:00:15.49 info:  [893] therm:  2.40  2.40  2.40  1.95  0.55  0.27   54.55
stress-ng: 10:00:16.49 info:  [893] therm:  2.40  2.40  2.40  2.11  0.61  0.29   52.90
stress-ng: 10:00:17.49 info:  [893] therm:  2.40  2.40  2.40  2.11  0.61  0.29   55.65
stress-ng: 10:00:18.49 info:  [893] therm:  2.40  2.40  2.40  2.11  0.61  0.29   54.55
stress-ng: 10:00:19.49 info:  [893] therm:  2.40  2.40  2.40  2.11  0.61  0.29   55.65
stress-ng: 10:00:20.49 info:  [893] therm:  2.40  2.40  2.40  2.11  0.61  0.29   55.10
stress-ng: 10:00:21.49 info:  [893] therm:  2.40  2.40  2.40  2.27  0.67  0.31   54.55

As you can see, the temperature linearly increased up to 50°C. At this stage, the active cooler is automatically activated from the Raspberry PI OS and the cooling system keeps the temperature at a steady 55°C.

Comparing the Results

Putting together the temperature curves, we can compare them. In the following chart, the orange line is the temperature in the stress test WITHOUT active cooler, while the blue line is the temperature WITH the active cooler:

raspberry-pi-active-cooler-stress-test-comparison-3

As you can see from this chart, at the beginning of the stress test the heat sink of the active cooler keeps the CPU less hot even if the fan is still off. At the second 7, the temperature goes over 50°C and the fan switches on. From this moment, the CPU remains at a controlled temperature and the maximum value reached is 55°C, which is a lot lower (and safer) than the 70°C of the previous stress test.

Next Step

Interested in more Raspberry PI projects? Take a look at peppe8o Raspberry PI tutorials to find cool ideas.

Enjoy!

How useful was this post?

Click on a star to rate it anonymously!

Average rating 4 / 5. Vote count: 1

No votes so far! Be the first to rate this post.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?

Leave a Comment

Your email address will not be published. Required fields are marked *

I accept the Privacy Policy

Subscribe my newsletter:
×