RGB LED Maker Tree

by kurt_rooks in Circuits > LEDs

16111 Views, 82 Favorites, 0 Comments

RGB LED Maker Tree

RGB LED Christmas Tree
IMG_5766.JPG
the_tree.png

The Innovation Hub sponsored a tree to be displayed on Main Street for the month of December (2018). During our brainstorming session, we came up with the idea of putting a ridiculous amount of the LEDs on the tree in place of traditional ornaments. As makers that like to do things a bit over the top, we quickly decided that a tree that could play animations would not only be fun, but would also generate some buzz.

I researched some existing solutions that used dedicated LED controllers and decided that close source just wouldn't do. I came across an excellent tutorial by Adafruit on using their "FadeCandy" LED controllers. This neat little board has made a number of Burning Man appearances and has lots of good examples to work from. The tree consists of 24 strands of individually addressable RGB LED strains controlled using FadeCandy boards and powered by a single 5V 60A power supply. A Raspberry Pi serves up animations to the FadeCandy boards through micro-USB cables, which in turn connect to the individual LED strands. The strands are arranged radially to form a cone / tree shape as seen above.

The neat thing about this setup is that it isn't limited to a single use. The LED strands can be rearranged to form many shapes, including a regular old grid. We hope to reuse this setup to make an interactive exhibit / game for our next Mini MakerFaire in the spring.

Parts List

Electrical System Overview

controller_final.png

As seen in diagram above, the tree's electrical system can be divided into several major components: control box, power junction boxes, data junction boxes and LED strands. The control box houses the 5V 60A power supply and the Raspberry Pi. The Data Junction boxes contain the FadeCandy LED controllers. The Power junction boxes contain bus bars to distribute power (5V & GND) to the LED strands. Each pair of junction boxes (one data + one power) control eight LED strands. As there are 24 strands of LEDs used in this project, there are three sets of junction boxes (six total).

*There's an error in the diagram shown above, CAT6 Cable 0 (Strands 0-7) should be (Strands 0-3) and CAT6 Cable 1 (Strand 7-15) should be (Strands 4-7).

Attach Waterproof Connectors

LED_wiring_tree_side.png
IMG_8986.JPG
IMG_8988.JPG

As the tree was intended for outdoor use, extra care was taken to ensure that all the connections were waterproof. For those wishing to make a similar indoor project, the waterproof connectors can be ignored in favor of the 3 pin JST connectors that come with the LED strands. A lot of the labor on this project went into soldering the waterproof connectors to the strands.

For our setup, we cut the existing JST connector off the LED strand and attached a 3 pin waterproof connector in its place. Care should be taken to add the connector on the "input" side of the LED strand, the data connection on the LED strands are directional. We found that each LED had a small arrow indicating the direction of data. We initially attached each of the three wires on the LED strand side using a technique involving solder, heat shrink and caulking. Eventually we switched to using these waterproof splice connectors, which proved to be a huge time saver.

The the power/data side (ie, the side that the LED strands connect to), we used 22 AWG wire for power/ground and CAT6 cable for data/ground. Each CAT6 cable contains four twisted pairs, so we could connect four LED strands to a single CAT6 cable. The diagram above shows how the 3 pin LED strand breaks out into 4 wires (5V, GND, Data). Connecting four wires to three wires seemed to be a point of confusion when assembling this project. The key takeaway is that the two grounds (Data + Power) are combined at the waterproof connector.

Each CAT6 cable was terminated with a RJ-45 connector which plugged into a RJ-45 female housing connected to a FadeCandy board. The CAT6 wires could have been soldered directly to the FadeCandy boards, but we opted to add connectors to allow for easier repairs if needed. We made all of our wiring 48 inches long to give ourselves some flexibility when physically assembling the tree.

Attach Connectors to FadeCandy Boards

IMG_9002.JPG
IMG_9006.JPG
IMG_8989.JPG

The FadeCandy boards we purchased didn't come with headers attached, rather there was two rows of 0.1" spaced vias. Ultimately we decided that the FadeCandys would connect to the the CAT6 cables using standard RJ-45 "punch-down" sockets. In the event that we needed to replace a FadeCandy (turns out we did!), we also added 0.1" pins to each FadeCandy board. We attached female crimp pins to each of the eight wires attached to the RJ-45 punch down socket to connect to the 0.1" headers. In addition to crimping the pins to each wire, I also added a little bit of solder to prevent the pins from pulling off. Of course, I only discovered this solder "trick" after half the pins I crimped failed on me, lesson learned.

Insert LEDs Into Spacer Strips

IMG_20181117_171634264.jpg
20181117_112415.jpg
IMG_20181217_134210559.jpg

After reading a few forum posts and watching some videos from other folks that have made similar 'trees', the use of plastic spacers seemed to be a recurring item. The strips allow the spacing of the LEDs to be adjusted to fit individually needs and allows the LED strands to be tensioned between the upper and lower tree rings. The size of the LED must match the size of the spacer holes (in our case 12mm), such that each individual LED fits snuggly into the holes in the spacers. We decided to have our LEDs zig-zag, such that 24 strands of LEDs forms 48 columns around the tree.

We made a mistake at this point that forced us to generate some additional "holes" for LEDs. We cut the strips in half so we would have 48 lengths of spacers. What we discovered was that each eight foot spacer contained 96 holes (one every inch) and cutting them in half on a hole meant we were four holes short per LED strand. Heed our mistake and account for this ahead of time! We ultimately laser cut some "extensions" to add the missing holes.

The vector file used to laser cut the extension brackets is attached below ("TreeLightBracket.eps")

Assemble Power Junction Boxes

IMG_8978.JPG
IMG_8979.JPG
IMG_9000.JPG

The three power distribution boxes each house a pair of bus bars. The first bar distributes 5V and the other distributes GND. As our tree was displayed outdoors, we opted to use waterproof electrical boxes to house the bus bars. We attached each bar in place using hot glue and added a scrap of a manila folder between each bar and the case to prevent shorts. Each power junction box connects to eight LED strands via the 22 AWG wire previously described. Each box connects to the main power supply using 12 AWG wire and has an "Anderson" connector to allow for easier transportation.

Assemble Data Junction Boxes

IMG_8981.JPG
IMG_8997.JPG

Using the same boxes as with the power distribution boxes, we created three "data" distribution boxes housing a single FadeCandy board in each. The micro USB cables from the Raspberry Pi connects to the FadeCandy boards inside this box and the CAT6 cables connect to the RJ-45 female sockets as well. As the FadeCandy boards don't have large mounting holes, we zip tied each board to a scrap of plywood. This plywood also functioned as an insulator to keep the board from short circuiting against the electrical box.

Wire Power Supply

IMG_8963.JPG
IMG_8965.JPG
IMG_8967.JPG

The 5V 60A monster of a power supply we ordered provides power for the entire project. Each of the three power junction boxes connects to this main supply with 12 AWG wire. Each junction box has its own pair of Anderson connectors and an inline 20A fuse to isolate any shorts. The Raspberry Pi gets power from this supply as well, which I accomplished by cutting a USB cable up and connecting the power/ground wires to the power supply terminals. As these wires were quite small I also added a couple zip ties to add some strain relief on these connections. The power supply didn't come with a AC outlet plug, so I cut up an standard computer/monitor power cable and attached it to the screw down terminals. Be extra careful at the stage and triple check your work! I found this Adafruit project extremely helpful in understanding how the power is connected.

Setup Raspberry Pi

IMG_8975.JPG

I setup a microSD card with the Raspbian operating system and setup a FadeCandy server using the instructions found here:

https://learn.adafruit.com/1500-neopixel-led-curta...

https://learn.adafruit.com/1500-neopixel-led-curta...

I found that the OpenPixelControl repository had a great set of examples for interfacing with the FadeCandy server. I ultimately ended up writing a Python script to loop animations on the tree when the Pi booted. It loads videos at our target resolution, steps frame by frame through the video and sends a FadeCandy control array for every frame. The FadeCandy configuration file allows multiple boards to be interfaced as if they were one single board and makes for a very clean interface. The python script that controls the tree is setup to load files from a specific folder. As such, adjusting the animations is as simple as adding/removing video files from that folder.

In the process of the testing the tree, I managed to corrupt an microSD card. I attribute this to removing power from the Pi without doing a proper shutdown. To avoid future incidents I added a push button and configured it to safely power down the Pi. I also made several backups of the final microSD card, just in case.

Prior to receiving all the parts for the actual tree, I forked the OpenPixelControl git hub repository and discovered a neat LED simulator inside. I actually used this program to test a large portion of the animation script mentioned above. The simulator takes a configuration file that indicates the physical placement of each LED in space (think X,Y,Z) and uses the same interface as the FadeCandy server program.

Make Animations

The previously linked Python script can play any video format on the tree, as long as the resolution is 96x50. The resolution of the tree is 48x25, however the tool I was using to convert videos to lower resolution (Handbrake) had a minimum pixel limit of 32 pixels. For this reason, I simply doubled the actual resolution of the tree and then sampled every other pixel in my Python script.

The process I used for most of the animations was to find or generate a GIF, then crop it (using handbrake) until the aspect ratio was 1.92:1. I would then change the output resolution to the target 96x50 and begin the conversion. Some GIF files wouldn't import into handbrake correctly for me, so I used ffmpeg to convert them to a video file first.

Using the OpenPixelControl interface, you can also generate patterns programmatically. During initial testing I used the "raver_plaid.py" python script quite a bit.

The animations used for our tree are attached below "makerTreeAnimations.zip".

Electrical System Test

IMG_20181116_191623063 (2).jpg
16 Strand Test Pattern
16 Strand Mario Test

With all the major electrical/software components connected, it was time for test everything out. I built a simple wooden frame to tension the LED strands, which proved very useful in identifying if any strands were out of order (which there were several). The videos above show a canned demo from OpenPixelControl and my custom video player Python script running a Mario animation.

Construct Frame

IMG_8996.JPG
20181119_192238.jpg
IMG_20181118_152010448.jpg
IMG_20181117_152401002.jpg

We attached all the LED strands to a prototype frame we build out of of PVC and pex tubing. We left the zip ties loose so we could reposition them if necessary. This proved to be a great decision as we decided that the vertical PVC broke up the LED grid too much and switched to a CNC'd design instead. The final design basically consists of an upper loop and a lower loop. The lower loop is mounted at the base of the tree and has a larger diameter than the upper loop that is (no surprise), mounted at the top of the tree. The LED strands span between the upper and lower loops to form the cone (or "tree" if you will) shape.

Both loops were cut out of 3/4" plywood on a CNC router, the vector file for the loops are attached below ("TreeMountingPlates.eps"). The upper and lower loops each consist of two semi-circular pieces that form a complete loop. The two piece design was so that we could easily attach the two halves around the tree without damaging the branches. Our local CNC guru added a nice bit of flair by making the upper and lower frame loops into snowflakes. A touch of white paint and some glitter were also added to spruce the frame up.

Construct Lower Disc / Mount Electronics

20181119_192158.jpg

We cut two half circles out of another piece of plywood the same diameter as the lower loop previously described in order to mount the electronics (control box, junction boxes) underneath the lower loop. As with the upper and lower loops it was made in two pieces, then joined along the center line to form a complete circle. The disc was painted green to help it blend in and seal it from rain. We mounted all the electronics boxes on the underside of this disc, such that the disc formed a kind of umbrella to the electrical components. Excess wire lengths were wrapped and zip tied to this disc to maintain a clean appearance.

Attach Frame to Tree

20181119_192212.jpg
IMG_8995.JPG
20181120_154015.jpg
20181120_173019.jpg

When the upper and lower frame loops were dry, we drove several long pieces of angle iron down into the tree's pot to help stabilize the trunk. The angle iron also provided mounting points for the upper and lower frame loops, without adding strain to the physical tree. With all the LED strands attached to the upper loop, we used a piece of rope to suspend the upper ring assembly from the ceiling. We found that it was easier to slowly lower the ring onto the tree instead of attempting to hold it in place by hand. Once the upper ring was in place on the angle iron, we attached the lower ring to the tree and zip tied the LED strands tightly to the lower loop as well. The lower (green) disc was mounted directly below the lower loop with all the electronics attached.

Deliver (optional)

20181120_195619.jpg

Now sit back and enjoy the fruits of y(our) labor! Our tree will be on display in North Little Rock for the entire month of December (2018). I'm already pondering how we can make the display interactive for our mini MakerFaire in the spring.

Have any questions? Ask in the comments!