Precision quartz guidance sought

Assisted in no small part by the excellent online resources such as this forum, I have recently been following what appears to be a traditional path learning about microcontrollers and general electronics through building a series of clocks/timers. I started out with a simple binary clock and am currently experimenting with one featuring an LCD display with a battery backed RTC disciplined via a GPS.

I would now like to put together a clock which has as high a level of accuracy as possible without the use of external sources, eg radio signal, GPS or network time signals. To that end I am looking at using some kind of precision quartz oscillator, but I am having a little difficulty determining what is readily available and realistically achievable.

Ideally I would like to find something I can use as a more or less direct replacement for the cheap 32KHz watch crystals I have been using thus far, either directly connected to a microcontroller timer, or as the base timing source for a RTC.

Any experiences/ideas/pointers would be gratefully received.

I have used a few DS3231 RTC chips for projects and they are quite accurate (less than 2 seconds per week drift). Not sure if this is accurate enough for your needs but you can also compensate in code (or on chip) for this drift and make it more accurate still if you have the time.

You can use a trimmer (variable capacitor) to fine tune the accuracy of these crystals.
For ultimate accuracy you need a crystal oven to keep the temprature constant but that will take lots of power.

I like the DS3231 as well, if a minute or two per year suits. These seem kind of neat, but again, more significant power requirements. I've also been playing with the Microchip MCP79412 RTC which has a calibration register built in, details on my blog.

Hi, If you are willing to pay the money, look for a TCXO (Temperature Compensated Xtal [Crystal] Oscillator). Just put TCXO into Google, read the Wikipedia entry etc...

Year ago when I built an automated FM Broadcast station I wanted .25 ppm stability or better to guarantee 1 second per month. Since this was automatically joining a national news broadcast wire every hour, it had to be that close. I ended up with a high-quality crystal (a round piece of quartz in a vacuum tube type package) in a constant-temperature box (85F) and a FET oscillator design with very low and constant crystal drive that I developed. You can find it in Electronics Magazine, somewhere in the Ancient History section...

I used a frequency counter calibrated against WWV and a 10 second gate to adjust it. A couple years after, all the TV stations went to atomic clock sync and their colorburst frequency was good to something like 10 to the -9 . Now GPS is even more accurate. But if you want standalone, no burp stability then probably a good TCXO is what you need, wether you build it yourself or not.

Let us know how it comes out...

A few possibilities:

  1. a precision timer like ds323x and their MEM versions.
  2. a precision quartz. You can get 5pm quartz fairly inexpensively.
  3. Trimming. Some chips offer hardware trimming in their RTC modules. You can use software trimming.
    ...

The issue is less with accuracy at a given temperature. The issue is with drifting at different temperatures. So one solution would be to use a temperature sensor and then trim based on that temperature reading.

Thanks for the replies thus far. Lots of useful information and ideas in there.

Most of the large prestige watch manufacturers have 'high end quartz' offerings in their catalogues. These typically boast from 20 to 5 seconds per year accuracy with users often reporting better than that. This appears to be achieved through a combination of careful quartz production, selection and pre-ageing along with thermo compensation and software correction. If my maths is correct this equates to ~ 0.5 ppm, which is about where I'm initially aiming.

The MCP79412 and DS3234 look interesting, but I'm not equipped or confident enough to tackle surface mount yet. However the Sparkfun DS3234 Deadon RTC board is available here in the UK from one of their resellers. This could be a reasonable starting point.

The bad boy Rb Atomic Oscillator in Dave's video looks awesome, and at roughly the same price as a bare GPS module isn't out of reach. I had already briefly looked at the Symmetricom Chip Scale Atomic Clock (CSAC), but at "around $1,500 for small quantities" quickly ruled it out.

dhenry:
2) a precision quartz. You can get 5pm quartz fairly inexpensively.

Do you have any pointers for where I could source these?

@terryking228: A TXCO based unit - possibly coupled with a nixie display, all mounted on an aluminium chassis - would certainly make a fantastic conversation piece. Unfortunately I don't think it's something I'm up to taking on at this stage. I'll certainly be seeing if I can dig out the article though.

Meant to add, there are several sites out there selling clock kits and also assembled if that's what you're after. Quite a few Nixie-based but others as well. Haven't looked into details, but I'd think that some are based on DS3231/34s.

The DS3231/34 have basic accuracy of ±2ppm, but they also have an aging trim register that allows adjustments of about 0.1ppm at room temperature. Have not played with the aging register in the one I have, but getting to these levels of accuracy raises the question of how to measure and observe the effect of adjustments without waiting A Long Time. I might still want one of those Rb oscillators or something similar to compare against.

Farnell have a good range of crystals and oscillators including TCXO and OCXO's, their website is very useful.http://uk.farnell.com/crystals-oscillators

OCXO's can give 30ppb or so with longterm stabilities of 0.5ppm. Not cheap.

MarkT:
Farnell have a good range of crystals and oscillators including TCXO and OCXO's, their website is very useful.http://uk.farnell.com/crystals-oscillators

OCXO's can give 30ppb or so with longterm stabilities of 0.5ppm. Not cheap.

I've seen great prices for TCXO, OCXO, and other high quality clock sources on E-bay, either new old stock or recently pulled from equipment.

I wouldn't trust ebay for something like this, especially when you have no equipment to confirm their reliability / accuracy.

Go to a reputable distributor and search for oscillator and you will find thousands of listing. Most of them allow for filtering, making it easy for you.

A big consideration will be intended applications. If you want low power consumption, any ocxo-based solutions are out of the window.

If you want to put the mcu into sleep, any solution based on the main oscillator (software rtc) is out of the window, as are hardware rtc modules without its own power domain (Vbat pin).

If you don't want to program. You have to get one of those precision 32khz oscillators - maxim / dallas has one.

I wouldn't trust ebay for something like this, especially when you have no equipment to confirm their reliability / accuracy.

There is certainly room for different personal opinions on that matter. I feel a hobbyist does himself a big disservice if he/she limits themselves to only using full retail large vendor's offerings, especially for exotic high cost parts. A hobbyist dollar can go a lot farther if he/she considers E-bay listings, surplus outlets, etc, especially for high value exotic parts like a OCXO. I've had good luck over the years using E-bay for electronic parts. Now certainly a commercial enterprise can't be sourcing their parts via E-bay, for a variety of reasons, but a hobbyist needing one off special components is certainly free to explore that avenue.

Lefty

I feel a hobbyist does himself a big disservice if he/she limits themselves to only using full retail large vendor's offerings, especially for exotic high cost parts.

I second that, eBay has saved me a small fortune for components and nothing has been DOA or died of natural causes, just the odd item murdered by my incompetence :smiley:

Depending on your skills, making an ocxo isn't that difficult - get a power transistor / mosfet as the heater, a temperature sensor (ptc, ntc or a good old bjt), and a few resistors and some handy work, you are done.

The difficult part is to caliberate this thing, and making sure that it is stable - they are fairly easy to thermally oscillate.

An easier approach is to implement a tcxo in software.

dhenry:
Depending on your skills, making an ocxo isn't that difficult - get a power transistor / mosfet as the heater, a temperature sensor (ptc, ntc or a good old bjt), and a few resistors and some handy work, you are done.

The difficult part is to caliberate this thing, and making sure that it is stable - they are fairly easy to thermally oscillate.

An easier approach is to implement a tcxo in software.

There are several trade-off decisions between selecting a OCXO Vs a TCXO, as you stated power consumption, package size, but if frequency accuracy/stability is the important issue then there is no comparison, the OCXO is magnitudes better.

Lefty

[quote author=Jack Christensen link=topic=124085.msg933487#msg933487 date=1348497283]... but getting to these levels of accuracy raises the question of how to measure and observe the effect of adjustments without waiting A Long Time.
[/quote]

There's an interesting discussion on this subject in the watchuseek forum here - Methods of Determining the Accuracy of a Watch | WatchUSeek Watch Forums

retrolefty:
I've seen great prices for TCXO, OCXO, and other high quality clock sources on E-bay, either new old stock or recently pulled from equipment.

OK I'm now hooked on the idea of using an ebay sourced OCXO. Am I right in thinking I could possibly use one like this? - http://www.ebay.co.uk/itm/310380778466?ssPageName=STRK:MEWAX:IT&_trksid=p3984.m1423.l2649

I've run over the specs as presented in the listing, as well as the Micro Crystal datasheet linked to from there, and have come up with a 'conceptual design' on which I would very much appreciate any and all feedback.

The general idea I have in mind is to use the 10MHz output from the OXCO as the clock for a small micro controller, such as an ATtiny45, running a simple program which uses the timer to generate a suitable timing pulse, eg 1 pps, for use as an interrupt signal on an arduino controlling the RTC and clock display. Could this be made to work, or am I being too simplistic?

A second more specific question relates to the Frequency Adjustment referred to. Would I be correct in assuming this means that I can fine tune the output frequency by applying a fixed dc voltage in the range .5V to 5V, as provided by a simple voltage divider with a variable resistor in it, say? Or again, have I misunderstood the complexity involved?

petethegeek:

[quote author=Jack Christensen link=topic=124085.msg933487#msg933487 date=1348497283]... but getting to these levels of accuracy raises the question of how to measure and observe the effect of adjustments without waiting A Long Time.

There's an interesting discussion on this subject in the watchuseek forum here - Methods of Determining the Accuracy of a Watch | WatchUSeek Watch Forums

retrolefty:
I've seen great prices for TCXO, OCXO, and other high quality clock sources on E-bay, either new old stock or recently pulled from equipment.

OK I'm now hooked on the idea of using an ebay sourced OCXO. Am I right in thinking I could possibly use one like this? - http://www.ebay.co.uk/itm/310380778466?ssPageName=STRK:MEWAX:IT&_trksid=p3984.m1423.l2649

Looks to be a very nice one at an attractive price. What does the current consumption say from the datasheet?

I've run over the specs as presented in the listing, as well as the Micro Crystal datasheet linked to from there, and have come up with a 'conceptual design' on which I would very much appreciate any and all feedback.

The general idea I have in mind is to use the 10MHz output from the OXCO as the clock for a small micro controller, such as an ATtiny45, running a simple program which uses the timer to generate a suitable timing pulse, eg 1 pps, for use as an interrupt signal on an arduino controlling the RTC and clock display. Could this be made to work, or am I being too simplistic?

I don't see why not. Just make sure the ATtiny45 has clock fuses set for external clock signal input.

A second more specific question relates to the Frequency Adjustment referred to. Would I be correct in assuming this means that I can fine tune the output frequency by applying a fixed dc voltage in the range .5V to 5V, as provided by a simple voltage divider with a variable resistor in it, say? Or again, have I misunderstood the complexity involved?

No, you have it correctly, but keep in mind the adjustment range is small +/- 40hz. One might ask how you will determine that an adjustment is required, that is what standard will you use to suggest a change is required?
Lefty

[/quote]

petethegeek:

[quote author=Jack Christensen link=topic=124085.msg933487#msg933487 date=1348497283]... but getting to these levels of accuracy raises the question of how to measure and observe the effect of adjustments without waiting A Long Time.

There's an interesting discussion on this subject in the watchuseek forum here - Methods of Determining the Accuracy of a Watch | WatchUSeek Watch Forums
[/quote]

Thanks, that looks interesting!

The general idea I have in mind is to use the 10MHz output from the OXCO as the clock for a small micro controller, such as an ATtiny45, running a simple program which uses the timer to generate a suitable timing pulse, eg 1 pps, for use as an interrupt signal on an arduino controlling the RTC and clock display. Could this be made to work, or am I being too simplistic?

I'd think it could be done with a single microcontroller, e.g. use the external clock input on Timer/Counter1 to divide down the 10MHz signal, generate an interrupt, etc.

That OXCO does look interesting. Hmmm... :smiley:

Micro Crystal datasheet linked to from there,

The ebay device is actually quite expensive. You can get tcxo's now for < $5 in single quantity from a reputable distributor.

The general idea I have in mind is to use the 10MHz output from the OXCO as the clock for a small micro controller, such as an ATtiny45, running a simple program which uses the timer to generate a suitable timing pulse, eg 1 pps, for use as an interrupt signal on an arduino controlling the RTC and clock display. Could this be made to work, or am I being too simplistic?

That is the set-up if you want to use the ocxo as a timing standard to see how much off your rtc is. Otherwise, it is much simpler to use it to implement a software rtc:

//use the ocxo as an external oscillator to drive the arduino

#define F_OCXO  16000000ul  //ocxo's frequency, in hertz
#define F_CPU    F_OCXO  //F_CPU 1:1
#define RTC_1s   F_CPU  //rtc count for 1 second
#define RTC_500ms (RTC_1s / 2) //rtc count for 0.5 second
#define RTC_100ms (RTC_1s / 10) //rtc count for 0.1 second
#define RTC_PR  RTC_1s //rtc period. set to 1 second

//set up the rtc
void rtc_init(void) {
  //set up a timer to count the oscillator
  //put your code here to reset the rtc
}

//timer isr
ISR(TIMERn_OVF_vect) {
  static unsigned long timer_counter = 0; //timer counter
  
  timer_counter += 0x10000ul;  //increment timer_counter, assuming a 16-bit counter
  if (timer_counter >= RTC_PR) {//rtc period has been reached
    timer_counter -= RTC_PR;  //reset timer counter
    rtc.sec += 1;  //increment rtc second count
    if (rtc.sec >= 60) {//second overflow
      rtc.sec -= 60;  //reset rtc second
      rtc.min += 1;
      ...
}

With this approach, you will have maintained a software rtc whose (long-term) accuracy is identical to that of the ocxo (or xtal if you so chose).

You can easily implement trimming here if you desire.

The ebay device is actually quite expensive. You can get tcxo's now for < $5 in single quantity from a reputable distributor.

We are talking OCXO here not TCXO, a different animal with better frequency specs.

Lefty