[ Home ] [ Tech Tips ] [ Raspberry Pi] [ Powershell ] [ Ubuntu ] [ Django ] [ About ]
Raspberry Pi - Temperature Monitor

Raspberry Pi - Temperature Monitor

Morning all, sometimes we need to test if your Pi is getting too hot and if you need a fan or upsize your fan or mega size your fan. Let's look at a quick script so we can do this easily

Of course I still love the one liners and can just copy the line below and github is at


sudo apt-get install git -y && git clone https://github.com/LukeKeam/pi-temperature_monitor && cd pi-temperature_monitor && python3 temperature_monitor.py

Or we can take the longer approach and put this in a .py file

import os
import time
import datetime

def measure_temperature():
        while True:
                temperature = os.popen("vcgencmd measure_temp").readline()
                temperature = (temperature.replace("temp=",""))
                now = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
                print(now, ' Temperature:', temperature)

if __name__ == '__main__':


How about that? Super easy aye? The github link also has logging


Luke Keam
Thank you for reading. Any questions, comments or suggestions email me [email protected]
Have a great day

Luke Keam


techgeek logo.biz