Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Moon Phase Indicator

Status
Not open for further replies.

blort1961

Member
I am looking for a circuit that will indicate with leds, moon phases.
There are 7 actual moon phases (Each of the 4 lunar phases is roughly 7 days (~7.4 days) each but varies slightly due to lunar apogee and perigee).
I would like to do this with 6 leds, and the 7th represented by no leds illuminated.
Now I know that this can be done quickly and easily with a microcontroller, but I would like to give this a try the old-fashioned way...NO not with tubes, but with 555's and 4017's...and something along that line. It can be plugged in, so its not limited to a battery supply.
So whatcha say.....any help would be GREATLY appreciated.
Thanks
in advance
images
**broken link removed**
 
Last edited:
I am not sure how you arrived at 7 phases, a quick googling showed me 8 phases.

As for the display, I would not use a 555 for the timing element, you would do much better with something crystal controlled.

JimB
 
The days were were cut and pasted from Wikipedia...maybe the 8th
is no phase (blacked out)
???!!!!????!!!

Of course if this number is incorrect...I will use whatever number of leds is correct.

I'd be more than happy to use a crystal-controlled oscillator...I was just indicating the Types of components I would like to use...not pic type components
 
Last edited:
Wikipedia lists 8 phases from new (all dark) to fill (full brightness) back to new. Those would be 8 outputs (0 through 7) of a 4017 that drive the LEDs through individual driver transistors or a ULN2803. So much for the easy part.

The hard part is generating a very accurate clock with a period of 3.6925 days. This can be a purchased high frequency oscillator followed by a bunch of counters, or something like a CD4060 (a counter that can work with a bare crystal) followed by more counters. Either way, you need to calculate the exact period of the clock input into the 4017, and work backwards to determine what frequency you want the high frequency clock oscillator to be.

BUT - that method will produce a crystal frequency that is some weird value you cannot buy. So, you start with that method, then move the crystal freq up to one that you can buy. To get the 4017 clock to be correct, decode its period from all of the counter outputs with gates.

EDIT: Move the crystal freq down to one that you can buy.
ak
 
Last edited:
HMM...I THOUGHT I cut and pasted that from Wiki...maybe from another site.
It doesnt need to be highly accurate..if I need to adjust it every so often.
 
An easy way to make an accurate clock with an odd frequency would be to use a DDS (Direct Digital Synthesiser) chip.
You would just need a cheap AD9850 module, and a PIC or Arduino to send the control words to initialise it.......:facepalm:

Mmmm., a possible snag there !:rolleyes:

JimB
 
Ok, I KNOW a quick easy way is with a pic...But I know next to nothing about programming...
GUESS I could have a once a day pulse with 37 4017's, to get 365 days........
......HMMM.. the sheer absurdity of the thought intrigues me LOL
 
I met a guy in Ohio , who claimed he measured the phase of the moon with a 8" or so diameter gold loop measuring the self resonance frequency affected by gravitation effects on the earth's magnetic fields.

His other demonstrations, showed me he was for real.

He had a garage full of White Sand's Ebay purchases, but only need a stable oscillator design and counter calculating offset in ppm for lunar phase.

Display can be any method you wish with 8 or more LEDs in a circular pattern. using a binary decoder or Johnson counter with pulse increment in a circular pattern of 8 ( or 16 or whatever) and use different colors for waxing and waning.

For phase accuracy, you can use a 1ppm Xtal XO and sync manually at apogee if needed every 10 years or so. Then count down with CD 4060 and or fractional logic PLL. to 8 pulses per phase using a battery and/or super cap on float charge.
 
Last edited:
**broken link removed**
  • New moon (dark moon)
  • Waxing crescent
  • First quarter
  • Waxing gibbous
  • Full moon
  • Waning gibbous
  • Last quarter
  • Waning crescent
Ok, so just to make my poop straight....there ARE 8 phases of the moon, but 3 phases can be fairly accurately portrayed by no illumination...so that means this can be relatively accurately represented by 6 leds.
 
  • Std watch crystal 32768 Hz Tolerance +/-10ppm to 20.... tempco -(0.035 ± 0.008) ppm/°C load cap. = 6pF or 12.5 pf options
  • lunar cycle frequency 1/( 3.6925 *24*3600)= 1/319,032 = 3.134482 e-6 Hz
  • 10,454,040,576= 1.0454 e+10 = divider ratio

  • You may want accuracy of 5 digits for accuracy. < $1 Watch crystal does this with 5% 12pF caps or as specified or interface to a watch with coil pickup with rear removed and externally powered with magnet wires and very stable Lithium battery. Then you have 1 pps ( 1Hz)
  • From 1 Hz you need divider = 319,032 = 100 1101 1110 0011 1000 or a 19 bit down counter with this preset. or a 14 bit CD4060 and 5 bits of another counter.
  • Then a Johnson CD4017 counter driving LEDs direct with a 2 mA using White LEDs with Ultrabright >1000 to 20,000 mcd output @ 30deg. using 8 of 10 ports and 9th to reset the counter.
The rest is easy for Analog kid to finish.,

upload_2015-11-13_15-26-48.png


Your circuit assuming you have a 0.1% stable Vcc is at best 0.1% or 1000 ppm accurate not 10. and probably more like 1% without experience.

So count on re-syncing it like an old wind up watch .. often...every month

Nigel could code this up in his sleep into a PIC and send you the chip for his favorite adult beverage in exchange.
 
Last edited:
Nigel could code this up in his sleep into a PIC and send you the chip for his favorite adult beverage in exchange.
I would be more than happy to pay him for the chip, as well, as a favoured beverage
 
I might suggest single malt Oban.
 
Here is one approach. To count down a normal crystal frequency to a 3.7 day period takes 34 stages of binary counters. That's two chips, plus some decode logic.
1 CD4521 - this is a 24 bit counter that can work with a 32.768 kHz "watch" crystal. Only the last 7 bits are available, but that's enough for reasonable precision.
1 CD4040 - this is a 12 bit counter with all bits available.
19 small signal diodes like 1N914 - these are used to decode the counter state that is closest to the correct period for one phase.
1 CD4017, drivers, and LEDs to make the phase display.

One moon phase lasts 319,032 seconds, and one second is 32,768 counts of the crystal oscillator stage. So when the counter reaches 10,454,040,xxx (decimal), that number is decoded and used to reset the big counter and increment the 4017. This is about 80% of the overall counter's full range. It's not as scarey as it might sound, and it is more stable than either phase locked loop (PLL) or direct digital synthesis (DDS) techniques. Decoding only the top 19 bits of the 34 bit counter adds 4 seconds per month to the system error budget.

EDIT: Here is an updated schematic with full decoding and decoupling, missing the displays. For the decoded binary value that equals the transition of phases, the upper group of diodes connects to the ones and the lower group connects to the zeros. The decoded output of large ripple counters usually has some small glitches caused by timing skew in the bit transitions, so this circuit has an RC filter that also acts as a pulse stretcher for the advance/reset signal.

ak
LunarPhase-1-c.gif
 

Attachments

  • LunarPhase-1-c.pdf
    16.7 KB · Views: 155
Last edited:
Well...HOLY CRAP Analogue.. once again you truly are amazing...its a simple, elegant design
Just 2 questions:
-can the output just go to switching transistors...like 2n2222's to drive the leds?
-is The oscillator is just a stand alone unit, such as:
ABRACON Oscillator 32.768MHz 5V HCMOS ACO-32.768M, DIP-14,

Thank you for all your timer and effort.
 
Last edited:
1. Yes. The 4017 can source about 2-4 mA reliably. This can drive directly the gate of a small MOSFET like a 2N7002, or a small NPN through a gate current limiting resistor. That's essentially what's inside the 2803, without having to connect all of the individual parts. But if you've got the discreets, go right ahead.

2. I show a stand-alone, integrated oscillator because that's what's in my design library. For less cost you can hang a 32.768 kHz watch crystal and two capacitors on the 4521 (it has the electronics for a crystal oscillator built in). Note that most integrated oscillators run on 3.3V or 5V, while the rest of the parts are true CMOS and can run on anything up to 18 V.

To set the clock, pressing the switch advances the output one phase and resets the timer. So, for example, if you want the phase display to change at midnight of the transition day between phases, or noon of the peak day, that's when you press the button.

NOTE: I just noticed that I left out the connection between 4017 output "8" and its reset input. Here is a corrected schematic that also shows a crystal connection.

ak
LunarPhase-2-c.gif
 

Attachments

  • LunarPhase-2-c.pdf
    17.1 KB · Views: 189
Last edited:
Thanks so much Analogue, once again....this is truly a beautiful circuit.'

Is there a way to expand the output of U5, as the phases reverse after a cycle, not start over again at one,
(Im not certain how to explain this)
for example, the first cycle is:
1 2 3 4 5 6 7 8
The next cycle is:
8 7 6 5 4 3 2 1
Could this be done by just cascading U5 with another 2803, and adding some diodes to all the outputs to steer to the appropriate LED??
Thanks,
Kim
 
Yes, there is a way to do that. But last time I checked, the lunar phases haven't reversed in a very long time, as in never. Is this for something other than a lunar phase display?

A display that steps right, then left, then right, repeating, is called a Knight Rider display, named after the light display in the front grill of the KITT 2000 car in the TV series Knight Rider. Lotsa modules on ebay to do this.

ak
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top