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.
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
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.