RGB LED Maker Tree

10,648

73

14

About: Maker, tinkerer and aspiring jack of all trades.

Our local makerspace 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.

Supplies:

Step 1: Parts List

    Step 2: Electrical System Overview

    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).

    Step 3: Attach Waterproof Connectors

    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.

    Step 4: Attach Connectors to FadeCandy Boards

    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.

    Step 5: Insert LEDs Into Spacer Strips

    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")

    Step 6: Assemble Power Junction Boxes

    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.

    Step 7: Assemble Data Junction Boxes

    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.

    Step 8: Wire Power Supply

    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.

    Step 9: Setup Raspberry Pi

    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.

    Step 10: 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".

    Step 11: Electrical System 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.

    Step 12: Construct Frame

    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.

    Step 13: Construct Lower Disc / Mount Electronics

    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.

    Step 14: Attach Frame to Tree

    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.

    Step 15: Deliver (optional)

    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!

    Make it Glow Contest 2018

    Runner Up in the
    Make it Glow Contest 2018

    Share

      Recommendations

      • Colors of the Rainbow Contest

        Colors of the Rainbow Contest
      • Gardening Contest

        Gardening Contest
      • Party Challenge

        Party Challenge

      14 Discussions

      1
      None
      manattweb

      4 months ago

      Voted! Would love some additional pics of the actual boxes and other electrical components. Doubt I could replicate this project based on the writeup alone.

      2 replies
      0
      None
      kurt_rooksmanattweb

      Reply 4 months ago

      The tree just got taken down, I updated the write up with some additional pictures of the junction boxes and power supplies.

      0
      None
      kurt_rooksmanattweb

      Reply 4 months ago

      Thanks for the for vote!

      I struggled with your exact point while writing it up, I didn't any pictures of the inside of the boxes. Our deadline got moved up and the first thing to suffer was documentation. It's actually still on display for a few more days, but when we take it down, I'll grab a few more pictures to fill in the blanks.

      0
      None
      compudon

      4 months ago

      Great Project! Voted! I appreciate the details of the various parts you used. I also would like to see some of the power distro when you have a chance.

      2 replies
      0
      None
      kurt_rookscompudon

      Reply 4 months ago

      The tree just got taken down, I updated the write up with some additional pictures of the electrical components.

      0
      None
      kurt_rookscompudon

      Reply 4 months ago

      Thanks for the vote, I'll update the write up when we take the tree down and get some better pictures on the wiring.

      0
      None
      WannaDuino

      4 months ago

      love it
      now thats a place i want to work.\
      WannaDuino from WannaDIY

      How to use the Rainbow LEDsVID_20180428_195458time logo2.png
      1 reply
      0
      None
      Frankv14

      4 months ago

      Voted. Very nice!
      Is there a particular reason why you went for individual LEDs instead of IP68 WS2812 strips (e.g. https://www.aliexpress.com/item/5-Meter-WS2812B-IP... It seems to me that there would have been a *lot* less work to make the tree from strips.
      Was there a reason why you went for multiple FadeCandy controllers? All the strips could have their data lines daisy-chained together (still run the power supply in parallel) and run from a single controller, which could be the Raspberry Pi itself (https://tutorials-raspberrypi.com/connect-control-raspberry-pi-ws2812-rgb-led-strips/).

      1 reply
      0
      None
      kurt_rooksFrankv14

      Reply 4 months ago

      Thanks for the vote Frankv14, much appreciated!

      The reason for using the "light strand" style LEDs instead of the strips was to allow for the spacing between LEDs to be adjustable and to allow the strands to be tensioned top to bottom without putting excess load on the thin copper backing those strands use. That said, it would have probably worked either way, sometimes decisions need to be made to keep moving a project forward :).

      The FadeCandy boards can only control 64 LEDs per channel and they each have 8 channels. In order to drive 24 strands, we needed 3x FadeCandy boards. I believe (don't quote me on this), the reason they limit each channel to 64 LEDs is to allow for high frame rates. Additionally, I really like(d) the interface the FadeCandy server (running on the Pi) provides. The creators have done a nice job of abstracting the lower level controls and allow developers to focus what is displayed, not how it is displayed.