SparkFun Forums 

Where electronics enthusiasts find answers.

Tips and questions relating to the GPS modules from SFE
By cwang36
#34172
We bought a GPS Logger 2.4 kit for tracking applications. We are using mode 1 (sleep) at a 10 minute interval so that we can track a subject for as long as a week. But we found the GPS does not timeout when the subject when to somewhere where there is no GPS signal. This will keep the GPS working and comsuming over 100mA, and drain the battery quickly. So we modified the firmware a little and added a timeout to it.

The problem now is, we can't determine what value should be assigned to the timeout. A cold start can take as long as several minutes, while a hot fix takes less than 20 seconds. If the subject went to a no signal area for a long time (e.g., over 10 hours), we cannot determine when the GPS went out of the area, so we cannot determine when to try a cold start, while keep doing a five minute timeout try will drain the battery very quickly, using a 30 second timeout will make it impossible to do cold start even when the user move out of the area.

Have anybody encountered this problem? Any idea to solve it?

Thank you.
By coyotebush
#35342
You need to stay awake long enough to search for satellites and to download missing ephemerides. You might also need to update the almanac every day or two.

The ephemeris is transmitted every 30 seconds and is valid for 30 minutes to 2 hours. The almanac is sent every 12.5 minutes and is valid for several days. You probably want to double the wait times to ensure you get a complete sequence.

So, one possible algorithm:
Code: Select all
repeat
       If you have enough healthy satellites, take the fix and go to sleep.
       Periodically stay awake several minutes allowing the 
                new ephemerides to be transmitted and new 
                satellites to be detected
       Every once in a long while, stay awake 25 minutes to update
                the almanac.