Page 1 of 1

A look inside the DS3231 RTC

Posted: Fri Aug 11, 2017 5:39 pm
by Pito
What is inside the DS3231 RTC (the cheap boards we use frequently):

https://blog.heypete.com/2017/07/29/a-l ... ime-clock/

Re: A look inside the DS3231 RTC

Posted: Fri Aug 11, 2017 6:41 pm
by ahull
I spotted that. I have some of those modules on my raspis. Its actually quite an interesting device, and with a bit of tweaking is pretty accurate. I wonder how accurate you could make it with a bit of oven control and a GPS reference to tune it.

Re: A look inside the DS3231 RTC

Posted: Sat Aug 12, 2017 1:51 pm
by ddrown
ahull wrote:
Fri Aug 11, 2017 6:41 pm
I spotted that. I have some of those modules on my raspis. Its actually quite an interesting device, and with a bit of tweaking is pretty accurate. I wonder how accurate you could make it with a bit of oven control and a GPS reference to tune it.
No oven control, but I did get around 1 second per year (-0.038ppm +/-0.085 ppm) in my test: https://blog.dan.drown.org/rtc-comparison/

Re: A look inside the DS3231 RTC

Posted: Sat Aug 12, 2017 3:12 pm
by Pito
Unless you measure 1y long you cannot get precise results (aging, temperature).
I got 4secs in 6months with DS3231 (temp 19-28degC, stock reg period) - that is great as well.

Re: A look inside the DS3231 RTC

Posted: Sat Aug 12, 2017 6:44 pm
by ddrown
Pito wrote:
Sat Aug 12, 2017 3:12 pm
Unless you measure 1y long you cannot get precise results (aging, temperature).
I got 4secs in 6months with DS3231 (temp 19-28degC, stock reg period) - that is great as well.
That is true, aging is probably around +/-1ppm/year. And my results were under a much narrower temperature range than the chip is rated for. Both of those factors would lead to larger errors in other tests.

Still, these were much better results than I was expecting.

Your result of 4s/6months is around 0.25ppm which is about right for an average change of 1ppm/year.

Re: A look inside the DS3231 RTC

Posted: Sat Aug 12, 2017 7:15 pm
by Pito
Also the GPS 1pps outputs are not precise (especially with cheapo modules), the jitter could be huge short time.
You need a quality OCXO disciplined by the 1pps output with a large time constant in the loop, like several hours or more, to get a good precision out of it..

Re: A look inside the DS3231 RTC

Posted: Sat Aug 12, 2017 10:36 pm
by david.prentice
Surely you can synchronise a clock to a GPS signal over a time period. And get an accurate time with averaging.

There is no need to wait for a year. You can measure any phase difference between the DS3231 pulse output and the synchronised "accurate" clock.
A 1 second error in 365 days is 0.03 ppm. You should be able to measure the phase difference within 30 seconds.
The absolute accuracy is not very important. The short term stability of a regular HF crystal is good. You are only measuring the phase difference.

I quite agree that it is simpler for a human to compare whole seconds after a year. But it is not very practical.
It s my bedtime. I may have the maths wrong but the argument seems valid.

David.

Re: A look inside the DS3231 RTC

Posted: Sun Aug 13, 2017 12:04 am
by ddrown
Pito wrote:
Sat Aug 12, 2017 7:15 pm
Also the GPS 1pps outputs are not precise (especially with cheapo modules), the jitter could be huge short time.
You need a quality OCXO disciplined by the 1pps output with a large time constant in the loop, like several hours or more, to get a good precision out of it..
The GPS signal can jitter 30ns for this module (RMS measure, while in 3d lock). So I did have to use longer time periods than 1 second to measure what I did. Averaging over longer time periods works for time keeping, but I would need to use your GPSDO suggestion if I was testing a clock source for radio use.

Re: A look inside the DS3231 RTC

Posted: Sun Aug 13, 2017 7:01 pm
by ddrown
Pito wrote:
Sat Aug 12, 2017 3:12 pm
Unless you measure 1y long you cannot get precise results (aging, temperature).
I got 4secs in 6months with DS3231 (temp 19-28degC, stock reg period) - that is great as well.
To go into more detail about your point about aging, this is a few months of data from two TCXOs (not the DS3231, but it should be somewhat similar). I've somewhat controlled for temperature effects so the majority of the graph's week to week motion should be from aging. The datasheet spec for these TCXOs are +/-1ppm/year.

Image

I turned both TCXOs off for a week in July and you can see that caused its own change as well. The two lines have a slope of 0.71ppm/year as my estimate of their aging rate. Aging isn't a straight line, but makes an ok fit.

Assuming this aging rate stays constant and linear (and it won't, but it's a useful estimation) this would result in a 11.2s drift this year. I've read that crystal aging rate slows down after the first year, so that's something else to expect.

Re: A look inside the DS3231 RTC

Posted: Mon Aug 14, 2017 6:44 am
by Pito
Nice measurements!
I messed with OCXOs a decade or more back, while I was lucky and had real Cesium based equipment handy (not GPS based nor the stuff from ebay, but real calibrated Cesium stuff, part of the ww network - the national standard). I saw how the crystal cracks (the layers of atoms move) while running in the oven for 2 weeks and I saw the various effects (temperature, gravity, ..) you cannot see when not having such precise equipment handy.. ;)