GPS not being detected

Hi,
I have a project which I would like to track the position of a car with a gps during a race; however, I can not get the gps to work with the examples.

Problem:
The serial monitor says that the wiring is not correct, even after checking the wiring several times from several examples, which all had the same wiring layout. The LED on the gps is blinking every sec which should me it is working fine. Also, I have a decent antenna on it and outside when testing.

Materials:
I am using TinyGPS++ library and the NEO 7m module for gps and an UNO.

So after serval hours of research, I have not come to any closer to understanding why the wiring would be bad. I did check the voltage of the pins: RX = 5V TX = fluctuate between 1.4V to 3.4V. Don't know if this is normal but it was the only thing I could think of checking. For codes, the basic sketch will work to get the lat and the long but for some reason on the other example codes such as DeviceExample it would only output the set up message and not anything from the loop function. Any help or ideas will be great.

Thanks!

If the basic 'code' works that would suggest the GPS is wired correctly and working.

So maybe there is a problem with the other 'code' you are using ?

The examples in the TinyGPS++ library do work, so if they dont for you maybe you are changing the code or doing something different ?

This tutorial, Arduino Serial I/O for the Real World has a GPS parsing example, Reading and Parsing Instrument Data - GPS, which may point you in the right direction

I think you need to take Mikhal's suggestion to "check your wiring" as just that -- a suggestion. There are many things that need to be working for a complete GPS system to work. Mikhal's sketch can't possibly deduce the state of your wiring.

If the GPS on-board LED changes from steady to blinking then that typically means it has got a fix.

Next step is to read the NMEA sentences output by the GPS with the minimum of devices and DIY programming. This is best done with the u-center software from u-blox. Everyone who tinkers with GPS ought to know how to use u-center (IMHO).

1 Like

Hello
Do the GPS antenna can "see" the GPS satellites or the ceiling of your room only? :nerd_face:

Thank you for the resources as they are very helpful to better understand the software side of things for GPS.

Thank you for the suggesting and directing me to learn more about reading NMEA output of the gps.

But you said quite clearly;

"For codes, the basic sketch will work to get the lat and the long"

So its a reasonable assumption that you have the wiring correct and the well known reliable TinyGPS++ library is working, how would you get the lat and long otherwise ?

So you dont really need to understand or consider other methods or libraries for parsing the GPS output since clearly the TinyGPS++ library is doing that already.

What you need to tell us is what you changed between using the working example in the TinyGPS++ library and the example that apparently did not work.

Very true the basic code example works getting the lat and the long; however, I tried the next example code called DeviceExample, which is suppose to print the coordinates along with the time, not messing with any of the code except the software serial as I am doing this on a mega. Rx = 19 and Tx = 18. Also the baud rate as the NEO 7 gps works on 9600 baud rate.

#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 = 19, TXPin = 18;
static const uint32_t GPSBaud = 9600;

// 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();
}

I ran this code and the message that the wiring is still wrong. After checking it is correct.

I have read that SoftwareSerial doesn't work well with mega but I know pin 18 and 19 are the serial port 1 and the default. So, that might be a possible issue.

But I have concluded after reading how to use the library from TinyGPS++ | Arduiniana, it is an issue of the gps data is not getting to the Arduino. So, I do not know how to fix that issue but I will use the debugging from that previous site.

Sorry to confuse people who read these post as I originally working on a project with a mega but switched to UNO because thought it was easier to modify codes that were designed for the UNO but changed back to the mega.

Solution:

It was the SoftwareSerial library. I connected the RX = pin 50 and TX = pin 51. Apparently the actual serial ports don't work with it which surprises me.

Just curious. Is there any benefits to having the info do through the SoftwareSerial library or is it best to go through the actual serial pins? Note: this project will be doing multitasking, taking in multiple information points through the analog pins such as, temp, acceleration, rpm circuit that requires an interrupt, and tracking information from the gps.

Also for the baud rate, is it better to have the Serial baud rate different than the gps or does it not matter?

On AVR boards (Uno/Mega2560/Nano etc), the Arduino SoftSerial disables all interrupts when sending a byte which interferes with receiving data. The SoftwareSerial library has the following known limitations: -
If using multiple software serial ports, only one can receive data at a time.
Not all pins on the Mega and Mega 2560 support change interrupts, so only the following can be used for RX: 10, 11, 12, 13, 14, 15, 50, 51, 52, 53, A8 (62), A9 (63), A10 (64), A11 (65), A12 (66), A13 (67), A14 (68), A15 (69).
Not all pins on the Leonardo and Micro support change interrupts, so only the following can be used for RX: 8, 9, 10, 11, 14 (MISO), 15 (SCK), 16 (MOSI).
On Arduino or Genuino 101 the current maximum RX speed is 57600bps
On Arduino or Genuino 101 RX doesn't work on Pin 13

Use the Mega and Hardware Serial.

Set the Serial baud rate as high as works (115200 at least) and see Arduino Serial I/O for the Real World for how to add debugging without loosing GPS and other inputs

As has been mentioned, the Software serial reference is clear, pins 18 and 19 are not supported for Software serial and its not a 'bug' in the software serial library.

Software serial works as well on a Mega as it does on a UNO or Pro Mini, althought since the Mega has 3 extra hardware serial ports using software serial on a Mega makes no sense.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.