🛠 Surveiller la température et la fréquence de la Zero 2 W
Objectives
Learn to read the thermal and frequency state of the board: the Zero 2 W packs a quad Cortex-A53 into 65 × 30 mm without a fan, using thick copper layers as heat sinks. The throttling threshold is 85 °C (progressive reduction starting at 80 °C). You will measure, constrain, and verify behavior under load.
Equipment
- 1 Raspberry Pi Zero 2 W (connected via SSH)
- Optional: a small adhesive heat sink (closed cases worsen temperature rise)
- A test load: sysbench or a simple calculation loop
Complete code
# Température du SoC (mesure côté GPU, la plus juste sur les kernels Pi) :
vcgencmd measure_temp # temp=48.3'C
# Fréquences actuelles des cœurs :
vcgencmd measure_clock arm # en Hz (1000000000 = 1 GHz nominal)
# Bits d'état : 0x0 = tout va bien ; bit 0 = sous-tension,
# bit 18 = bridage thermique déjà survenu depuis le boot :
vcgencmd get_throttled
# Échantillonnage toutes les 2 s pendant une charge :
nproc
seq 4 | xargs -P4 -I{} sh -c 'yes > /dev/null &'
while true; do
printf "%s %s %s\n" "$(date +%T)" \
"$(vcgencmd measure_temp | cut -d= -f2)" \
"$(vcgencmd measure_clock arm | cut -d= -f2)"
sleep 2
done
# Stopper la charge : Ctrl-C puis « pkill yes »
Expected verification
At idle, around 40–50 °C; under load on all 4 cores, the temperature rises sharply. At 20 °C ambient, a bare Zero 2 W sustains an indefinite stress test without throttling (documented by the foundation) — but in a closed case or without a heat sink in a hot room, the frequency drops below 1 GHz and get_throttled displays bit 18. Optional passive cooling then becomes a performance choice, not a safety one.
Common errors
- Relying on
/sys/class/thermal, which can lag:vcgencmd measure_tempspeaks directly to the GPU, which is the reference on this SoC. - Confusing
throttled=0x0(never throttled since boot) with the instantaneous state: history bits are only cleared on reboot. - Believing bit 0 (undervoltage) is reliable on Zero: the Zero range has NO hardware undervoltage detection —
0x0does not prove the power supply is good. - Attaching a heat sink to the wrong component: heat comes from the RP3A0 package (the SiP SoC), not the regulator.
- Leaving
yesrunning in the background after the test: the board heats up for no reason and the SD card wears out.
Other tutorials for this board
- Premier démarrage de la Zero 2 W sans écran (headless)
- Se connecter au Wi-Fi (et comprendre les limites 2,4 GHz / WPA2)
- GPIO en Python : LED et bouton avec gpiozero
- Le tour de passe-passe « clé USB Linux » : Ethernet sur USB (g_ether)
- Serveur de blocage de pub réseau avec Pi-hole
- Remettre une Zero 2 W en état de boot : usbboot et boot files
Code examples for this board
clignotante.pyPythonbouton-gpio.pyPythoncapteur-i2c.shBashsurveillance-temperature.shBashcapteur-dht11.pyPythonservo-pwm-sysfs.shBash