Flashy: Hardware Utilization Indicator

Using a simple hardware dongle on the parallel port with several light emitting diodes, we can indicate various stats about the system without needing a display.

Possible Uses

The Hardware

Using the parallel port is the most obvious choice of interface because it requires the least amount of support hardware to drive simple electronics projects. The parallel port normally has 8 data lines allowing it to send or receive one byte per iteration not including control data. If desired, these lines can also be used to display more information.

To keep things simple, we map each bit of output to one display bit, ie one LED. Therefor, when we specify an 8 bit integer to output, it's binary equivalent will be displayed on the output.

The actual construction of the light dongle will be soldered to a DB25 connector. Each light requires a resistance in order to not burn out the light due to over current draw. In order to save space and simplify construction, I doubled the lights per resister. This gives a slight difference in brightness when one of the light pairs is lit versus two, but it is not significant. The small yellow led bar was the obvious choice for this since it is compact and makes construction easier since the lights all hold themselves together.

Here is the light bar/dongle I made:

The Software

The software used can vary greatly depending on what the intended use of the device is. For my example, I chose to use the lights to display the current processor usage of my computer. On Linux/UNIX systems, this information can easily be extracted from the /proc directory. Reading the file, /proc/stat gives us various pieces of information about the current processor usage, but it requires some calculations in order to be in a useful form, such as a relative processor utilization percentage. This can be found by taking the inverse of the idle time divided by the sum of the user, nice, and system times. These times correspond to the amount of time the processor spends in each category. Once we convert this into a usable number, such as a percentage, the correct number of leds can be turned on.

flashy.c can be downloaded here When run, flashy will poll proc (every 500ms by default) to compute the cpu usage and then display on the parallel port. Pretty simple!

Eric Buehl ebuehl@andrew.cmu.edu
(2/26/05)