DIY Artificial Sunrise – RGBW Individual Addressable LEDSFebruary 6, 2019
Today on the hookup we’re going to add a little flare to my automated bedroom curtains by adding a valance with individually addressable RGBW LEDS that can simulate a sunrise, set the mood, or just provide you with high quality tunable white light.
Outside of youtube I’m a high school science teacher, and for the most part I love my job, but one thing that I absolutely hate is that my day starts well before the sun comes up. I’d love to be able to wake up to the sunrise and natural light, but it’s just not in the cards. So what’s the next best thing? How about a gradual artificial sunrise that peeks out from the top of the valence? Sounds like a job for individually addressable RGBW LEDs.
If you’re interested in my construction process for the valence, there’s not much to it. I bought two 1 by 8 by 12 pieces of pine from home depot, cut them to length, lazily joined them together in the middle and then stained them. I chose pine for a few reasons, these may or not apply to you, choose accordingly. I spent about an hour total on the construction of the valence and 3 or 4 hours trying to get it mounted while dealing with rapidly increasing frustration and blood pressure. In the end, I’m happy with how it came out, so I guess that’s all that matters.
I am using a 5 volt 6 amp power supply and a nodeMCU to power these LEDS. I’m not using a logic shifter so I needed to keep the NodeMCU close to the LEDs. To do this I just used some female to male jumper wires to connect to the harness that comes with the LEDS and then I used the power injection wires on the LED strip to supply 5 volts and ground. This is a super easy way to power your NodeMCU from the same supply as your LEDs without needing to solder anything. I put the nodeMCU in a little clear box so that it wouldn’t short out on the aluminum railing and left it on top of the curtains behind the valance.
I ran the LEDs along the back of the valance pointing towards the wall so the light would be as indirect as possible. Like other LED strips I’ve used the adhesive backing on these is pretty worthless for attaching to wood and quickly comes loose, this is an easy problem to solve with a few dabs of hot glue, but it is an additional step that I’d recommend you take to make sure your installation is permanent and troublefree.
As I mentioned before, the LEDs I selected use WS2812B chip and are therefore individually addressable like I’ve used in a bunch of other projects, but these are bit special. Instead of RGB, which has the led chip split up into a red, green, and blue segments, these are RGBW, which adds a fourth channel containing a pure white LED. The major upside to this variety is that instead of the strange bluish white that you get from RGB pixels, RGBW pixels can produce true white light and by incorporating a bit of RGB you can easily tune the color temperature to match the rest of your lightbulbs.
I sourced these RGBW LEDs from banggood, and before I go on, I feel like I need to publicly apologize to my contact at Banggood. Back in October she sent me this RGBW LED strip and a couple of other products for a project, but unfortunately, that project totally failed so I scrapped the video, and put the components into my drawer of shame where I throw the components of my incomplete projects. When I started this project I remembered I had them and they were a perfect fit for this application, sorry this video is so late Jessica!
Alright, back to the project. The only downside of RGBW is that since they require 4 channels per pixel they are not compatible with my favorite individually addressable Arduino library, FastLED. The neopixel library is able to drive them, but it’s not as feature rich as the FastLED library, so if you want to do things like fading, adding or subtracting a value for a color, or changing strip brightness you need to write those functions yourself.
I searched quite a bit for a sunrise simulation that I liked, but in the end I decided to write a new one specifically for this application. The way it works is you fill out the user configuration section including your wifi information, mqtt information, how many LEDs are in your strip, and how large you want want the sun to be and upload it to your nodeMCU. Then you send the number of seconds that you want the sunrise to last to the wakeAlarm mqtt topic and it will run the sunrise animation over that specific amount of time. The light starts out very dim for the first few cycles and gradually gets brighter and brighter as the sun peeks over the horizon.
It takes a few mornings to figure out how quickly you will wake up once the lights come on, but once you get it dialed in the difference between waking up to a noisy alarm clock and an artificial sunrise is pretty great. I’ve figured out that if I set the sunrise to 5 minutes that I usually start stirring around 1 minute into the sequence, then have about 3 minutes of being slightly irritated by the fact that I need to wake up and finally 1 minute of just laying in bed and enjoying the rest of the animation. If you need a snooze button on your sunrise, you’ll need to code that yourself.
Aside from being a great alarm clock these strips also make an excellent general purpose light. The indirect light that they provide is really pleasant and the brightness and color can be easily changed in home assistant. I wired a shelly with tasmota into the switch box to control the lights via MQTT and I’m currently using a node red automation to listen for the tasmota switch toggle and then synchronize that with the home assistant light entity. This works well because the sunrise sets the state of the switch in home assistant to “on” so it can be easily turned off without needing to cycle the lights on and off.
Aside from mounting the valence to the wall, which nearly gave me an anxiety attack, this project was relatively simple and straightforward, and the results look great. If you’d like to give this project a try, I’ve put all the parts that I used down in the description as well as a link to my github page that contains the code.
Thank you to all of my awesome patrons over at patreon for your continued support of this channel, if you’re interested in supporting my channel, check out the links the description. If you enjoyed this video, please consider subscribing, and as always, thanks for watching the hookup.