OpenPPS

I’ve been working with GPS for a long time, since at least 1994. In those days products with GPS receivers were just becoming available to consumers and were big and expensive. I remember the first time I got my hands on a development kit from Trimble I was very excited. After carefully following the setup instructions to apply power and look at the data coming from the receiver it didn’t seem to be be sending out anything that made sense. After a day or two of trying to figure it out I finally realized that it wouldn’t work indoors! Ok so you have to take it outside to test it which is no problem except maybe in the winter 🙂 That’s when I learned the hard way that GPS "cold start" had a double meaning. It was no fun being out in a snowstorm for half an hour waiting for the GPS receiver to get its first fix.

So fast forward to 2018 and GPS receivers are everywhere and taken for granted. They are in your phone, your car and even your watch. They still don’t work very well indoors however and they certainly can’t tell you where you are in a building. They can often still give you a position depending on the receiver and the building you are in but it’s not really useful for anything so essentially the receiver is more or less in a standby mode waiting to go outdoors again.

But a GPS gives you more than your position and in particular it gives you the time. A very precise time in fact, as good as 20 nanoseconds (ns) depending on conditions! I have always been intrigued by that and the fact that it is a byproduct of how GPS works. The receiver synchronizes its time to the atomic clocks that are in the satellites and then it uses that to estimate the distance from each satellite and triangulates to get its own position. In simple terms at least the more precise the time the better the position estimate (along with many other factors).

As long as your GPS has some kind of position fix then it is giving you the time. So what can you do with that? Probably the most common use is to synchronize other time sources such as a computer's internal clock. In fact there are commercial systems that are available to do that. You connect them to your network, run a cable to put the antenna on the roof and then every computer connected to the network can have its clock synchronized to all the others to an accuracy of a few milliseconds at least. Here is an example of a current product from Trimble:

You can actually find some used ones of these on Ebay. In most cases at home or in the office however synchronizing to your national time source over the Internet will be good enough.

But what if you want to have a really accurate time reference that is always available? With that you could make a very accurate frequency counter or pulse measurement tool, both of which are commercially available but much too expensive for hobbyists.

Last year starting in October I decided I really needed to try this and see how well I could do. I already had some ublox Neo 7 GPS modules lying around from past experiments with flight controllers for drones and they were pretty good at keeping a fix indoors which I needed because my workshop is down in the basement and I certainly wasn’t going to develop this working outside or in the kitchen.

I had also already written my own library for interfacing ublox receivers with the ESP32 and the Arduino framework so that combination seemed like a good place to start.

The first thing I did was build two of these for testing and they did keep working in my workshop as long as I left them upstairs by the window for a while first to get a reasonable position fix. This is a good time to mention that most (all?) GPS receivers produce a timing pulse called PPS (pulse per second). This is most often used to flash an LED to indicate that the receiver is operational and has a position estimate. Some receivers bring this signal out to a pin and that was the case with the Neo 7s that I had.

Next I tried comparing the PPS from the two separate receivers using my trusty old Tektronix 4 channel oscilloscope and I was really surprised at the result.


The leading edge of the PPS from both receivers stayed within 50 ns of each other! It didn’t seem to matter much what I did like take one away to restart it and bring it back it was always within 50 ns. I have to say that was an encouraging way to get started. It was time to build something.



Next page, OpenPPS Development...