Problems reading serial data from a GPS module

Hi, I’m using my Arduino UNO to read serial data from a Skylab GM25 GPS module. My goal with this is to find out wich is the Output in the TX pin (The datasheet says is the pin #5) when the GPS software tells me that the location of the tracker is invalid (this means that the gps is not acquiring the position).

I’ve setted the circuit the following way:

Arduino USB to Computer
Arduino Digital Pin 10 to Pin 5 in the GPS module (Its not really conected, I just touch the GPS module pin with the wire connected to the Arduino pin when i want to read). This module is mounted in a GPS tracker AL900C, the test reading for the configuration was done while the GPS was ON and working correctly (Reporting the the server via its GSM module and having a valid location (it acquired its location)).

Heres is my code

#include <SoftwareSerial.h>
SoftwareSerial GPS = SoftwareSerial(10,2);

void setup(){
  GPS.begin(9600);
  Serial.begin(9600);
}

void loop(){
  Serial.print(GPS.read(),DEC);
}

I got 2 datasheets for the GPS module the one that I uploaded and another one that is in the internet.

The uploaded one says: UART Ports: The module supports two full duplex serial channels UART. All serial connections are at 2.85V LVTTL logic levels, if need different voltage levels, use appropriate level shifters. the data format is however fixed: X, N, 8, 1, i.e. X baud rate, no parity, eight data bits and one stop bit, no other data formats are supported, LSB is sent first. The modules default baud rate is set up 9600bps. The RXD0(1) & TXD0(1)
recommended to pull up (10K?). It can increase the stability of serial data.

I’ve read that the arduino even its TTL its threshold allow it to read LVTTL so im considering that this is not the problem.

THe other datasheet I found is in the URL: http://www.componex-electronics.com/files/SkyNav_GM25_DS.pdf
And the pin Im trying to read is described as following:

UART Ports: The module supports two full duplex serial channels UART0 and UART1. All serial connections are at 3V CMOS logic levels, if need different voltage levels, use appropriate level shifters. The baud rate of both serial ports are fully programmable, the data format is however fixed: X, N, 8, 1, i.e. X baud rate, no parity, eight data bits and one stop bit, no other data formats are supported, LSB is sent first. The modules default baud rate is set up 4800bps, however, the user can change the default baud rate to any value from 4800 bps to 115kbps. UART0 is used e.g. for
booting and NMEA interface. UART1 can be utilized for UBP protocol.

Notice the difference between the baud rates and the logic they use.

The output I’m getting in the Serial Monitor while I’m not touching the pin in the module:
-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1 and continues indefinitely
This is the return of the GPS.read() while it has not data available

When i touch the GPS module pin i get in the Serial Monitor:
-1-1-1-1-1-1-1255-1-1-1255-1-1-1255-1-1-1-1-1

I tried using Serial.write(GPS.read()); since the GPS.read() return bytes and the serial monitors displays something like this:
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ

Aprecciate all your help

SkyNav_GM25_DS.pdf (415 KB)

Most (all?) GPS mosules send ASCII by default so drop the DEC in the write statement. Connect the GPS and leave it connected. The GPS only sends data once a second and you can stop the serial monitor from scrolling.

Mark

A link to the datasheet would be use full as all I get are are sales site what don't link to a datasheet.

Mark

I just uploaded this code

#include <SoftwareSerial.h>
SoftwareSerial GPS = SoftwareSerial(10,2);

void setup(){
  GPS.begin(9600);
  Serial.begin(9600);
}

void loop(){
  Serial.write(GPS.read());
  delay(1000);
}

I added a second delay and dropped the Serial.write(val,DEC);

ANd I still get the ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ output

This is the link to the module datasheet i found in internet http://www.componex-electronics.com/files/SkyNav_GM25_DS.pdf

I have another one that differs in the description of the UART ports as I described in the initial thread.

A read returns -1 if there is no data. That prints as ÿ.

So, working as expected.

If you don't want to see thousands of ÿ you need to check if serial data is available.

The default baud rate appears to be 4800 and not 9600. An of course its a 3.3V chip!

Mark

Sorry guys, i was confused about the datasheet this is the correct one: http://www.componex-electronics.com/files/SkyNav_GM25_DS.pdf

Im using the same setup for the hardware. I changed my code to the following:

#include <SoftwareSerial.h>
SoftwareSerial GPS = SoftwareSerial(10,2);

void setup(){
  GPS.begin(4800);
  Serial.begin(4800);
}

void loop(){
  if(GPS.available()){
    Serial.write(GPS.read());
  }
}

THis is the ouput im getting in the serial monitor setted to 4800 baud:

ÿöþÿÿÿýÿÿÿÿÿÿÿûÿÿÿýÿÿÿÿÿÿÿÿÿþß¿þýÿÿÿÿÿÿÿÿÿÿÿîÿÿÿÿÿÿþÿÿÿÿÿÿÿùýÿÿÿüÿÿÿÿÿÿÿÿÿÿÿþÿþÿþÿÿÿýþûÿÿþÿÿÿÿÿÿÿÿÿÿÿÿþßÿûÿù¿ÿÿÿÿÿÿÿÿÿÿÿÿþÿÿ

What im expecting to fet is an NMEA sentence. For example:
$GPGGA, 161229.487,3723.2475,N, 12158.3416,W, 1,07,1.0,9.0,M.0000*18

iocaraballo: I've setted the circuit the following way:

Arduino USB to Computer Arduino Digital Pin 10 to Pin 5 in the GPS module (Its not really conected, I just touch the GPS module pin with the wire connected to the Arduino pin when i want to read).

What about the ground?

the fact you’re getting gibberish means the data’s being sent…

given that fact (providing it’s not noise (eg you’re missing a pulldown/up resistor) from a near by source… your baud rate is incorrect,.

#include <SoftwareSerial.h>
SoftwareSerial GPS = SoftwareSerial(10,2);

void setup(){
  GPS.begin(4800); //providing the baud rate is 4800
  Serial.begin(9600);  
}

void loop(){
  if(GPS.available()){
    Serial.write(GPS.read());
  }
}

your baud rate is incorrect,.

Or/and inverted?

About the ground:

THe Module is mounted in a gps tracker that has a battery, so I guess it should have the Vcc and GND from the battery. Im just connecting a cable to the pin i want to read from, if this is incorrect plz tell me how to do it.

About the baud rate:
Why do i have to change the baud to 9600, I thought If the baud rate for the Serial monitor is the same as the Serial.begin(); it should work no matter how much is the baud rate, could you explain me why is it wrong?

Where should i locate the pull up/down resistor?

I updated the code to:

#include <SoftwareSerial.h>
SoftwareSerial GPS = SoftwareSerial(10,2);

void setup(){
  GPS.begin(4800);
  Serial.begin(9600);
}

void loop(){
  if(GPS.available()){
    Serial.write(GPS.read());
  }
}

And this is my output:
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿýÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ÷ÿÿÿÿùÿÿÿÿÿÿÿÿþÿÿÿÿÿþÿÿûýÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ

You have to connect the grounds. A single cable just won’t do it. Electronics circuits are called “circuits” for a reason.

Ok, sorry for that. So the ground should be to the arduino or the module?

This video is what Im using as a guide: http://www.youtube.com/watch?v=AO_Dv6kqn5k

The gps module Vcc and GND are connected to a battery and the battery. That is hat turn on the module.

I think I havent been so clear about my purpose. The module Im trying to red is part of a GPS tracker that actually works fine by its own. My goal is to read the data transmited for testing purposes.

To make the test I'm turning on the tracker and wait until it works as expected. Then i Upload the code to the arduino and then I put a wire between the pin 10 of the arduino and the Pin 5 of the GPS module and open the serial monitor

I added a wire between one of the arduino's GND and one of the GND pins in the GPS modules.

The output changed to:

!e%©¥%o'ÿ¹®IJJ*?Th©%+©µéi«íëå9%©+%eëe­·©)åB*?¾?I É?¥¥%ë?ʐ´ÅJK?JéIjë´H­)/k¥o¯JJJBZB ß´YII*) K ¹®IJJ*?T?©%+© ÒR±S[ /JyÊ+j©II- Ki©®??I))) É)) ?)¹ÎI?ôÈ)©½k©%+© ÒB­ÚB?3?c©h+Íí

?))h*ø¹®IJJ*?T?©%+© ÐB­S[+/ Jy*Jkj©IIÍ K ©®???)É))))) ª ©ÎIJj*J*/JjIJ*-zJ*K?é)É)-k)©®îII?T?,o'ÿ¹®IJJ*J*JjIJÊ-jJ*?jéII*KIIj©+-J?)h(ÍÍ, É))))É)H-(Í®,JJ«IJéIj+JJ©?KJiK+/))©¨+(ÍÍ

J Éð?á¹®IJj+J*JjIJÊ-jJêkJ)II*KIIJiË-êJ?)h+(ÍÍ,,)))))))X-(Í®,JJKIJéIJ+JJ©IKJiK+/))©h(Íí/* JÉ h ø¹®IJj+J*JjIJÊ-ªJêkJ)II*?? jiËÍTí!RZBJÜ?Y ÉÉ éuÔé¹?J!¥¥KJéIj+Jj©I?J©·?¿¥¥¥½ÖBj??¤[? )K ¹®IJj+J JjI?

jJêöå9%©+%eëe­·©)å9BbBn??Ä[ )))))) ª ¹ÎIJj+J*/JjIJÊ-jj*KJé É K)©®îIIIJ )K ¹®IJJ+?k©%+©µéi«íëå9%©+%eëe­·©)å9BbBj??Ä[ )))))) ª)©ÎIJj+J*/JjIJ*-jJ*kjé)))-ki)®îII?*) K

Things are looking better, i guess these are some NMEA sentences because the data was printed in chunks maybe at 1Hz (thats the speed they should go). Thanks Nick Gammon.

But the data still unreadable, Ive checked the Baud rate in the serial monitor and is 9600, what else could be wrong?

Maybe post a photo of all this. A clear one. And your current code. And a link to your GPS.

Code:

#include <SoftwareSerial.h>
SoftwareSerial GPS = SoftwareSerial(10,2);

void setup(){
  GPS.begin(4800);
  Serial.begin(9600);
}

void loop(){
  if(GPS.available()){
    Serial.write(GPS.read());
  }
}

Output:
CJ*-jJkjù)))
k ©®îIII
) K ¹®IJj*?T?©%+©µéi«ÖBS?Fy**J+j©II*- « ¹®??I) ))) )? ©î­I??Ì)©½©%+© Ò"½Ú"?3?c©h*Íí

J))hJø¹®IJ**JJjIJÊ-jJ?jéIIKIIj©±J?)h-(Íí
É )))ÉR÷
nKFRb¥?J
/JjIJ
-zJkjé)))
K ©®îIII
É K)¹®IJj
?
JjIJ

jZj{jéIIKII?I±J©IH (ÍÍ,))))É))H-(Í®,Jª?(¥+­R1Jj­?z?é) )
K)©®îIII
) K ÿÿÿÿÿ

Datasheet (I guess this is what you meant with link to the GPS, if this is not what you meant plz tell me): Is in a attached file and in this link as well http://ge.tt/9hsIKYn/v/0?c

SkyNav_GM25_DS.pdf (415 KB)

Hi guys just fixed the problem about the unreadable data. THe problem was caused because Im not working with just the GPS module, it is mounted in a GPS tracker so they tracker manufacturer changed the setting for the gps module to work at 9600 bps. I just changed that and is working nicely.

Appreciate are your help guys, specially Nick Gammon.

Hi guys

I have the same problem, but hay have 2 GPS, and VCC 5V

Crius CN-06 GPS with 10hz refresh and

NSA-C3M-NV
!(http://i.ebayimg.com/t/High-Performance-SiRF-3-III-GPS-Module-TTL-With-Antenna-/02/!B6hR0-!!2k~$(KGrHqMOKiMEy(h7WF2mBM)kt0YBP!~~_1.JPG)

I use de code, y the datashet put 9600 baud rate but I test with other baud rate and nothing

#include <SoftwareSerial.h>
SoftwareSerial GPS = SoftwareSerial(0,1);

void setup(){
  GPS.begin(9600);
  //GPS.begin(4800);
  Serial.begin(9600);
  //Serial.begin(4800);
}

void loop(){
  Serial.write(GPS.read());
  //delay(1000);
  //delay(100);
}

the output is

40,304,19,07,156,45,20,76,305,*70
$GPGSV,4,3,14,23,40,176,37,28,ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ…

it reads any code and then it lost the code

sometimes it changees the ÿ for -1, -1 I suppose it is lost the code.

I use the Arduino NANO v3 with atmega328

Maybe is it this?

sajosecaper: Serial.write(GPS.read());

You need to check there is input available before you read it. If you call read () when there is nothing available it will return -1, which if treated as an ascii character (as you're doing) will display ÿ.