How to check temperature on Raspberry Pi

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
How to check temperature on Raspberry Pi
How to check temperature on Raspberry Pi
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:

$ vcgencmd measure_temp
Checking the current operating temperature of the Raspberry Pi
Checking the current operating temperature of the Raspberry Pi

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
Using the watch command to continue tracking the Raspberry Pi temperature every second
Using the watch command to continue tracking the Raspberry Pi temperature every 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:

  1. Right click on the task bar at the top of your screen and click on ‘Add / Remove Panel Items’.



    Clicking on the option to add or remove panel items from the task bar
    Clicking on the option to add or remove panel items from the task bar

  2. In the Panel Preferences window, click on the ‘Add’ button to add a new plugin.
    Adding a new plugin via the Panel Preferences window on Raspberry Pi
    Adding a new plugin via the Panel Preferences window on Raspberry Pi
  3. Then, find and highlight the ‘CPU Temperature Monitor’ option from the list. Click on ‘Add’ when done.
    Adding the CPU Temperature Monitor to the list of panels in task bar
    Adding the CPU Temperature Monitor to the list of panels in task bar
  4. Finally, you will see continuous temperature output in the task bar on your desktop:
    Checking the Raspberry Pi temperature from the desktop task bar
    Checking the Raspberry Pi temperature from the desktop task bar

Closing Thoughts




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.



Comments and Discussions
Linux Forum