A Charlieplexed Christmas Tree




About: 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. Together they have way too much time on their hands.

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.



    • Tape Contest

      Tape Contest
    • Trash to Treasure

      Trash to Treasure
    • Arduino Contest 2019

      Arduino Contest 2019

    21 Discussions


    3 years ago

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

    1 reply

    Reply 1 year ago

    sorry, no idea how to generate a schematic


    2 years ago

    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.


    4 years ago on Introduction

    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.


    6 years ago on Introduction

    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.


    6 years ago on Introduction

    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!


    7 years ago on Step 5

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


    Reply 7 years ago on Introduction

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


    7 years ago on Introduction

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

    1 reply

    Reply 7 years ago on Introduction

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


    7 years ago on Introduction

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