Neo 6m gps module, software serial not available

I have a neo 6m gps module connected to my arduino mega2560 R3, and am simply trying to read the gps data via serial monitor. I'm following this tutorial.
I've attached image of my wiring and the wiring schematics, and the code used is shown below. The issue I'm getting is that nothing is showing up on my serial monitor. I've narrowed down the issue to the fact that ss.available is never greater than 0 - I think that means my computer is not receiving any data at all? The gps module led is blinking, meaning it's locked in to satellite.

#include <SoftwareSerial.h>

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

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

Here's what I've checked so far:

  • I've successfully tried using the Arduino with software serial to print out a message when I press a push button, so I know the serial monitor connection can work.
  • I've tried using different digital pins for the wiring to make sure the issue wasn't with pins 3 and 4.
  • I've tested the soldering of the neo 6m gps module and the connection is fine.
  • I've ordered another neo 6m gps to make sure the issue wasn't with the module.
  • I've checked the wiring a hundred times.

Please help :slight_smile:

The Mega has four (4) hardware serial ports, so why are you using software serial?

zorya78:
Here's what I've checked so far:

  • I've successfully tried using the Arduino with software serial to print out a message when I press a push button, so I know the serial monitor connection can work.

This is nonsense. The serial monitor is on hardware serial, and no amount of software will print to it by any other means. Having said that the serial monitor connection by USB cable should be the least of your problems. Just make sure your GPS module is wired the right way round Tx>Rx and Rx<Tx

Example to read GPS using Serial1 serial port on Mega and output to serial monitor with Serial port.

//gps test
// connect GPS TX to Mega pin 19 (RX1)  GPS RX not connected

void setup()
{
   // Open serial communications
   Serial.begin(9600);  
   Serial1.begin(9600);
   Serial.print("Mega up");
}

void loop()
{
   if (Serial1.available())
   {
      Serial.print(char(Serial1.read()));
   }
}

zorya78:
Here's what I've checked so far:

  • I've tried using different digital pins for the wiring to make sure the issue wasn't with pins 3 and 4.

If you read the reference guide for SoftwareSerial, you will find it does not work for RX on pins 3 or 4 on a Mega;

https://www.arduino.cc/en/Reference/softwareSerial

But why use SoftwareSerial on a Mega, it has 3 spare hardware serial ports.

thank you for putting your code in code tags in your first post without being told.

Thanks everyone, I'm a complete beginner so the help was very much appreciated! I switched to using the hardware serial ports and it's working great - hoping this will soon progress to a fully functional dog gps collar. :slight_smile: