Analog CPU/RAM USB Performance Meter

by sprucegum Mar 11, 2019
Download All Files

Thing Apps Enabled

Please Login to Comment

I just found this project and I'm so excited to try it!

Though I've never used an Arduino before, so this should be an interesting experience!

Looks awesome. would it work with an arduino nano? i have one lying around...

Yup! I've got one running with a Nano too! Just needs 5V PWM and a USB connection to your computer!

THX! I'll order the Voltmeters immedeatly :)
Really looking forward to built this...

Today the meters arrived :)
I'll tinker around with your enclosure design a bit and probably add a housing for the Arduino.

Wicked! I'm happy to help if you have any questions about any of the code!

I Finally got around to print the Stand/eclosure/whatever-you-wanna-call-it. Not enough Time fr all the cool projects :( .

Ordered a differnet size of meters somehow... so i ended up remodelling them completely. I remixed them with a housing for an Arduino Nano and since i had it in Tinkercad I added "COU" and "RAM" to the 3D-Print Files.
going to solder it all together and try to wrap my head around the code today or in the next days... so I'll be back with Question soon, I'll guess. :)
Now I'm going to upload my Remix. :)

OMG, Cool! I can't wait to see it! I've got some of the smaller meters too and some Arduino nanos as well! They might just fit with your version of the design! Please post a make I can't wait to see it!

Let me know if the Arduino/Python driver code is working for you. I've had it working on Windows and Linux, Mac shouldn't be a problem either, just need to change a few variables. Sorry it's so poorly documented.

Ok... Arduino part wasn't a problem. But I've never used Python before... so it's going to be interesting, how long it takes me to figure out how it works :)
right now I'm Installing Python, then I'll try to figure out how to turn your file into an .exe and tun it :D
I'm definetly going to learn something today :D

OK Question: I downloaded Python and tried to compile the "meter" file into an .exe following this tutorial: https://www.youtube.com/watch?v=lOIJIk_maO4

i basically typed in "Pyinstallter meter". when i try to start the meter.exe which is located in C:\Users\Maxi\Compile\build\meter the VU gauge doesn't move.

should i cnage PORT = '/dev/ttyUSB0' to the com-port of the Arduino?
did i do something else wrong?

warn-meter.txt says this (maybe it helps?):

This file lists modules PyInstaller was not able to find. This does not
necessarily mean this module is required for running you program. Python and
Python 3rd-party packages include a lot of conditional or optional module. For
example the module 'ntpath' only exists on Windows, whereas the module
'posixpath' only exists on Posix systems.

Types if import:

  • top-level: imported at the top-level - look at these first
  • conditional: imported within an if-statement
  • delayed: imported from within a function
  • optional: imported within a try-except-statement

IMPORTANT: Do NOT post this list to the issue-tracker. Use it as a basis for
yourself tracking down the missing module. Thanks!

missing module named resource - imported by posix (top-level), C:\Users\Maxi\Compile\meter (top-level)
missing module named posix - imported by os (conditional, optional), C:\Users\Maxi\Compile\meter (top-level)
missing module named _posixsubprocess - imported by subprocess (conditional), C:\Users\Maxi\Compile\meter (top-level)
missing module named readline - imported by cmd (delayed, conditional, optional), code (delayed, conditional, optional), pdb (delayed, optional), C:\Users\Maxi\Compile\meter (top-level)
excluded module named _frozen_importlib - imported by importlib (optional), importlib.abc (optional), C:\Users\Maxi\Compile\meter (top-level)
missing module named _frozen_importlib_external - imported by importlib._bootstrap (delayed), importlib (optional), importlib.abc (optional), C:\Users\Maxi\Compile\meter (top-level)
missing module named _winreg - imported by platform (delayed, optional), C:\Users\Maxi\Compile\meter (top-level)
missing module named _scproxy - imported by urllib.request (conditional)
missing module named java - imported by platform (delayed), C:\Users\Maxi\Compile\meter (top-level)
missing module named 'java.lang' - imported by platform (delayed, optional), C:\Users\Maxi\Compile\meter (top-level), xml.sax._exceptions (conditional)
missing module named vms_lib - imported by platform (delayed, conditional, optional), C:\Users\Maxi\Compile\meter (top-level)
missing module named termios - imported by tty (top-level), C:\Users\Maxi\Compile\meter (top-level), getpass (optional)
missing module named grp - imported by shutil (optional), tarfile (optional), C:\Users\Maxi\Compile\meter (top-level)
missing module named org - imported by pickle (optional), C:\Users\Maxi\Compile\meter (top-level)
missing module named pwd - imported by posixpath (delayed, conditional), shutil (optional), tarfile (optional), http.server (delayed, optional), webbrowser (delayed), C:\Users\Maxi\Compile\meter (top-level), netrc (delayed, conditional), getpass (delayed)
missing module named 'org.python' - imported by copy (optional), C:\Users\Maxi\Compile\meter (top-level), xml.sax (delayed, conditional)
missing module named serial - imported by C:\Users\Maxi\Compile\meter (top-level)
missing module named psutil - imported by C:\Users\Maxi\Compile\meter (top-level)

You'll need to change /dev/ttyUSB0 to COM0 or COM1. I haven't used Pyinstaller before. I'm sorry I didn't properly define the python requirements for the code. You need to install psutil and pyserial I believe. I've got plans tonight but I'm free tomorrow and so I'll boot up my Windows machine and run through the installation process myself again. I'll update the code so hopefully it's easier for you and other people to run it on Windows!

They would be awesome! I'm getting everything together to give this project a try as well!

I'll try again later or tomorrow... now the wife woke up from her nap on the couch... so I have to go. ;)
If you could document it a little bit when you run it again, it would for sure hepl a lot for all those newbies like me, who don't know their was around python that well :)

Thanks a lot for your support! :)

Today I installled psutil and pyserial, and changed /dev/ttyUSB0 to COM0 and COM1 respectively (also tried COM2 and COM3 for good measure) but still didn't work. :(
Arduino Nano seems to connect via COM3 so I tried /dev/ttyCOM3 , then i read that under win Com-prts are moved by one so i tried /dev/ttyCOM2 as well.

It should just be COM3 (not /dev/ttyCOM3). You're so close! I fired up my Windows box and I'm trying to update the code so it's easier to work with on Windows/Mac (I think I'll add a config file so you don't need to change the code to change the serial port). Let me know how if you make any progress! I'll shoot you a message when I get this Windows code updated!

I got it running on windows again! If you pull my latest code, it should work for 1 meter. https://github.com/sprucegum/freemeter
I think I'm going to update the code so that it's config file based. I'd love to see how we could add other metrics, like maybe CPU temp or FPS in games?!

Thanks a lot. now I'll try to configure it for CPU and RAM. at the Moment it seems that both meters show the CPU Usage (with a bit of delay - which would make sense, right?)

things that might be also interesting, apart from CPU Temp and FPS might be GPU Usage.... and also Internet/Network traffic. I told a freind of mine aboutthe Project and he thought it could be Funny to add an analog meter to the server rack of his company to show the network traffic. :D

new question (I don't really have a clue how python works, I just try to use my quite limited knowledge with arduino code):
I tried uncommenting
"mem = self.getMem()" and

when i run "python meter" now it just says "' 'svmem' object has no attribute 'percentusage' "


If you pull the latest code I've changed the Python and Arduino code to run from a config file so it should be very easy to set CPU and RAM to whichever pin you've connected the gauge to. I've fixed the issue you mentioned in your last comment too.

If you use the latest Python you'll also need to flash the latest Arduino code too. I've changed the serial protocol so it can work with as many gauges as you can connect. We just need more metrics to graph now!

Moin! :)

Great Work! config file should make it much easier for dummies like me :D.
I'm looking Forward to get home and try it out again. :D
I had it running for a bit with the CPU Meter after I tested it and what I saw is that it's quite "twitchy". What I mean, is that the needle jumps around a lot. At the moment I like it, but I don't know if that gets annoying over Time. so maybe a bit lower refresh rate, to keep the needle of the CPU a bit more stable would be better... Maybe you could include that in your config file? so that everyone is able to decide how twitchy the meter is going to be. I didn't look at the code though if you could easyl Change it anyway... just came as a thought right now. :)

works like a charm now :)
THX a lot for all the help! I think now it's quite easy to setup for people who have at least some basic knowledge of what they're doing.
maybe you could include a simple how-to how to compile it or add it to your auto-start routine in the different systems? that might be another hurdle for some people...
Let's see if I'm one of them ;)