{"id":550,"date":"2019-02-06T10:02:07","date_gmt":"2019-02-06T15:02:07","guid":{"rendered":"http:\/\/www.thesmarthomehookup.com\/test_install\/?p=550"},"modified":"2023-02-08T16:35:45","modified_gmt":"2023-02-08T21:35:45","slug":"diy-artificial-sunrise-rgbw-individual-addressable-leds","status":"publish","type":"post","link":"http:\/\/www.thesmarthomehookup.com\/test_install\/diy-artificial-sunrise-rgbw-individual-addressable-leds\/","title":{"rendered":"DIY Artificial Sunrise &#8211; RGBW Individual Addressable LEDS"},"content":{"rendered":"<p><iframe width=\"560\" height=\"315\" src=\"https:\/\/www.youtube.com\/embed\/2j3UyrBjB4g\" frameborder=\"0\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen=\"\"><\/iframe><\/p>\n<p>Today on the hookup we\u2019re 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.<\/p>\n<p>Outside of youtube I\u2019m 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.&nbsp; I\u2019d love to be able to wake up to the sunrise and natural light, but it\u2019s just not in the cards.&nbsp; So what\u2019s the next best thing?&nbsp; How about a gradual artificial sunrise that peeks out from the top of the valence?&nbsp; Sounds like a job for individually addressable RGBW LEDs.<\/p>\n<p>If you\u2019re interested in my construction process for the valence, there\u2019s not much to it.&nbsp; 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. &nbsp;I chose pine for a few reasons, these may or not apply to you, choose accordingly.&nbsp; 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.&nbsp; In the end, I\u2019m happy with how it came out, so I guess that\u2019s all that matters.<\/p>\n<p>I am using a 5 volt 6 amp power supply and a nodeMCU to power these LEDS.&nbsp; I\u2019m not using a logic shifter so I needed to keep the NodeMCU close to the LEDs.&nbsp; 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.&nbsp; This is a super easy way to power your NodeMCU from the same supply as your LEDs without needing to solder anything.&nbsp; I put the nodeMCU in a little clear box so that it wouldn\u2019t short out on the aluminum railing and left it on top of the curtains behind the valance.<\/p>\n<p>I ran the LEDs along the back of the valance pointing towards the wall so the light would be as indirect as possible.&nbsp; Like other LED strips I\u2019ve 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\u2019d recommend you take to make sure your installation is permanent and troublefree.<\/p>\n<p>As I mentioned before, the LEDs I selected use WS2812B chip and are therefore individually addressable like I\u2019ve used in a bunch of other projects, but these are bit special.&nbsp; 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.&nbsp; 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.<\/p>\n<p>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.&nbsp; 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.&nbsp; 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!<\/p>\n<p>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.&nbsp; The neopixel library is able to drive them, but it\u2019s 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.<\/p>\n<p>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.&nbsp; 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.&nbsp; 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.&nbsp; The light starts out very dim for the first few cycles and gradually gets brighter and brighter as the sun peeks over the horizon.<\/p>\n<p>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.&nbsp; I\u2019ve 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. &nbsp;If you need a snooze button on your sunrise, you\u2019ll need to code that yourself.<\/p>\n<p>Aside from being a great alarm clock these strips also make an excellent general purpose light.&nbsp; The indirect light that they provide is really pleasant and the brightness and color can be easily changed in home assistant.&nbsp; I wired a shelly with tasmota into the switch box to control the lights via MQTT and I\u2019m currently using a node red automation to listen for the tasmota switch toggle and then synchronize that with the home assistant light entity.&nbsp; This works well because the sunrise sets the state of the switch in home assistant to \u201con\u201d so it can be easily turned off without needing to cycle the lights on and off.<\/p>\n<p>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.&nbsp; If you\u2019d like to give this project a try, I\u2019ve put all the parts that I used down in the description as well as a link to my github page that contains the code.<\/p>\n<p>Thank you to all of my awesome patrons over at patreon for your continued support of this channel, if you\u2019re interested in supporting my channel, check out the links the description.&nbsp; If you enjoyed this video, please consider subscribing, and as always, thanks for watching the hookup.<\/p>\n<h5>Parts List:<\/h5>\n<h5>NodeMCU <a href=\"https:\/\/amzn.to\/2MkBcka\">https:\/\/amzn.to\/2MkBcka<\/a><\/h5>\n<h5>RGBW WS2812B LED Strip <a href=\"http:\/\/bit.ly\/2QaujCG\">http:\/\/bit.ly\/2QaujCG<\/a><\/h5>\n<h5>Power Supply <a href=\"https:\/\/amzn.to\/2TAwrG2\">https:\/\/amzn.to\/2TAwrG2<\/a><\/h5>\n<h5><\/h5>\n<h5>Code and Instructions: <a href=\"https:\/\/github.com\/thehookup\/RGBW-Sunrise-Animation-Neopixel-\">https:\/\/github.com\/thehookup\/RGBW-Sunrise-Animation-Neopixel-<\/a><\/h5>\n<h5><\/h5>\n<h5>Follow me on Twitter: @TheHookUp1<\/h5>\n<h5><\/h5>\n<h5>Support my channel:<\/h5>\n<h5>Patreon: <a href=\"https:\/\/www.patreon.com\/thehookup\">https:\/\/www.patreon.com\/thehookup<\/a><\/h5>\n<h5><\/h5>\n<h5>Music by <a href=\"http:\/\/www.BenSound.com\">www.BenSound.com<\/a><\/h5>\n","protected":false},"excerpt":{"rendered":"<p>Today on the hookup we\u2019re 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\u2019m a high school science teacher, and for the [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":2576,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[4],"tags":[],"class_list":["post-550","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-projects"],"acf":[],"mb":[],"mfb_rest_fields":["title","gutenberg_elementor_mode"],"_links":{"self":[{"href":"http:\/\/www.thesmarthomehookup.com\/test_install\/wp-json\/wp\/v2\/posts\/550","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.thesmarthomehookup.com\/test_install\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.thesmarthomehookup.com\/test_install\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.thesmarthomehookup.com\/test_install\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.thesmarthomehookup.com\/test_install\/wp-json\/wp\/v2\/comments?post=550"}],"version-history":[{"count":4,"href":"http:\/\/www.thesmarthomehookup.com\/test_install\/wp-json\/wp\/v2\/posts\/550\/revisions"}],"predecessor-version":[{"id":2331,"href":"http:\/\/www.thesmarthomehookup.com\/test_install\/wp-json\/wp\/v2\/posts\/550\/revisions\/2331"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.thesmarthomehookup.com\/test_install\/wp-json\/wp\/v2\/media\/2576"}],"wp:attachment":[{"href":"http:\/\/www.thesmarthomehookup.com\/test_install\/wp-json\/wp\/v2\/media?parent=550"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.thesmarthomehookup.com\/test_install\/wp-json\/wp\/v2\/categories?post=550"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.thesmarthomehookup.com\/test_install\/wp-json\/wp\/v2\/tags?post=550"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}