Introduction: A Charlieplexed Christmas Tree

Welcome to my first Instructable. I'd appreciate any constructive criticism you care to leave in the comments, but please be gentle.
Having recently built a 4x4x4 LED cube, I thought it might be interesting to apply the same techniques to building an LED Christmas tree. I used a single white LED as the 'star' and then a mix of red and green LEDs forming the sides. Initially I thought to make the tree star shaped in cross-section, but eventually realized that a six sided star would be easier as the supports could be made out of two identical triangles.
I used an Arduino to control the light patterns with a sketch loosely based on some sketches for a 3x3x3 LED cube.
What you are going to need:

1 medium white LED
15 diffused red LEDs
15 diffused green LEDs
6 resistors (values depend on the LEDs chosen, I used three 10 ohm and three 1k ohm)
some medium gauge copper wire
some fine gauge copper wire
an Arduino, I used a Freeduino
an Arduino compatable prototype shield
some male headers to attach the protoshield to the Arduino

Step 1: Building the Frames

I decided to make the tree with five layers and a single white LED on top. This meant I needed to construct 5 six sided stars to support the different layers. I decided on a base 8 cm across which implied that the stars should decrease around 1.3 cm per layer. I then measured out an 8 cm equilateral triangle on a piece of hard wood and drove in three nails at the vertices. I then bent some medium gauge copper wire around the nails to form a triangle. I cut off the excess wire and soldered the two ends together.
I then built a second identical triangle. The two triangles were soldered together to form a six sided star.
Four more stars were made similarly by decreasing the distance between the nails by about 1.3 cm per layer. The smallest layer was pretty tiny and I might try decreasing the amount of change per layer next time.

Step 2: Soldering on the LEDs

I wanted three green and three red LEDs per layer. I soldered the anode (the shorter leg) of each LED to the point of the star. I found it was easiest to hang the LED from a bend in the anode using a clamp to hold the LED in place. The cathode of the LED was allowed to point upwards. These cathodes will form the connections between the layers.
I used a coin cell to make sure all of the LEDs still lit and then cut off the extra length of anode. The last picture shows the finished star right side up and sitting on the cathodes of the six LEDs.

Step 3: Soldering the Layers

I learned the hard way that it's easiest to solder from top to bottom. Position the two layers so that the tails of the upper cathodes are in contact with the next layer's cathodes just below the body of the LED. Carefully solder the two cathodes together. I lined up all the green LEDs and all of the red LEDs to make selecting appropriate resistors easier. Use a coin cell to make sure all of the LEDs still function.
Support the white LED above the top layer of the tree. Solder its cathode to the cathode of one of the six LEDs in the top layer. Leave the anode unattached for now.

Step 4: Connecting to the Prototype Board

Solder the male headers to the underside of the prototype board to make connection with your Arduino. It helps to use the female headers on the Arduino as a guide to soldering.
Bend the cathodes from the bottom layer of the tree inward. Then bend each of the leads to find a hole on the prototype board. It's best if the holes chosen are already connected to another hole. This will make the connections to the Arduino easier, but you will probably not be able to do that in all cases. Once all six of the cathodes are inserted to the protoboard solder them in place.
Take six lengths of small gauge copper wire. One of these gets soldered to the anode of the white LED at the top of the tree. The other end gets soldered to a free connection on the prototype board. For the other five lengths, form a hook in one end and solder it to one of the copper frames. There should be one lead per level. Solder the other end to a free spot on the protoboard. Just make sure that none of these leads or the cathodes are connected to each other on the protoboard.
You will need to choose appropriate resistors for your LEDs. I found that 10 ohm resistors worked well for the green LEDs and 1k ohm worked well with the red LEDs. This gave approximately the same light level out of the LEDs and kept the current flow low enough to avoid taxing the Arduino.
Since the resistors were matched to the color of the LEDs they had to be connected to the 'columns', that is the cathodes. To do this I soldered one end to each of the legs of the columns and the other end to one of the digital pins on the protoboard. Just to make life simpler I used digital pins 8 through 13. As you can see in the photos I did this on the top of the protoboard. I also tried to keep them sequential as one moves around the sides of the tree. This makes programming a bit simpler.
I used small gauge wire to connect the layers to the analog pins of the protoboard. Since the analog pins can function as digital pins this kept the two sets of lines separate and makes it a bit less confusing. I connected the top layer (the white LED) to A0, I then moved down the array with layer two attached to A1 and so on. As you can see I ran these leads on the bottom of the protoboard. Again this was to keep things cleaner.

Step 5: Upload the Code

Connect your protoshield to your Arduino and upload the code below. I'm not much of a programmer so the code is very crude. I've seen much better programs to control LED arrays but, to be honest, I didn't understand them so I couldn't adapt them to this application.
Since all of the LEDs in a column are attached by their cathodes which are attached to one of the digital pins and all of the anodes in a layer are connected together and to one of the analog pins any LED can be lit by setting its cathode high and its anode low. This does limit how many LEDs can be controlled at one time since a three dimensional system is being controlled by two variables. This can be gotten around by using POV (peristance of vision) but that's beyond my ability to program. See some of the 4x4x4 LED cube Instructables for examples.
Enjoy your LED xmas tree. If you get motivated to write better code please post it in the comments section.
Thanks for playing.


gbushta made it! (author)2017-01-15

Thanks for posting this Christmas Tree. I made something like it, but I multiplexed instead of Charlieplexing. I sort of made mine like one would make a cube. I made five rings of LEDs on different sizes. I used six resistors and five transistors. For the yellow star LED I forgot to use a resistor. That would have made it seven resistors. It works anyway.
Thank you for the inspiration.

ChrisB197 made it! (author)2015-11-12

could you post you're schematic diagram for this? thanks

alcurb made it! (author)2015-01-05

Very nice effects in the video.

I can't find the schematics on your instructable. I have a visually-oriented learning style and I need to see a schematic to build one that I can scale up.

Thanks for posting.

cgrrty made it! (author)2013-12-06

I like it

donce16 made it! (author)2013-11-30

Very nice job :)

Geekaton made it! (author)2013-10-20

what size LEDs have you guys used for this?

lmperkins made it! (author)lmperkins2013-10-20

They were normal 5mm LEDs.

LeskoIam made it! (author)2013-01-16

Hello again! Just to show off here is my christmas tree (just some pictures). Keep up the good work, man

lmperkins made it! (author)2012-12-17

You are correct, see my comment in step 4 on choosing resistors. I usually find measuring the actual current flow in a system once it's built works better than simply using a calculated value as components vary a fair bit. The suggested resistors worked well for me, but YMMV.

LeskoIam made it! (author)2012-12-17

Just one thing. I looked up the specs for original Arduino (2009) and just want to say that pins can safely sink or source 40 mA of current. So if you light up a column of LEDs (20mA per LED times 5 = 100 mA) is more than twice as much.... Just be careful and do the math and use transistors or driver IC. And correct me if I'm wrong. Otherwise, great project with a lot of educational content!

teeh made it! (author)2012-02-10

Nice work! A will be good gift with a small barebones arduino clone. Congrats for the first non cube charlie.

nobusato93 made it! (author)2012-01-19

What is the power rating of your LEDS? :)

lmperkins made it! (author)lmperkins2012-01-19

According to Sparkfun they are rated to 20 mA at 2.2 volts. This works out to 40 milliwatts.

sjswanner made it! (author)2011-12-25

Great project. Just got done building and programming. This is the first project that I have done like this and programming it was fun.

lmperkins made it! (author)lmperkins2011-12-25

That's great! If you have a picture to post, it would be fun to see how it turned out.

Slittape made it! (author)2011-12-22

Nice workmanship! Very clever to use a 6 pointed star.

mikeasaurus made it! (author)2011-12-22

This looks great!

pushpavanthar made it! (author)2011-12-22

thank was very informative...:)

blinkyblinky made it! (author)2011-12-21

Very nicely done.

Kiteman made it! (author)2011-12-21

Ohhh, pretty....

I have great respect for folk that build stuff like this - I never seem to have enough fingers, myself.

About This Instructable




Bio: She is a crafter including bookbinding, jewelry design and paper crafting. He prefers electronics with lots of blinky lights and an Arduino to control them ... More »
More by lmperkins:Birch Bark Custom Wrap for Amazon Echo DotSpinning Blinking Papercraft TardisHan Solo in Carbonite Pendant from Copper or Silver Metal Clay
Add instructable to: