Check wiring on GPS Module

#include <SoftwareSerial.h>

#include <TinyGPS.h>

/* This sample code demonstrates the normal use of a TinyGPS 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).
*/

TinyGPS gps;
SoftwareSerial ss(15, 14);

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

Serial.print("Simple TinyGPS library v. "); Serial.println(TinyGPS::library_version());
Serial.println("by Mikal Hart");
Serial.println();
}

void loop()
{
bool newData = false;
unsigned long chars;
unsigned short sentences, failed;

// For one second we parse GPS data and report some key values
for (unsigned long start = millis(); millis() - start < 1000;)
{
while (ss.available())
{
char c = ss.read();
// Serial.write(c); // uncomment this line if you want to see the GPS data flowing
if (gps.encode(c)) // Did a new valid sentence come in?
newData = true;
}
}

if (newData)
{
float flat, flon;
unsigned long age;
gps.f_get_position(&flat, &flon, &age);
Serial.print("LAT=");
Serial.print(flat == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : flat, 6);
Serial.print(" LON=");
Serial.print(flon == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : flon, 6);
Serial.print(" SAT=");
Serial.print(gps.satellites() == TinyGPS::GPS_INVALID_SATELLITES ? 0 : gps.satellites());
Serial.print(" PREC=");
Serial.print(gps.hdop() == TinyGPS::GPS_INVALID_HDOP ? 0 : gps.hdop());
}

gps.stats(&chars, &sentences, &failed);
Serial.print(" CHARS=");
Serial.print(chars);
Serial.print(" SENTENCES=");
Serial.print(sentences);
Serial.print(" CSUM ERR=");
Serial.println(failed);
if (chars == 0)
Serial.println("** No characters received from GPS: check wiring **");
}

I use above codes.but output result is "No characters received from GPS: check wiring ". Led blink on GPS module.Why??? I want to know this anaswer.

Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'

Use code tags (the </> icon above the compose window) to make it easier to read and copy for examination

That usually means that the GPS has a lock on enough satellites to provide GPS data

// Serial.write(c); // uncomment this line if you want to see the GPS data flowing

What do you see if uncomment this line

Do you know which Arduino and GPS you are using ?

How are the pins, to which you have connected the TX and RX of the GPS module, labelled ?

Rx and tx pin on Mega

Yeah

OK. On the Mega, if you want to use pins 14 and 15, you should not use software serial, you should use Serial3 instead. Don't forget that RX and TX are crossed over. For example, TX on the GPS module is connected to RX3 (pin15) on the Mega.

How can the OP view the raw GPS output on the IDE monitor using the Mega without going through a sketch?

I've only done this on other boards, not a Mega.

What do you mean Serial3? and "do not use Software Serial"?I want to know what it mean .Sir

What is actually printed alongside pins 14 and 15 is TX3 and RX3
image
The Mega has 4 hardware serial ports (UARTS) which means that you do not need to use SoftwareSerial. Pins 14 and 15 give you access to Serial3 which you can use exactly the same as a serial port created using SoftwareSerial by using Serial3 as its name

thank you sir.I have done.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.