Arduino Controlled Christmas Light Tree

Arduino Controlled Christmas Light Tree

December 1, 2022

Arduino Controlled Christmas Light Tree

I’ve always wanted to try and make on of those crazy Xmas light setups that I see people on the internet make so I figured I’d start with something small like a simple Xmas tree and maybe eventually work my way up to something Grander if I can get this to work first.

The lights for this project are going to be controlled with a Arduino UNO and and a SainSmart 8 channel Relay Module.

Hooking up the Arduino to the relay module is pretty simple.  The VCC of the relay board is connected to the 5V pin of the UNO and then the 8 relay pins IN1-IN8 are connected to 8 digital pins on the UNO (2-9 in my case). A ground connection to the UNO is not necessary because I will be powering the relay module separately.

For this project I am going to be using an Anker 24W Dual USB Wall Charger to power both the UNO and Relay Module.

I had some old USB cables laying around that I will use to connect the boards to the power supply.

The wires on the USB cables were awful small so I just hacked off the ends and soldered on some thicker wires directly to the USB plugs. I thought about 3D Printing a new end cover but will wait to see if everything works before spending any more time on little details like that…

…for now I then used a little heat shrink tubing to clean everything up.

For the cable going to the relay module I added a DuPont connector to the other end. (This connects to the relay boards VCC and GND pins after completely removing the jumper from VCC JD / GND).

Power to the UNO is supplied with this other cable with a 2.1mm x 5.5mm Male DC Pigtail Connector.

Here is what the completed power setup will look like. (I did go back and redo the UNO power cable to soldered the thicker pigtail wires right to the USB connector.)

Next after a little help from Google I wrote a simple test code to flash every light on the board. (basically simulate turning on and off the relays.)

At this point everything looked like it should work.

For the tree lights I am going to be using these 12V LED strips.  I thought about using normal outdoor Xmas lights but really didn’t want to play around with 120 voltage just yet.

To power all of the LED strips that I will be using (probably around 66 feet in total) I am using this MEAN WELL LRS-150-12 150W 12V 12.5 Amp Power Supply.

Next it was time to design the actual tree so I jumped over to Fusion 360 and did a quick and rough design of how things were going to go.

This is the star and hanger mount portion of the design. I’m not going to lie I didn’t put much effort into this and everything is probably going to be clobbered together.

Starting with the Star… it’s about 24″ wide so it was printed in 5 pieces to fit on my printers bed. (everything was printed in PETG)

This is what it will look like when assembled.

The back side has reliefs for little printed joiners. (it’s rough because PETG supports suck)

The joiners are super glued in place. It’s still a little flimsy but hopefully it works out.

I had some old white led strips laying around so I covered them in Kapton tape to make them yellow and then glued them to the star base.

The LED strips are then soldered together…

… testing as I go.

All wired up… I might add some more tip lights later as it looks a little weird here.

I am using a piece of aluminum for a hanger.  Everything will attach to this with a few 4-40 screws. Here you can also see the star tips a quickly added.

This is where all of the LED strips will attach too.

I bought these cheap 8′ long Polystyrene Screen Molding pieces to attach the strips to. Hopefully these hold up to the winter elements.

I designed and printed a quick JIG to slice the moldings in half.

This allows the blade of the razor to slide down the middle of the molding to slice it in two without losing a finger.

After drilling a few holes the pieces are test fit into the star base.

So far so good….

Next it was time to attach the strips to the molding pieces. The strips have 3M sticky tape on the back of them…

… but I’ve learned in the past that this probably isn’t actual 3M tape because it doesn’t stick for very long so I also used some zipties every foot or so.

The LED strips come 16.4 feet long so once I cut them to 8 feet to match the molding pieces I solder on female DC Pigtail Connector to the other half.

Here you can see the molding pieces are attached with a 4-40 screw and the remaining LED strip piece with be secured with another zip tie.

To finish off the frame work I printed up a bunch of these clips.

The clip secure the light strips to a cross piece of 1″ molding.

There are two cross braces… one at the bottom and this one at the top. Hopefully these are enough to keep everything in place.

Now it was time to finish the wiring. Again I am using 2.1mm x 5.5mm DC Pigtail Connectors.  These will make it easy to disassemble everything when not in use.

I start by connecting all of the negative ends together into a single ground wire.

Here are all of the 8 needed connectors for all of the LED strips.

After that I strip and bend a single wire for the positive side of power to the LEDs.

Relay Terminal Layout

This gets connected to the COMMON terminal for each relays.

Then the positive side of the pigtail connectors get attached to the Normally Open terminal of each Relay.

The power wires from the relays get connected to the 12v power supplies V- & V+ connections.

This mess is just for testing purposes.

The first test and everything looks like it’s working.

Now I just have to figure out how to cleanly stick all this stuff in this Plano box so its all weather proof while still being able to wire everything back up.

This is a quick design I came up with that should drop right into the box while still allowing me access to the wiring.

Here is the printed holder ready to go after installing a bunch of heat set inserts.  I screwed up a few dimension for the plug holder but I made it work.

A quick test fit in the box and everything looks good.

The power supply and mains plug got mounted first.

Next was the UNO mounted vertically.

The relay module was mounted up top so all of the connections could be easily done once it was in the box.

I also installed a 10 amp fuse which should be plenty because all of the lights only draw about 5.3 amps.

Next wires were connected from one end of the plug to the main input for the powers supply.

I then stuck a big grommet into the side of the box…

…and the mains power cord was fed into the box and connected to the other end of the plug.

This is how everything fits ion the box so far.

More grommets and wires for the lights are fed in from the other side of the box.

Those wires are then connected to the relays. Connecting the ground to the power supply was a bit of a challenge.

Those wires were then soldered to the pigtails.

Here is the finished power/controller box.

The tree was then hung from my deck with the aluminum bracket show before.

I used some string to secure the bottom to keep it from swinging in the wind.

I stuck the box up off the floor under my deck table to help keep it out of the elements.

The power cord is plugged into this outdoor time which turns on at dusk and then runs for a set time before turning back off until the next day.

Here is a crappy video just to show all the patterns of the final program.  The music was added post production just for the video, my setup is not that complex yet it’s just lights so far. There are also some branches in from of the camera which make it look like some of the light are out but they all work.


Overall everything worked great the only problems I had was it if got below 30°F the relay board would stop working until it warmed up.  It wasn’t that the relays would actually freeze and stop working… I think it was something to do with the other side (control side) of the board because the LED’s wouldn’t even cycle through with the program. 


All Information, Pictures, and Material is copyright © 2022 by Stephen Thone and may not be used for any personal or commercial purposes without the consent of the author. All rights reserved. The Author makes no guarantees or warranties as to the accuracy or completeness of, or results to be obtained from accessing and using the Information herein.

Leave a Reply

Your email address will not be published. Required fields are marked *