Trouble with receiving GPS data on UBLOX Neo-6M

Hi, I've been trying to make this GPS tracker but when I check the output, it says "No GPS detected: check wiring" I connected my GPS RX to Arduino D3 then TX to D2. Could somebody please help me with this problem? I've been searching for a few days. Thanks!

#include <TinyGPSPlus.h>
#include <SoftwareSerial.h>

static const int RXPin = 6, TXPin =5;
static const uint32_t GPSBaud = 9600;
// The TinyGPS++ object
TinyGPSPlus gps;

SoftwareSerial ss(RXPin, TXPin);

// The serial connection to the GPS device
void setup()
{

  Serial.begin(9600);
  ss.begin(GPSBaud);

}
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()
{
  int h, s, m, m1, h1;


  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(" "));
  // int h, s, m, m1, h1;
  if (gps.time.isValid())
  {
    if (gps.time.minute() + 30 >= 60)
    {
      h = gps.time.hour() + 6;
      Serial.print(h);
      Serial.print(F(":"));
      m = (gps.time.minute() + 30) - 60;
      if (m < 10) Serial.print(F("0"));
      Serial.print(m);
      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 if (gps.time.minute() + 30 < 60)
    {
      h1 = gps.time.hour() + 5;
      Serial.print(h1);
      Serial.print(F(":"));
      m1 = gps.time.minute() + 30;
      if (m1 < 10) Serial.print(F("0"));
      Serial.print(m1);
      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();

}

I moved your topic to an appropriate forum category @leftnrightgnight.

In the future, please take some time to pick the forum category that best suits the subject of your topic. There is an "About the _____ category" topic at the top of each category that explains its purpose.

This is an important part of responsible forum usage, as explained in the "How to get the best out of this forum" guide. The guide contains a lot of other useful information. Please read it.

Thanks in advance for your cooperation.

1 Like

did you connect anything else like the GND ?

well, 5 and 6 doesn't sound like 2 and 3.. does it?

when you do SoftwareSerial ss(RXPin, TXPin);, the RXPin is the pin on which to receive data, so it must be connected to the Tx pin of the GPS module and the TXPin is the pin on which you send data so it must be connected to the Rx pin of the GPS module

1 Like

I used an Arduino Nano with this. And when I connected the Rx pin of the GPS module to the TXPin of the Nano and the Tx pin of the GPS module to the RXPin of the Nano, the uploading would take some time, and then it became an error.

An error occurred while uploading the sketch
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00

don't use pins 0 and 1, they are used by Serial and your USB connexion to upload the code

if you do

static const int RXPin = 6, TXPin =5;
SoftwareSerial ss(RXPin, TXPin);

then the Arduino Pin 6 is connected to the Tx pin of your GPS and the Arduino Pin 5 is connected to the Rx pin of your GPS

don't connect anything to pins 0 and 1

1 Like

I did that and still "No GPS detected: check wiring."

provide a drawing of your circuit with all the details

And full code you used

1 Like
#include <TinyGPSPlus.h>
#include <SoftwareSerial.h>

static const int RXPin = 6, TXPin =5;
static const uint32_t GPSBaud = 9600;
// The TinyGPS++ object
TinyGPSPlus gps;

SoftwareSerial ss(RXPin, TXPin);

// The serial connection to the GPS device
void setup()
{

  Serial.begin(9600);
  ss.begin(GPSBaud);

}
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()
{
  int h, s, m, m1, h1;


  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(" "));
  // int h, s, m, m1, h1;
  if (gps.time.isValid())
  {
    if (gps.time.minute() + 30 >= 60)
    {
      h = gps.time.hour() + 6;
      Serial.print(h);
      Serial.print(F(":"));
      m = (gps.time.minute() + 30) - 60;
      if (m < 10) Serial.print(F("0"));
      Serial.print(m);
      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 if (gps.time.minute() + 30 < 60)
    {
      h1 = gps.time.hour() + 5;
      Serial.print(h1);
      Serial.print(F(":"));
      m1 = gps.time.minute() + 30;
      if (m1 < 10) Serial.print(F("0"));
      Serial.print(m1);
      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();

}

Arduino Nano uses 5V logic levels.

The GPS is using 3.3V logic levels.

it depends, some 6M or 7M like this board


have a built-in 5v adaptor

Yes, but the schematic shows the GPS being powered by 3.3V.

ah right, missed that

@leftnrightgnight do you have a link to your exact module and its datasheet?

And depending on the drop out voltage of the regulator, the GPS could be getting quite a bit less than 3.3V.

NEO-6_DataSheet_(GPS.G6-HW-09005).pdf (866.1 KB)

I have watched many guide and tutorials in youtube and I followed exactly their procedure and steps.

But nevermind, thanks for the guides y'all! I will use my sim7600e since it has built-in gps there in the modem/board and has lte also.