Intro: Charliplexed Christmas Tree for My Cubby
Last Year I got a set battery operated bulb type Christmas light set at the local home store and put it on a table top Christmas Tree. Just to make the cubby festive. Almost all the comments I received were along the line of "Don't they Blink?"
This Year I was bound and determined to make something that would stand out.
An LED battery operated set of lights cut up and hooked to an Arduino, Charlieplexed style, and a little code to make them bllnk in nice patterns, changed randomly, filled the bill.
It took some time to get the random part to work, but I didn't want the pattern to repeat over and over and get boring.
I could have fancied it up hiding all the connections and putting the arduino in an Altoids tin. But I wanted them to see all the wires. Besides, its geekier that way.
Step 1: Finding the Positive Side of the LED
Charliplexing allows N*(N-1) LEDs to be driven by N pins. In this case i had 20leds, so using 4 pins to get a of 12 leds
I cut them apart then used the supplied battery case to find the positive wire for each.
Step 2: Wiring Up the Sets
After Finding the positive I soldered them up in sets each set having the positive and negative from each LED soldered together. You can test if you got it right with the battery case - touching the wires to the battery wires, one LED should light - reversing the wires should light the other one.
Step 3: Covering the Wires With Paper Plant Tape
You can get tape from the local craft store that is used to cover stems of Silk Flowers. I got mine at Walmart. The "tape" is waxy paper colored green and sticks to itself quite well and hides the wires routed around in the tree.
Step 4: Hooking Up the Lights
This instructable isn't about Charliplexing theory - but how to apply it in an insteresting way. Charliplexing is well documented. This Wikipedia article gives you the basics. Plus if you search here at instructables you will find many more examples.
To hook up the lights I used pins 10,11,12,13 on the Arduino. How you hook up each wire of each pair of LEDs doesn't matter - the wires of each are interchangeable. You just have to hook each pair across different pins through the 100 ohm resister. In this case:
a 10 & 11
b 11 & 12
c 12 & 13
d 10 & 12
e 11 & 13
f 10 & 13
You can add more sets by using more pins, but the more you add the less time each light stays on and the dimmer it will get. 12 seemed to be a nice round number and nicely bright.
Step 5: Collecting the Wires Together
I tried just plugging the individual sets directly into the bread board, but they kept pulling out.
So I put them all on a little perfboard and with a female connector to keep the wires managed.
Radio shack sells a four conductor Rainbow Wire that has solid conductors and fits the connector quite well.
The connector was cut from a long strip of female headers I picked up on eBay.
Step 6: Breadboard Layout
The other end of the rainbow wire connected to a small breadboard with an Adafruit Arduino Clone. I used 100 Ohms for the limiting resistors , which is a little low putting about 5v/200ohm=25ma to each lit LED. The Arduino didn't seem to mind and it makes the LEDs a little brighter. Since they are pulsed the whole circuit will draw the 25ma and a little for the Arduino - Making battery operation feasible. The original light set pulled almost 120ma from the batteries - this is much lower.
Step 7: A Little Software
I have a LED Heart kit from Jimmie Rodgers and the software was ready made to drive the Charliplexed array. I modded the code to add a random shuffle. This rearranges the pins between each time a particular animation frame is called to keep from getting boring and repetitive.
I made a few arrays that hold each animation frame lighting one LED , two, three.... and so on.