Design a site like this with
Get started

Overclocking the Raspberry Pi Zero / Zero 2

As my OctoPi installation was a bit slow on my RPi Zero I wanted to try overclocking it. I found a lot of different reports about overclockability and temperature, so I did some measurements myself.

Make sure your CPU governor is set correctly

Otherwise you CPU will not clock to the maximum clock speed you set. You can check the current governor by:

cat /sys/devices/system/cpu/cpufreq/policy0/scaling_governor

If this shows “ondemand“, you’re fine, else set it correctly:

sudo sh -c "echo ondemand > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor"

This change is not permanent. If you want this to be permanent, add it to /etc/rc.local:

echo ondemand > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor

Measuring RPi temperature and clock frequency

I used this script to run the CPU test from sysbench on all cores of the CPU in a loop and print the ARM frequency and temperature and also the throttle flags:

CORES=$(grep -c '^processor' /proc/cpuinfo 2>/dev/null)
echo "Running sysbench --test=cpu --cpu-max-prime=2000 --num-threads=$CORES (CTRL-C quits)"
for (( ; ; ))
  # For Rasperry Pi systems
  echo "ARM $(vcgencmd measure_clock arm), $(vcgencmd measure_temp), $(vcgencmd get_throttled)"
  # For other systems
  #echo "$(lscpu | grep MHz), $(sensors | grep 'Core 0')"
  echo -n "Sysbench CPU ";
  time sysbench --test=cpu --cpu-max-prime=2000 --num-threads=$CORES run >/dev/null 2>&1
#  echo -n "Sysbench Memory ";
#  time sysbench --test=memory --memory-block-size=1M --memory-total-size=10G --num-threads=$CORES run >/dev/null 2>&1

Example output:

Running sysbench --test=cpu --cpu-max-prime=2000 --num-threads=1 (CTRL-C quits)
ARM frequency(45)=700000000, temp=31.5'C, throttled=0x0
Sysbench CPU 22.118s
ARM frequency(45)=1100000000, temp=39.0'C, throttled=0x0
Sysbench CPU 21.961s

Additionally I measured power consumption at 5V with a UNI-T UT61B meter. Note that the Pi model was a non-W RPi Zero (no heatsink, board upside down, so not much airflow, ~20°C room temperature) and had an active USB hub with a WiFi adapter (Ralink Technology, Corp. RT5370) attached. The current draw is for the whole system (RPi + hub + WiFi). I was connected the whole time through SSH. Here are some results:

speeds (arm / gpu / sdram) (MHz)
idle (mA)
load (mA)
temperature (°C )
time (s)
Thermal throttling
Stock (1000 / 400 / 450)29138044.524.2No
1100 / 500 / 50029240747.622.0No
1150 / 550 / 55029341849.221.0No
1150 / 600 / 60029342249.821.0No
1200 / 550 / 550
(did not boot)
Benchmark results on Raspberry Pi non-W. Maybe apples to oranges, but an Intel m7 6Y75 does the sysbench test in ~10.0s…

So the takeaway is that you can overclock the Pi Zero by ~10-15%, it will not throttle and you actually have a decent performance gain. Cooling seems to be unnecessary. You have to try what works for your specific hardware though (ymmv). You could take this further by voiding your warranty and using “force_turbo” + “over_voltage” and trying higher frequencies. You can find all config.txt overclocking parameters here and the RetroPie wiki has an extensive entry about overclocking.

Here are the entries I used for /boot/config.txt:

# Pi Zero W modest overclock. See: for parameters

# Pi Zero W maximum overclock. See: for parameters

# Pi Zero 2 W modest overclock. See: for parameters

Published by HorstBaerbel

Software developer by trade and interest, but I venture into the electronics- and diy-world from time to time.

One thought on “Overclocking the Raspberry Pi Zero / Zero 2

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: