Ultimate GPS+Logging Shield

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
thoma
 
Posts: 1
Joined: Sat Dec 28, 2013 4:47 pm

Ultimate GPS+Logging Shield

Post by thoma »

Hello,

I bought this shield several months ago.
I start to use to build a car tracker.
But currently I have a strange behavior, in fact, sometimes the time, the latitude and the longitude are wrong as you can see below.
Time: 13:16:29.0 - Location (in degrees): 47.963687896, 2.210210084
Time: 0:0:13.0 - Location (in degrees): 47.009521484, 2.002043247
Time: 13:16:44.0 - Location (in degrees): 47.963687896, 2.210210084
Time: 0:0:13.0 - Location (in degrees): 47.009685516, 2.210210084
Time: 13:18:3.0 - Location (in degrees): 47.963687896, 2.210210084
Time: 13:18:46.0 - Location (in degrees): 47.963687896, 2.210208296
Time: 0:13:23.0 - Location (in degrees): 47.009521484, 2.210208296
Time: 13:23:47.0 - Location (in degrees): 47.963687896, 2.210208296
Time: 13:25:25.0 - Location (in degrees): 47.963687896, 2.210206627
The red one are wrong and I do not know from where the problem comes.
Is this a GPS error or a software bug ?

Has anyone experienced this problem ?

Many thank for your help.

Thoma

Code: Select all

  if (GPS.newNMEAreceived())
  {
    if (GPS.parse(GPS.lastNMEA()))
    {
      if (GPS.fix != 0)
      {
        if ((previous_latitude != GPS.latitudeDegrees) || 
            (previous_longitudeDegrees != GPS.longitudeDegrees))
        {
          double lonA = M_PI * previous_longitudeDegrees / 180.0;
          double lonB = M_PI * GPS.longitudeDegrees / 180.0;
          double latA = M_PI * previous_latitude / 180.0;
          double latB = M_PI * GPS.latitudeDegrees / 180.0;

          double a = sin((lonA - lonB) / 2.0);
          double b = cos(lonA) * cos(lonB);
          double c = sin((latB - latA) / 2.0);
          double d = sqrt(a * a + b * c * c);
          double e = asin(d);
          double f = 12734890.0 * e;

          Serial.print("Time: ");
          Serial.print(GPS.hour, DEC); Serial.print(':');
          Serial.print(GPS.minute, DEC); Serial.print(':');
          Serial.print(GPS.seconds, DEC); Serial.print('.');
          Serial.print(GPS.milliseconds);
          Serial.print(" - Location (in degrees): ");
          Serial.print(GPS.latitudeDegrees, 9);
          Serial.print(", "); 
          Serial.print(GPS.longitudeDegrees, 9);
          Serial.print(" ("); 
          Serial.print(f, 0);
          Serial.println(")"); 
          previous_latitude = GPS.latitudeDegrees;
          previous_longitudeDegrees = GPS.longitudeDegrees;
        }
      }
    }
  }

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Ultimate GPS+Logging Shield

Post by adafruit_support_rick »

Please post clear, detailed pictures of both sides of the shield, showing your soldering.

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino Shields from Adafruit”