Electronic – GPS PPS signal corresponds to data time

gps

I currently have an Adafruit Ultimate GPS connected to an Arduino that outputing GPS data (nmea sentences) once per second. There is also a pin on the GPS outputting 1 PPS signal.

My question is whether the pulse of the PPS suppose to match the time that the GPS data is coming in i.e are they are coming in at the same time?

Also does PPS pulse come in at the beginning of a UTC second or is it random and simply once a second?

Best Answer

I have not used the Adafruit GPS, but GPS units almost always output the time after the PPS signal has been sent. They do this because the PPS signal is typically tied to the timing of the data stream coming from the satellite (or at least most GPSs have a mode where they are tied). In this case, the PPS is sent at exactly the moment the GPS satellite data stream says a UTC second starts. After that, they process the data, determine what time it actually was, and relay that data.

Some GPS have other modes where the PPS does not occur exactly at the top of a UTC second (which is helpful if you want to use the PPS signal before you have a GPS feed), but those that I have seen typically default to the PPS occurring at the top of the second.

If you need to know the time of the PPS, you need to latch an internal timer when the PPS signal occurs, then associate that with the data from the GPS when it comes in. Alternatively, keep track of the GPS data and, when the PPS is asserted, you can assume that it is now most_recent_gps_time_utc + 1 second.