A while ago a wanted to build one of those nightlights for my daughter that tell her when to sleep and when to call for the parents: an orange light behind a sun depicts the day, a blue light behind a moon the night. My first attempt was based on a Spark Core which is a bit pricy (~$40) to just connect to the internet to synchronise the time.
Playing with the ESP8266 I needed an actual project to use it and the nightlight came in handy. It uses both GPIO pins available on the ESP8266-ESP01 and calls google.com to synchronise the time every 30 minutes as soon as the device is connected to the access point. I currently still need an Arduino but just as power source and debugging tool. So the actual components are:
- plastic box (from food delivery)
- black paper as mask
- sun and moon downloaded and printed from the internet
- cardboard from a cereal box to shield the LEDs
- 2 LEDs (orange and blue)
- a mini bread board
- an ESP8266
- 2 resistors
- some jumper wires
Prepare the ESP8266
Check out the code and adapt it
Transfer the files to the ESP8266
A ridiculous amount of coffee was consumed in the process of building this project. Add some fuel if you'd like to keep me going!