# GPS is not working

**URL:** <https://forum.arduino.cc/t/gps-is-not-working/1100216>\
**Category:** Programming\
**Created:** [March 10, 2023, 2:27pm UTC](https://forum.arduino.cc/t/gps-is-not-working/1100216 "2023-03-10T14:27:59Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![akshaypowar](https://avatars.discourse-cdn.com/v4/letter/a/f475e1/32.png) [@akshaypowar](https://forum.arduino.cc/u/akshaypowar)\
**Post date:** [March 10, 2023, 2:27pm UTC](https://forum.arduino.cc/t/gps-is-not-working/1100216/1 "2023-03-10T14:27:59Z")

</div>

Hello everyone  
I am using neo 6m GPS with the Arduino Mega 2560.  
My connections are:  
Ard--\>GPS  
3.3v--\>Vcc  
GND--\>GND  
pin 0 (RX) --\> TX  
pin 1 (TX) --\> RX

my code is  
#include \<SoftwareSerial.h\>

SoftwareSerial ss(1, 0);  
void setup() {  
// put your setup code here, to run once:  
Serial.begin(9600);  
ss.begin(9600);  
}

void loop() {  
// put your main code here, to run repeatedly:  
Serial.pri  
while (ss.available()){  
// get the byte data from the GPS  
Serial.write(ss.read());  
}  
}

I removed the RX TX connections before uploading the code and again connected  
But there no output in the serial monitor. Not even a single character.

I have 3 gps modules and its the same for all of them. I waited for 1 hour for each gps module but there was no progress. NO GPS module LED blinking. and no RX TX LED on Arduino blinking.  
Could you please guide me??

---

<div class="post-metadata">

**Author:** ![ffur](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ffur/32/1013044_2.png) [@ffur](https://forum.arduino.cc/u/ffur)\
**Post date:** [March 10, 2023, 2:48pm UTC](https://forum.arduino.cc/t/gps-is-not-working/1100216/2 "2023-03-10T14:48:11Z")

</div>

You are useing SoftwareSerial, but you have connected your GPS to the hardware Serial  
pins on your Mega. These pins are used by the normal Serial.print.  
Your loop() has a problem with the Serial.pri ????  
Try to use other pins and try to use TinyGPS++.h with a lot of esamples  
/ffur

---

<div class="post-metadata">

**Author:** ![UKHeliBob](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ukhelibob/32/215663_2.png) [@UKHeliBob](https://forum.arduino.cc/u/UKHeliBob)\
**Post date:** [March 10, 2023, 3:29pm UTC](https://forum.arduino.cc/t/gps-is-not-working/1100216/3 "2023-03-10T15:29:59Z")

</div>

Your topic was **MOVED** to its current forum category which is more appropriate than the original as it has nothing to do with Installation and Troubleshooting of the IDE

> [@akshaypowar](#):
>
> my code is

Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'  
  
Use [color = red] **code tags** [/color] (the \</\> icon above the compose window)&nbsp;to make it easier to read and copy for examination

> [@How to get the best out of this forum](https://forum.arduino.cc/t/how-to-get-the-best-out-of-this-forum/679966):
>
> See also [FAQ - Arduino Forum](https://forum.arduino.cc/faq) for general rules on forum behavior and etiquette. Hello, Welcome to the Arduino Forum. This guide explains how to get the best out of this forum. Please read and follow the instructions below. Being new here you might think this is having rules for the sake of rules, but that is not the case. If you don’t follow the guidelines all that happens is there is a long exchange of posts while we try to get you to tell us what we need in order to help you, which is frus…

---

<div class="post-metadata">

**Author:** ![anon56112670](https://avatars.discourse-cdn.com/v4/letter/a/c5a1d2/32.png) [@anon56112670](https://forum.arduino.cc/u/anon56112670)\
**Post date:** [March 10, 2023, 3:37pm UTC](https://forum.arduino.cc/t/gps-is-not-working/1100216/4 "2023-03-10T15:37:31Z")

</div>

Why are you using software serial on a board that has spare hardware serial ports?

---

<div class="post-metadata">

**Author:** ![akshaypowar](https://avatars.discourse-cdn.com/v4/letter/a/f475e1/32.png) [@akshaypowar](https://forum.arduino.cc/u/akshaypowar)\
**Post date:** [March 10, 2023, 3:44pm UTC](https://forum.arduino.cc/t/gps-is-not-working/1100216/5 "2023-03-10T15:44:12Z")

</div>

Then which port should I use?

---

<div class="post-metadata">

**Author:** ![anon56112670](https://avatars.discourse-cdn.com/v4/letter/a/c5a1d2/32.png) [@anon56112670](https://forum.arduino.cc/u/anon56112670)\
**Post date:** [March 10, 2023, 3:44pm UTC](https://forum.arduino.cc/t/gps-is-not-working/1100216/6 "2023-03-10T15:44:48Z")

</div>

Serial1, Serial2 or Serial3.

---

<div class="post-metadata">

**Author:** ![akshaypowar](https://avatars.discourse-cdn.com/v4/letter/a/f475e1/32.png) [@akshaypowar](https://forum.arduino.cc/u/akshaypowar)\
**Post date:** [March 10, 2023, 3:47pm UTC](https://forum.arduino.cc/t/gps-is-not-working/1100216/7 "2023-03-10T15:47:30Z")

</div>

So for same hardware connections my code should look like

void setup() {

Serial.begin(9600);  
Serial1.begin(9600);  
}

void loop() {

while (Serial1.available()){

Serial.write(Serial1.read());  
}  
}

Right

---

<div class="post-metadata">

**Author:** ![johnwasser](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/johnwasser/32/214270_2.png) [@johnwasser](https://forum.arduino.cc/u/johnwasser)\
**Post date:** [March 10, 2023, 8:48pm UTC](https://forum.arduino.cc/t/gps-is-not-working/1100216/8 "2023-03-10T20:48:18Z")

</div>

> [@akshaypowar](#):
>
> So for same hardware connections

No, you should connect your GPS to the Serial1 pins (45, 46) and not the Serial pins (0, 1).

---

<div class="post-metadata">

**Author:** ![akshaypowar](https://avatars.discourse-cdn.com/v4/letter/a/f475e1/32.png) [@akshaypowar](https://forum.arduino.cc/u/akshaypowar)\
**Post date:** [March 13, 2023, 7:24am UTC](https://forum.arduino.cc/t/gps-is-not-working/1100216/9 "2023-03-13T07:24:26Z")

</div>

Thank you John for suggestion but on my arduino mega  
19 18 are RX1 TX1,  
17 16 are RX2 TX2,  
15 14 are RX3 TX3,  
so I connected RX and TX of GPS module to TX1 and RX1 respectively. Then I got the readings on serial monitor.  
and I just used Serial1 instead of ss of Software Serial.

Final code looks like this.

```cpp
int GPSBaud = 9600;
void setup() {
  Serial.begin(9600);

  Serial1.begin(GPSBaud);
}

void loop() { 
  while(Serial1.available()){
    Serial.write(Serial1.read());
  }
}

```

---

<div class="post-metadata">

**Author:** ![akshaypowar](https://avatars.discourse-cdn.com/v4/letter/a/f475e1/32.png) [@akshaypowar](https://forum.arduino.cc/u/akshaypowar)\
**Post date:** [March 13, 2023, 7:25am UTC](https://forum.arduino.cc/t/gps-is-not-working/1100216/10 "2023-03-13T07:25:02Z")

</div>

Thank you

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [September 9, 2023, 7:25am UTC](https://forum.arduino.cc/t/gps-is-not-working/1100216/11 "2023-09-09T07:25:49Z")

</div>

Closed on September 9, 2023, 7:25am UTC

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