πŸŒ™ Moon Phase Display – Arduino MEGA + TFT + RGB LED

Hi makers :waving_hand:

I built a simple moon phase visualization project using Arduino MEGA, a 2.0" TFT display (176x220) and a DS3231 RTC module.

The display renders the moon phase in 8 steps:

  • New Moon
  • Waxing Crescent
  • First Quarter
  • Waxing Gibbous
  • Full Moon
  • Waning Gibbous
  • Last Quarter
  • Waning Crescent

The phases are rendered directly from bitmap data (generated via image2cpp), not from an SD card.


:sunrise: Day Phase Indicator

In addition to the moon display, I added an RGB LED that indicates the time of day:

  • Night (blue)
  • Sunrise
  • Day
  • Sunset

The LED logic updates every 15 minutes and checks one hour before and after defined sunrise/sunset times.


:date: About Accuracy

The moon phases are based on a precomputed table for the year 2026 (365 days).
Leap years skip February 29 internally to keep alignment.

This is not an astronomical precision tool β€” it’s a maker project built for learning and visual enjoyment :slightly_smiling_face:

Daylight Saving Time is not handled automatically.
The RTC needs manual adjustment when DST changes.


:electric_plug: Hardware Used

  • Arduino MEGA
  • RTC Module – DS3231 AT24C32
  • 2.0" TFT Display (176x220, ILI9225, SPI)
  • Keyes KY-009 RGB SMD LED 5050 Module
  • 220Ξ© resistors (for RGB LED current limiting)
  • 100nF ceramic capacitor (power decoupling)
  • 10Β΅F electrolytic capacitor (power stabilization)

:framed_picture: Construction

As an enclosure, I used an IKEA RΓ–DALM 13x18 photo frame.

The original glass was covered with a black transparent film to keep the wiring subtly visible while maintaining a clean aesthetic.
The film was carefully cut in the area of the TFT display so the screen remains fully visible.

The modules are connected using classic jumper wires, routed to small shields mounted on the Arduino MEGA.
Power is supplied via USB from the back of the frame.

Unlike many projects hidden inside closed boxes, this build intentionally exposes its structure.
The wiring is part of the story.


The .fzz file is attached below.
Full project documentation (+ gallery) available on GitHub.

If you have ideas for improvements or optimizations, feel free to share!

β€” Tom :crescent_moon:
moon-phase-arduino-mega.fzz (26.4 KB)

1 Like