Some people like to tweak cars. Some like to overclock PCs. Then there are the guys like [Jack Zimmermann] who are obsessed with accurate time. He’s working on a project that will deploy NTP (Network Time Protocol) servers in different African countries and needed small, cheap, energy-efficient, and accurate servers. What he wound up with is a very accurate setup for around $200. Along the way, he built some custom hardware, and hacked a computer to sync to the GPS clock reference.
His original attempt was with a Raspberry Pi 3. However, the network adapter isn’t the fastest possible, both because it is 100 MBPS and, primarily, because it is connected via the USB bus. Network latency due to these limitations makes it difficult to serve accurate time.
His solution includes an Odroid C2. For $50 it is a very capable computer with four cores, gigabit Ethernet, and can even use eMMC storage which is faster than the usual SD card. You can still use a conventional SD card, though, if you prefer.
For a time reference, [Jack] used a Trimble GPSDO (GPS-disciplined oscillator) that outputs a PPS (pulse per second) and two 10 MHz signals. These are locked to the GPS satellite clocks which are very accurate and [Jack] says the timing is accurate to within less than 50 ns. Unfortunately, the pulse from the Trimble board is too short to read, so he designed a pulse stretching circuit.
Instead of trying to discipline the existing clock on the Odroid to the GPS reference, [Jack] removed the crystal and associated components completely. He then used a frequency generator chip to convert the 10 MHz GPS signal to the 24 MHz clock the Odroid expects. He has plans to use the extra outputs from the chip to drive the ethernet and USB clocks, too, although their absolute accuracy is probably not that critical.
We’ve seen NTP clocks before that can consume this kind of time reference. If you want to know more about the Odroid C2, we talked about them at length last year.
One day… one day I’ll get that GPS NTP server set up. One day.
is that 24 hours or 24 hours?
http://www.satsignal.eu/ntp/Raspberry-Pi-quickstart.html
Looks fairly easy to setup. It’s probably not good enough for high speed trading but would work well for a remote or isolated network.
I ran into some info on GPS and the NTP client in linux the other day as we had some issues with std steady_clock on the job.
It seems that the NTP client can sync directly from a GPS NMEA stream!?
Sooo. Question being: Could you simply sync the server to the GPS sattelites via this method?
And if so, how would this simple setup stack up against the method in this article?
Unfortunately not. The delay is too big on the serial line. Most people uses the GPS NMEA stream to set the hour:minutes:seconds and rely on the PPS signal for more exact seconds. It’s really easy to modify an U-Blox GPS module from eBay to output PPS (or 10MHz) by soldering a wire on the board. There’s even cheap Raspberry Pi boards from Adafruit and others that has the PPS signal out, connected to a GPIO pin.
Forgot to mention, some GPSDO’s actually use the DTR pin for PPS signal.
Garmin GPS18x LVC here. Just have to run the wires were needed.
How about a GPS based ESP8266 Wireless NTP server. No internet connection needed:
http://www.absolutelyautomation.com/articles/2016/09/15/esp8266-based-wireless-ntp-server-no-internet-connection-needed.
http://absolutelyautomation.com/imagenes/160915_ESP8266_GPS_1280x720.jpg
That doesn’t use PPS at all which means its accuracy is vague at best.
You can grab an ebay timing GPS and timing GPS antenna for under $50 like the motorola oncore UT+ … it has a PPS timing output along with TTL serial and is configurable
i should also add i have never had a timing GPS delivered from china without the box being searched … they look like mini warheads so the xray would be interesting at best
timing GPS antenna*
its late
>> “deploy NTP… the network adapter isn’t the fast … Network latency … difficult to serve accurate time.”
Isn’t NTP supposed to accurately sync time across a network IN SPITE of network speed and latency? I guess you still need at least one server to be the timebase…
The more jitter and latency you can remove, the better the NTP server will perform. Yes, NTP can handle jitter and latency, but why make the job harder?
“Yes, NTP can handle jitter and latency, but why make the job harder?”
The job of making NTP handle jitter and latency is already done, so there’s nothing hard about it. Of course, what’s missing from this blog entry is the actual requirement specification. We have no idea what kind of accuracy is ultimately needed, making it hard to contribute useful suggestions.
It’s fairly straight forward to use the pps_gpio linux module as a time source for NTPD, For an RTK GPS basestation & rover I used an OrangePi Zero running the latest Armbian and uBlox LEA-6T modules. For $80 AUD each they happily run RTKLIB and ntpd without breaking a sweat. The RMS error of the LEA-6T PPS output is 30ns according to the datasheet.
So you’re looking for accuracy and precision. The time right now is 10:08 AM EDT. That’s accurate, but it’s not precise. Precise would be 10:06:54:30. That’s precise, but not accurate. Precise and accurate would be something I can’t do easily on this Windows PC ;)
It stopped being accurate as soon as you clicked “post comment.”
That is precisely true.
Instead of adding a coverter from 10 MHz to 24 MHz, I’d have used a CPU that can run a timer from separate clock input pin like the AM335x with its TCLKIN pin.
And for pushing that accuracy out to the net, PTP is much better than NTP, especially with Ethernet controllers that can do hardware timestamping.
Maybe build one that can decode MSF, GPS, Galileo AND GLONASS using recycled phone parts?
I did read somewhere that GPS micro-antennas are way better than the junk piece of wire typically sold with phones,
and can give about a 30-50% increase in gain with negligible increase in noise.
Maybe that should be the next hack? How to increase the performance of phone GPS?
https://www.sparkfun.com/products/9131
Also I have built makeshift antennas for my buddies at Golf Charlie Hotel Quebec before, using large area blue LEDs harvested from assorted junked LED matrix boards used on some jets (seriously!) and they also work if you stack up enough of them side by side with the emitters facing sideways on for maximum exposure of the junctions to the sky.
They incidentally also have incredibly good varicap properties and the ones from old flat screen TVs in series work moderately well if you pick emitters with 1Px16S single diode arrays in them but are far bulkier.
The record is a 3mm*4mm * 2mm double sided “module” which out-locked a £15,000 custom made laser tuned antenna by a factor of 1.3 just using the cheapest GPS single chip solution we could find for a whole £9 plus some very finicky hand nano-soldering.
Catch is that they have atrocious temperature and light sensitivity but the fix is to use 3 such emitters with different peaks and connect them in parallel via DC blocking wye filters to the front end.
With only minor work the same module picks up Galileo as well.
ntp2.kfu.com is part of the NTP pool, and it’s a mash-up of two Hackaday projects:
https://hackaday.io/project/20156-raspberry-pi-zero-w-desk-clock
https://hackaday.io/project/15137-raspberry-pi-gps-stratum-1-ntp-server
Why not just pick up a used Symmetricom GPS NTP off eBay? You can score them < $200 sometimes…..