0

I bought this gps hat https://www.adafruit.com/product/2324 for my Pi 2 with the intention of making a tracking device.

The way it works is that every 1 minute, latitude and longi is sent to my database. My problem is, even when my device is stationary, I get coordinates that seem to say my device is moving. I figured I could use the speed parameter and not record while my speed is 0, but much to my surprise. Even when my device is not moving I still get varing speeds.

This is a look of my database.

Lat          Long         Speed
45.29274167 -61.24924167 0.68400000
45.29232833 -61.24946833 1.42300000
45.29239500 -61.24941000 0.65100000
45.29279833 -61.24976500 0.55600000
45.29226833 -61.24929667 31.36500000 (not a typo, an actually 31 was recorded.)
45.29248833 -61.24941000 1.25300000
45.29215000 -61.24931000 1.97700000

I will confess I have not yet attached the antenna (the pigtail wire was a male) but im not to convinced that will help much. Would appreciate it if I could get some insight as to this behavior probably is a issue with my script? I may be comparing apples with Oranges but the GPS on my phone even thou it's not DEAD accurate, it doesnt jump around so much.

I have added a condition to not take a recording if speed is less than 1 and distance from the last pin is less than 30 M, but that also...doesnt do much...as sometimees I get a point over 5om away.

6
  • "I will confess I have not yet attached the antenna (the pigtail wire was a male) but im not to convinced that will help much." -> I've noticed smartphones and other GPS equipped devices will do exactly the same thing when they haven't gotten a good enough fix on enough satellites.
    – goldilocks
    May 4, 2016 at 13:33
  • @goldilocks Thanks for the speedy response :). Yes I have the antenna but i got the wrong connecting cable (new one is on it's way) However I was trying to decipher how accurate a gain of "28dB" is when I was wonderning if my issue would be solved when i conenct it
    – Grace
    May 4, 2016 at 13:39
  • Dunno much about it, but you might check around for a GPS app that shows a similar metric -- I was just looking at "GPS Test" (Android) but that appears to use a % signal-to-noise ratio. Not having a math or engineering degree, I fear one is require to convert dB to SNR, but I groan a lot. Might be something you could ask about on EE, if an app showing dB is not available (or you just plain can't find a formula, I am pretty sure I have run across one in a textbook before).
    – goldilocks
    May 4, 2016 at 13:49
  • BTW Grace, presuming this is for that vehicle tracking thing and you haven't thought of this already: Once you get this sorted out wherever you are currently testing it, make sure to test it again wherever it is you plan to use it in the vehicle before you proceed with anything else, because there's plenty of places that I think will render a non-industrial strength GPS defunct. The first edition of the Asus Transformer tablet actually had to ditch the aluminum chassis for plastic because of this (and that's a pretty serious oversight by some pretty serious people).
    – goldilocks
    May 4, 2016 at 15:11
  • The signals travel through the swirling ionosphere from very high altitude satellites that are moving at high speed. The GPS calculates the distance to the satellites from a spinning earth. The calculations vary. You could do like a phone and calculate speed changes with an accelerometer.
    – PaulF8080
    May 5, 2016 at 2:01

1 Answer 1

-2

I see that you have stated that you have not yet attached the pigtail antenna yet, I have also noticed that my phone will tell me that I'm moving when I'm not, it's because gps Relies purely on timing and your lack of a proper antenna is also limting the number of satellites that your Pi is able to connect to. furthermore I was wondering why you would need to record gps data on a device that's speed is zero and is stationary? It just feels really redundant to me, if your end goal was to only have it record gps data when in motion you should consider attaching an accelerometer to your Pi to have it activate gps immediately as motion is detected. Yes your issue should be solved when you connect your antenna as the only antenna you are using right now is the internal patch antenna which Even on the adafruit page that is trying to market the product, states that it should be used "outdoors in clear sky's". Which is never a sign that's it's of good quality.

On a side note: the gps on your phone doesn't jump around so much because

  1. It's got a much nicer antenna than your gps because it isn't expecting an external antenna.
  2. Because instead of showing you (the user) a lot of not so accurate points, software that is built into your phone will draw a circle around all the gps dots generated(removing anomalies in the data) it will then place a blue dot in the centre of said circle, which gives you the most accurate results possible, I recommend that you do something similar with your gps processing software to gain the most accurate results.
5
  • Alright, then im expecting a turn for the better once I put in my antenna. However I have two statements. You said <i>as the only antenna you are using right now is the antenna connector which was never intended to be used as an antenna.</i> are you calling the "antenna" built to the HAT the antenna connector? Secondly,I don't want to record GPS from a device that is stationary, the fact that the GPS points are moving when it is stationary was part of the problem. I thought the gpsd.fix.speed would return zero when the PI was not moving but that proved to be false.
    – Grace
    May 4, 2016 at 14:03
  • Yes sorry for any confusion I didn't realize that it contained an internal patch antenna, but even on the ads fruit page it states that it is for outdoor use with clear sky's only. May 4, 2016 at 14:05
  • the gps speed is based purely on taking 2 gps readings and measuring the difference, it will never really be all that accurate, but will get marginally better when you get that antenna installed, but if what you need is accuracy, you should look into getting an accelerometer which will allow you to detect if your pi is stationary. May 4, 2016 at 14:43
  • Using an accelerometer will not tell you when your device is moving. It will only tell you when it's accelerating or decelerating. At a constant speed acceleration is zero.
    – Andy Lamb
    May 4, 2016 at 17:05
  • @AndyLamb your under the assumption that his device is able to move completely steady, for all you know he is building something for a backpack which will have a lot of up and down movement for the accelerometer to detect, but sure if it is on an rc car or real car other sensors to detect motion would be more optimal such as rpm which is how cars estimate there speed. But if he really wanted to use the gps for measuring movement he could take multiple samples and see the difference and if it's large enough he could assume that his Pi has moved. May 4, 2016 at 18:38

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.