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
Sources
- Lua firmware
- Esplorer (ESP8266 IDE)
- ESP8266 example for google time client (thanks to GeoNomad)
Hi Daniel,
what is the deeper sense of this light?
Is it for conditioning a baby when it has to sleep?
If yes, has it worked?
Regards
Thomas
I have a commercial version of this and for us it was just a way to let them know when it was time to get up and stop them form getting up at 4 in the morning. The very first night they stayed in bed until the sun was shown and after two years it still works and they still stay in bed until the sun comes up.