1

can someone please point me at some code snippets to detect when the GPS is stationary. I am currently using tinyGPS library and it is working fine, but my data-logger has thousands of stationary details I'd like to not bother logging. Currently I am using this,

uint8_t speedZero() {
uint8_t spd = gps.speed.mph();
  if (spd < 5) {
    return 0;
  } else {
    return spd;
  }
}

But it is too granular at slow speeds, but the NEO-6M drifts a lot and 5mph standing still is not uncommon.

I have tried comparing Last Lat/Lon but not having any success as this Math is waaaay out of my skill-zone.

4
  • 2
    Just add accelerometer sensor to your device. It's just around 1USD and it will easily detect lack of movement. Feb 26, 2019 at 22:07
  • I have tried comparing Last Lat/Lon but not having any success as this Math is waaaay out of my skill-zone. - find a function that gives you a distance between two lat/long points, the remaining math is trivial Feb 26, 2019 at 22:11
  • 1
    I gave an answer in PHP a few month ago, maybe it can help: stackoverflow.com/questions/7222382/…
    – Peter
    Feb 26, 2019 at 22:44
  • Only log the values when they've significantly changed?
    – Paul
    Mar 29, 2019 at 20:34

1 Answer 1

1

I found this to get me started.

http://apexlogic.net/code-bank/arduino/serial-gps-find-distance-between-two-points/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.