Arnov Sharma
Published © GPL3+

U-Blox NEO-6M GPS Module Tutorial

Simple tutorial for u-blox's NEO-6M GPS module to find your current latitude and longitude.

BeginnerProtip12 minutes3,762
U-Blox NEO-6M GPS Module Tutorial

Things used in this project

Hardware components

GPS receiver (generic)
×1
Arduino UNO & Genuino UNO
Arduino UNO & Genuino UNO
×1
UTSOURCE Electronic Parts
UTSOURCE Electronic Parts
everything above can be found here for a low price
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

neo_6m_arduino_K3Pd3ids7e.png

add the bt if you want to see your serial data over BT in your smartphone.

Code

code

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

static const int RXPin = 4, TXPin = 3;
static const uint32_t GPSBaud = 9600;

// The TinyGPS++ object
TinyGPSPlus gps;

// The serial connection to the GPS device
SoftwareSerial ss(RXPin, TXPin);

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

void loop(){
  // This sketch displays information every time a new sentence is correctly encoded.
  while (ss.available() > 0){
    gps.encode(ss.read());
    if (gps.location.isUpdated()){
      Serial.print("Latitude= "); 
      Serial.print(gps.location.lat(), 6);
      Serial.print(" Longitude= "); 
      Serial.println(gps.location.lng(), 6);
    }
  }
}

Credits

Arnov Sharma

Arnov Sharma

51 projects • 83 followers
Just your average MAKER

Comments