Go Down

Topic: Arduino GPS Shield (Read 23458 times) previous topic - next topic

Johnny D

Dexter Industries Arduino GPS Shield

http://dexterindustries.com/Arduino-GPS_Shield.html

We have had a few customers buy this on Amazon and through other vendors and we wanted to make sure the code was out there.  The GPS shield uses Digital Pins 3 and 4 for serial communications with the GPS unit, freeing up the serial lines on Pins 0, 1 for communications with the computer.  This makes debugging a lot easier.

This requires some slightly different code than the typical GPS tutorial offers.  So we've modified it here below.

You can download the code from our website, but we thought we'd paste it here to make it easier to find:

Quote

/*

 Listen for the $GPRMC string and extract the GPS location data from this.
 Display the result in the Arduino's serial monitor.
 
 For use with the Dexter Industries GPS Shield.  
 
 This code was a modification of code found on the Arduino website.
 
 SoftwareSerial Library:  http://www.arduino.cc/en/Reference/SoftwareSerial
 GPS Tutorial:  http://www.arduino.cc/playground/Tutorials/GPS
 
 
 */

#include <string.h>
#include <ctype.h>
#include <SoftwareSerial.h>
// Software serial TX & RX Pins for the GPS module
#define SoftrxPin 3
#define SofttxPin 4
// Initiate the software serial connection
SoftwareSerial gpsSerial = SoftwareSerial(SoftrxPin, SofttxPin);

int ledPin = 13;                  // LED test pin
int rxPin = 0;                    // RX PIN
int txPin = 1;                    // TX TX
int byteGPS=-1;
char linea[300] = "";
char comandoGPR[7] = "$GPRMC";
int cont=0;
int bien=0;
int conta=0;
int indices[13];

void setup() {
  pinMode(ledPin, OUTPUT);       // Initialize LED pin
  pinMode(rxPin, INPUT);
  pinMode(txPin, OUTPUT);
  Serial.begin(9600);
  gpsSerial.begin(9600); //start serial for communication with GPS
  for (int i=0;i<300;i++){       // Initialize a buffer for received data
    linea=' ';
  }   
}

void loop() {
  //delay(1000);
  digitalWrite(ledPin, HIGH);
  byteGPS=gpsSerial.read(); //read a byte from the serial port
  if (byteGPS == -1) {           // See if the port is empty yet
    delay(100);
  } 
  else {
    linea[conta]=byteGPS;        // If there is serial port data, it is put in the buffer
    conta++;                      
    Serial.print(byteGPS, BYTE);
    if (byteGPS==13){            // If the received byte is = to 13, end of transmission
      digitalWrite(ledPin, LOW);
      cont=0;
      bien=0;
      for (int i=1;i<7;i++){     // Verifies if the received command starts with $GPR
        if (linea==comandoGPR[i-1]){
          bien++;
        }
      }
      if(bien==6){               // If yes, continue and process the data
        for (int i=0;i<300;i++){
          if (linea==','){    // check for the position of the  "," separator
            indices[cont]=i;
            cont++;
          }
          if (linea=='*'){    // ... and the "*"
            indices[12]=i;
            cont++;
          }
        }
        Serial.println("");      // ... and write to the serial port
        Serial.println("");
        Serial.println("---------------");
        for (int i=0;i<12;i++){
          switch(i){
          case 0 :
            Serial.print("Time in UTC (HhMmSs): ");
            break;
          case 1 :
            Serial.print("Status (A=OK,V=KO): ");
            break;
          case 2 :
            Serial.print("Latitude: ");
            break;
          case 3 :
            Serial.print("Direction (N/S): ");
            break;
          case 4 :
            Serial.print("Longitude: ");
            break;
          case 5 :
            Serial.print("Direction (E/W): ");
            break;
          case 6 :
            Serial.print("Velocity in knots: ");
            break;
          case 7 :
            Serial.print("Heading in degrees: ");
            break;
          case 8 :
            Serial.print("Date UTC (DdMmAa): ");
            break;
          case 9 :
            Serial.print("Magnetic degrees: ");
            break;
          case 10 :
            Serial.print("(E/W): ");
            break;
          case 11 :
            Serial.print("Mode: ");
            break;
          case 12 :
            Serial.print("Checksum: ");
            break;
          }
          for (int j=indices;j<(indices[i+1]-1);j++){
            Serial.print(linea[j+1]);
          }
          Serial.println("");
        }
        Serial.println("---------------");
        delay(10000);
      }
      conta=0;                    // Reset the buffer
      for (int i=0;i<300;i++){    // 
        linea=' ';             
      }                 
    }
  }
}







Hello,

I'm new on Arduino and I want to start working with on a GPS project.

I would like to have the Arduino GPS and SMS (GPS) capable, also I would like it to record a log of coordinates as well as some other info as time in i.e. then it needs to be able to download the log to my PC using Bluetooth so I will build a route map on my PC track system (working in the development too).

What Arduino board and shields do you recommend me to buy for my prototype?

Thank in advance for your help.

Eduardo

hello..im new in arduino..im using arduino mega 1280..im trying to display the longitude and the mag. at 20x4 lcd..btw,im using gps shield v1.0...need others connection between arduino board and gps shield?because i just stack them together...is lcd.print=serial print command?plssss help me,can someone provide me the coding...

PaulS

Mega 1280, LCD, GPS, and newbie are not 4 terms that belong in the same post.

Quote
is lcd.print=serial print command?

Depending on what class lcd is an instance of the print() method may actually come from the Print class. The Serial.print() method does come from the Print class. In that sense, they are the same. Where the data that gets printed goes to is quite different, so in that sense they are not the same.

Quote
plssss help me

Ok. That's spelled please.

Quote
can someone provide me the coding...

Coding for what? Which GPS do you have? On which pins/serial port? Which LCD do you have? On which pins? This is not a start from scratch project. This is a built it up as you add hardware project. Writing GPS data to the LCD is exactly the same as writing "Hello, world" to the LCD. If you can't get "Hello world" on the LCD. put the GPS back in the box, and put it away, until you can.

hello..sorry for my silly question and my broken English..ive no problem displaying hello world, i've trying to modified the coding from arduino tutorial...im using Charactor LCD Module (20 x 4 lines, LED Backlight) and GPS shield v1.0(MYD1094 model) with active antenna...i need the examples coding to display the gps data on the lcd..and how to communicate the GPS shield to my arduino..

PaulS

Quote
i've trying to modified the coding from arduino tutorial

I'm pretty sure that there is more than one Arduino tutorial on the internet. Can you be just a teensy bit more specific?

Quote
im using Charactor LCD Module (20 x 4 lines, LED Backlight)

Which you can write to, so you know that it is connected correctly and is functioning.

Quote
and GPS shield v1.0(MYD1094 model) with active antenna

I've clicked all over your post. Nothing happens. The internet must be down. I'll try again later.

Quote
i need the examples coding to display the gps data on the lcd

Code: [Select]
lcd.print(gpsData);

Quote
and how to communicate the GPS shield to my arduino

As soon as the internet comes back up, or you post a link...

100Grand

Cool story bro, When i get my arduino im getting this!

Johnny D

I've been working on a few updates to our Arduino GPS Shield.



First: we have a new set of GPS Libraries.  They're located here:  http://dexterindustries.com/Arduino-GPS_Shield.html

Next: I did a quick post about how to convert GPS coordinates from GPS format into decimal-degrees.  There is example code that's (mildly) documented: http://dexterindustries.com/howto/arduinogpsprojects-gps-coordinates/

Finally: We have a great new color and design:

Hi everyone!

Here is another Arduino GPS Shield from ITEAD Studio: http://imall.iteadstudio.com/im120417017.html

Cheers,

Wendy
Make innovation easier!
http://imall.iteadstudio.com/

sbright33

Adafruit: The Ultimate GPS
If you fall... I'll be there for you!
-Floor

Skype Brighteyes3333
(262) 696-9619

Johnny D

We have updated the GPS shield to include Mega, Duo, and Leonardo.

And a picture of our latest build!

ursm

and what is the improvement of this version?

Johnny D

#12
Nov 02, 2012, 05:53 pm Last Edit: Nov 02, 2012, 11:27 pm by Johnny D Reason: 1
One really big one:  we've added solder jumpers on the bottom that let you use it with the Mega version of the Arduino.  You can use these to use a different set of communication lines if you need the original lines for your project.  

If this sounds confusing, we have added the schematic and board drawings:  http://dexterindustries.com/files/GPS_Shield_2.0.zip

Another one: the software and examples were updated for the latest Arduino 1.0.1.  We added a few examples and additional calculations that let you calculate distances to destinations and times easier: http://dexterindustries.com/files/dGPS.zip

ursm

hi
both links point to the same zip file with .sch and .brd
the link to the examples is missing.

BUT it's still incompatible with the 3.3V specification of the GPS receiver!

CrossRoads

How do you figure ursm?

?Input Voltage: 3.0V ~ 5.5V DC
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Go Up