Raspberry Pi: Passive vs Active Cooling
I noticed the other day that my Raspberry Pi reached 85 °C. That is hot. And it wasn’t even doing anything crazy, just running some Syncthing syncing. It already has heatsinks on both the CPU and RAM, but apparently that’s not enough. It also doesn’t help that the Pi sits in a poorly ventilated spot. It’s not in a fully closed space, but there’s very little airflow.
So I decided to buy a fan and see if it makes a noticeable difference. This post is about that experiment: passive vs. active cooling.
The case I’m using isn’t designed for a fan, so I had to improvise. I made a hole in it using a soldering iron. I also breathed some of the fumes. I did use a mask and had a fan blowing at the time, but ya.
I’ll compare three setups:
- Raspberry Pi as it was (case + heatsinks, no modifications) -> passive cooling
- Case with a large hole, but still no fan -> passive cooling (with ventilation)
- Case with a fan mounted -> active cooling
For each case, I measured the temperature over 15 minutes and calculated the average.
Here’s the script I used:
import time
from datetime import datetime
import os
duration = 900 # 15 minutes
interval = 30
def get_temperature():
try:
with open('/sys/class/thermal/thermal_zone0/temp', 'r') as temp_file:
temp = float(temp_file.read()) / 1000
return temp
except Exception as e:
return f"Error reading temperature: {e}"
log_file = f"rpi_temp_log_{datetime.now().strftime('%Y%m%d_%H%M%S')}.txt"
with open(log_file, 'w') as f:
f.write("Timestamp,Temperature (°C)\n")
start_time = time.time()
while time.time() - start_time < duration:
temp = get_temperature()
timestamp = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
with open(log_file, 'a') as f:
f.write(f"{timestamp},{temp}\n")
print(f"{timestamp}: {temp}°C")
time.sleep(interval)
print(f"Done. Data saved to {log_file}")
All measurements were taken under the same conditions: same room, constant temperature, no open windows (so no drafts). I also made sure that the Pi was idling. The only variables were the Pi’s cooling setup.
Passive cooling (no modifications)
My starting setup: the Pi in a case, with heatsinks on CPU and RAM.
Here are the readings:
Timestamp,Temperature (°C)
11:14:24,41.856
11:14:54,40.78
11:15:24,41.318
11:15:54,41.318
11:16:24,40.78
11:16:54,41.318
11:17:24,42.394
11:17:54,41.856
11:18:24,42.932
11:18:54,42.932
11:19:24,42.932
11:19:54,42.932
11:20:25,42.932
11:20:55,42.932
11:21:25,42.932
11:21:55,43.47
11:22:25,43.47
11:22:55,44.008
11:23:25,42.932
11:23:55,44.008
11:24:25,44.008
11:24:55,42.932
11:25:25,44.008
11:25:55,44.546
11:26:25,44.008
11:26:55,44.008
11:27:25,44.546
11:27:55,44.008
11:28:25,44.008
11:28:55,44.546
Average Temp: 43.02 °C
So the baseline was ~43 °C.
Passive cooling (case with hole)
I now added a hole in the case, a ~ 3.3 cm hole. I did not add the fan just yet. The temperature for this section are with just heatsinks, as shown in the previous picture, and the potential extra airflow due to the hole.
Timestamp,Temperature (°C)
12:16:18,40.78
12:16:48,39.704
12:17:18,39.704
12:17:48,39.704
12:18:18,40.78
12:18:49,40.242
12:19:19,40.78
12:19:49,40.78
12:20:19,40.78
12:20:49,40.78
12:21:19,41.318
12:21:49,41.318
12:22:19,40.78
12:22:49,41.318
12:23:19,42.394
12:23:49,41.856
12:24:19,42.394
12:24:49,41.856
12:25:19,41.856
12:25:49,41.856
12:26:19,42.394
12:26:49,42.932
12:27:19,42.932
12:27:49,42.394
12:28:19,42.394
12:28:49,42.932
12:29:19,42.932
12:29:49,42.932
12:30:19,42.932
12:30:49,43.47
Average Temp: 41.64 °C
The average dropped to 41.6 °C, about 1.5 °C cooler. Not dramatic, but noticeable.
Active cooling (case with fan)
Finally, I mounted a fan directly over the CPU/SoC. I could have installed it to blow air out, but a quick search suggested blowing air onto the board works better.
And here is the full setup, Raspberry Pi with an HDD connected.
Timestamp,Temperature (°C)
14:17:29,33.786
14:17:59,33.248
14:18:29,33.248
14:18:59,32.71
14:19:29,33.248
14:19:59,33.786
14:20:29,33.248
14:20:59,33.786
14:21:29,33.248
14:21:59,33.248
14:22:29,33.248
14:22:59,33.248
14:23:29,33.248
14:23:59,33.786
14:24:29,33.248
14:24:59,33.786
14:25:30,32.71
14:26:00,33.786
14:26:30,33.248
14:27:00,33.248
14:27:30,33.248
14:28:00,33.248
14:28:30,33.248
14:29:00,33.248
14:29:30,33.248
14:30:00,33.786
14:30:30,33.248
14:31:00,33.248
14:31:30,33.248
14:32:00,33.786
Average Temp: 33.36 °C
With the fan, the temperature dropped by nearly 10 °C compared to the original setup. A 22% decrease! Not bad for a fan that cost me ~2 €.
To do
I have now a lingering question. I wonder: would it matter if the fan were mounted outside the case, instead of inside and right on top of the CPU? My intuition says the extra air volume might change things, but I’m not sure in which direction. That’s an experiment for another day though. For now, I’m happy with the setup.