How to Interface NEO-6M GPS Module with Arduino UNO

3,049 views

Introduction

You often heard about GPS tracking. If not in real life then you must have seen in the movies how intelligence agencies use a system to search for a villain. Certainly, Global Positioning System (GPS) is a satellite-based system that uses the satellite to estimate the position, understand the navigation, enable the tracking, stimulate the mapping, and measure the precise time. In short, the system is used to track or trace the position through the device called the GPS module.

Generally, the module is used in smartphones, compact wearable devices, etc. The different kinds of modules are available in the market. Hence, in this tutorial, we are going to interface ” NEO-6M GPS Module with Arduino UNO”

Specifications About NEO-6M

  • The NEO-6M GSM module works on a voltage range from 3 to 5 volts.
  • The module has a baud rate of 9600bps.
  • When it get interfaced, it shows the NMEA sentences to comprehend the data
  • The module has a built-in EEPROM
NEO-6M_NEO6MV2_GPS_Module

Hardware Required

S.noComponentValueQty
1.ArduinoUNO1
2.USB Cable Type A to B1
3.Jumper Wires1
4.GPS ModuleNEO-6M1

Circuit Diagram

Interface-NEO-6M-GPS-Arduino-UNO-Circuit

Connection Table

ArduinoNEO-6M GPS Module
GNDGND
D3RX
D4TX
5VVCC

Arduino Code


// Circuits DIY
// For Complete Details Visit -> https://circuits-diy.com
#include <SoftwareSerial.h>

// The serial connection to the GPS module
SoftwareSerial ss(4, 3);

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

void loop(){
  while (ss.available() > 0){
    // get the byte data from the GPS
    byte gpsData = ss.read();
    Serial.write(gpsData);
  }
}

Working Explanation

Connect the NEO-6M GPS Module with Arduino UNO according to the diagram given above. Further, copy the above code and paste it into your Arduino IDE. Now, open the Serial Monitor. You will find plenty of data on it. Some data or lines on the monitor are the National Marine Electronics Association (NMEA) sentences. These NMEA sentences start with the dollar ($) sign. To understand the NMEA sentences, let’s take an example,

$GPGGA 190118.00, 41XX.XXXXX, N, 00831.54550, W, 1, 08, 0.95, 122.6, M, 50.1, M, *4C

  • 19018.00 shows the time that at 19:01:18 the location was taken
  • 41XX.XXXXX, N, shows the latitude
  • 00831.54550, W indicates the longitude
  • 1 shows the quality. Since GPS has different qualities defined by numbers from 0 to 8
  • 08 implies the number of satellites
  • 122.6, M is an altitude above sea level
  • 50.1, M is the height of geoid
  • *4C shows the checksum information

Code Explanation

  • First, we have included the serial.h library to communicate the serial pins of the receiver and transmitter of an Arduino. Hence, the serial connections are at pin 3 and 4
  • In the void setup, we have initialized the Serial monitor
  • In the void loop, we have defined the while loop to sense the data coming from the serial port. And, to send the data to the Serial monitor when it gets received.

Application and Uses

The applications of the GSM module are in

  • Portable wearable devices
  • Smartphones
  • Computing devices, etc