Monday, July 9, 2018

Sunrise Simulator


Intro

For an event, I needed something special. How about a simulated sunrise. And it would be nice, if I could be able to remote control it and put it anywhere in the room. And of course it should be low cost. So the magic words for this are: NodeMCU, Neopixels, LiPo battery and a MQTT broker.


Wiring


Nothing fancy here. The battery is connected to GND and the 3.3 Volts on the NodeMcu and also on GND and the 5 Volt input of the Neopixel stripe. Yes, we power a 5V Neopixel stripe with a 3.7V battery. When fully charged, it will work for some time. The Neopixel stripe mustn't be too long. I used just five pixels, and it works fine.


Video




 

Algorithm


Sunrise



To simulate the sunrise, I'm setting one color at a time. So I divided the given time in three equal parts (one for each color). Within the first third of the time span, I raise the color value of the red LED from 0 to 255. Then I start with the green color. Blue at last. When all three colors are at max, you'll get a white glowing LED stripe.

ToDo

I want to add a sunset algorithm and a full cycle of a sunrise, sunshine and a sunset. Just check the Git repository from time to time.

Links

Git repository

https://bitbucket.org/Remnis/sunrise-simulator/src/master/

Amazon

NodeMCU
Neopixels 60 LEDs/m
Electrical box
LiPo battery





No comments:

Post a Comment