Can't get any readings from GPS

Greetings!

I'm trying to connect my NEO6M GPS module with Arduino. I made the following connections:

GPS VCC -> Arduino 5V
GPS RX -> Arduino Pin3
GPS TX -> Arduino Pin4
GPS GND -> Arduino GND.

I'm using module as GY-GPS6MV2

I tried using following codes for it:

#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(4, 3);

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 **");
}

With this I got following things in my Serial Monitior

Simple TinyGPS lHARS=72 SENTENCES=0 CSUM ERR=0
 CHARS=144 SENTENCES=0 CSUM ERR=0
 CHARS=216 SENTENCES=0 CSUM ERR=0
Simple TinyGPS library v. 13
by Mikal Hart

 CHARS=72 SENTENCES=0 CSUM ERR=0
 CHARS=144 SENTENCES=0 CSUM ERR=0
 CHARS=265 SENTENCES=0 CSUM ERR=0
 CHARS=360 SENTENCES=0 CSUM ERR=0
 CHARS=432 SENTENCES=0 CSUM ERR=0
 CHARS=504 SENTENCES=0 CSUM ERR=0

Another code I that tried

#include <TinyGPS++.h>
#include <SoftwareSerial.h>
/*
   This sample sketch demonstrates the normal use of a TinyGPS++ (TinyGPSPlus) 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).
*/
static const int RXPin = 4, TXPin = 3;
static const uint32_t GPSBaud = 4800;

// The TinyGPS++ object
TinyGPSPlus gps;

// The serial connection to the GPS device
SoftwareSerial ss(RXPin, TXPin);

void setup()
{
  Serial.begin(115200);
  ss.begin(GPSBaud);

  Serial.println(F("DeviceExample.ino"));
  Serial.println(F("A simple demonstration of TinyGPS++ with an attached GPS module"));
  Serial.print(F("Testing TinyGPS++ library v. ")); Serial.println(TinyGPSPlus::libraryVersion());
  Serial.println(F("by Mikal Hart"));
  Serial.println();
}

void loop()
{
  // This sketch displays information every time a new sentence is correctly encoded.
  while (ss.available() > 0)
    if (gps.encode(ss.read()))
      displayInfo();

  if (millis() > 5000 && gps.charsProcessed() < 10)
  {
    Serial.println(F("No GPS detected: check wiring."));
    while(true);
  }
}

void displayInfo()
{
  Serial.print(F("Location: ")); 
  if (gps.location.isValid())
  {
    Serial.print(gps.location.lat(), 6);
    Serial.print(F(","));
    Serial.print(gps.location.lng(), 6);
  }
  else
  {
    Serial.print(F("INVALID"));
  }

  Serial.print(F("  Date/Time: "));
  if (gps.date.isValid())
  {
    Serial.print(gps.date.month());
    Serial.print(F("/"));
    Serial.print(gps.date.day());
    Serial.print(F("/"));
    Serial.print(gps.date.year());
  }
  else
  {
    Serial.print(F("INVALID"));
  }

  Serial.print(F(" "));
  if (gps.time.isValid())
  {
    if (gps.time.hour() < 10) Serial.print(F("0"));
    Serial.print(gps.time.hour());
    Serial.print(F(":"));
    if (gps.time.minute() < 10) Serial.print(F("0"));
    Serial.print(gps.time.minute());
    Serial.print(F(":"));
    if (gps.time.second() < 10) Serial.print(F("0"));
    Serial.print(gps.time.second());
    Serial.print(F("."));
    if (gps.time.centisecond() < 10) Serial.print(F("0"));
    Serial.print(gps.time.centisecond());
  }
  else
  {
    Serial.print(F("INVALID"));
  }

  Serial.println();
}

For this all I got on my serial monitor is

DeviceExample.ino
A simple demonstration of TinyGPS++ with an attached GPS module
Testing TinyGPS++ library v. 1.0.2
by Mikal Hart

So I also tried changing my GPS Module Baudrate to 9600 and I got this response

DeviceExample.ino
VALID  Date/Time: 0/0/2000 00:00:00.00
Location: INVALID  Date/Time: 0/0/2000 00:00:00.00
DeviceExample.ino
A simple demonstration of TinyGPS++ with an attached GPS module
Testing TinyGPS++ library v. 1.0.2
by Mikal Hart

Location: INVALID  Date/Time: 0/0/2000 00:00:00.00
Location: INVALID  Date/Time: 0/0/2000 00:00:00.00
Location: INVALID  Date/Time: 0/0/2000 00:00:00.00
Location: INVALID  Date/Time: 0/0/2000 00:00:00.00

What am I missing here? have I got damaged Module? Thanks in advance

I've not played with GPS on Arduino but had plenty of experience of it in a military environment.

Your last example seems to be communicating with the module. Assuming that is the case, it takes time for the GPS to get a fix on its position. The module also needs reasonable signals from the SVs (i.e. Satellites) in order to get a fix on its position.

You don't say where your GPS is. Have you taken it outside to see if the module works better?

Every NEO6M GPS I have tried is supplied working at 9600 baud, your 'example' code is using 4800 baud.

Why use a kind of time limit? What work us supposed to be done after blowing the time limit?
Use TinyGPS++ instead.

And .... you might need to be outside to get a signal

Try reading the NMEA sentences coming from the GPS TX pin without Mikal's sketch or any sketch. This is the sensible starting point for troubleshooting a GPS problem.

I suspect Mikal's diagnostic messages are not terribly helpful for newcomers to GPS.

I have kept the GPS on my desk and I didn't took it outside to see if there is any improved performance.

HillmanImp:
Try reading the NMEA sentences coming from the GPS TX pin without Mikal's sketch or any sketch. This is the sensible starting point for troubleshooting a GPS problem.

I suspect Mikal's diagnostic messages are not terribly helpful for newcomers to GPS.

How do I do that?

srnet:
Every NEO6M GPS I have tried is supplied working at 9600 baud, your 'example' code is using 4800 baud.

I tried that as well, but nothing works

Railroader:
Why use a kind of time limit? What work us supposed to be done after blowing the time limit?
Use TinyGPS++ instead.

Tried that too

markd833:
I've not played with GPS on Arduino but had plenty of experience of it in a military environment.

Your last example seems to be communicating with the module. Assuming that is the case, it takes time for the GPS to get a fix on its position. The module also needs reasonable signals from the SVs (i.e. Satellites) in order to get a fix on its position.

You don't say where your GPS is. Have you taken it outside to see if the module works better?

How much time approx does it takes to settle down?

Give the unit some 5 - 10 minutes to start up. What kind of antenna do You use?

Hi,
Have you tried the examples in the IDE for TinyGPS++?

Thanks.. Tom... :slight_smile:

Count:
How much time approx does it takes to settle down?

A decent GPS with a good working antenna, when started up from cold, should get a fix in circa 40-60 seconds, if its outdoors with a good view of the sky.

A bad GPS or a good GPS with a bad antenna can take 15 minutes or more to get a fix even if its outdoors.

When you apply power to the GPS it immediately emits serial data on the TX pin. These are in the format of NMEA sentences (plenty of reference material on those can be found).

It doesn't need satellite signals to produce the sentences. They will contain many blank fields until satellite signals are received.

The simplest way to read the sentences is by using a TTL/USB adapter. They cost a few dollars.

The adapter is inserted in the PC's USB port and the sentences can be displayed in the Arduino IDE or a serial terminal program or the u-center program from u-blox.

When you get that going you can experiment with the GPS antenna and positioning it with a good view of the sky. There's no real value in feeding the data to a sketch unless you are receiving satellite data. You will see the data in the sentences.

Another way to read them is via a simple sketch on the Arduino to read the TX pin and send the data to the IDE.

John.

You can also use an UNO as a serial adapter by connecting the Reset pin to ground. Serial appears on pin 0 and 1. You can use that to talk directly to a GPS unit.

Railroader:
Give the unit some 5 - 10 minutes to start up. What kind of antenna do You use?

That's a lot of time! I use the square shaped antenna that came along with GPS (it smells weird!)

TomGeorge:
Hi,
Have you tried the examples in the IDE for TinyGPS++?

Thanks.. Tom... :slight_smile:

Hey Tom! how u r doing Buddy? I'm seeing u after very long time. I remebered u helped in one of my previous project. It was a divine help for me :slight_smile: To ur question, yes I tried using tinygps++ but no use...

srnet:
A decent GPS with a good working antenna, when started up from cold, should get a fix in circa 40-60 seconds, if its outdoors with a good view of the sky.

A bad GPS or a good GPS with a bad antenna can take 15 minutes or more to get a fix even if its outdoors.

How do I know if I have a bad antenna or a good one?

HillmanImp:
When you apply power to the GPS it immediately emits serial data on the TX pin. These are in the format of NMEA sentences (plenty of reference material on those can be found).

It doesn't need satellite signals to produce the sentences. They will contain many blank fields until satellite signals are received.

The simplest way to read the sentences is by using a TTL/USB adapter. They cost a few dollars.

The adapter is inserted in the PC's USB port and the sentences can be displayed in the Arduino IDE or a serial terminal program or the u-center program from u-blox.

When you get that going you can experiment with the GPS antenna and positioning it with a good view of the sky. There's no real value in feeding the data to a sketch unless you are receiving satellite data. You will see the data in the sentences.

Another way to read them is via a simple sketch on the Arduino to read the TX pin and send the data to the IDE.

John.

I'll give it a try, thanks

Count:
How do I know if I have a bad antenna or a good one?

You capture the NMEA sentences the GPS puts out, one of them tells you the signal strengths of signals from the satellites the GPS can see. Lots of weak signals indicate a problem.

There is a discussion of the various issues people have with GPSs here;

Count:
That's a lot of time!
I use the square shaped antenna that came along with GPS (it smells weird!)yes I tried using tinygps++ but no use...How do I know if I have a bad antenna or a good one? I'll give it a try, thanks

Yes. Starting first time in a significant new place it takes extra time. Minuts has been said by several helpers.
I got an antenna 1" in square and connected by an antenna plug. That's a good one. In my use it works fine indoors, reinforced concrete walls and roof.

I've used 9600 baud from the beginning. The UNO Tx -> GPS Rx is not connected at all. Only GPS Tx -> UNO Rx.

Copied from data shet:
Parameter Specification
Receiver type 50 Channels
GPS L1 frequency, C/A Code
SBAS: WAAS, EGNOS, MSAS
Time-To-First-Fix1 NEO-6G/Q/T NEO-6M/V NEO-6P
Cold Start2
26 s 27 s 32 s
Warm Start2
26 s 27 s 32 s
Hot Start2
1 s 1 s 1 s
Aided Starts3 1 s <3 s <3 s

Link: https://www.u-blox.com/sites/default/files/products/documents/NEO-6_DataSheet_(GPS.G6-HW-09005).pdf

Railroader:
Yes. Starting first time in a significant new place it takes extra time. Minuts has been said by several helpers.
I got an antenna 1" in square and connected by an antenna plug. That's a good one. In my use it works fine indoors, reinforced concrete walls and roof.

I've used 9600 baud from the beginning. The UNO Tx -> GPS Rx is not connected at all. Only GPS Tx -> UNO Rx.

I need to try this for sure... I'll try it out and get back to state what happens

Just one more thing... Right now I supply GPS with 5V is it okay if I supply it with 3V? Or do I need to supply it with 5V only?

Count:
Just one more thing... Right now I supply GPS with 5V is it okay if I supply it with 3V? Or do I need to supply it with 5V only?

Did you read the specifications? Also keep in mind that some modules have 3.6V maximum logic levels. Can't connect to 5V devices directly.

aarg:
Did you read the specifications? Also keep in mind that some modules have 3.6V maximum logic levels. Can't connect to 5V devices directly.

I checked it from the vendor I brought it. His website says it works from 3-5V. But all the YT videos says it should be powered by 5V. What is the right way?