ESP32 Moon Lamp That Shows the Real Moon Phase on Crowpanel Round Dispaly
A unique combination of astronomy, embedded programming and ambient lighting that transforms an ESP32-powered display into a realistic real-time Moon simulator.
As you can see in several of my previous projects, I own a CrowPanel 2.1inch-HMI ESP32 Rotary Display which seemed ideal for this purpose considering that it offers almost twice the display resolution, a powerful ESP32-S3 microcontroller, built-in WiFi connectivity, as well as a push button and rotary encoder that could be utilized for additional functionality.

When turned on, the display shows a message about connecting to the local Wi-Fi network, and then a beautiful image of the current state of the moon for the given coordinates appears.


Board: ESP32S3 Dev Module
Flash Size: 16MB
USB CDC On Boot: Enabled
Upload Mode: UART0 / Hardware CDC
Partition Scheme: Huge APP
PSRAM: OPI PSRAM
It is also important to install ESP32 core version 3.3.7 because with the latest version an unpleasant flickering of the display occurs. Finally, the following libraries need to be installed:
Arduino_GFX_Library
SerialCommands
and time Library


As a final visual enhancement, I added the option to modify the Moon's color temperature. Instead of a neutral grayscale appearance, the displayed Moon can be rendered with a warmer yellowish tint that more closely resembles the pleasant glow of a traditional night lamp. The color balance can be adjusted through the following parameters:
fr = min(fr * 1.20f, 1.0f);
fg = min(fg * 1.08f, 1.0f);
fb = fb * 0.70f;

The final result is a unique combination of astronomy, embedded programming and decorative lighting. It accurately reproduces the current appearance of the Moon using real astronomical calculations while also serving as an attractive night lamp with user-adjustable illumination. Thanks to the larger high-resolution display and the additional controls provided by the CrowPanel hardware, the project offers a significantly enhanced user experience compared to the original design while remaining faithful to the core concept created by Julian Scheffers.
Want to build a project?
Bring your design to life with the Elektor PCB Service, powered by Eurocircuits. Upload the project files and order professionally manufactured PCBs or assembled boards through a proven European production platform.
Supporting KiCad, Eagle, Gerber, and ODB++ formats, the service is suitable for everything from prototypes and validation builds to series production and volume manufacturing.
Made in Europe. Fast. Reliable. Professional.

Discussie (0 opmerking(en))