Arduino GPS Shield by iteadstudio.com

Hi Frederic,
Thank you for responding.

I have attached the images of my setup and module.
I am planning to go out afternoon today (when its not so hot) and run the GPS for an hour just in case it is taking a long time warming up and I will change the baud rate from 4800 to 9600 if it still doesn't work.

I will post the results up here when I finish.

Thanks again,
-Frank

I see that you seem to have an antenna hooked on, that is a good thing. :wink:

Yeah give us new.

Nope, no good.
Still ***** (using TinyGPS example)
at both 4800/9600 baud rate and waited for an hour

I am beginning to think that I might have burned the GPS when I first installed it. Since I didn't catch that 5V switch the first time I plugged it into the Mega.

=(

That is unfortunate. Those are costy.

Would you know if that could be the case?
Like if the GPS was burned would Mega be receiving any kind of data (invalid or not)?

Thanks for your input. I will need to get another one if you think that could be the case.

Well it is possible that some parts of the gps circuit are dead and other are still alive. So it theorically could be possible that the radio died, radio are very sensitive, and the UART could still be alive.

The fact that you are receiving NMEA code tel me that you connection is OK, AND the selected speed is good. So basically, the UART work, the gps microcontroler also work, but it react like when it has not lock on satelites so, I would suspect the radio.

Next time read and check 2 time before.powering on. :wink:

Shield are expensive, get your self an empty proto shield and a stick on gps module. You will save a bundle this way

All right,
Thank you very much!! :slight_smile:

That switch should not be on an Arduino UNO base designed shield, since by default This design has access to 5v. It's a feature for them not for you. They probably count on this to sell more shield, it's a money making feature. They know very well that beginner are those who buy shield for their simplicity. And even if they say that it's to be compatible with Mapple design, it' /$%"%?

Any way's here what I would suggest you. Usually I always suggest the real Arduino product but for some reason, Arduino did not make MEGA proto shield so I will have to go for third party:

http://www.aliexpress.com/item/Free-Shipping-High-Quality-MEGA-Proto-Shield-for-Arduino-with-mini-breadboard/1385086850.html

the breadboard is not mounted on the protoshield, I suggest you don't stick it on since you want to make a permanent device.

8.50$

http://www.aliexpress.com/item/Free-Shipping-1pc-GPS-module-SiRF3-MMCX-external-antenna-port-HX-87-EB713-GR-87/1565289221.html
There is a sticker at the bottom of the module, just peal it and stick the module where you want it on the protoshield.

8.30$

http://www.aliexpress.com/store/product/Free-Shipping-1pcs-GPS-antenna-12X12MM-welded-E-Aerospace-Line-Road-Navigation-Antenna-navigators-maintenance/342106_1226395481.html

6.90$

There is also a sticker at the base of the antenna, do the same as for the GPS.

along with a 3.3volt voltage regulator and a 5volt <> 3.3 volt signal conversion unit.

So maybe 25.00$, If you take the time to search you can probably cut the cost to 18$ for the whole thing.

SIRF3 GPS work at 4800 bps. They are reliable, and fast to "warm up" I use those.

This way, you will have every this hook where you want it and no wire coming out of the shield.

Got v1.1 of this shield working nicely with the Uno and the Mega. More details in my blogs at:
Uno: Internet of Things: GPS Location Sensing with the ITEAD GPS Shield and Arduino Uno
Mega: http://davidhoulding.blogspot.com/2014/06/gps-location-sensing-with-arduino-mega.html

Hello Frederic,

So now I think I am getting the right NMEA data (see below), but TinyGPS still shows *****. Does this mean TinyGPS is like... out of date with current Arduino IDE (I am using Arduino 1.05 r2)or something? Or is the NMEA data actually wrong?

NMEA data I got from your code

$GPRMC,021954.00,A,3752.32203,N,12217.22313,W,0.070,,050814,,,A63
$GPVTG,,T,,M,0.070,N,0.129,K,A
2E
$GPGGA,021954.00,3752.32203,N,12217.22313,W,1,06,1.51,40.9,M,-29.5,M,,5D
$GPGSA,A,3,16,29,18,21,26,15,,,,,,,2.72,1.51,2.26
00
$GPGSV,3,1,09,05,15,044,,15,32,116,26,16,20,315,23,18,49,213,2978
$GPGSV,3,2,09,21,58,302,31,22,11,220,25,25,14,185,,26,24,077,33
77
$GPGSV,3,3,09,29,68,117,3445
$GPGLL,3752.32203,N,12217.22313,W,021954.00,A,A
75
$GPRMC,021955.00,A,3752.32206,N,12217.22312,W,0.072,,050814,,,A64
$GPVTG,,T,,M,0.072,N,0.133,K,A
27
$GPGGA,021955.00,3752.32206,N,12217.22312,W,1,06,1.51,40.7,M,-29.5,M,,56
$GPGSA,A,3,16,29,18,21,26,15,,,,,,,2.72,1.51,2.26
00
$GPGSV,3,1,09,05,15,044,,15,32,116,27,16,20,315,23,18,49,213,2979
$GPGSV,3,2,09,21,58,302,32,22,11,220,26,25,14,185,,26,24,077,33
77
$GPGSV,3,3,09,29,68,117,3342
$GPGLL,3752.32206,N,12217.22312,W,021955.00,A,A
70

Hey, glad to see you on the right path.

I havent use tiny gps for a while, since i use my owne routine to extract the data I need.

I wont be home tonight, but I will get back to you as soon that I can put my hand on my arduino.

How ever, I know that those stars problem thing is a recurent problem that many people face, maybe. You can check if you serial port speed is set right in the tinygps code.

This being sayed, I can tel you that your kit is properlly set since you are getting full and good NMEA sentence.

Get back to you asap

So your gps is surely working and I can tel you that your position is. 3752.32206,North ,12217.22312,West and The time was 02:19:55

Hey Frederic,

Thank you for replying so fast!!
I think I got it to work when I changed the baud rate of both Serial and Serial1 to run at 38400 (as in your code) and it give me valid data! When I changed it back to 4800 it gave me ****.

Oh btw, does the "course" data value mean the heading? Because I will be using heading of the GPS in my project.

Thank you for all your help! You really saved me a lot of trouble!!

Below is the results if you want to take a look

Testing TinyGPS library v. 13
by Mikal Hart

Sats HDOP Latitude Longitude Fix Date Time Date Alt Course Speed Card Distance Course Card Chars Sentences Checksum
(deg) (deg) Age Age (m) --- from GPS ---- ---- to London ---- RX RX Fail

**** **** ********* ********** **** ********** ******** **** ****** ****** ***** *** ******* ****** *** 0 0 0
7 171 37.871986 -122.287109686 08/05/2014 02:35:16 691 31.20 0.00 0.17 N 8603 32.68 NNE 464 2 0
7 171 37.871986 -122.287109706 08/05/2014 02:35:17 711 31.10 0.00 0.19 N 8603 32.68 NNE 928 4 0
6 205 37.871986 -122.287109726 08/05/2014 02:35:18 731 31.10 0.00 0.09 N 8603 32.68 NNE 1388 6 0
6 205 37.871986 -122.287109744 08/05/2014 02:35:19 750 30.80 0.00 0.91 N 8603 32.68 NNE 1848 8 0
7 206 37.871982 -122.287109761 08/05/2014 02:35:20 766 30.70 0.00 0.07 N 8603 32.68 NNE 2312 10 0
6 217 37.871986 -122.287109784 08/05/2014 02:35:21 789 30.80 0.00 0.19 N 8603 32.68 NNE 2772 12 0
6 217 37.871986 -122.287109805 08/05/2014 02:35:22 810 30.80 0.00 0.56 N 8603 32.68 NNE 3232 14 0
6 217 37.871986 -122.287109823 08/05/2014 02:35:23 828 31.10 0.00 0.11 N 8603 32.68 NNE 3692 16 0
7 179 37.871982 -122.287109837 08/05/2014 02:35:24 842 31.40 0.00 0.48 N 8603 32.68 NNE 4156 18 0
7 171 37.871982 -122.287109857 08/05/2014 02:35:25 862 31.60 0.00 0.04 N 8603 32.68 NNE 4620 20 0
7 171 37.871982 -122.287109874 08/05/2014 02:35:26 879 31.30 0.00 0.96 N 8603 32.68 NNE 5086 22 0
6 206 37.871982 -122.287109894 08/05/2014 02:35:27 899 30.90 0.00 1.15 N 8603 32.68 NNE 5548 24 0

It was a pleasure friend, how ever i'm not totally sure what the coarse result is, it might be the vector you are pointing, maybe you could copy paste the equation that lead to that result and I will tel you what it is.

Hey,

Well, the TinyGPS example only shows gps.f_course() to get that data, I believe.

Anyways, I have another problem now that the GPS is working, the SD.open("File") function fails.
When I switch back to 9600, the SD card opens fine, but not with a baud rate of 38400.
How can I solve this problem?

Can you show me your code?

Yes, below is the code I am using for testing.

//Jeremy Blum's Arduino Tutorial Series - Episode 15 - GPS Tracking
//Sample Code 2 - Logging GPS Data to an SD Card
//http://www.jeremyblum.com
//TinyGPS Library and Helper Functions by Mikal Hart http://arduiniana.org/libraries/tinygps/


#include <TinyGPS.h>
#include <SD.h>
#include <stdlib.h>

/* This sample code demonstrates the normal use of a TinyGPS object.
   It uses an Arduino Mega with a GPS attached to Serial1 at 4800 buad.
*/

TinyGPS gps;
static char dtostrfbuffer[20];
int LED = 13;

//Define String
String SD_date_time = "invalid";
String SD_lat = "invalid";
String SD_lon = "invalid";
String dataString ="";

static void gpsdump(TinyGPS &gps);
static bool feedgps();
static void print_float(float val, float invalid, int len, int prec, int SD_val);
static void print_int(unsigned long val, unsigned long invalid, int len);
static void print_date(TinyGPS &gps);
static void print_str(const char *str, int len);

const int SD1 = 11; //MOSI pin on shield, connect to MOSI pin on board (pin 51)
const int SD2 = 12; //MISO pin on shield, connecto to MISO pin on board (pin 50)
const int SD3 = 13; //SCK pin on shield, connecto to SCK pin on board (pin 52)
int CS = 53; //CS pin on board, connect to D10 on the shield (CS pin for shield)

void setup()
{
  pinMode(SD1,INPUT);
  pinMode(SD2,INPUT);
  pinMode(SD3,INPUT);
  pinMode(CS, OUTPUT);  //Chip Select Pin for the SD Card
  pinMode(LED, OUTPUT);  //LED Indicator
  
  //Serial interfaces
  Serial.begin(38400);
  Serial1.begin(38400);
  
  //Connect to the SD Card
  if(!SD.begin(CS))
  {
    Serial.println("Card Failure");
    return;
  }
  
  
  
  Serial.print("Testing TinyGPS library v. "); Serial.println(TinyGPS::library_version());
  Serial.println("by Mikal Hart");
  Serial.println();
  Serial.print("Sizeof(gpsobject) = "); Serial.println(sizeof(TinyGPS));
  Serial.println();
  Serial.println("Sats HDOP Latitude Longitude Fix  Date       Time       Date Alt     Course Speed Card  Distance Course Card  Chars Sentences Checksum");
  Serial.println("          (deg)    (deg)     Age                        Age  (m)     --- from GPS ----  ---- to London  ----  RX    RX        Fail");
  Serial.println("--------------------------------------------------------------------------------------------------------------------------------------");
}

void loop()
{
  bool newdata = false;
  unsigned long start = millis();
  
  // Every second we print an update
  while (millis() - start < 1000)
  {
    if (feedgps())
      newdata = true;
  }
  
  gpsdump(gps);
  
  //Write the newest information to the SD Card
dataString = SD_date_time + "," + SD_lat + "," + SD_lon;
  if(SD_date_time != "invalid")
    digitalWrite(LED, HIGH);
  else
    digitalWrite(LED, LOW);
    
  //Open the Data CSV File
  File dataFile = SD.open("LOG.csv", FILE_WRITE);
  if (dataFile)
  {
    dataFile.println(dataString);
    Serial.println(dataString);
    dataFile.close();
  }
  else
  {
    Serial.println("\nCouldn't open the log file!");
  }
}

static void gpsdump(TinyGPS &gps)
{
  float flat, flon;
  unsigned long age, date, time, chars = 0;
  unsigned short sentences = 0, failed = 0;
  static const float LONDON_LAT = 51.508131, LONDON_LON = -0.128002;
  
  print_int(gps.satellites(), TinyGPS::GPS_INVALID_SATELLITES, 5);
  print_int(gps.hdop(), TinyGPS::GPS_INVALID_HDOP, 5);
  gps.f_get_position(&flat, &flon, &age); 
  print_float(flat, TinyGPS::GPS_INVALID_F_ANGLE, 9, 5, 1); //LATITUDE
  print_float(flon, TinyGPS::GPS_INVALID_F_ANGLE, 10, 5, 2); //LONGITUDE
  print_int(age, TinyGPS::GPS_INVALID_AGE, 5);

  print_date(gps); //DATE AND TIME

  print_float(gps.f_altitude(), TinyGPS::GPS_INVALID_F_ALTITUDE, 8, 2, 0);
  print_float(gps.f_course(), TinyGPS::GPS_INVALID_F_ANGLE, 7, 2, 0);
  print_float(gps.f_speed_kmph(), TinyGPS::GPS_INVALID_F_SPEED, 6, 2, 0);
  print_str(gps.f_course() == TinyGPS::GPS_INVALID_F_ANGLE ? "*** " : TinyGPS::cardinal(gps.f_course()), 6);
  print_int(flat == TinyGPS::GPS_INVALID_F_ANGLE ? 0UL : (unsigned long)TinyGPS::distance_between(flat, flon, LONDON_LAT, LONDON_LON) / 1000, 0xFFFFFFFF, 9);
  print_float(flat == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : TinyGPS::course_to(flat, flon, 51.508131, -0.128002), TinyGPS::GPS_INVALID_F_ANGLE, 7, 2, 0);
  print_str(flat == TinyGPS::GPS_INVALID_F_ANGLE ? "*** " : TinyGPS::cardinal(TinyGPS::course_to(flat, flon, LONDON_LAT, LONDON_LON)), 6);

  gps.stats(&chars, &sentences, &failed);
  print_int(chars, 0xFFFFFFFF, 6);
  print_int(sentences, 0xFFFFFFFF, 10);
  print_int(failed, 0xFFFFFFFF, 9);
  Serial.println();
}

static void print_int(unsigned long val, unsigned long invalid, int len)
{
  char sz[32];
  if (val == invalid)
    strcpy(sz, "*******");
  else
    sprintf(sz, "%ld", val);
  sz[len] = 0;
  for (int i=strlen(sz); i<len; ++i)
    sz[i] = ' ';
  if (len > 0) 
    sz[len-1] = ' ';
  Serial.print(sz);
  feedgps();
}

static void print_float(float val, float invalid, int len, int prec, int SD_val)
{
  char sz[32];
  if (val == invalid)
  {
    strcpy(sz, "*******");
    sz[len] = 0;
        if (len > 0) 
          sz[len-1] = ' ';
    for (int i=7; i<len; ++i)
        sz[i] = ' ';
    Serial.print(sz);
    if(SD_val == 1) SD_lat = sz;
    else if(SD_val == 2) SD_lon = sz;
  }
  else
  {
    Serial.print(val, prec);
    if (SD_val == 1) SD_lat = dtostrf(val,10,5,dtostrfbuffer);
    else if (SD_val == 2) SD_lon = dtostrf(val,10,5,dtostrfbuffer);
    int vi = abs((int)val);
    int flen = prec + (val < 0.0 ? 2 : 1);
    flen += vi >= 1000 ? 4 : vi >= 100 ? 3 : vi >= 10 ? 2 : 1;
    for (int i=flen; i<len; ++i)
      Serial.print(" ");
  }
  feedgps();
}

static void print_date(TinyGPS &gps)
{
  int year;
  byte month, day, hour, minute, second, hundredths;
  unsigned long age;
  gps.crack_datetime(&year, &month, &day, &hour, &minute, &second, &hundredths, &age);
  if (age == TinyGPS::GPS_INVALID_AGE)
  {
    Serial.print("*******    *******    ");
    SD_date_time = "invalid";
  }
  else
  {
    char sz[32];
    sprintf(sz, "%02d/%02d/%02d %02d:%02d:%02d   ",
        month, day, year, hour, minute, second);
    Serial.print(sz);
    SD_date_time = sz;
  }
  print_int(age, TinyGPS::GPS_INVALID_AGE, 5);
  feedgps();
}

static void print_str(const char *str, int len)
{
  int slen = strlen(str);
  for (int i=0; i<len; ++i)
    Serial.print(i<slen ? str[i] : ' ');
  feedgps();
}

static bool feedgps()
{
  while (Serial1.available())
  {
    if (gps.encode(Serial1.read()))
      return true;
  }
  return false;
}

The course information is going to be meaningless unless you are actually moving.

Yeah that is for sure since it seem to be the difference between 2 positions. If it is 2x the same Positions. The pointer is null