GPS shows symbols

I’m working on a project with GPS.
The GPS works on software serial and I use the TinyGPS library.
However, the serial monitor shows symbols instead of useful information. I checked the pins, they match the code. The baud rate according to most resources should be 4800, but according to the website where I bought my GPS it should be 9600. I tried both with the same result.

Also, what I find weird is that the serial monitor shows symbols on 4800 and 9600 baud rate.

Anyone who knows what’s wrong here?

#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; // set by software on 4800, according to hackerstore  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();
      else { (Serial.println("no gps encode"));}

  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: "));

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

Thanks in advance!

the serial monitor shows symbols instead of useful information.

Your Serial is set to 115200- is that what you set the monitor to?

Serial.begin(115200);

Hi,
A flow of data on the monitor indicates the GPS is properly connected. Garbage characters indicates mismatching baud rate settings.

Mikal's example uses 4800 cos that must have worked for the module he was using. I see 9600 most often specified as the default, at least of u-blox receivers. You shud follow the data sheet of the GPS receiver as sourced from the maker, not the data sheet of the board from the vendor.

Mikal's examples are good.

It is also useful to send the GPS output direct to the monitor without going thru a sketch.

John.

Further to my previous about the monitor baud rate, forget the GPS for a moment, do these text messages in setup() print ok but the GPS data is garbage, or is all the serial output garbage?

Serial.println(F("DeviceExample.ino"));[code]

meltDown:
Your Serial is set to 115200- is that what you set the monitor to?

Serial.begin(115200);

This was set in the software I didn't change. Should I change it? This is the baud rate of the serial monitor and not the gps?

meltDown:
Further to my previous about the monitor baud rate, forget the GPS for a moment, do these text messages in setup() print ok but the GPS data is garbage, or is all the serial output garbage?

Serial.println(F("DeviceExample.ino"));[code]

Yes this prints normal .

On 4800 baud I get "15:07:27.123 -> ,,⸮s⸮⸮"
On 9600 baud I get "I⸮͍⸮"&⸮W"

Oh on 115200 baud I get proper information! Not yet GPS coordinates though.

"DeviceExample.ino
15:08:36.062 -> A simple demonstration of TinyGPS++ with an attached GPS module
15:08:36.062 -> Testing TinyGPS++ library v. 1.0.2
15:08:36.062 -> by Mikal Hart
15:08:36.062 ->
15:08:41.095 -> No GPS detected: check wiring.
"

I suspect I should try again when outside? Will do later, it is very hot here now.

Thanks for your tips! I didn't think of setting the baud rate of the serial monitor

15:08:41.095 -> No GPS detected: check wiring.
"

I suspect I should try again when outside? Will do later, it is very hot here now.

Stay inside until you fix your wiring issue.

PaulS:
Stay inside until you fix your wiring issue.

Ok, but I’m not sure there is a wiring problem?

I checked the wires but everything is connected as stated in the instruction from the website where I bought it.
It says:

V of Vcc voedingsspanning – I connected it to the 5V
G of Gnd massa (nul)
T of Tx seriële uitgang – connected to pin 3 as stated in the software (software serial)
R of Rx seriële ingang – connected to pin 4 as stated in the software (software serial)
P PPS uitgang - hoef je niet aan te sluiten – it says that it doesn’t have to be connected
E enable ingang - hoef je niet aan te sluiten – this one too says it doesn’t have to be connected.

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

Are there other situations than wrong wiring that can cause gps.charsProcessed() to be smaller than 10?

Try sending the GPS output directly to the monitor without going thru a sketch.

Try this simple program, which just sends the characters from the GPS to the serial monitor.
Make sure that both Baud rates match the devices and that the GPS pin assignments are correct.

#include <SoftwareSerial.h>

SoftwareSerial mySerial(10, 11); //(GPS RX, TX) check correct pin assignments.

void setup() {
  mySerial.begin(9600);
  Serial.begin(9600);
  Serial.println("GPS start");
}

void loop() {
  while (mySerial.available()) {
    Serial.write(mySerial.read()); //corrected!
  }
}

jremington:
Try this simple program, which just sends the characters from the GPS to the serial monitor.
Make sure that both Baud rates match the devices and that the GPS pin assignments are correct.

#include <SoftwareSerial.h>

SoftwareSerial mySerial(10, 11); //(GPS RX, TX) check correct pin assignments.

void setup() {
  mySerial.begin(9600);
  Serial.begin(9600);
  Serial.println(“GPS start”);
}

void loop() {
  while (mySerial.available()) {
    Serial.print(mySerial.read());
  }
}

Thanks. I run this sketch and it only prints “GPS start” so no GPS output but it is available apparently.

Ok, but I'm not sure there is a wiring problem?

The output you posted, produced by some code, says that there IS a problem. It is possible that the code prints that message simply because it does not receive any data from the GPS.

You need, therefore, to show us how the GPS is actually connected to the Arduino.

PaulS:
The output you posted, produced by some code, says that there IS a problem. It is possible that the code prints that message simply because it does not receive any data from the GPS.

You need, therefore, to show us how the GPS is actually connected to the Arduino.

I attach an overview with this post

Did you fix the pin assignments in the code to match your wiring?

wildbill:
Did you fix the pin assignments in the code to match your wiring?

TX = 3 and RX =4, same in the image as in the code

It looks like you have pin 4(RX) connected to R on your GPS, which implies receive to receive. Transmit should be wired to receive and vice versa.

You can take the sketch out of the equation altogether -- use the UNO hardware serial port.

TX of the GPS to pin 1 of the UNO. You don't need to connect the GPS RX pin to anything.

Connect the UNO RESET pin to one of its GND pins. This kills your sketch.

Select the correct COM port, open the monitor, try 9600 baud to start with.

Something shud appear on the monitor, a good chance it'll be legible NMEA sentences. They won't contain satellite or positional data; that's the next thing to work on.

John.

TX = 3 and RX =4, same in the image as in the code

SoftwareSerial mySerial(10, 11); //(GPS RX, TX) check correct pin assignments.

You have an interesting definition of same.

PaulS:
You have an interesting definition of same.

Op’s code used 3 & 4, jremington’s suggested code used 10 & 11.

meltDown:
Op's code used 3 & 4, jremington's suggested code used 10 & 11.

But there is no proof that OP changed jremington's code to use different pins.

wildbill:
It looks like you have pin 4(RX) connected to R on your GPS, which implies receive to receive. Transmit should be wired to receive and vice versa.

Ah! I didn’t know that.

Now I changed that and the test code by jremington outputs a whole series of numbers.

When I run the TinyGPS sketch, it prints “no gps encode” (probably not the best description but I put it there as a note for myself to see when geps.encode(ss.read())) is false)

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

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