Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

A Moon Phase Clock


  • Please log in to reply
6 replies to this topic

#1 patduino

patduino

    Member

  • Members
  • PipPip
  • 20 posts
  • LocationIndiana, USA

Posted 29 November 2012 - 04:02 AM

I’m not sure about you – but ever since watching the Apollo 11 mission in 1969, I’ve been obsessed with the moon. Combine that with my obsession for cool electronic gadgets and Netduinos, and you get the following project: a Moon Phase Clock. And what better time to post this project than during a full moon!

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.

Attached Files


There are 10 types of people in the world... Those that can understand binary and those who can't.

#2 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 29 November 2012 - 04:40 AM

Patduino, your idea is awesome, and the final result looks wonderful indeed! Just one question: the crystal of the Netduino is not much accurate. Do you have any time-adjust trick? Cheers
Biggest fault of Netduino? It runs by electricity.

#3 Nevyn

Nevyn

    Advanced Member

  • Members
  • PipPipPip
  • 1072 posts
  • LocationNorth Yorkshire, UK

Posted 29 November 2012 - 06:47 AM

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.

Neat and great to hear that kids are talking about it.

Regards,
Mark

To be or not to be = 0xFF

 

Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life

Follow @nevynuk on Twitter


#4 patduino

patduino

    Member

  • Members
  • PipPip
  • 20 posts
  • LocationIndiana, USA

Posted 29 November 2012 - 11:48 AM

Thanks!

...the crystal of the Netduino is not much accurate. Do you have any time-adjust trick?
Cheers


Mario, I ran some tests beforehand to calibrate the uP. I determined that I would be off by about 22 seconds per phase, so I account for that in the code. I assumed that the drift was constant.

...great to hear that kids are talking about it.
Cheers


Mark, you bet. My (not so) secret plan is to stir up an interest in science in these kids. I answered some of their questions, but told them they'd have to wait until later in the year when they learn about the Solar System. Now they can't wait!
There are 10 types of people in the world... Those that can understand binary and those who can't.

#5 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 29 November 2012 - 12:46 PM


Mario, I ran some tests beforehand to calibrate the uP. I determined that after about a day that I was off by 22 seconds, so I account for that in the code. I assumed that the drift was constant.


Yeah, does have sense. The typical drift of a crystal is about 50ppm, depending on quality.
BTW, the drift is not constant so much, because is depending from temperature. The higher is the temperature, the lower will be the oscillating frequency.

Anyway, it was just a question for learning better what did you put in the toy!
Congrats again.
Cheers
Biggest fault of Netduino? It runs by electricity.

#6 Paul Newton

Paul Newton

    Advanced Member

  • Members
  • PipPipPip
  • 724 posts
  • LocationBerkshire, UK

Posted 29 November 2012 - 06:39 PM

Great idea for a project - brilliant execution!

#7 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 30 November 2012 - 08:47 AM

Wow patduino. I don't want to add an empty comment to your post but...really cool. :) Thanks for building and sharing this! Chris




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.