RGB LED Christmas Tree, controlled via web app

This year, I convinced my wife to let me decorate the small 4’ Christmas tree in our family room. Naturally, I had to use one of the Photons and a LED string I had laying around unused. :smile:

Note: This is my first real post here, so I’m not sure how much detail to include. A lot of this information seems like it’d be obvious to the pros around here, but might be useful for people just getting started. Feedback is most welcome. I can try to make it a full tutorial, if there’s any interest.

Features

  • Remote control over Wi-Fi via web app, so it’s cross-platform (Windows, Mac, Linux, iOS, Android, etc).
  • Responsive web app design, so it’s functional on desktop, laptop, tablet, phone, etc.
  • Settings (brightness, selected pattern, etc) are saved to EEPROM, in case it loses power.
  • 15 different patterns.
  • Solid color mode, with color picker.
  • Basic, in-development, experimental, interactive drawing mode. Did I mention it’s experimental?

Parts

  • A string of 50 WS2811 RGB LEDs
  • Particle Photon
  • 5V 3A (or higher) power supply
  • Jumper wires, perma-proto board, etc.
  • Christmas tree

A note on power

I powered both the Photon and LED string with the small 2A USB power adapter. The string could use 3A at full brightness, all white, so I just try to avoid doing that. :slight_smile: I really should upgrade to a 5V 4A power supply, just to be safe.

FastLED Library

I used the FastLED library, which I highly recommend. It makes it relatively easy to add cool new patterns and effects. It supports a large variety of MCUs (Arduino, Teensy, etc), platforms, and RGB LED chipsets (WS2812, APA102, etc). It’s highly optimized for speed and performance. There’s a fork which adds support for the Core and Photon. It’s available in the Build online IDE and can be downloaded and included in projects in Dev.

The FastLED library is maintained by the brilliant Daniel Garcia and Mark Kriegsman, who regularly add new functionality and share amazing new patterns, effects, techniques, etc. Check out the fantastic FastLED community over on G+: https://plus.google.com/u/0/communities/109127054924227823508

The pattern featured in the video is ColorWavesWithPalettes, which was created and shared by Mark Kriegsman. It draws color waves with an ever-changing, widely-varying set of parameters, using a large set of different color palettes.

Remote Control via Web App

The remote control web app is available here:

http://evilgeniuslabs.org/tree

I used a slightly modified web app (that I made for other projects) to control the brightness, pattern, etc. It should work on pretty much any device/OS. It’s built using AngularJS for completely client-side JavaScript and Bootstrap CSS for responsive design/style. It’s hosted on GitHub Pages, which provides free hosting.

You start by entering your Particle access token. You can click the Save button to save it to client-side local storage, so you don’t have to enter it again. Nothing is stored or sent anywhere else. It pulls a list of your Particle devices using your access token. After you select a device, it requests the current setting values (brightness, pattern, color, etc).

Source Code

Here’s a link to the source code (firmware and web app): https://github.com/evilgeniuslabs/tree
Let me know if you have any questions, comments, suggestions.

New Year’s Resolutions

It’s good to have goals. Next year I’m going to go bigger, and make use of polar coordinate mapping, like the brilliant folks over at Maniacal Labs:

9 Likes

Thanks for sharing!

Man that tree that Maniacal Lab’s did up in the bottom video is crazy amazing :smiley:

My kids and wife would take a crap if I turned the tree on for the first time and that is what they saw :smile: I wonder how much ti would cost to do the do the same setup?

1 Like

Yeah, he really went all out. He used 350 8mm WS2811, so it’d probably be $80 or more, depending on the wire color, IP rating and supplier: http://www.aliexpress.com/item/Decoration-Lighting-100pcs-DC5V-12mm-Diffused-full-color-IP20-ws2811-IC-pixel-moudle-light-rgb-led/32305987883.html

He also used a white tree, which is a great idea for better color.

That’s not to bad for what you get in entertainment value.

I was thinking that this would be a cool outdoor tree display.

Based on what I read in their blog post about this tree and getting the cool effects you see in their video you have to align 14 rows of smaller and smaller circles up to the top with perfect alignment to get that effect.

I think a easy way to do this might be to just use a CNC machine to cut out 14 rings that would hold the Lights in perfect alignment. Something that looks like this from the top down, except with more rings:

And then from the side it would look something like this except with more rings of LED’s to make it fill in better.

It cutting out the rings would be no problem. Hanging the rings with the LED’s would take some time.

Just an idea, but I think it would look cool.

It would be really cool if this was outside and people could drive by and use their smart phones to control it via a webpage.

1 Like