element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Build a Present
  • Challenges & Projects
  • Project14
  • Build a Present
  • More
  • Cancel
Build a Present
Blog Raspberry Pi Temperature monitoring
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: rpiloverbd
  • Date Created: 10 Feb 2022 1:42 PM Date Created
  • Views 1477 views
  • Likes 9 likes
  • Comments 1 comment
Related
Recommended

Raspberry Pi Temperature monitoring

rpiloverbd
rpiloverbd
10 Feb 2022
Raspberry Pi Temperature monitoring

When you use a Raspberry PI, it is important to monitor its temperature. It should no way exceed 85 Degree centigrade. Years ago, I did a project with Raspberry PI, an LCD and a few jumper wires. My project showed the Raspberry PI temperature on the LCD display.

This project can be helpful for those you have begun to learn Raspberry Pi.

Components:

Raspberry PI 3B+ x 1

16 x 2 LCD with header x 1

Breadboard x 1

10K variable resistor x1

Jumper wires

Connection:

Raspberry Pi  LCD 
VCC VCC, LED+, 1st pin of 10K variable resistor
GND GND,LED-,2nd pin of 10K variable resistor
V0 connected to the common pin of the  10K variable resistor
37 RS, R/W
35 E
33 D4
31 D5
29 D6
23 D7

Code:

At first, I installed pip

sudo apt-get install python-pip

Then I installed RPLCD.py library

sudo pip3 install RPLCD

I installed the RPLCD.py library. 

If you type the following code in Raspberry Pi command prompt, it will show you the temperature.

/opt/vc/bin/vcgencmd measure_temp

We will run this code in our python script and it will show us the temperature in LCD.

import os
import time
from RPLCD import CharLCD
from RPi import GPIO
lcd = CharLCD(numbering_mode=GPIO.BOARD, cols=16, rows=2, pin_rs=37, pin_e=35, pins_data=[33,31,29,23])





def measure_temp():
        temp = os.popen("vcgencmd measure_temp").readline()
        print (temp)
        temp=temp.replace("'C","")
        #return (temp.replace("temp","Temp"))
        
        return(temp)

while True:
        
        lcd.clear()
        lcd.write_string("CPU ")
        lcd.write_string(measure_temp())
        lcd.cursor_pos = (0,13) 
        
        
        lcd.write_string(chr(223)+"C")
        
        time.sleep(1)

  • Sign in to reply
  • robogary
    robogary over 3 years ago

    This monitor is handy to do a design experiment with the RPi temperature, and ways to keep it reduced.

    The design variables are:

    open air cooled VS RPI in an enclosure ( and also size of enclosure) 

    heat sink VS no heat sink 

    convection cooled VS forced air 

    My experience is heat sinks do help, but in a small enclosure, the heat sinks only help to heat the enclosure faster. The enclosure needs alot of vents or a small fan,, and needs to direct fresh cooler air to the CPU.

    A small fan blowing directly on CPU helps alot, even without heat sinks.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube