SparkFun Forums 

Where electronics enthusiasts find answers.

Tips and questions relating to the GPS modules from SFE
By 3Dawn
#118171
I am hoping someone can help me. I am trying to hook an Arduino Duemilanove to the SparkFun Copernicus DIP package. I was able to use the Trimble software to get reading through the GPS evaluation board and using USB. I think I have the connections right based on some great posts by other people. It is posted below. Now, I am trying to sort through software and GPS setup.

Using the Trimble GPS Monitor I tried setting the Receiver Port to B, 4800-N-8-1. Next I used the following code to try to get something through the Serial Port. All I get is gobbly-gook - but that is certainly better than nothing. I tried different serial rates in the Serial Port Monitor. Anybody see what the problem is?

Thank you so much for your help. I am just learning Arduino and electronics and LOVING it!
Code: Select all
/* Example code for connecting a Parallax GPS module to the Arduino
 Igor Gonzalez Martin. 05-04-2007
 igor.gonzalez.martin@gmail.com
 English translation by djmatic 19-05-2007
 Listen for the $GPRMC string and extract the GPS location data from this.
 Display the result in the Arduino's serial monitor.
 */ 
 #include <string.h>
 #include <ctype.h>
 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(4800);
   for (int i=0;i<300;i++){       // Initialize a buffer for received data
     linea[i]=' ';
   }   
 }
 void loop() {
   digitalWrite(ledPin, HIGH);
   byteGPS=Serial.read();         // Read a byte of the serial port
   if (byteGPS == -1) {           // See if the port is empty yet
     delay(100); 
     Serial.print("Serial line not empty yet");
   } 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[i]==comandoGPR[i-1]){
           bien++;
         }
       }
       if(bien==6){               // If yes, continue and process the data
         for (int i=0;i<300;i++){
           if (linea[i]==','){    // check for the position of the  "," separator
             indices[cont]=i;
             cont++;
           }
           if (linea[i]=='*'){    // ... 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[i];j<(indices[i+1]-1);j++){
             Serial.print(linea[j+1]); 
           }
           Serial.println("");
         }
         Serial.println("---------------");
       }
       conta=0;                    // Reset the buffer
       for (int i=0;i<300;i++){    //  
         linea[i]=' ';             
       }                 
     }
   }
 }
You do not have the required permissions to view the files attached to this post.
By mnm364
#145541
Hi, I was wondering if you ever figured out how to use the Copernicus with the Arduino. I am having the exact same issues you are having: the Copernicus attached to the GPS Evaluation board works perfectly (with Trimble Studio) but when I wire it to an Arduino I receive random strings of symbols in the serial port. I am using the Copernicus II DIP Module (very similar to the Copernicus I) and the Arduino Uno. If you did figure out how to integrate the Copernicus with the Ardiuno, I was wondering if you could explain your wiring and post your code? I would really appreciate it. All I need is simple NMEA sentences containing GPS coordinates, altitude, velocity, speed, and UTC time to track a weather balloon. Also can you pull information off the Copernicus with the Arduino and input it into Trimble Studio; this might be too complicated but if you know how to and you wouldn't mind explaining it it would be immensely helpful. In this way, I will be able to have a GUI. Again, I do not need this but if you know how to do this, it would be great! I am very new to electronics and would benefit from any help or advice. Thank you so much, in advance, for your time.