I thought it would be fun to make a clock that showed the current phase of the moon. The project turned out nicely and is currently mounted on the wall of my wife’s first grade classroom. The students are fascinated by it and refer to it often. See Figure 1.
Operation: The shapes of the moon (i.e., the lunar phases) are caused by the light shining on the moon and the position of the Earth relative to the sun and moon throughout the lunar cycle. For my moon, I decided to have 8 lighted segments; which allows me to depict 16 different moon phases, from a New Moon (fully dark), to a Full Moon (fully lit), and back to the New Moon again.
As described in http://www.moonconne...on_phases.phtml the synodic period, or lunation, is exactly 29.5305882 days. It's the time required for the moon to move to the same position (same phase) as seen by an observer on earth.
For my project, the 29.5305882 day synodic period is divided into 16 clock phases, each 1.8456617625 days; or 44 hours 17 minutes and 45.176 seconds; or 159465.2 seconds long. My clock uses a counter to keep track of the time, and advances to the next phase after each 159465 second interval.
Construction: I used an old wall clock for the chassis and put a picture of the moon under the plastic front as shown in Figure 1. The face of the clock is segmented into 8 sections, each with a pair of bright LEDs, as shown in Figure 2.
For the electronics, I used a Netduino Mini mounted on a Radio Shack circuit card. Each of the 8 LED moon phase segments is powered by a GPIO output pin connected to an NPN transistor. The Phase Advance switch shorts a GPIO input pin to ground to allow me to set the clock. This is shown in Figure 3.
On startup, the software initializes its program variables, performs a simple LED test to verify that the lights work, sets the clock to a New Moon (no lights lit), and starts a counter to keep track of the time. When the time for a phase elapses (159465 seconds, as explained above), the software advances the phase and turns the next LED segment on or off, depending on whether the moon is waxing or waning. The user may also advance the phase by pressing the Phase Advance button. The code is included in Attachment 1.