Although the Raspberry Pi is small, it packs a lot of power into that small space. When doing intensive tasks, the Raspberry Pi can generate too much heat, and it does not come with a fan to help keep the temperature down. For this reason, it is important to keep an eye on your Raspberry Pi’s temperature to make sure it does not get too hot and risk damaging components. Furthermore, the Raspberry Pi will not perform up to par if it needs to throttle itself to keep temperatures down.
In this tutorial, you will see how to check the temperature on a Raspberry Pi from both command line and GUI. Both methods can be used to continuously monitor temperatures, and warn the user if the device starts getting to hot. If you notice it getting hot too often, you may need to point a fan at your Raspberry Pi or install one on the device in order to keep temperatures down. This will be particularly true for the Raspberry Pi 4 and future models, which are packing more and more power into an already tiny device.
In this tutorial you will learn:
- How to check Raspberry Pi temperature from command line and GUI
|Category||Requirements, Conventions or Software Version Used|
|Other||Privileged access to your Linux system as root or via the
# – requires given linux commands to be executed with root privileges either directly as a root user or by use of
$ – requires given linux commands to be executed as a regular non-privileged user
How to check temperature on Raspberry Pi
To get the Raspberry Pi’s current temperature from command line, you can execute the following command:
$ vcgencmd measure_temp
In order to keep a continuous eye on the temperature, we can use the above command in conjunction with the
watch command. For example, this command will check the temperature by executing the command every 1 second:
$ watch -n 1 vcgencmd measure_temp
If, in addition or instead, you would like track the Raspberry Pi’s temperature from the GUI, we can add a panel icon to the task bar at the top of the screen on Raspberry Pi OS. Follow the steps below to enable the temperature plugin for your task bar:
- Right click on the task bar at the top of your screen and click on ‘Add / Remove Panel Items’.
- In the Panel Preferences window, click on the ‘Add’ button to add a new plugin.
- Then, find and highlight the ‘CPU Temperature Monitor’ option from the list. Click on ‘Add’ when done.
- Finally, you will see continuous temperature output in the task bar on your desktop:
In this tutorial, we saw how to check the temperature on a Raspberry Pi system. Perhaps even more importantly, we learned about methods to continuously monitor the Raspberry Pi temperature, allowing us to keep an eye out for irregularities that could slow down the Raspberry Pi due to necessary throttling, or ultimately damage components after prolonged heat exposure.