Arduino + Bluetooth Jenkins CI build monitor using car lights

The Problem

Like many software projects, at work we use Jenkins CI to build the software after every check-in. To ensure we take notice of the build status we also have a number of 'build radiators' around the office showing the status of the main builds.  That's a fine idea but they soon begin to merge into the wallpaper and get ignored....

Searching the Internet I found lots of people who have connected various devices, mainly lights, to Jenkins giving a more visual indication of the build status.  I looked at traditional traffic lights, but that has been done lots of times before; and real traffic lights are very large and expensive (even on eBay).  More thinking required.....
Spoiler ;)

The Design

My thinking went like this :
  1. I work on a car related project...
  2. Cars have lots of lights...
  3. The rear lights are red (bad) , orange (not so bad) and white (good)
  4. Arduino controlling the lights (I have lots of parts - and a bit of experience)
  5. Generic interface (via Bluetooth)
  6. Jenkins integration using existing Raspberry PI - connected via Bluetooth
Now that sounds like a plan.

After quick search on eBay i had purchased a rear light cluster from a Golf MK2 GTI (a classic)  for 99p + postage, happy days.

The Electronics

While waiting for the lights to arrive I set about designing the Arduino controller to receive the Jenkins status and translate it into a light sequence, having built a few light controllers before I was on safe territory.  I decided on the following:
  • 10 channels; to control each bulb individually
  • I have lots of transistors already so wanted to use these rather then purchase relays
  • Use Bluetooth to control the unit from the existing Raspberry PI build radiators.
    • I wanted to try my new HC05 Bluetooth module
After reading the various component specs I decided on the following parts list:
  • Arduino mini-pro (I already had some knocking around and they are cheap from China ~£2.50)
  • 2 * ULN 2803 Darlington arrays
    • By doubling up each channel that provides 50V & 1 Amp per channel. 
    • Giving 8 channels
  • 2 * TIP31 power transistors
    • 3 amps per channel
    • Providing the final 2 channels
  • HC-05 Bluetooth module
    • Link to the outside world
The initial circuit diagram is shown below.  The thing to note is the voltage divider (2*resistors) on the TX line to the Bluetooth module, this is needed as the module is 3.3v !
Circuit schematic
Once the design was complete, off to the soldering bench :)
Completed board

Board top view

Completed board

The Lights

On receiving the lights I realised that it wasn't going to be as simple as I had originally thought :(  Cars have a common earth, I had used NPN transistors that sink current so need separate earths DOH!  Looking on the positive side I got to play with me Dremel metal cutter, sparks everywhere :)  After a quick rewiring job we were back on track.

Cutting the lights
Tracks cut ready for wiring

Common live installed

Ready to go

Bulb holders ready to go

Bulb holder installed in light

Having done my sums and realising how much current standard bulbs draw I had also ordered LED bulbs.

LED bulbs mounted

Testing

With the lights modified and the controller built it was time for some testing.


No problems :) Well there's a surprise !

The Software

With the basics working it was now time to think about the software. I designed a simple command line interface that allowed standard sequences to be selected for the left and right lights independently.  This is operated via the Bluetooth module leaving the standard Arduino serial for debugging and programming.

I also design a number of static and flashing light sequences that can be used on either light or as a set across both lights for more complex patterns.

The interface currently has the following operations:

  • SEQ:{name}
    • Set sequence {name} on both left and right lights
  • SEQ:{name1} {name2}
    • Set sequence {name1} on the left light and {name2} on the right light
  • SEQL:{name}
    • Set sequence {name} on the left light
  • SEQR:{name}
    • Set sequence {name} on the right light
  • OFF
    • Turn all lights off
  • ON
    • Resume the last sequence
  • HELP
    • List off of the define sequences

Putting it all together

With all the pieces complete it was time to put it all together.  This was simply a case of mounting the lights and controller on a piece of MDF.  I painted the board with blackboard paint to give it a nice finished.

The final touch was a custom reg plate "JEN KINS" mounted between the lights.

Mounting lights


The final finishing touch was to apply some 'Stain glass film' to the white lights to turn them green.  This served two purposes:
  1. Now we have green=good
  2. Reduced the brightness of the white bulbs to the same level as the other lights
All done.



Next Steps

I have plans for an enhancement, that is well underway, to add a 3"TFT screen under the reg plate.  The display will show the actual build status of each individual build rather than the aggregated view of the lights.

I intend to use a second Arduino mini pro connected to the first via I2C to control the screen.

Watch this space.....

Comments

Popular Posts