GPS EM-406 with Arudino Uno R3, Cannot get valid GPS Data / NMEA

Hi Guys,

I just got an Arudino Uno R3 for the first time, never did anything with electronics before since I mainly study on web development. I am currently doing an assignment that will use a GPS + Sim card to transmit the current position over to Google maps (on a website that I will be developing) which I will be doing in the near future.

My problem is that I have connected the GPS to the Arduino board using the sparkfun shield. After some time I got a fix on my GPS (as the red light is flashing). However when I open the serial monitor from my Arudino IDE all I get is a whole lot of 'y' characters (screenshot attached) instead of the NMEA sentences.

Before I uncomment the below line from the script, i get this => CHARS=47 SENTENCES=0 CSUM ERR=0
But once I uncomment it, I get just 'Y' characters one next to the other.

//Serial.write(c); // uncomment this line if you want to see the GPS data flowing

I used the example from the IDE (Tiny GPS Simple_Test)

This is my code:

#include <SoftwareSerial.h>

#include <TinyGPS.h>

/* This sample code demonstrates the normal use of a TinyGPS object.
   It requires the use of SoftwareSerial, and assumes that you have a
   4800-baud serial GPS device hooked up on pins 4(rx) and 3(tx).
*/

TinyGPS gps;
SoftwareSerial ss(1, 0);

void setup()
{
  Serial.begin(115200);
  ss.begin(4800);
  
  Serial.print("Simple TinyGPS library v. "); Serial.println(TinyGPS::library_version());
  Serial.println("by Mikal Hart");
  Serial.println();
}

void loop()
{
  bool newData = false;
  unsigned long chars;
  unsigned short sentences, failed;

  // For one second we parse GPS data and report some key values
  for (unsigned long start = millis(); millis() - start < 1000;)
  {
    while (ss.available())
    {
      char c = ss.read();
      //Serial.write(c); // uncomment this line if you want to see the GPS data flowing
      if (gps.encode(c)) // Did a new valid sentence come in?
        newData = true;
    }
  }

  if (newData)
  {
    float flat, flon;
    unsigned long age;
    gps.f_get_position(&flat, &flon, &age);
    Serial.print("LAT=");
    Serial.print(flat == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : flat, 6);
    Serial.print(" LON=");
    Serial.print(flon == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : flon, 6);
    Serial.print(" SAT=");
    Serial.print(gps.satellites() == TinyGPS::GPS_INVALID_SATELLITES ? 0 : gps.satellites());
    Serial.print(" PREC=");
    Serial.print(gps.hdop() == TinyGPS::GPS_INVALID_HDOP ? 0 : gps.hdop());
  }
  
  gps.stats(&chars, &sentences, &failed);
  Serial.print(" CHARS=");
  Serial.print(chars);
  Serial.print(" SENTENCES=");
  Serial.print(sentences);
  Serial.print(" CSUM ERR=");
  Serial.println(failed);
  if (chars == 0)
    Serial.println("** No characters received from GPS: check wiring **");
}

The problem might be very simple, but i'm relatively new to Arudino and any help would be greatly appreciated.

Thank you in advance.

catechumen(novice)

SoftwareSerial ss(1, 0);

Don't use Software Serial on pins D0 & D1. On the Uno they are used for serial communication (to talk to Serial Monitor).

Pick another pair and try again?

Hi dannable,

Thank you for your reply, the only way I get any form of data from the GPS is if I set it to 1 and 0, when I tried to change them, say 3,4 I get this message on the serial monitor.

CHARS=0 SENTENCES=0 CSUM ERR=0
** No characters received from GPS: check wiring **

Regards

The ÿ character is -1, which usually means no data to read.

Have you had any data from it? If not I would use a simple serial relay to read the data coming in from the GPS and send it to Serial Monitor.
Something along the lines of:

#include <SoftwareSerial.h>

SoftwareSerial ss(3, 4);

void setup()
{
  Serial.begin(115200);
  ss.begin(4800);
}

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

or something like this. I'm not at home so can't test it.

Connect your gps to pins 3 & 4 and see if anything happens. If not, swap the RX/TX pins over!

I've tried as you told me but there is nothing showing on the serial monitor, the GPS's led is flashing, that means it's working correct?

I've attached an image with my set-up.

I've tried switching the pins but still nothing.

Thank you once again for your time and help

Regards

Can we have a link to the shield please?

sure..

GPS Shield:

GPS Module:

From the link:

The DLINE/UART switch switches the GPS module’s input/output between Arduino’s standard TX/RX pins or any digital pins on the Arduino (default setting uses pins 3 and 2 connected to TX and RX, respectively).

Move the switch over and use

SoftwareSerial ss(2, 3);

in the example I gave.

And why don't you just plug the shield on top of the Arduino?

Still nothing...Yes that's what I have originally done, I just saw an example somewhere else and tried connecting it with the jump wires.

I was reading on the SparkFun website and I don't know if this can makes any difference.

My GPS Module is EM-506 and on the shield specifications it says

and only the EM-406 connector is populated

It worked!

I have disconnected everything and stacked the gps on the Arudino, uploaded your example again and changed the pins to 2 and 3 and tried the serial monitor again!

Attached is an example of what I'm getting.

Thank you so very much for your time and help, much appreciated.

That looks a lot healthier!

You're welcome.