Hi, I’m Lex (they/them), I make silly projects.
This one is a physical CPU usage display. Kinda like the CPU usage display in task manager, but with a physical analog meter for each CPU.
It also does memory usage!
Enjoy!
FAQ:
Q: How do you get the performance numbers from the computer to the arduino
A: I wrote a Rust program that uses the systemstat crate to get the data from linux, it then does a little bit of maths to transform the data, and sends that to the ardunio over USB-serial
Q: What’s the music?
A: Just some random thing I threw together in a midi editor, I’m not very experienced with music production.
Q: Does this slow down the computer?
A: Not significantly. Yes, it does take a little bit of CPU time to calculate the numbers, transform them, and send them out the serial port, but as you can see from the meters, the CPUs are often almost totally idle, so it’s not a burden on the computer at all.
Q: Is the code available? A parts list? A wiring diagram?
A: Not really, but I can explain what you need: The wiring is very simple, you can follow an arduino tutorial for wiring up LEDs, and the meters just need to be connected up to PWM pins with the right resistor. The parts are just an arduino, some addressible LEDs, and any suitable ammeter. The software is designed specifically for my needs and I don’t intend to update it to work in the general case where the number of meters might be different to mine, so I’m not releasing the code. Sorry.
Q: Why is the swap meter so high all the time?
A: I’m not exactly sure, but it’s probably a side effect of the way that Linux manages swap space. There might be some other more useful measure that I could use instead. EDIT: okay, update, it hasn’t ever been that high since I filmed the video. I’ve been using it regularly and the swap mostly stays around 0 now, I don’t think I changed the code, so I guess this was an anomaly.
Q: Why not make the refresh rate higher? (related: Why not make it a rolling average instead of polling?)
A: TL;DR: this sample rate is the most sensible. Long answer: Okay, so the answer to this question could get really technical and go into the details of how the CPU usage is calculated by the OS. If you open Windows task manager, MacOS activity monitor, or your favourite linux system monitor utility, you’ll see that the refresh rate is about once per second by default. This is because higher sample rates actually produce less meaningful numbers. Suppose you were to sample at about 100hz. That means that even a really short computation that only takes one hundredth of a second to complete will show up as 100% cpu usage in that time, and then 0% for the rest, insead of being 1% in the past second. There is no such thing as an instantaneous CPU usage reading, becuase it’s either running or sleeping, there is no in between. Any CPU usage number that’s meaningful is an average of the run/sleep time over some period. You have to sample slowly to get meaningful numbers at all. This is also why a rolling average isn’t useful. It doesn’t really tell you more information. This display does, in fact, interpolate between readings. This is why the needles slowly move to the next value instead of jumping there immediately (and then wobbling around a bit as they settle at the new reading). This is effectively the same thing you’d see if it was possible to get a rolling average from the OS. (well not quite, but close enough.) I don’t think any OS does provide an API for a rolling average like that, since doing so would require a significant computational overhead that doesn’t provide any meaningful benefit.
3 views
145
30
6 days ago 01:43:11 1
Moto-X Heaven On Earth
6 days ago 00:31:53 4
Tokyo Xtreme Racer - Customizing and Fully Upgrading 350Z
1 week ago 00:03:46 1
Where Secrets Slumber - Orchestral/Fantasy Music
2 weeks ago 00:14:08 2
U.S. Nightmare Became a REALITY: Russia Took Iran Under Its Military and Economic Protection
2 weeks ago 00:00:00 2
Exploring Kiki’s & Lieutenant Packard’s ABANDONED HOUSE With EVERYTHING LEFT BEHIND & A Classic Car
2 weeks ago 00:32:55 1
💥✅ Mysterious Sewing Techniques. You’ve Been Sewing Wrong All this Time!
2 weeks ago 00:04:30 1
Наутилус Помпилиус - Скованные одной цепью (Воспоминания о будущем)
2 weeks ago 00:25:33 1
BO SINN SIGMA PLAYLIST #1 // VILLAIN
2 weeks ago 00:02:43 1
Rīċa Ēastlēah - Never gonna give you up Cover In Old English. Bardcore/Medieval style
2 weeks ago 00:00:53 1
Cat has a crazy deep meow
2 weeks ago 00:09:39 1
Cho Aniki COLLECTION - Nintendo Switch gameplay release - the return on switch
2 weeks ago 00:23:20 1
Holy Ground - St. Catherine’s Monastery on Mt. Sinai with Fr. Justin Sinaites
2 weeks ago 00:46:54 2
Conversion of Fr. Lazarus ElAnthony تحويل ابونا لعازر الانطونى
2 weeks ago 00:05:41 1
Matteo Mancuso & Joscho Stephan Trio // Django’s Tiger
2 weeks ago 00:12:38 1
Giuseppe Sammartini (1695-1750) - Concerto per la Flauta
2 weeks ago 00:13:56 1
Milarepa - Mantra by Chogyal Rinpoche
2 weeks ago 00:01:27 1
Dead by Daylight | Junji Ito Collection Trailer
3 weeks ago 00:00:30 1
Eagle Brand Medicated Oil Range (English Version)
3 weeks ago 00:04:23 1
Just apples and cocoa! No sugar! I eat it every day and I’m losing weight before my eyes!
3 weeks ago 00:19:33 1
HUMAN REMAINS HIDDEN INSIDE AN ABANDONED ABBEY
3 weeks ago 00:24:45 10
ОТКУДА БЕРУТСЯ ПРОБЛЕМЫ в жизни и как с этим бороться? // профессор Осипов Алексей Ильич
3 weeks ago 00:19:22 1
Create Mind-Bending Effects with this Hidden Effect in After Effects!
3 weeks ago 01:06:00 14
Как управляют людьми и государствами? Виктор Ефимов о Путине, духовности и 500-летнем кровавом бале
3 weeks ago 00:22:23 1
Structures Burn as Palisades Fire Explodes to 1,200+ Acres