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
Software Requirements and Linux Command Line Conventions
Category
Requirements, Conventions or Software Version Used
System
Raspberry Pi
Software
N/A
Other
Privileged access to your Linux system as root or via the sudo command.
Conventions
# – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command $ – 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:
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:
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:
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.