Stylish Small Christmas Tree From Aluminum Strip and WS2812b Led Strip

by wouterrusman in Circuits > Arduino

2573 Views, 31 Favorites, 0 Comments

Stylish Small Christmas Tree From Aluminum Strip and WS2812b Led Strip

Christmas tree with ws2812 and arduino nano

During December almost everyone enjoys Christmas lights as they light up the dark world around us when we get to work in the early morning. Also, they bring the holiday spirit into our homes and offices and give a warm welcome home after a day's work.

This was my inspiration when, a few years ago, I came up with this very simple but stylish Christmas tree made from an aluminum strip, a WS2812b led strip, and any type of small Arduino or other embedded platform at your disposal.

The aluminum strip will create the tree shape and the led strip's dimmed green color will make it look even more like a tree. Some of the leds will color red to make up the decorations; the decorations will "sparkle" to make it even more alive.

Let's build it!

What You Will Need

materials.jpeg
wemos.jpeg
woorden-base.jpeg
ledstrip.jpeg

The materials needed for this build are only a few :

  • an aluminum strip of 1 meter (about 40 inches) in length and about 15mm (about 0.6 inches) wide;
  • 1 meter of ws2812b led strip, preferably 144 leds per meter and a black background for the best effect;
  • a thick wooden base - this can be either round, square, oval, or whatever shape you like (I took a round one to match the shape of the tree); and
  • a wood screw to attach the aluminum strip to the base.

The tools you need are :

  • a soldering iron to connect the led strip to the Arduino;
  • a drill to make the hole in the aluminum strip; and
  • a screwdriver to fasten the aluminum strip to the base.

Additionally, you can use any round object to help shape the cone of the tree.

Shape the Aluminum Strip to the Shape of a Christmas Tree

hole.jpeg
spiral1.jpeg
spiral2.jpeg
spiral-mounted.jpeg

First, drill a hole at one end of the aluminum strip, to be able to attach the strip to the base. Do this first because this is harder to do once the strip is shaped like a tree.

Next, shape the aluminum strip with your hand into the cone shape that is so common for Christmas trees. Be sure to use the end with the hole in it as the tree base, rather than the top! You can use any round object to assist you in the shaping process: a coffee mug, a roll of tape, a broomstick... anything round will do.

Once you are satisfied with the shape, attach the aluminum strip to the base using the screw. It may be necessary to re-model the shape of the aluminum strip a bit after it has been attached to the base. When you are happy with its appearance, continue to the next step.

Attach the WS2812b Led Strip to the Aluminum Strip

strip-mounted.jpeg
strip-connection.jpeg

Now attach the (self-adhesive) WS2812b led strip to the aluminum strip.

This led strip has a working direction, often marked by arrows, or by "di" (data in) at the start and "do" (data out) at the end. Be sure to attach it in the direction as shown in the picture, with the arrows pointing towards the top of the tree. If you attach the led strip in the wrong direction, then the led strip won't work like it should.

Start attaching the led strip from the top, working your way back to the base. Due to the shaping process, the aluminum strip has expanded a bit; thanks to this, the led strip will end before it reaches the screw.

It may be necessary to apply a little CA glue between the top of the tree and the start of the led strip to prevent the led strip from peeling.

Attach the Led Strip to the Arduino

wemos-conection.jpeg
arduino nano_ws2812.png
attiny85_ws2812.png
wemos-d1_ws2812.png

Next step is to attach the led strip to the Arduino (or another embedded platform of your choice).

In this example I used a Wemos D1 Mini because last year I gave a workshop on building this Christmas tree. (The esp processor on the Wemos adds wifi connectivity so you can even make it interactive if you like.) For a more simple and straightforward example I also included the schematics for how to connect an Arduino Nano, or even something as tiny as the Attiny85.

When connecting the led strip to your Arduino, keep the following in mind :

  • WS2812b led strips use 5 volt, so only connect the +5v of the led strip to the 5v outlet of the Arduino, or directly to the 5v line of the USB cable. Never use more than 5 volts !
  • WS2812b led strips use a lot of current, especially when all 144 leds are set at bright white. Make sure the current can be delivered by the power source and by the voltage converter on the Arduino itself! If you are unsure, or if you would like to use a lot of leds at a high bright setting, then you can connect the 5v of the led strip directly to the 5v power line of the usb cable; however, this is not covered in this instructable. Be aware that setting all 144 leds on the strip to the brightest white will quickly burn out a Wemos!
  • Connect the data pin to a digital pin on the Arduino; in this example I use pin 1 on the Wemos, which translates to Arduino pin 5.

Upload the Code

The final step (for now) is to upload the below code to the Arduino and enjoy the result of our build.

I've created this code for the Arduino Nano, but it will also easily run on the esp8266 of the Wemos or on any Arduino-compatible hardware.

#include <Adafruit_NeoPixel.h>
#define PIN 5 // pin 5 (wemos D1) is connected to the data pin of the led strip
#define NUM_LEDS 144 // the total number of leds
#define NUM_SPARKLE 26 // the number of sparkling led's in the chain
Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_LEDS, PIN, NEO_GRB + NEO_KHZ800);

// the array of led's that will be red and sparkle at random
int leds[NUM_SPARKLE] = {0,4,10,16,22,27,33,37,44,50,58,63,70,74,79,85,90,97,102,107,114,120,126,132,138,143} ;

void setup(){
strip.begin();

// set all the led's on the strip dimmed green
for(int i = 0; i < NUM_LEDS; i++ ) {
strip.setPixelColor(i,0,0x05,0);
}
strip.show();

// set the led's in the sparkle array dimmed red
for (int l=0; l<= NUM_SPARKLE; l++) {
strip.setPixelColor(leds[l],0x10,0x00,0x00);
}
strip.show();
}

void loop() {
sparkle(leds[random(NUM_SPARKLE)]); // sparkle a random led from the array of red led's
}

void sparkle (int sparkleLed) {
// intensify the brightness fast
for (int s=10; s<= 125; s++)
{
strip.setPixelColor(sparkleLed,s*2,0,0);
strip.show();
}
// and dim the brightness fast
for (int s=125; s>= 10; s--)
{
strip.setPixelColor(sparkleLed,s*2,0,0);
strip.show();
}
}