This project was conceived as a present for my friend Chris Lasher to commemorate his moving and beginning a graduate program in bioinformatics. Chris will be doing a lot of programming, and is an adherent of Pragmatic / Agile Programing, one of the principals of which is unit testing. While the unit tests of a program are running, it is nice to know if they are succeeding or failing, and which is predominant. Famously, some pragmatic programmers made a feedback system by controlling full-sized lava lamps from a unit testing framework by plugging together some off-the-shelf home control devices (it cost them over $60). The lamps allowed them to see whether tests were passing or failing, and the gradual heating up on one lamp allowed them to see which events were predominant. This is a cool idea, but I wanted to make Chris something that:
1) would control two small USB-powered lava lamps,
2) would be powered off Chris's fancy new laptop, and interface via USB (no legacy ports on newer computers, particularly laptops),
3) would be a bit more homemade and hacker-friendly,
4) would be allot cheaper.
Driving relays from a USB to serial port converter would seem to be a simple solution. There are many circuits available on-line for serial port control projects. One excellent project that I adapted was at http://www.windmeadow.com/node/4. Unfortunately, almost all USB to serial devices do not allow for low level bit banging (the manually toggling of control lines) that is required to use these circuits. Another approach would be to buy a USB interface circuit, or build one from a microcontroller. Either way, the project would require a good deal of microcontroller code and drivers (even using the pre-existing human interface drivers or a pre-made controller).
I chose to solve this problem with a salvaged USB keyboard, since they are relatively cheap, and contain everything that is needed for three simple on/off outputs, in the form of the number, caps, and scroll lock LEDs. Under Linux there are a number of mechanisms to toggle your LEDs from a program or command line (one is even referenced in Cryptonomicon). Setled is the simplest, and is pre-installed on almost all machines, ledd is built on a client-server model, and there is even a module in the Ruby programing language. Windows and Mac OSs, and other programming languages, should have comparable mechanisms - post them in the comments if you know how to toggle keyboard LEDs in other OSs or programming languages!
I gave Chris his present, and now he can not only see if his unit tests are passing, all the programmers in his new department can know what a cool DIY maker he is.
Remove these ads by
Signing UpStep 1Parts list
1 USB keyboard
(an apple keyboard would also allow you to salvage two USB jacks, making the hackery listed in the "poor man's USB jack" step unnecessary)
$0 for a scraped keyboard with a dead key or two, to $4 on-line (http://froogle.google.com/froogle?q=usb%20keyboard) to $30 at best buy)
2 reed switch relays (Radio Shack #275-233 $3.00, Mouser #677-OMR-112H $1.54)
all other electrical components should only cost a few dollars.
2 transistors (like a 2N2222) (Radio Shack #276-1617, Mouser #511-2N2222A)
2 resistors (Radio Shack #271-1124, Mouser #291-4.7k, yellow-violet-red-gold bands)
4 diodes, something like 1N404 (Radio Shack #276-1103, Mouser #512-1N414B)
1 power switch (SPST)
a little bit of wire
1 perfboard (Radio Shack #276-1395)
1 Altoids tin
some cardboard, a sheet of transparency/overhead film
Tools:
soldering iron and / or wire wrap tool and wire
dremel tool or hand-tool and patience
drill and bits
a digital multimeter
red and green sharpie marker
Knowledge and skills:
Basic soldering and electronics knowledge. I highly recommend Forest Mimm's book if you are an electronics beginner and would like to know how circuits work.
Time:
This project took two evenings and an afternoon, including troubleshooting.
| « Previous Step | Download PDFView All Steps | Next Step » |













































http://wiki.hudson-ci.org/display/HUDSON/Lava+Lamp+Notifier
Would you mind including a link on that page, for people who might find your page, but are interested in making one for another unit testing system?
http://ktechlab.org/
http://sourceforge.net/projects/ktechlab/
There is really not much more information in the .circuit file than in the .svg diagram, but ktechlab is fun to work with when it doesn't crash.
Hope that helps!