John's Musings

Yeah, Me Neither

LED Strip Lighting

Home automation is kind of like a drug. The more you get the more you want. And the more you study and read up about it the more you see people messing with LED strip lighting. There are all kinds of LED strip lighting you can buy but I'll center this discussion around WS2811, 12 volt strips and WS2812, 5 volt strips. I only have one strip which is the WS2811 which I bought here for a little bit less than $27. You can get cheaper stuff on eBay as well. For my first excursion into this I wanted to make sure I had something tried and tested and I read several on line accounts of people who used these successfully. Here's what a cut shortened section looks like.

The roll you get is 5 meters long and has connectors on it. I just cut this section off to play around. See the line going through where the power wires get soldered onto on the left side are? That is the cut line. You can cut these strips to any length.

This is not a definitive work on LED strips but just my experience with this one strip. And my control mechanism is an MQTT server used under Home Assistant Home Automation software. I basically replicated the work of "Ben" and used his code. If you use Home Assistant software it's hard not to know who Ben is as he has made several great informative YouTube videos.

If you do not know what an MQTT server is or what Home Assistant is ..........move on quickly. You can however buy these lights as kits with RF controllers that have remote controls with them. Rather than just jamming power into it you power the RF controller which plugs right into the end of your LED strip and then you just click-ity click on the remote to get the colors you want displayed. Easy money.

By setting this up with MQTT and using an ESP8266 Internet of Things chip you can computer control your lights and make them part of your home automation which is what I've done here. My pic below is an oversimplification to be sure. Here are the parts you need:

12volt power supply. This can be a brick or a dedicated power supply. I got this one. It makes some noise as it has a fan for cooling which kicks on sometimes so if you need whisper quiet get a 12 volt, 10 amp computer type brick. Also since you have 12 volts readily available now it is best to get your 5 volts for the ESP8266 from a 12 volt to 5 volt step down converter. I used this one. Lastly you'll want a NodeMCU ESP8266 WiFi chip from here.

Also note on my pic below that that isn't the drawing for the LED strip I ordered above. It was as close as I could find. Ignore the markings on the drawing below but wire as depicted in my photo above.

The LED Strip you receive will have 3 wires connected to a plug already soldered on it. And you'll receive another plug with a short section of wiring with bare wires on the end. When I shoved these wires into the breadboard and the longest run of wire I had was about 6" it worked PERFECTLY. However when I drilled a hole through the wall, then routed the wires down to the noisy power supply in the garage the run was about 3' long. I had what I would call some data issues due to the length of the cable.

Here's the deal with that. The data signal coming off the ESP8266 pin D5 (as per the code, you could move the pin if you wanted to) is 3.3v. The data signal the LED Strip wants is 5v. If you have short wires, and maybe not a full LED strip this may in fact be adequate, however if you have long wire runs and a long LED strip you may need a Logic Shifter. It will shift your signal from 3.3v to 5v. Right at the moment I am not using a logic shifter but will probably add one. Just to be safe. I picked mine up here. Don't buy one up front until you know you need one.

One more gotcha here........The code that is written has all manner of cool animations. Your LED strip can be quite amazing however after running the animations for a few minutes it crashes. This seems to be a known issue and the code developer (Ben) is working on it. As it is the solid colors work fine for me. I'm not really into running animations on my LED strip, as I just wanted it for back lighting effects so I'm good!

NOTE: As of today, 2 June 2017, there seems to be a fix to the code which is working well so far! Told ya.

As you can see I laid mine on top of the decorative arch in my living room. It was the perfect length and it just laid down flat, no tape, no staples, nothing. I can remove it in moments if I need to.

I drilled a hole through my wall into the attic and then pushed the wires down into the garage.

There were some issues with this setup. The data wire (green wire on the left side of the ESP8266) was about 2' to 3' away from the actual LED strip. When I applied power the first three LED's immediately lit up. When I turned them on those LED's would behave as the others, same color and all and then when I shut the strip off the first three LED's would remain lit and color shift a bit.

I figured the data signal was corrupting or something so I took apart this rig and laid all the components out on a breadboard and laid them on top of my decorative arch right next to the LED strip. That worked GREAT but you could see the breadboard from the ground and when the LED strip came on it cast a noticeable shadow from the breadboard and components. That bothered me too much.

So I took a protoboard and soldered the NodeMCU in with a 3.3v to 5v Logic Level Shifter. This takes the 3.3v signal and amplifies it. I was then able to mount everything back in the garage.

Here's the layout.

And here's the real deal:

Now nothing is visible at all and the LED lights are in my mind professionally installed now.

Here a quick rundown of the system: