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
1 month ago 00:01:28 1
С Днем святого Архангела Михаила. Красивое поздравление с праздником Михаила Архангела
1 month ago 00:04:49 1
Play To Earn🔥This New Play to Earn Game is About to Make a Lot of People RICH
1 month ago 00:00:37 1
I AM KIRA || Death Note
1 month ago 00:10:38 1
Колокольный звон Святогорья в честь Крестителя Руси
1 month ago 00:08:04 1
БОЖЕ КАК ВКУСНО Научили в дорогом ресторане, удивила Всех моих гостей!Ни одного ПРАЗДНИКА без них
1 month ago 01:01:47 1
Новая жизнь после смертельной болезни и многолетней зависимости. Интервью Зака Скау и Ады Кондэ
2 months ago 00:05:54 1
Трендовый гаджет от кисетных морщин — тестирую на себе + Простой массаж для красивых губ
2 months ago 00:02:10 1
Glockenspiel - “Corpse Bride Theme“ Lesson by Project Musica 🎶
2 months ago 00:04:50 1
Motionless In White - “Immaculate Misconception“ Official Music Video
2 months ago 00:03:18 1
целую))))
2 months ago 00:20:02 1
NEW Thermaltake TH360 V2 Ultra ARGB Sync AIO CPU Water Cooler With IPS LCD Screen
2 months ago 00:05:18 157
Don’t Speak feat. RE4R Ada and Casual Leon
2 months ago 00:07:04 1
Они самые лучшие! Бантики из репсовой ленты своими руками/новинки канзаши 2020/мк/DIY/kanzashi