Travis Lights

I wanted to make it really clear when my builds are broken, so I hooked up a decomissioned & refurbished set of London traffic lights to a Spark Core and built this small ruby web app to redirect travis build push events to it via the Particle API.

These devices are very low powered, so this webapp translates Travis' webhook notifications into the simple POST request required by the Core API.

If you're interested in building something similar yourself then have a look at the instructions below to see how I put this together!

Set up your repo

You'll need to configure Travis so that it talks to your traffic light controller app. Add the following lines to your .travis.yml:

Build your hardware

My hardware was more complex than it needed to be (Particle now offers a relay shield which is perfect for this), but still very simple.

I attached my spark to a 4 channel relay module I found on eBay and rigged each of the three traffic light bulbs to it.

I figured out the hard way that you need to use isolated power supplies for relay control and the spark (the back emf from switching the relays on and off occasionally triggers the spark to reset).

Please take care when you wire up the mains lines to the relay, make sure there are no bare wires that might touch other metalic objects and, if you can, cover the mains contacts with electrical tape once you're done. Always completely detach your traffic lights when you're working on the electronics!