Introduction: Arduino Controlled LED Strip Holiday Lighting
For this project, I used some analog RGB LED Strips with a very simple Arduino control setup so we can make our own light show! I used two strips that were run next to each other, so there are six LED lines to control - two sets of R,G,B. The analog strips allow you to control each color for the whole strip so you can dim and brighten colors on the whole strip. Digital LED strips offer individual LED control so you can do chase effects, but they cost a lot more.
The setup for this is the same as was used for the TeleToyland Sandbox 2 project LEDs, except you can control those live!
Step 1: Parts
Waterproof LED Strips. Be sure to look carefully at the types of LEDs used. I ordered ones using the 3528 LEDs on Amazon and those are the ones pictured here. These are lower cost, but have a very important disadvantage! They have separate red, green, and blue LEDs about 1/2" apart, so you cannot get truly blended colors like yellow or orange with direct viewing (unless maybe you are REALLY far away!). So, they would not be good for permanent lighting. But, since I am using them for Christmas, they work OK - each of the separate colors is a valid holiday color, and when you turn on red and green at the same time, they alternate nicely. The 5050 LEDs are tri-color, and thus can have any apparent color output. The other thing to note is that some strips have 150 LEDs per 5m (16 feet), and some have 300. They all work pretty well, and the 300 LEDs take more power.
This one uses 5050 LEDs and comes with a power supply, receiver and remote control. The power supply is useful for this project, but we will not need the receiver and remote. They are nice for initial testing, though.
- Arduino - most of them will be fine for this application. I used an Arduino Uno I had available.
- An Arduino prototyping shield - I used a spare MakerShield that I had, but any of them should be fine.
- (6) N-Channel Power MOSFET transistors from Adafruit - you need one per color. Since I had two strips with R, G, B on each, I needed 6 of them. There are other ways to do this, but the nice thing about the MOSFETs is there are no other components needed.
- 12v supply and connector - check the current needed for your LED strips - they typically draw several amps. I had a power supply from an LED kit, which can handle about 4 amps, and seems to work with the two strips I have. For the connector, I used a pre-wired jack from Jameco. The 12v power supplies have different connectors, so make sure your jack matches the power supply plug.
- (2) LED strip connectors - See step 2 - female ones with the below adapters are the most flexible. You could use other connectors, or even hard wire them. You can also get clip on connectors.
- (2) male-to-male adapters if needed by your particular LED strips.
- Wire staples - 1/2" NM type like these. I got a bunch at Home Depot. These are slightly bigger than the waterproof LED strips, so they don't pinch the strips. In my case, I will remove the strips after the holidays, so these work well.
Step 2: Wiring and Programming
Adafruit has a great tutorial on how to use an Arduino to control these analog strip lights. The circuit here is exactly what is in the tutorial (times two). The nice thing about needing 6 LED lines is that the basic Arduino boards have 6 pins that allow the PWM out - 3, 5, 6, and 9, 10, 11. So that works out perfectly for two strips!
You can see from the pictures how the FETs were mounted. The source pins were just soldered together and connected to the Ground (-) side of the power supply since the LEDs are common anode (+).
The only other trick here is that I used the 12 volt supply to run the Arduino too, by connecting it to the Gnd and Vin pins.
Make sure you have the right jack for your power supply. I have a 2.1mm ID power supply, but was testing it with a 2.3mm one, and it was not making a good electric connection. Very pesky.
There are a few ways to connect the LED strips to the circuit: Using the standard LED strip 4-pin inline connectors, using your own connectors, and direct soldering to the strips. They all will work fine, so you can choose your own approach. Having some kind of connectors is probably better to make it easier to take apart. I used the standard LED connectors. So, for that approach, you will need some extra connectors for the circuit side. I found some on Amazon, and I chose female ones. The LED strips seem to have a random choice between male and female connectors, but the trick with using female connectors on the circuit side is that you can also get male-to-male adapters to handle the specific configuration of the LED strips.
I used some four conductor wire to extend those connectors a bit to make it easier to move the Arduino around.
A sample Arduino sketch is attached, and is very simple. I started with the sample from the Adafruit tutorial and made some changes. I am still trying different animation techniques - one tip so far is that in a doorway type situation like mine, keeping at least one strip partially on most of the time is better. Maybe we can start a library of best holiday scripts.
Since the MakerShield has a potentiometer, you could use that to set the timing constant in the code very easily.
Step 3: Boxing It Up and Mounting the LED Strips
I used a simple plastic container to protect the Arduino. I intend to dress it up more or hide it better shortly! Once the Arduino is programmed, connecting it is easy since there are just the three connectors to plug in.
For the LED strip mounting, the 1/2" NM staples worked well for me, but there are plenty of other approaches. I do not think I would trust the adhesive strip, though that may work. In my case, I will slip those strips out after the Christmas holidays since they have the separate color LEDs (see the parts list).
Participated in the
Make It Glow