element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • 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 & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • 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
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • 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
Arduino
  • Products
  • More
Arduino
Blog cpu monitor panel - part 2
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Former Member
  • Date Created: 14 Apr 2019 12:09 PM Date Created
  • Views 716 views
  • Likes 10 likes
  • Comments 4 comments
  • python
Related
Recommended

cpu monitor panel - part 2

Former Member
Former Member
14 Apr 2019

In the first part, I tested out Python to see if it was possible to gather some system information which worked very well. While waiting for the LCD screen to arrive I thought I'd try to see how straight forward it was to get that information out of a serial port.

 

I connected some hookup wires to the internal serial port of my Desktop PC:

 

image

 

And then used the following Python script to test:

 

#!/usr/bin/env python

import unittest
import sys
import serial

PORT = '/dev/ttyS0'
BAUDRATE = 115200

sport = serial.serial_for_url(PORT, BAUDRATE, timeout=10)

sport.write("hello")

sport.close()

 

Just a very short script to open the port, send out the word "hello" and then close the port again. So I connected an oscilloscope to the hookup wires to monitor whether any signals were being sent when the script runs:

 

image

 

Awesome, the script works, the serial port works and there is a definite path to transfer system information to an Arduino which then display that onto and external LCD.

 

I was hoping to get some back and forth communication between the Python script and the Arduino happening but the oscilloscope suddenly reminded me of something I'd completely overlooked, it's been so long since working with serial ports that I'd forgotten that the desktop pc uses +/- 12V on its serial port and the Arduino uses 0V/5V ttl serial. Damn... I need order a level shifter before I can move onto that stage

  • Sign in to reply

Top Comments

  • jw0752
    jw0752 over 6 years ago +1
    Hi Lucie It was good that you did the testing and determined the level difference before hooking things up. Thanks for posting this interesting project. John
  • DAB
    DAB over 6 years ago

    Nice update.

     

    DAB

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Former Member
    Former Member over 6 years ago in reply to ralphjy

    I ordered a bunch of Max3232 boards already populated even though I know full well that theres at least 2 Max232's in a dip package in my stores, theyre too cheap on ebay to be bothering with the soldering!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • ralphjy
    ralphjy over 6 years ago

    Remember that RS232 also has the signals inverted so if you just do level shifting you'll need to account for the inversion in software.  If you use an RS232 interface IC like the Max3232 then it does the inversion as well as the level conversion.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • jw0752
    jw0752 over 6 years ago

    Hi Lucie

     

    It was good that you did the testing and determined the level difference before hooking things up. Thanks for posting this interesting project.

     

    John

    • Cancel
    • Vote Up +1 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