Steve's blog

A blog about what's going on in Analysis UK...

Build Indicators revisited

Arduino controlled X-Mas tree.

Some time ago I posted about a USB Snowman build indicator, the problem with the first version was the USB IO board I used, its availability was limited and the output was designed as a current sink rather than source, so some modifications had to be made to the board, which isn’t really ideal.

Recently I came across the Arduino project, an open source hardware solution and one of the little Diecimila boards provides a perfect base for revisiting the build indicator. The SnowMan is still in use at home and I wanted one for work as well so I figured Id make another build indicator based on the Arduino.

Arduino Diecimila.

The 13 IO pins can sink or source up to 40mA which is ideal for driving the tri-color led used by the build indicator. The led requires 2 current sources and has a common cathode. The Arduino has a USB interface that provides normal serial port communications to the host PC so interfacing is easy as well.

This time instead of a snowman I decided to use a Xmas tree. They are very similar, basically a lump of plastic with a 5MM LED mounted inside. The Arduino provides multiple IO ports of which I’m using only two and the intention here is to provide some common functionality so that the device could be easily adapted to other forms of build indication (Switching relays, multiple project build indicators, other led’s, buzzers etc).

X-Mas tree as new.

Removing the base and replacing the led is a simple job, either use a flat screwdriver or use the cable exit to push off the base off.

X-Mas tree from underneath.

X-Mas tree base removed.

Pull out the led fitted into the tree using the cable. This is no longer needed.

X-Mas tree led removed.

Now glue the base onto the top of the box the tree is to be mounted on. Previously I used a black ABS box but this time I’m using a ice blue box and this has worked out much better for aligning the parts and seeing the led’s on the Arduino board (RX/TX when programming), and also appeals to the inner geek a little more now that the workings can be seen.

Plastic case with X-Mas tree base glued in place.

Drill a hole through the middle of the base so that it will line up with the middle of the x-mas tree. This is best done with the base stuck to the box as it holds it in place and ensures every thing lines up. The hole should be about 7-8mm so that the LED + resistors pass thought easily.

Hole through Xmas tree base and case.

Now we need to prepare the led. Using a standard Tri-Color led (I’ve used Red + Green) we need to fit a current limiting resistor to the supply legs. One for the red and one for the green component of the led.

Using the datasheet for the led the voltage drop across the red Led is about 2V, this leaves a drop of 3V across the current limiting resistor as it’s driven from a 5V source. I’m going to drive the Led’s at 30mA, so we will need a 100R resistor for the red Led.

The green led has a different voltage drop across it (3.4V) so we need to do the same calculation for that and again aim to drive it at 30mA which means we need a 53R resistor, as I only had a 56R resistor to hand I’ve used that which gives us about 29mA current flow.

The data sheet gives luminous intensity for both red and green at 20mA and the green is much brighter than the red so we may wish at a latter date to play around with the drive current to get a better balance when both red and green are on.

Trim the red and green legs of the led fairly short but leave enough to solder on the resistors and attach these. Next connect a cable to the other side of the resistors and to the common pin on the led. If you prefer you can attach the resistors to the Arduino connector and solder the cable directly to the led.

The Tri-color led.

I used 2 core screened cable as this happened to be what I had to hand and as it turns out by tinning the screen and soldering to the led common pin gives a good sturdy way to physically push the led into the socket in the tree (and pull it out again!). I also put a bit of heat shrinking around the connections to prevent them shorting out.

Led with resistors and wires connected.

Now we need the connection to the Arduino board, the led is connected to pins 12, 13 and GND. This is easy as they are all close together and as an added bonus the Arduino already uses an onboard led on pin 13 for status when starting up which means that the tree flashes when the Arduino is starting up, it’s easy to use other pins if you prefer.

I’ve used a standard 0.1" Molex connector (The type used for 3 pin PC fans), the PCB version is ideal, but soldering the led connecting wire to the PCB side and plugging it into the header in the Arduino rather than mounting it on a PCB.

Connector for the led to Arduino controller.

Led connector plugged into the Arduino.

Note that in the photo’s the red cable is actually for the green led and the blue one is for the red led. It doesn’t really matter a great deal which way round they go as long as you get the correct resistor matched up with the appropriate led. However the default in the firmware is that the red led is on pin 13 and green on pin 12.

Next drill some holes in the base of the box and mount the Arduino. Note that one hole is smaller than the others so I ended up using only 2 mounting points due to my lack of any 2mm bolts.

Arduino mounting points.

The advantage of using a translucent box is finding the place to drill a hole of the USB connector. I elected to use a cone drill and just have a circular cut out for the USB cable to go through, it doesn’t look all that professional but it was quick and it worked a treat!

Hole for the USB connector

Next it’s just a matter of screwing everything together.

X-Mas tree build indicator assembled.

A Green X-Mas tree.

I put 6 small feet on the base of the box as well. Why 6? With sticky feet one always falls off (especially with commercial products!) and then it rocks, with 6 you still have some stability to the device if one falls off.

Now all that’s needed is a little firmware to run the Arduino and some software for the PC to put it to use but that’s going to have to be the subject of the next posting(s).

Comments are closed