GPS problem

Hi,

I buy this GPS module : GY-GPS6MV1 GPS APM2

I try this code to get the data of the GPS :

#include <SoftwareSerial.h>

SoftwareSerial gps(0,1); // RX, TX  Connect GPS TX to pin 3
void setup()
{
  Serial.begin(115200); // be sure to check lower right corner info in an open 'serial windows'
  gps.begin(9600);  // may be 4800, 19200,38400 or 57600

}

void loop()
{
  if (gps.available())  Serial.write(gps.read());
}

But nothing happen…

I have an Arduino Mega 2560

Thanks a lot

Does your GPS have a clear view of the sky?

You do NOT use pins 0 and 1 for software serial!

Mark

nathan30: But nothing happen...

What do you expect to happen?

Big smoke coming out of the Arduino board? Or do you expect big smoke coming out of the GPS module? What?

Be happy "if nothing happens" with your configuration!

This is a very big mistake in your software and most likely in your cabling too:

SoftwareSerial gps(0,1); // RX, TX  Connect GPS TX to pin 3

The pins 0 and 1 are the RX and TX pins of HARDWARE SERIAL! You cannot use those pins for software serial in addition.

The MEGA board has 4 hardware serials, so you need not to use unreliable SoftWareSerial in any way.

Just connect your GPS module to let's say the RX3 pin on your MEGA, which is pin-15. RX3 is for receiving on Serial3.

You most likely will not want to send anything to your GPS, so do not connect TX3 as this provides 5V output and I'm not sure if your GPS module is really ready to accept 5V I/O voltage from your Arduino. Look up the datasheet before you connect (when needed)!

So connect GPS-TX to let's say Arduino-RX3 and use:

// Test code for Arduino MEGA and receiving serial data on RX3
void setup()
{
  Serial.begin(115200); // be sure to check lower right corner info in an open 'serial windows'
  Serial3.begin(9600);  // may be 4800, 19200,38400 or 57600
}

void loop()
{
  if (Serial3.available())  Serial.write(Serial3.read());
}

AWOL:
Does your GPS have a clear view of the sky?

Yes !

jurs:
What do you expect to happen?

Big smoke coming out of the Arduino board?
Or do you expect big smoke coming out of the GPS module?
What?

Be happy “if nothing happens” with your configuration!

This is a very big mistake in your software and most likely in your cabling too:

SoftwareSerial gps(0,1); // RX, TX  Connect GPS TX to pin 3

The pins 0 and 1 are the RX and TX pins of HARDWARE SERIAL!
You cannot use those pins for software serial in addition.

The MEGA board has 4 hardware serials, so you need not to use unreliable SoftWareSerial in any way.

Just connect your GPS module to let’s say the RX3 pin on your MEGA, which is pin-15.
RX3 is for receiving on Serial3.

You most likely will not want to send anything to your GPS, so do not connect TX3 as this provides 5V output and I’m not sure if your GPS module is really ready to accept 5V I/O voltage from your Arduino. Look up the datasheet before you connect (when needed)!

So connect GPS-TX to let’s say Arduino-RX3 and use:

// Test code for Arduino MEGA and receiving serial data on RX3

void setup()
{
  Serial.begin(115200); // be sure to check lower right corner info in an open ‘serial windows’
  Serial3.begin(9600);  // may be 4800, 19200,38400 or 57600
}

void loop()
{
  if (Serial3.available())  Serial.write(Serial3.read());
}

I try to connect the RX pin of the GPS to the RX3 (pin 15) and TX to TX3(pin 16)

But nothing happen in the serial monitor, again…

nathan30: Yes !

I try to connect the RX pin of the GPS to the RX3 (pin 15) and TX to TX3(pin 16)

But nothing happen in the serial monitor, again.....

You always will need crossing the cables with serial connections.

The transmitting pin (TX) of one device is connected to the receiving pin (RX) of the other device. And the other way round.

RX --> connect to TX TX --> connect to RX

So one device can receive on his RX pin what the other device sends on his TX pin.

Finally I try with Serial1 and it's works ! :)

Thanks a lot !