rgb led load monitor (linux only)

hi y'all

for those who still remember my never ending thread about the 8x8 rgb matrix and toner transfer ::), now it's evolved into a load monitor for my linux box. so far it is just a history plot with fancy colors. consists of the firmware of course and a little perl script. it is linux only, as I don't know anything about this win32 visual X stuff. and unless I'll be forced to learn it, this won't change ("ignorance is a bliss...") :sunglasses:

here's the video

Looks good, mad!

Will you be posting the details? I'd love to set something like this up. I've been poking around with something similar, and would like to see how you did it :slight_smile:

Well, it is quite simple.

As described in the 8x8 matrix project, the arduino talks to the common anode rgb matrix using 4 daisy-chained 595 shift registers and hardware spi (all of this can be found in the playground). Three arrays form the 'framebuffer' for each color value. These are scanned by an interrupt routine, which translates the values into a PWM signal for each led and color. To allow for serial communication with a PC, I had to limit the bit-resolution of the PWM cycle to about 5 (32 brightness levels per color). Otherwise there's just no time left for the cpu to do anything else. The framebuffer can be manipulated with a set of predefined primitives, such as setting a led/row/column to a desired RGB or HSV value.

In the stripped down code for the load monitor I've added a serial listener which hands some data bytes to different functions, depending on the value of 1st data byte. On the PC there's just a little perl script reading the current system load via the 'iostat/systat' commands and adding that to a ring-buffer which is shifted by 1 entry at each update. The buffer is then sent to the arduino to plot the load history. Doing the rotation in the atmel chip might improve overall speed, but the fastest updates on the load data on my linux system is 1s anyway.

Currently I'm working on a smaller sized version to make it fit into a nice wooden container. I'm basically removing the quartz and some driver chip which turned out to be of no use. Hardware SPI is fast enough to run with the 8MHz internal oscillator without any bad effects on the PWM cycles. A port of ladyada's game of life and a battery pack might come later.

All the fine details, schematic, code and so on can be found on my blog.
For windoze users, there's still a chance to get in running with perl. The module Device::SerialPort has a win32 equivalent. But I wouldn't know how to get access to load statistics on a win32 box.



Awesome. I'll check out the source later :smiley:

That box looks great, by the way. Did you build it yourself, or find it somewhere?

I would've liked to make it myself, but I don't have the right tools for that kind of precision cutting/milling yet (except for glue and wax). I just did the CAD drawings and pestered a local carpenter's shop until they made it. Actually 5 of those (payed for 4 :slight_smile: ). Otherwise cost per piece would've skyrocketed. It's still about 30$ per piece, including the glass. Applying the hard-wax and gluing it together was a piece of cake.

I found a similar design on youtube. He's also a member of this forum I think.