Interfacing GPS module with Arduino: GPS coordinates on Lcd

Interfacing GPS module with ArduinoToday’s tutorial is about the interfacing of GPS module with Arduino. We will learn what is GPS module? How it is used? How it is interfaced with Arduino to locate position? Today’s tutorial will comprise of following section:

  • Introduction to GPS
  • Components Required
  • Pin out of GPS module
  • Key Features
  • Wiring Connections
  • Note
  • Arduino Code
  • Applications

Introduction to GPS:

The Global Positioning System (GPS) is a satellite-based navigation system that consists of 24 orbiting satellites, each of which makes two circuits around the Earth every 24 hours. These satellites transmit three bits of information – the satellite’s number, its position in space, and the time the information is sent. These signals are picked up by the GPS receiver, which uses this information to calculate the distance between it and the GPS satellites. With signals from three or more satellites, a GPS receiver can triangulate its location on the ground (i.e., longitude and latitude) from the known position of the satellites. With four or more satellites, a GPS receiver can determine a 3D position (i.e., latitude, longitude, and elevation). In addition, a GPS receiver can provide data on your speed and direction of travel. Anyone with a GPS receiver can access the system. Because GPS provides real-time, three-dimensional positioning, navigation, and timing 24 hours a day, 7 days a week, all over the world, it is used in numerous applications, including GIS data collection, surveying, and mapping.

Let’s assume that the receiver determines that it is 20,000km from a particular satellite. This means that the receiver could be anywhere on an imaginary sphere with the satellite as its center. If it also determines that it is 25,000km from a second satellite this narrows its location down even further. The only location in space where it can be both 20,000km from the first satellite and 25,000km from the second is where these two spheres intersect. That intersection is a circle of points. A third measurement adds another sphere which intersects the circle formed by the first two. This intersection occurs at two points, and so, with these three measurements, the GPS receiver has narrowed down its location to just two points in the entire universe.

A fourth measurement will intersect exactly with one of the two points. In practice, however, you may not need this fourth measurement as one of the two points will normally be located thousands of kilometers out into space, and therefore is unlikely to be your position! However a fourth measurement is used to calculate altitude. It also ensures that the receiver’s clock is truly synchronized with universal time.

 Although this example demonstrates the use of four satellites, many receivers are capable of tracking more than four satellites at a time.  In some cases this improves the positional accuracy of the receiver.

Components Required

Following is the list of components required for this project.

  • GPS module
  • GPS Antenna
  • Arduino UNO
  • LCD 16 x 2
  • Breadboard
  • Potentiometer 10kohm
  • Connecting wires

Pin out of GPS module

GPS module has 4 pins provided out of module for connections.

  1. Tx Data Transmitting Pin
  2. Rx Data Receiving Pin
  3. Vcc 5V power Supply
  4. GND Power supply ground

Key Features:

  • Small form factor: 25.4 * 25.4 * 3 mm
  • RoHS/WEEE compliant
  • High sensitivity -159dBm
  • Searching up to 32 Channel of satellites
  • Fast Position Fix
  • Low power consumption
  • RTCM-in ready.
  • Built-in WAAS/EGNOS/MSAS Demodulator.
  • Support NMEA0183 V 3.01 data protocol.
  • Real time navigation for location based services.
  • For Car Navigation, Marine Navigation, Fleet Management, AVL and Location-Based Services, Auto Pilot, Personal Navigation or touring devices, Tracking devices/systems and Mapping devices application.

Interfacing GPS module with Arduino

GPS module interfacing with Arduino

Connect the circuit as follows

  • GPS GND to Arduino GND
  • GPS Vcc with Arduino 5V
  • GPS Rx with Arduino Tx
  • GPS Tx with Arduino Rx
  • LCD Rs with Arduino digital pin 4
  • LCD En with Arduino digital pin 5
  • LCD D4 with Arduino digital pin 6
  • LCD D5 with Arduino digital pin 7
  • LCD D6 with Arduino digital pin 8
  • LCD D7 with Arduino digital pin 9

These are the connection which will be used in program. For rest of the LCD connection see tutorial on LCD interfacing with Arduino.

  • Connect GPS Antenna with GPS module.

Note:

The problem with this connection is that, while programming Arduino uses serial ports to load program from the Arduino IDE. If these pins are used in wiring, the program will not be loaded successfully to Arduino. So you have to disconnect wiring in Rx and Tx each time you burn the program to Arduino. Once the program is loaded successfully, you can reconnect these pins and have the system working.

Video Interfacing GPS module with Arduino

Arduino Code of Interfacing GPS module with Arduino

// Creating a Simple GPS Receiver

#include <TinyGPS.h>

#include <LiquidCrystal.h>

LiquidCrystal lcd( 4, 5, 6, 7, 8, 9 );

// Create an instance of the TinyGPS object

TinyGPS gps;

void getgps(TinyGPS &gps);

void setup()

{

Serial.begin(4800);

lcd.begin(16, 2);

}

void getgps(TinyGPS &gps)

// The getgps function will display the required data on the LCD

{

float latitude, longitude;

//decode and display position data

gps.f_get_position(&latitude, &longitude);

lcd.setCursor(0,0);

lcd.print("Lat:");

lcd.print(latitude,5);

lcd.print(" ");

lcd.setCursor(0,1);

lcd.print("Long:");

lcd.print(longitude,5);

lcd.print(" ");

delay(3000); // wait for 3 seconds

lcd.clear();

}

void loop()

{

byte a;

if ( Serial.available() > 0 ) // if there is data coming into the serial line

{

a = Serial.read(); // get the byte of data

if(gps.encode(a)) // if there is valid GPS data...

{

getgps(gps); // grab the data and display it on the LCD

}

}

}

Result:

While programming Arduino uses serial ports to load program from the Arduino IDE. If these pins are used in wiring, the program will not be loaded successfully to Arduino. So you have to disconnect wiring in Rx and Tx each time you burn the program to Arduino. Once the program is loaded successfully, you can reconnect these pins and have the system working.

After successfully uploading the program the LCD shows the longitude and latitude of your current position. Write these positions in Google map search bar such that first is latitude and second is longitude separated by a comma and space. Now Google map will display your current position

Applications:

  • Automotive and Marine Navigation
  • Automotive Navigator Tracking
  • Emergency Locator
  • Geographic Surveying
  • Personal Positioning
  • Sporting and Recreation
  • Embedded applications: Smart phone, UMPC, PND, MP

4 thoughts on “Interfacing GPS module with Arduino: GPS coordinates on Lcd”

  1. I don’t want co ordinates on lcd and I m using Intel gallio and S1216F8 GPS module.Help me to achieve co ordinates on Serial monitor.Thank you in Advance.

    Reply

Leave a Comment