# A High-Precision Energy-Efficient GPS Time-Sync Method for High-Density Seismic Surveys
## 2 Development of the GPS Time-Synchronization Method
### Time-Synchronization Method
We propose a low-power solution based on the GPS operating mode. After the GPS provides time service, it sleeps. When it is the time that the GPS provides time service, it wakes the GPS. The sleep and wake of GPS are realized by the MCU sending UBX instructions to GPS. Figure 8 shows the working state of GPS in power save mode and continuous working mode. In power save mode, the GPS wake-up operation must be completed before GPS provides time service in order not to miss a sampling point. The time relationship is shown as follows:  
\[\Delta\mathrm{T}\geq t_{sleep}+t_{cs} \tag{5}\]  
where \(t_{sleep}\) is the GPS sleep time, \(t_{cs}\) is the cold start time. In general, \(t_{cs}\) is about 2 s. The average power consumption is about 20 mW in GPS sleep mode, and the average power consumption is about 75 mW in GPS continuous mode. Thus, the power save mode would save 73% of the total energy compared to the continuous mode in a time service cycle. As shown in Figure 9, the entire acquisition and time-synchronization workflow of the seismograph is divided into five phases:  
1. GPS positioning: The node performs a self-test immediately after the system is powered on. When the self-test is completed, it immediately enters the GPS positioning task. After the valid GPS information is obtained for the first time, the GPS time information is extracted as the time-synchronization folder name and time-synchronization file name. 2. Record seismic data: The seismic data FIFO size is set to 4 kbytes. The FIFO size is detected and written to the SD card at one time when the FIFO is full. If the node collects at a sampling rate of 1000 sps and each data point occupies 4 bytes, then the amount of data generated per second is 4 kbytes. That is, an SD card data-write operation will be performed every second. 3. Trigger synchronization time: The setting of this time is given by Equation (4). Set a variable to count the number of FIFO writes. When the count reaches the trigger time, it notifies the GPS serial data output interrupt and PPS interrupt to start time-synchronization. Figure 8: The working state of GPS in power save mode and continuous working mode. 4. Time synchronization: The ADC generates an interrupt through the DRDY pin. When a DRDY interrupt occurs, a data point is the output. A variable is set to count the number of data points. When a time synchronization event occurs, the amount of data point generated by the ADC, and the accurate GPS time is stored as a time-sync file in the SD card. 5. Close file: When the detected seismic data file size reaches the set block size, close the current data file and create the next data file. At the same time, the ADC count is cleared and the counter is started again, and so on, until the end of the acquisition task. Calculating the local time from GPS time to UTC time mainly uses two parameters, GPS week number and GPS milliseconds time of the week [26]. In order to record the synchronization information accurately, we have designed a 1-s time series, which is between the output time information of the mm second pulse and the output time information of the (mm + 1000) second pulse, as shown in Figure 10.  
Figure 10: The 1-s time series of GPS time. Figure 9: The workflow of the main program. \(T_{0}\) in the time series is the point of time when encountering GPS serial data output interrupt, and \(T_{1}\) is the point of time when a PPS interrupt event is encountered. Since the rising edge of the 1 PPS pulse of the GPS receiver is the starting point of the second and the time series length is 1 s if the GPS serial interruption time corresponds to \(T_{0}(\text{nn : mm})\), then the recorded time is \((T_{0}+1)\).