Arduino UNO and Neo 6m GPS Module - empty serial monitor (NMEA and lat/long)

Hello, I need to read the readings off my GPS module onto the Serial monitor. Ive tested out using Arduino MEGA and it went fine. However, when it comes to Arduino UNO, I did not get any data. I can only use TinyGPS.h library as TinyGps++. h library always gives me empty data. I don’t know why.

I waited for 20+ minutes in an open area. My Arduino board is in working condition and the module has light blinking. I’ve tried 2 different configuration for RX and TX for both times but still no result (empty serial monitor). My connection is per below:

Configuration 1: RX = Pin 3, TX = Pin 4 while for configuration 2: RX = Pin 1 (TX), TX = Pin 0 (RX). For configuration 2, I did it that way because I’ve seen in multiple post where the RX of GPS is to connect to TX (same concept w TX of GPS). Both configuration: VCC = 5V, GND = GND

Codes below is by using Configuration 1. For Serial Monitor and NMEA Code

#include <SoftwareSerial.h>


// The serial connection to the GPS module (configuration 1)
SoftwareSerial ss(3, 4);//rx,tx


void setup(){
  Serial.begin(9600);
  ss.begin(9600);
}

void loop(){
  while (ss.available() > 0){
    // get the byte data from the GPS
    byte gpsData = ss.read();
    Serial.write(gpsData);
  }
}

Codes below is by using Configuration 1. For Serial Monitor and lat/long Code

#include <TinyGPS.h>
#include <SoftwareSerial.h>


float lat,lon;
TinyGPS gps; // create gps object
// The serial connection to the GPS module (configuration 1)
SoftwareSerial ss(3, 4);//rx,tx

void setup(){
Serial.begin(57600); // connect serial
Serial.println("The GPS Received Signal:");
Serial1.begin(9600); // connect gps sensor

}
 
void loop(){
    while(ss.available()){ // check for gps data
    if(gps.encode(ss.read()))// encode gps data
    { 
    gps.f_get_position(&lat,&lon); // get latitude and longitude

    Serial.print("Position: ");
    
    //Latitude
    Serial.print("Latitude: ");
    Serial.print(lat,6);
    
    Serial.print(",");
    
    //Longitude
    Serial.print("Longitude: ");
    Serial.println(lon,6); 
    
   }
  }
}

If your module and Arduino are wired up correctly and the baudrate is set correctly you should see messages from your board instantly when running the first example.

If you have an oscilloscope you can look at the pins of the module to see whether it is sending data. The data is sent as soon as the module is powered up.

TinyGPS is just a parsing library, if the NMEA messages are correct the rest is just moving bytes around and combining the right ones.

bittercoffee:
Ive tested out using Arduino MEGA and it went fine. However, when it comes to Arduino UNO, I did not get any data.

Are you sure you didn't write that backwards? The reason I ask is because you can only use specific pins on the Mega for the SoftwareSerial RX pin and pin 3 is not one of those pins. So If you were using the SoftwareSerial code you shared on the Mega I would not expect it to work, but you can use any pin on the Uno for SoftwareSerial RX, so that code looks fine for the Uno.

did you connect GPS TX to Arduino RX and GPS RX to Arduino TX? that is the right way to connect.

I have connected my NEO6M to an Uno and loaded your configuration 1 code (software serial). The GPS TX pin is connected to the Uno pin 3 and the GPS RX pin is not connected (or needed for a simple test).

I get:

$GPRMC,154540.00,V,,,,,,,,,,N*7C
$GPVTG,,,,,,,,,N*30
$GPGGA,154540.00,,,,,0,00,99.99,,,,,,*67
$GPGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*30
$GPGSV,1,1,03,20,,,18,21,,,23,29,,,26*7C
$GPGLL,,,,,154540.00,V,N*4B
$GPRMC,154541.00,V,,,,,,,,,,N*7D
$GPVTG,,,,,,,,,N*30
$GPGGA,154541.00,,,,,0,00,99.99,,,,,,*66

on serial monitor.

Connection the GPS to the Uno hardware serial port (pins 0 and 1) can cause problems. Only one device should be connected to a serial port at a time.

Bittercoffee,

Try feeding the NMEA sentences from the GPS module directly to the monitor without using a sketch.

John.