Connecting GPS Module

Hi there,

Please see photos.

I connected the GPS module to Arduino via female wires.

TX -- RX
RX -- TX

  • -- gnd
  • -- 3.3V

This is my code:

#include <TinyGPS++.h>
#include <SoftwareSerial.h>

static const int RXPin = 0, TXPin = 1;
static const uint32_t GPSBaud = 4800;

TinyGPSPlus gps;

SoftwareSerial ss(RXPin, TXPin);

double x;
double y;

void setup()
{
  Serial.begin(115200);
  ss.begin(GPSBaud);

  Serial.println(F("ASH"));

}

void loop()
{
  while (ss.available() > 0)
    if (gps.encode(ss.read()))
      displayInfo();

  if (millis() > 5000 && gps.charsProcessed() < 10)
  {
    Serial.println(F("No GPS detected: check wiring."));
    while(true);
  }
}

void displayInfo()
{
  Serial.print(F("Location: ")); 
  if (gps.location.isValid())
  {
    Serial.print(gps.location.lat(), 6);
    Serial.print(F(","));
    Serial.print(gps.location.lng(), 6);
    delay(100); // after testing please set the delay as 5000.
    
    x = (gps.location.lat());
    y = (gps.location.lng());
    
    Serial.println();
    Serial.print("X");
    Serial.println(x);
    Serial.print("Y");
    Serial.println(y); 
  }
  else
  {
    Serial.print(F("INVALID"));
  }
   Serial.println();
}

When I upload this it says:
ASH
No GPS Detected: Check wiring

How can I fix this? Do I need to solder it? Can someone help me?

GPS:

Data sheet:
http://www.u-blox.com/images/downloads/Product_Docs/NEO-6_DataSheet_(GPS.G6-HW-09005).pdf

Pins 0 and 1 are for programming, and Serial.print to the monitor. Use other pins for software serial.

Your code says it is using pins 0 and 1 but you have wired up the Tx/Rx on pins 2 and 3 (or perhaps 3 and 4 - it is hard to see for sure).
Edit this line and change it to the correct pin numbers:

static const int RXPin = 0, TXPin = 1;

Pete

Hi there Pete!

Thank you for helping me. Sorry, I was testing something, including changing code and ports, so thats not the problem, i changed it back to 3 and 4 (in the code and the ports), but still not working :frowning:

Instead of using TinyGPS to start with, why not just read what is coming in on SoftwareSerial and relay it to SerialMonitor? And if you don't get anything, try swapping Rx/Tx over. Once you have that working you can use TinyGPS to decode your incoming data.

Can you help me with that? How can I check the GPS is working in the first place?

The link in my signature will show you a sketch called SerialRelay to do just that. I'm sure you can modify it to use the same pins that you are.

Until you get some output from the GPS there's no point trying to parse it.

Are you familiar with the NMEA string format? If not, you might want to do some research.

Hi there,
First of all, thank you so much for helping me!

I didn;t receive anything. I changed the pin to 4,3 and swapped those arround, but when I type AT at baud rate 192000 nothing is happening. Is it a better option to solder the wires of the GPS directly under the arduino?

Try this (alter the software serial pins to suit your connection...)

#include <SoftwareSerial.h>

SoftwareSerial gpsSerial(9,12); //RX,TX

int sleepPin = 8;

void setup()
{
  pinMode(sleepPin, OUTPUT);
  digitalWrite(sleepPin, HIGH);
  
  Serial.begin(115200);
  gpsSerial.begin(4800);
  gpsSerial.listen();
}

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

My GPS unit has a sleep facility which is the reason for the references to the sleep pin.

You shouldn't need to solder the pins to the Arduino.

Do I need to leave the 8 (sleepPin) unchanged?

Unless I need to change that one, it doesn;t work. I've also stripped a bit of the wire from gps to female but nothing pops up in the serial monitor

Unless you are using pin 8 then leave it untouched.

I'm assuming that the power light and the status lights on the GPS are lit?

There are no lights on the GPS?

There are two on the module you gave the datasheets for. A power light and a status light. And the device you have looks very much like the one in the datasheets.

You have put a solder bridge on the voltage select jumper?