Go Down

Topic: GPS NEO6M-V2 not working  (Read 275 times) previous topic - next topic

Jalal711

hi everyone, recently i bought GPS neo6m-v2 and i use it with arduino uno to show "Lat,Long" and i used this code :
Code: [Select]
#include "TinyGPS++.h"
#include "SoftwareSerial.h"

SoftwareSerial serial_connection(10, 11); //RX=pin 10, TX=pin 11
TinyGPSPlus gps;//This is the GPS object that will pretty much do all the grunt work with the NMEA data
void setup()
{
  Serial.begin(9600);//This opens up communications to the Serial monitor in the Arduino IDE
  serial_connection.begin(9600);//This opens up communications to the GPS
  Serial.println("GPS Start");//Just show to the monitor that the sketch has started
}

void loop()
{
  while(serial_connection.available())//While there are characters to come from the GPS
  {
    gps.encode(serial_connection.read());//This feeds the serial NMEA data into the library one char at a time
  }
  if(gps.location.isUpdated())//This will pretty much be fired all the time anyway but will at least reduce it to only after a package of NMEA data comes in
  {
    //Get the latest info from the gps object which it derived from the data sent by the GPS unit
    Serial.println("Satellite Count:");
    Serial.println(gps.satellites.value());
    Serial.println("Latitude:");
    Serial.println(gps.location.lat(), 6);
    Serial.println("Longitude:");
    Serial.println(gps.location.lng(), 6);
    Serial.println("Speed MPH:");
    Serial.println(gps.speed.mph());
    Serial.println("Altitude Feet:");
    Serial.println(gps.altitude.feet());
    Serial.println("");
  }
}

i tested the gps outside the house and the blue led start blinking but in the serial Monitor give just GPS START, can you help me plz i bought 2 gps but the same not working

-dev

Read this for better alternatives to SoftwareSerial, connection advice, along with some other troubleshooting tips.  I suspect that the GPS is not connected correctly.

I would suggest connecting the GPS TX pin to the Arduino pin 8 so you can use AltSoftSerial.  It is available from the Arduino Library Manager, under the IDE menu Sketch -> Include Library -> Manage Libraries.

Do not connect anything to the GPS RX pin until you read the connection advice above.  The NEO-6M is a 3.3V device, and can be damaged by connecting a 5V Arduino transmit pin to the GPS RX pin.

The above pages are from my NeoGPS library.  It is smaller, faster, more accurate and more reliable than all other GPS libraries.  It is also available from the Library Manager..
Really, I used to be /dev.  :(

Jalal711

Thank you for your answer but the supplier of this gps send me a video using the same code and the same method and it connected and give latitude and longitude, !!!

jremington

#3
May 10, 2018, 12:26 am Last Edit: May 10, 2018, 12:28 am by jremington
Take the GPS/Arduino outside, for a clear view of the sky. You may have to wait up to 15 minutes for a "cold start" fix.

Go Up