This is an ESP32 lighting project that delays the rising and setting time of the outdoor sun so that the user does not need to find himself unexpectedly sitting in the dark when the sun sets. This indoor sun rises twice daily - once in the morning to wake the user, setting after a set period, and again in the evening, setting at bedtime. The device polls for time using NTP, and can accurately calculate sunrise and sunset times given the longitude and latitude of the user.
- Create a new ESP-IDF sample project
- Copy files into the project folder
- Open settings (bottom row of window) and configure accordingly.
Tips:
- To find your Longitude and Latitude, open Google Maps, search for your location and right-click on the exact point to display the Latitude and Longitude.
- Change
RTC Clock SourcetoInternal 8.5MHz oscillator, divided by 256 (~33kHz)for more accurate oscillator cycles
LED Strip (WS2812):
OLED Display (SSD1306):
Sunrise/Sunset Algorithm:
WiFi and SNTP: