Hi, im trying to display gps data on Arduino serial monitor. I tried to it with tinygps and tinygps++ libraries but it didnt work. Then i tried the following code without any libraries to display just raw gps data.
CODE:
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()));
}
}
Still i dont get any data, just 'Mega up' on serial monitor. Even though i left the GPS very near a window with Arduino connected to my laptop with USB for 1.5 hours, still no data. No leds on the GPS module are blinking or working.
My connections:
VCC GPS - 5V Arduino
GND GPS - GND Arduino
TX GPS - RX1 Arduino (Serial1 hardware port)
RX GPS - TX1 Arduino (Serial1 hardware port)
Any suggestions what might be wrong here? Maybe my GPS is faulty or something. Thanks in advance.
Default baudrate of my GPS is 9600. I set serial monitor to 9600 baudrate also. So i think, i have a correct baudrate, if i understood your question correctly.
Hi,
Can you please post an image of your project, so we can see your component layout?
Does your GPS have an antenna socket like in the Fritzy you posted?
Can you post a link to where you purchased and link to data/specs?
Hi and welcome to the forum.
Some GPS boards do not show any LED activity until they are receiving satellite data.
Perhaps you should be looking at the RX LED on the Mega. That might light up when data is received on RX0, so why not use port 0 instead of port 1? You would then need to disconnect the GPS from RX0 when you upload a sketch.
I wired a Neo6M to my Mega according to your diagram and photo, uploaded and ran your code. My GPS started outputting normal NEMA sentences right away.
As far as I can see your diagram and photos show the GPS wired correctly and the code works.
Have you tried different jumper wires? Perhaps one or more are bad.
Can you measure the voltage at the VCC pin on the GPS board? If it's 5v then data ought to be pouring out of its TX pin (regardless of whether it is "seeing" any satellites).