Tracking the Date with a Real-Time Moon Phase Clock
This self-sufficient outdoor clock uses an ESP32 and an RTC to display the moon's phases on a realistic model.
Using the moon
Prior to the advent of ubiquitous calendars and digital timekeeping devices, people would rely on the sun and moon to tell the time. While the sun can give the current hour via a sun dial, the moon's phase was used to determine the day. For instance, native Hawaiians created a full lunar calendar that was utilized to determine planting times and predict tides. Drawing on this rich history, psuedoynomyous maker "rabbitcreek" has constructed a lifelike scale moon, which is illuminated according to the current day of the month thanks to a real-time clock.
Building the display
The microcontroller for this project is the Seeed Studio XIAO ESP32S3 due to its small footprint and deep sleep capabilities for power savings. To keep the time, rabbitcreek added an Adafruit RTC3231 module that talks via I2C to the ESP32. As for the lighting, waxing moon phases (where the visible portion of the moon is "growing") are denoted by a yellow color, while waning moon phases (where the visible portion is "shrinking") are colored blue-gray. Because this unit is meant to be outdoors, it houses an internal LiPo battery, charger, and solar panel for continuous operation.
Physically, the half-moon shell is composed of a 3D-printed PETG enclosure modeled after realistic satellite data. When it's time to adjust the moon phase angle, a servo rotates a small string of NeoPixel LEDs to the designated angle, thus illuminating the shell from the inside.
Real-time clock and lighting
Once it had been assembled, rabbitcreek wrote a small Arduino sketch for the ESP32 that begins by initializing the real-time clock and LEDs. From here, the ESP32 will enter deep sleep and then wake up every 15 minutes to check if the angle has changed based on the current date and time. During daylight hours, the LEDs are inactive to allow for the battery to charge from the solar panel.
More information about this moon phase clock can be found here on Instructables.