Festive RGB LED Tree

created: 2022/12/31

Summary

My custom RGB LED Christmas Tree. (other holidays are available) Plus the star I made for the top. Happy Holidays!

Pictures

Videos

Why?

I was interested in getting an RGB Christmas tree in about 2017. While doing research on what RGB light strings were available I came across this post from Evil Genius Labs. I had already completed some RGB LED projects with ws8212 LED strips so I felt like it was something I could do. I also thought it looked amazing and loved the idea of being able to animate each light on the tree.

The Tree

The tree is just a cheap tree from Walmart. (Other stores are available) It currently has 266 LEDs across 10 vertical levels. It is in 3 sections and the wiring allows them to be disconnected so the tree can still be taken apart for storage. The RGB LEDs are zip tied to the branches on the lower 2 sections. I was careful to position the LEDs so that the position of each LED could be mapped in software. This basically involved making sure a specific number of LEDs were on each branch and being careful that they are all positioned evenly.

The Star

Currently has 62 LEDs. (tree + star = 328 LEDs total) I cut the star by hand using my jig saw from acrylic (32% translucent cast acrylic) and assembled it with acrylic glue.

The front is held on with hot glue on the edges to allow for maintenance and repairs. I would have liked to use magnets and might upgrade it at some point.

The LED strips are all connected with flexible silicone wire and held in place with hot glue. That came in handy this year when several LEDs were dead and had to be replaced.

The strip I used for the star originally had been used in something else and I had issues with it. I used it in this project knowing I might have some problems with early failures and I certainly have.

WARNING

It is 2022 when I am writing this, 5 years from 2017 when I started this project, and I know some things now that I did not when I started. I am not an EE so forgive my naive understanding of all this.

An important difference from Evil Genius Labs is that I am NOT using a “cylindrical connector” (aka barrel connector) to supply power as I found it was getting warm. (A fire hazard) Most DC barrel connectors are not actually rated for that many amps.

A single 5v LED (that I used) = 0.3 Watts.

Just on the Tree there are 266 LEDs which at 5v is something like 16 Amps which is well above the rating for a barrel connector and most power supplies that will have one.

I supply power to various points evenly throughout the tree directly from a regulated power supply with multiple outputs using thick (18 awg) wire from a good supplier Parts Express. You can see the supply and power wires in some of the videos above. When the tree is setup they are hidden a few feet away from the tree.

The thing I have learned about low voltage LEDs in practice is that it takes thick wires to push a lot of current, and at low voltage (5v LEDs) it takes wide wires to supply enough current.

When you are pushing a lot of current down a wire it starts to heat up because of the resistance of the wire against the electrons. (I’m sure this is not exactly correct, sorry to anyone who is triggered by this terrible explanation. :P)

So if you are using lots of 5v LEDs make sure you consider your wiring requirements and power requirements. Otherwise consider using higher voltage LEDs like 12v.

(DO your research and DO NOT build a fire hazard.)

How Much Time?

I have sunk quite a few hours into the lighting firmware and hardware. Additionally I have added things to the tree itself and software pretty much every year. I am still working on the more advanced animations and this year worked on improving the mappings of the physical locations of the LEDs.

I would have no idea at this point how many actual hours, but a lot. Over the last 5 years I have sunk plenty of time into it but I think it was worth it. YMMV

Some Technical Details

This is not a comprehensive overview of things as I could honestly write multiple posts just about the lighting firmware.

Just some random bits that were tricky or badly documented elsewhere.

Through trial and error and much pain I discovered I should use the RX pin on the Wemos D1 micro to drive the LEDS. This allows the hardware timers on the Wemos D1 to drive the LED updates.

I love the FastLED library but had issues with “laggy” updates to the strip where animations would stop and then jump forward or other strange behavior. After a lot of time spent testing I found it was related to how FastLED updates the strips and the watchdog timers on the esp8266 (from what I remember). I did tons of testing fixes and never got things to work 100% reliably.

Eventually I found that the NeoPixel library works differently and did not suffer from the same issues for me. However FastLED provides additional helper functions that were nice and I already had built quite a lot of functionality around it.

I actually use FastLED internally to do all the color & brightness work / transitions and when it’s time to update the strip I convert the FastLED colors into what NeoPixel expects and update the strip using NeoPixel. It adds a small step (and takes more memory) but the firmware I have written is already non-blocking and handles updates in an efficient way.

The main loop is a non-blocking frame-limited lazy update loop. If nothing is updating the data for the strip it will periodically send out an update just to ensure things are in sync (in the real world noise can sometimes flip a pixel). If things are updating the data faster than the desired frame limit (number of updates per second), then the updates will be skipped to limit the frame rate.

The lighting firmware has a REST-ful JSON API which can be controlled with an android app I made. The android app just builds a UI using info queried from the API for each device. So each device can have it’s own modes and color palettes which are then queried by the app.

I built a custom board to make assembling the lighting controllers easier. I use stackable pin headers to attach a Wemos D1 to the board. I had them made at EasyEDA. I would like to release the schematic but it needs some more work. Specifically some of the holes need to be enlarged (like the screw hole and power input holes). Additionally I would like to route the power from the input to the output directly but that requires much wider traces. In practice I just wire the power from the supply to the strip skipping the board entirely for the LED power.

Wrap It Up

I would like to release my lighting firmware at some point in the future. It needs some improvements around the way settings are stored and some cleanup to be more generic, but otherwise is very functional.

I hope you enjoyed seeing my Festive RGB LED Tree in action. I am always blown away by the amazing effects you can create from just some simple loops and variables.

Happy Holidays!

The Meta

v0.1

2022/12/16
  • Finally started writing this post

v0.1

2022/12/23
  • More content
  • Added gallery and videos

v0.1

2022/12/31
  • Finished writing
  • Published