Raspberry Pi Cooling Test
Dated: 8/1/2018 Technology/Software used: Raspberry Pi 3 Model B, Raspian Stretch (June 2018)
I’ve owned my Pi for a couple years now. I’ve always wanted to overclock it. Before you overclock you have to have a good cooling solution. I wanted to take this opportunity to test some various cooling solutions and talk about the process I went through. In this post I’ll explore my results from various cooling tests I conducted.
A word of caution: Overclocking your Raspberry Pi may void your warranty, do at your own risk. Due to differences in manufacturing some Pis may overclock well, some will not at all.
The following in no way is meant to be scientifically accurate testing and your results may very.
Why do I want to overclock? Well I sometimes use my Pi to run the RetroPie operating system. I enjoy retro gaming and I would love to be able to emulate N64 better. There’s a lot of mixed opinion and the general consensus is that the Pi is not fit for N64 emulation (spoiler alert: they’re right) but I wanted to try and see for myself if it was possible to play Goldeneye on my Pi.
Ultimately I wanted to use both a small 5 volt fan and heat sink. But I was interested in seeing the thermal performance of each component individually. I tested the heat and processor throttling of a stock configuration using the sysbench application. I was inspired by Christopher Barnett’s thermal tests on his YouTube channel – Explaining Computers and I used a similar bash script to test.
Moding the Case
My case, a very basic one for the Pi, wasn’t designed to hold a fan. I cut an opening and screw holes for the fan with a Dremel tool. You can see in the photos below the before and after. I hadn’t cut acrylic plastic before. I used a regular cutting disk for this. While it did the job, I noticed the plastic was getting a bit gummy which made it hard to control. I would have benefited form scoring the plastic before cutting. If I have to do this again, I’d try a different cutting disk and maybe first score the circle before cutting.
With the prep-work done I began the test. I tried five configurations, the Pi in the closed case (before cutting the fan hole), the Pi in an open case, the fan by itself, the heat sink by itself and finally both the heat sink and fan.
Why is the cooling so important?
Running electrical components too hot can cause them to fail over time. Getting too hot in one instance can also cause an immediate failure. However, many modern computers have built in thermal protection which will reduce their power in an effort to cool the unit down. The Pi is no exception. Its thermal protection kicks in at about 80 C at this point the Pi will reduce it’s clock-speed to cool itself. I wanted to see how significant the throttling is. So I tracked both the average clock-speed throughout the entire test and the temperature between each test.
This is the script I had used. It’s a bash script which in Linux is like a batch file Windows. In other words a file which automatically runs a series of commands.
#! /bin/bash echo "Baseline" vcgencmd measure_temp vcgencmd measure_clock arm echo "Test 1" sysbench --test=cpu --cpu-max-prime=20000 --num-threads=4 run >/dev/null 2>&1 vcgencmd measure_temp vcgencmd measure_clock arm echo "Test 2" sysbench --test=cpu --cpu-max-prime=20000 --num-threads=4 run >/dev/null 2>&1 vcgencmd measure_temp vcgencmd measure_clock arm echo "Test 3" sysbench --test=cpu --cpu-max-prime=20000 --num-threads=4 run >/dev/null 2>&1 vcgencmd measure_temp vcgencmd measure_clock arm echo "Test 4" sysbench --test=cpu --cpu-max-prime=20000 --num-threads=4 run >/dev/null 2>&1 vcgencmd measure_temp vcgencmd measure_clock arm echo "Test 5" sysbench --test=cpu --cpu-max-prime=20000 --num-threads=4 run >/dev/null 2>&1 vcgencmd measure_temp vcgencmd measure_clock arm echo "Complete"
The script will run the test five times. We’ll look at the specifics of the each command next, but in essence it displays a base line temperature and clock speed, then runs a stress test followed by displaying the temperature and clock-speed and repeats that sequence 5 times. I recorded the temperature and clock speed after each test into a LibreOffice Calc spreadsheet for analysis.
BASH Script commands
The line that begins with the #! is called a shebang or hash-bang. That identifies to Linux where the interpreter for the script is. In this case Linux will find BASH in my /bin/bash directory.
Next is the echo keyword. This keyword is similar to print() in Python. It will display the text between the quotes on screen. In this script it is used to indicate the beginning of each test. The echo keyword is useful to communicate with the user and let them know what’s going on within the script.
After that we have the commands that actually performs the stress test. Sysbench is a piece of software which is used to perform various benchmark test to determine performance. In this script, rather than gauge performance I am using the CPU benchmark to apply stress to the system which will cause it to generate more heat and I can see how effective my cooling solutions are. The parameters passed to the Sysbench utility are to test the CPU. The CPU test utilized by Sysbench is to determine all prime numbers bewteen 2 and max-prime number in this case 20,000. This is a very intensive task for the computer. I then sepcified that I wanted it to run on all four cores of the processor. Lastly I use the >/dev/null 2>&1 parameter to direct Sysbench’s output to NULL. In otherwords to disregard the results, because in this use case I don’t care what the efficencny of the processor is just it’s heat and clock-speed.
The next commands are two uses of the vcgencmd. Vcgencmd is a utility on the Raspberry Pi to display certain information. In this case I display two things: measure_temp which shows the system temperature and measure_clock arm which displays the current clock-speed of the ARM chip or the main microprocessor of the of the Raspberry Pi. The Raspberry Pi’s microprocessor normally runs at 600Mhz but can turbo up to 1.2Ghz if needed. If the Raspberry Pi gets too hot (around 80C), the system will reduce the speed in an effort to cool it down, this is called throttling. By checking the temperature and clock-speed I can see if the Pi is overheating and throttled slower.
My prediction was that the Fan + Heat-sink would provide the best cooling, however I was surprised that the Fan by itself kept the Pi running near 70 C. I was also surprised that the heat-sinks I used (small aluminum ones) barley cooled the Pi below just having the lid off. We can also confirm from the data that the Fan + Heat-sink provided the best cooling keeping the Pi below 60 C.
From this graph we can see that the Pi only throttled while running without any cooling. The other cooling solutions were able to keep the Pi running at full speed (1200 MHz) throughout each test. From this test, I may have been able to get away with just a heat sink., however because I want to minimize the overall duration of heat exposure on my Pi so I will use both the Fan and the Heat-sink.
Testing the Pi in this way gave me some fascinating insights into different cooling options. In my testing I determined that using a Fan + Heat-sink offers the best cooling option and also does not lead to any throttling conditions. However, I was also able to determine that a Fan by itself offers a similar level of heat control.
As I cautioned at the beginning this was not meant to be a scientific testing of different heat control methods. One thing in particular I would have like to have done was a real use case test of the thermal performance. My motivation was to improve the N64 emulation performance in RetroPie. I was able to find a stable overclock which various recommended as potentially useful for what I wanted to do. However, I’m sad to report that in my case it did not improve the performance, which as these same forums mentioned, may not because the nature of the Pi is just very different than an N64. Even though I was not able to improve the performance I’m still glad I was able to go through with this experience.
Want to learn more about Raspberry Pi? Well I haven’t written a book on that (yet) but if you are eager to learn Excel and VBA programming check out my book – Beginning Microsoft Excel VBA Programming for Accountants has many examples of automating Excel to teach you ways to maximize your productivity! It’s available on Amazon, Apple iBooks and other eBook retailers!
Questions or Comments?
Connect with me: