Addressable LED Strips

Addressable LED Strips

I had seen Adafruit’s Neopixels in many designs over the years but I never had an application that inspired me to buy some. Then the rope lights I use for ambient lighting in the living room died during post Christmas cleanup. They have been gone for some time now and instead of doing something simple like buying new rope lights I thought it would be cool to use Neopixels since they provide so many more options than just on and off. Adafruit’s NeoPixel strips were a bit to pricey for the length I needed so I settled for some generic WS2812B LED strips from eBay. I chose the 60 LED per meter strips since I am using these for lighting and wanted to make sure they were bright enough. I also picked the waterproof edition in the silicon sleeve, not because I think my living room will experience a lot of rain but for a little light diffusion from the tube.

These LEDs are power hungry little devices pulling up to 60 mA each when on full brightness. That means they could potentially pull 3.6A per meter. At 5 volts we are looking at 18 watts per meter. Very rarely will I be running these at full brightness, but just in case I purchased a 50W power supply since my bookshelf is eight feet long. In the event I do run the strip fully on it should only pull a little more than 43 watts so my cheap power supply should be fine. I was a little surprised how much power the strip would use when i calculated it, but I was replacing a 25ft rope light that pulled something in the neighborhood of 75-100 watts.

To control my LED strip I used an Adafruit HUZZAH ESP8266 breakout board. The IO pins on the ESP8266 are 3.3V and the LED strip expects 5v logic for programming. In searching forums I found that people had mixed results with directly connecting to the LEDs so I opted to place a level shifter in line to guarantee my programming works. I bought some generic four channel logic level converters off eBay last year for just such an occasion and i was able to put one to good use. The converter I purchased uses BSS138 mosfets and will adjust the logic voltages based on the high and low reference voltages supplied to the board. I had also purchased a 74AHCT125 with my Adafruit order in case I ran in to issues but ended up not needing it. The other LED saving suggestions I followed were putting a 1000uF cap across the power supply to absorb the initial current rush and putting a 555ohm resistor on the data line to prevent a spike.

On the software side of things I started out with the demo Arduino code from Adafruit for their NeoPixels and was able to generate cool patterns on the strip. Not thinking this thru I started trying to come up with my own MQTT solution to communicate light commands. Then after some time it dawned on me that I should look and see what is built in to Home Assistant. It turns out HA has a nice MQTT interface for controlling lights I so I stated looking for someone who already had a client to run on the strip. After playing with several ideas and trying various code sets I found online, I settled on BRUHAutomation’s MQTT RGB Client. This one had all the needed pieces included with lots of effects and options. It also included the needed code to be able to reprogram the board wirelessly One of my favorite effects, although I probably won’t ever use it, is the lightning effect. While I think it is really cool, my wife doesn’t approve of simulated lightning in the living room.

The rope lights on one bookshelf have now been replaced by a set of LEDs I can control from my phone. I used to be able to turn the rope lights on and off with a X10 remote we kept on the mantle. While I think the new setup is cool I need to provide a similar experience to attain a decent WAF. Using the phone is not as convenient as having a dedicated switch that is always in the same location. Guess I have a new project to add to the list.

Thanks for stopping by,

Jacob

Leave a Reply

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