Continuous integration is great, but it’s only as effective as the visibility of the build status. You can use things like email notifications or Hudson Tray Tracker to help increase the visibility, but I wanted something physical that could radiate the current build status. Something everyone could see; even while you’re grabbing a cup of coffee. So, I decided to try and make a traffic light build indicator.
- Teensy 2.0 (with pins) – $19
- Breadboard and some wires – $9
- 4 channel relay – $9
- Light bulbs – $4 (Home Depot / Lowes)
- Large Blinking Traffic Light – $20
I’m hacking this together with pretty limited experience working with electronics. About 4 credit hours, to be precise. Don’t leave this thing on when you aren’t around.
When you turn the light on each of the lights will flicker randomly. I was a little surprised when I opened the light that there wasn’t really much in there. All three of the lights are wired up in series and connected straight to the power source. It turns out the light bulbs have a thermal switch inside of them that causes them to flicker on and off. The first thing you’ll want to do is replace those bulbs with some regular bulbs. Next up, go ahead and cut all the positive lines that join the bulbs together. You’ll need to make the positive leads a little longer and hook each of them up to the relay. Connect the positive line from the power cord into each of the relays.
Drop the Teensy into the breadboard and hook B0, B1, and B2 up to the relay. B0 should be connected to the input that drives the red relay, B1 is yellow, and B2 is green. Hook VCC and GND up to the relay as well and you’re done wiring.
I used some two sided tape to secure the teensy to the bottom of the traffic light. You might also need to drill a hole in the back of the light so you can hook up a USB cable to the Teensy.
Here’s what the whole thing looks like:
Connect the Teensy to your computer and use Arduino to deploy the Teensy Light Controller sketch to the device. After the firmware is on the device you can use the serial monitor feature in Arduino to test out the wiring. If you send a “1” to the device it should turn on the red light. Sending a 2 will turn on yellow, 3 is green. 5, 6, and 7 will turn off each of the lights. The relay makes a nice clicking noise when a light is toggled.
The Console App
At this point you can turn the lights on and off by writing some integers to a serial port. I threw together a console application that will poll a Jenkins server and push values to the light. It’s on GitHub – go fork it.