Arduino/Christmas lights projects for beginners
January 2, 2015 2:51 PM   Subscribe

What are some good Arduino projects involving Christmas lights for someone new to microcontrollers?

I've wanted to get into Arduino for a while, and thought a project programming Christmas lights would be fun. I don't have any specific plans for the lights other than turning them on and off in whatever patterns and colors I want. Plus, I think it would be fun to work on with my son.

What's a good board to start with, and what kinds of lights are easiest to use for this? I have some C++ programming experience from several years ago, so I'm not too worried about the coding part. But if this is not the kind of project for a newbie to start with, then I'd love to hear other suggestions. I just want something more fun and useful than "Turn on a single LED with Arduino!" Thanks, all!
posted by DakotaPaul to Computers & Internet (9 answers total) 13 users marked this as a favorite
The Arduino Uno is a great starting device. You can always add an ethernet shield if you want to connect it to the internet in some way. For LED fun, I would start with an 8 x 8 matrix and a MAX chip. Your local electronic parts shop may have one or you can order it online. This Arduino playground explains how to use it:

For more inspiration, head on over to Adafruit:

Have fun!
posted by hz37 at 2:58 PM on January 2, 2015

Response by poster: hz37, that first link is exactly why I want to start this now for next Christmas, as I am clearly in way over my head.
posted by DakotaPaul at 3:04 PM on January 2, 2015 [1 favorite]

If you want to control normal Christmas lights -- the kind that plug into a wall outlet -- then you'll need extra hardware to switch a 120V load on and off. The safest option is a relay, because it keeps the high voltage physically isolated from the microcontroller itself. If you just want to get something working, you might want to buy a pre-built relay module, like this one from SparkFun.

If you want to take the DIY route, you'll also need a transistor to control the relay coil (since they typically require more current than a microcontroller can provide directly) and a flyback diode (so your Arduino doesn't get fried by voltage spikes). And of course, be very careful when working with 120V power. Don't leave wires exposed if they may have high voltages, and protect the high-voltage parts of the circuit with a fuse or circuit breaker.

Good luck and have fun!
posted by teraflop at 3:25 PM on January 2, 2015

Oh I just did this. I can control my Christmas light colors from the web (or my phone).

A friend of mine wrote 98% of the software, his guide is here. I did a couple bits and pieces to get it going in my specific setup.

Final product is here:

I used a Raspberry Pi for the computer side, and these LED lights. I haven't published code for driving those lights yet, the Github only includes a different light driver (the one my friend is using). But it was only a couple hours to get working. And it works great.
posted by miyabo at 3:55 PM on January 2, 2015 [1 favorite]

I did a basic controller a few years ago with a TTL relay board and an AVR, but that was pretty limited.

I think the easiest way to do this is via something like the GE G35 individually addressable Christmas lights.

See G35Arduino, and the blog post that led to that code.
posted by straw at 3:57 PM on January 2, 2015 [2 favorites]

Use the electricity produced by an electric fish to control your Christmas lights. So cool, and all the instructions are here.
posted by cushie at 7:44 PM on January 2, 2015

You may not run into this if you're just running Christmas lights, but anyone designing lighting controllers should be aware that your run-of-the-mill 100W incandescent bulb will draw 15A at startup and 50A or more when it burns out. It's very common for new designers to underspec the relays and especially triacs for lighting use (relays are a bit more robust to these surges). Everything works fine until a bulb burns out, then it takes your triac with it.

You might not think you need a 600V triac rated for 100A non-repetitive surge current, but triacs are cheap and incandescent bulbs are harsh loads.

[above warning applies to standard incandescent bulbs, less so to decorative mini lights]
posted by ryanrs at 9:18 PM on January 2, 2015 [1 favorite]

I've been playing around with LEDs and Arduinos for a while. Lately I've really been loving Adafruit's 'Flora' model of Arduino; it makes it stupid easy to just hook up a battery and a string of lights, program it, and go.

Add in some LEDs: these or these are bright and fun to space out in the ways you might use Christmas bulbs in a tree, or maybe you want a strip of LEDs.

Once you have gotten that together and run the demo code, I think the best thing to do is to grab the FastLED library and start fooling around with its demos. It is SUPER powerful, comes with some great demos, and is really easy to work with; it abstracts away a lot of gory details* of how your LEDs may be implementing and adds some great things** on top of them.

* RGB/GBR/BRG/whatever color order, 4/7/8/whatever bits per color, whatever crazy bit-packing scheme - most libraries make you deal with this so they can just dump all the color values straight into the LEDs, FastLED gives you much more human-friendly 8-bit RGB values - or even friendlier HSV values - and twiddles it with super-optimized assembly when writing the colors out.
** color palette lookup tables, time-based dithering for a subtler range of colors, gamma correction, lots of great stuff.
posted by egypturnash at 10:32 PM on January 2, 2015

I did the GE G35 lights that 'straw' mentioned, but used an updated library. They incorporated some patterns from some AdaFruit LED libraries. They worked great all season this year, now I just have to take them down.

G35 MEO Arduino Library and example sketch

This library allows you to string 2 strings and work with them as a single string.

There's a bug in one of the pattern routines, and I posted a fix on the issues section of github.

I ran basically 4 strings off one Arduino Mega, and a single 3A 5V power supply. The strings were various lengths, and I paired the strings to a total of 2 outputs (limit of the library)

Going to see if I can make time before next year to add support for more than 2 distinct strings, and maybe use the much more powerful Teensy 3.1 or something STM32 based.

Loved the lights themselves though. Nice colours, highly efficient, and inexpensive if you can get them at Costco again next year.
posted by Zebble at 7:42 PM on January 7, 2015

« Older Cat obsession   |   Perfect storm of familial dysfunctionality--need... Newer »
This thread is closed to new comments.