0% found this document useful (0 votes)
18 views17 pages

Gps Tracker

The GPS Tracker Project details the design and implementation of a low-cost GPS tracking system using the Tiva C Series TM4C123 microcontroller, NEO-6M GPS module, and LCD display. It aims to provide real-time geographic coordinates for applications like navigation and asset tracking, showcasing embedded systems concepts such as serial communication and user interface design. The document includes components, code logic, challenges faced, and additional features like controlling LCD brightness and distance display.

Uploaded by

Kaushal Tiwari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views17 pages

Gps Tracker

The GPS Tracker Project details the design and implementation of a low-cost GPS tracking system using the Tiva C Series TM4C123 microcontroller, NEO-6M GPS module, and LCD display. It aims to provide real-time geographic coordinates for applications like navigation and asset tracking, showcasing embedded systems concepts such as serial communication and user interface design. The document includes components, code logic, challenges faced, and additional features like controlling LCD brightness and distance display.

Uploaded by

Kaushal Tiwari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

GPS TRACKER PROJECT

SUBMITTED TO
Dr. Ashraf Salem Dr. Bassem Amin Eng. Ayman Wagih Eng. Sarah Abdou
Contents
Contribution ..................................................................................................................................... 2
Table of bonus ................................................................................................................................... 2
Introduction: ..................................................................................................................................... 3
List of components: ........................................................................................................................... 4
• Tiva C Series TM4C123G Launchpad ........................................................................................ 4
• GPS Module (NEO-6M) ............................................................................................................ 4
• LCD 1602A ............................................................................................................................. 5
Block diagram of main components: .................................................................................................. 6
photos of the final project: ................................................................................................................. 7
List of additional features(bonus): ...................................................................................................... 8
• Controlling LCD brightness ...................................................................................................... 8
• Controlling LCD contrast ......................................................................................................... 8
• Buzzer .................................................................................................................................... 8
• Packaging ............................................................................................................................... 8
• Using embedded source .......................................................................................................... 8
• Code written following global conventions ................................................................................ 9
• The LCD driver ........................................................................................................................ 9
• GPS LED ................................................................................................................................. 9
• Displaying distance ................................................................................................................. 9
• Distance LED .......................................................................................................................... 9
Logic of code: ................................................................................................................................. 10
List of drivers (GitHub links) ............................................................................................................. 12
Obstacles and difficulties: ............................................................................................................... 13
Test benches: .................................................................................................................................. 15
video of the project: ......................................................................................................................... 15
GITHUB code: ................................................................................................................................. 15
Conclusion ..................................................................................................................................... 16
List of references ............................................................................................................................. 17

1|Page
Introduction:
This project presents the design and implementation of a GPS tracking system utilizing the
u-blox NEO-6M GPS module, the Tiva C Series TM4C123 microcontroller, and a 16x2
alphanumeric LCD. The primary goal is to develop a reliable, low-cost GPS tracker capable
of acquiring real-time geographic coordinates and displaying them directly to the user for
applications such as navigation, asset tracking, or location-aware systems.
The u-blox NEO-6M module receives satellite signals and provides position data in the form
of standard NMEA sentences. These are transmitted to the Tiva C microcontroller via UART,
where the data is parsed to extract key location information such as latitude and longitude.
This information is then displayed on a 16x2 LCD, which is interfaced with the
microcontroller through GPIO pins using 4-bit parallel communication. The LCD shows the
place on the first row and the distance on the second, allowing users to easily view their
current location in real time without the need for additional devices. This setup highlights
key embedded systems concepts such as serial communication, real-time data
processing, and user interface design, while delivering a portable, standalone GPS tracking
solution.

3|Page
List of components:
• Tiva C Series TM4C123G Launchpad
The Tiva C Series TM4C123G LaunchPad is a low-cost
development board from Texas Instruments, designed
for rapid prototyping and embedded systems
development. It is based on the ARM Cortex-M4F
microcontroller, which features a 32-bit RISC
architecture, a floating-point unit (FPU), and
operates up to 80 MHz. The board provides a rich set of
peripherals, making it ideal for a wide range of
embedded applications including robotics, automation, IoT, and control systems.
Key features of the TM4C123G microcontroller include:
• 256 KB Flash memory and 32 KB SRAM
• USB 2.0 interface, onboard debugger (ICDI)
• GPIO ports, UART, SPI, I2C, PWM, and ADC
• Timers and NVIC (Nested Vectored Interrupt Controller)
• Operates on 3.3V logic levels
The board is supported by TI’s Energia and Code Composer Studio (CCS) IDEs, providing
flexibility in programming using either C/C++ or simplified Arduino-like syntax. It also
includes two programmable push buttons and an RGB LED for testing and debugging
purposes.

• GPS Module (NEO-6M)


The NEO-6M GPS module is a compact and reliable satellite
navigation receiver used in embedded systems to determine
accurate geographical position, speed, and time. It operates
based on the Global Positioning System (GPS) and
communicates with microcontrollers via UART (serial
communication), typically outputting data in the NMEA
0183 standard format. The module features an onboard ceramic antenna and a backup

4|Page
battery for quick satellite acquisition. In this project, the NEO-6M was utilized to capture
real-time latitude and longitude data, which can be used for tracking and navigation.

• LCD 1602A
The LCD 1602A is a popular 16x2 alphanumeric
liquid crystal display used in embedded system
projects. It displays two lines of up to 16
characters, ideal for showing real-time data such
as sensor readings, menus, or status messages.
In this project, the LCD was interfaced using the
4-bit parallel communication mode, which
reduces the number of required data lines while
maintaining reliable performance.
LCD 1602A Pin Connections (4-bit Mode)
LCD Pin Name Description Microcontroller Pin
1 VSS Ground GND
2 VDD +5V Power Supply +5V
3 V0 Contrast Potentiometer center pin
4 RS Register Select PA5
5 RW Read/Write PA6
6 E Enable PA7
11 D4 Data Bit 4 Digital Pin D0
12 D5 Data Bit 5 Digital Pin D1
13 D6 Data Bit 6 Digital Pin D2
14 D7 Data Bit 7 Digital Pin D3
15 A (LED+) LED Backlight + +5V via 220ohm resistor
16 K (LED-) LED Backlight - GND

5|Page
Block diagram of main components:

6|Page
photos of the final project:

7|Page
List of additional features(bonus):
• Controlling LCD brightness
In this task, we use a potentiometer to vary the voltage
across the backlight LED terminals, thereby adjusting
the brightness of the entire LCD. The photo shows the
potentiometer used to make this adjustment.

• Controlling LCD contrast


In this task, we also use a potentiometer, where its
output is connected to pin 3 (VO) of the LCD to adjust
the contrast of the characters on the display. The photo
shows the potentiometer used for this adjustment.

• Buzzer
The buzzer’s task is to produce sound when the position
is changed, as will be demonstrated in the video.

• Packaging
In this task, we created a package for the project

• Using embedded source


In this task we included an embedded power source—a
power bank—since it has a USB port.

8|Page
• Code written following global conventions
In this project, we followed global coding conventions to organize our files and
directories. The drivers were separated into Inc and Src folders to distinguish between
interfaces and implementations. We used clear and consistent naming (e.g.,
snake_case) to enhance readability and maintainability. This structure aligns with
industry standards like HAL and CMSIS for embedded systems. And you can find that
at the GITHUB link.

• The LCD driver


We made the driver of LCD by our self and you can find it at the LCD driver at GITHUB
code

• GPS LED
We interfaced and wrote a code to a LED to turn on when
the GPS connects to the satellite, since this connection
does not occur immediately and typically takes about 3
minutes. Although the GPS module has a built-in LED, it
is not visible because the GPS chip is enclosed inside
the package. And its functionlty is shown in the video.

• Displaying distance
We do not only display the name of the nearest place but also the distance of that
place.as you can see in the video

• Distance LED
We interfaced and wrote a code to a LED to plink when
the distance is less than 30. And its functionlty is shown
in the video.

9|Page
Logic of code:
The project is structured according to global coding conventions, ensuring clarity and
modularity. The logic is separated into distinct driver modules, each placed under the
Drivers/Inc and Drivers/Src directories. For example, GPIO.c/h, UART.c/h, LCD.c/h, and
GPS_Module.c/h handle low-level hardware abstraction for digital I/O, serial
communication, display control, and GPS interfacing respectively. Utility functions for data
type conversion—such as float_to_string, string_to_float, and float_to_char_array—are
also implemented as separate modules to keep the code clean and reusable. The main
application logic resides in main.c, which integrates these drivers to execute the desired
functionality. This structure follows best practices like HAL/MCAL architecture, promoting
code scalability, portability, and ease of maintenance.
And this is a small breakdown to every file in the project:

Drivers
This directory contains modules that abstract and manage hardware peripherals, aligning
with the HAL layer. Each module typically includes a header (.h) and a source (.c) file,
organized into Inc/ and Src/ subdirectories, respectively.
• GPIO.c / GPIO.h
Purpose: Manage General-Purpose Input/Output (GPIO) pins.
Role: Provides functions to initialize and control digital I/O pins, such as toggling
LEDs or reading button states.
Position: HAL layer, facilitating interaction with the microcontroller's GPIO
hardware.
• GPS_Module.c / GPS_Module.h
Purpose: Interface with the GPS module to retrieve location data.
Role: Handles communication protocols (e.g., UART) to parse and process GPS
signals.
Position: HAL layer, abstracting the GPS hardware specifics.
• LCD.c / LCD.h
Purpose: Control the LCD display for outputting information.
Role: Implements functions to initialize the display, send characters, and manage

10 | P a g e
display settings.
Position: HAL layer, providing a standardized interface to the LCD hardware.
• UART.c / UART.h
Purpose: Manage Universal Asynchronous Receiver/Transmitter (UART)
communication.
Role: Facilitates serial communication, essential for modules like GPS.
Position: HAL layer, abstracting UART hardware details.
• floatToCharArray.c / floatToCharArray.h
Purpose: Convert floating-point numbers to character arrays.
Role: Assists in formatting numerical data for display or transmission.
Position: Utility layer, supporting data representation needs.
• floatToString.c / floatToString.h
Purpose: Convert floating-point numbers to strings.
Role: Similar to floatToCharArray, aids in preparing data for user interfaces or logs.
Position: Utility layer.
• strintofloat.c / strintofloat.h
Purpose: Convert strings to floating-point numbers.
Role: Parses numerical input received as strings, such as GPS data.
Position: Utility layer.
• systick.c / systick.h
Purpose: Configure and manage the system tick timer.
Role: Provides timing functions, delays, or periodic interrupts for task scheduling.
Position: HAL layer, interfacing with the microcontroller's system timer.

main.c
Purpose: Serve as the entry point of the application.
Role: Initializes hardware modules, enters the main loop, and orchestrates the
application's logic, such as reading GPS data and updating the LCD.
Position: Application layer, coordinating various HAL modules to achieve the desired
functionality.

11 | P a g e
tm4c123gh6pm.h
Purpose: Define the microcontroller's register addresses and bitfields.
Role: Provides low-level access to the TM4C123GH6PM microcontroller's hardware
features.
Position: MCAL layer, offering direct interaction with the microcontroller's core and
peripherals.

README.md
Purpose: Document the project's objectives, setup, and usage instructions.
Role: Offers an overview of the GPS tracking system, hardware requirements, and
implementation details.
Position: Documentation, essential for understanding and maintaining the project.

List of drivers (GitHub links)


GPIO Driver UART Driver stringToFloat
• GPIO.c • UART.c • stringToFloat.c
• GPIO.h • UART.h • stringToFloat.h
GPS Module Driver loatToCharArray SysTick Timer
• GPS_Module.c • floatToCharArray.c • systick.c
• GPS_Module.h • floatToCharArray.h • systick.h
LCD Driver floatToString
• LCD.c • floatToString.c
• LCD.h • floatToString.h

12 | P a g e
Obstacles and difficulties:
Challenges Faced During the Project
During the development of our embedded system project, which involved interfacing a Tiva
C TM4C123G LaunchPad with a NEO-6M GPS module and a 1602A LCD, we encountered
a number of technical challenges across both hardware and software stages. Below is a
detailed explanation of the main difficulties we faced and how they impacted our progress.
1. Understanding and Implementing the GPS Module
One of the primary challenges was working with the NEO-6M GPS module, especially in
terms of understanding the data it provides and integrating it correctly with the Tiva C
microcontroller. The module outputs data in NMEA 0183 format, which consists of long
comma-separated strings containing information such as latitude, longitude, time, satellite
status, etc.
Interpreting these NMEA strings in a meaningful way was initially confusing. We had to study
the structure of sentences like $GPGGA and $GPRMC to extract the correct fields. This
required writing custom code to parse the strings, remove unwanted characters, and
convert coordinate data from degrees and minutes format to decimal degrees, which
is more usable in distance calculations and map integration.
2. GPS Data Parsing and String Conversion
After receiving the raw NMEA data, we faced the problem of converting it from a plain text
string into usable numerical values. This involved handling string-to-float conversions,
dealing with invalid data (when GPS had not locked on to satellites), and filtering out
incomplete sentences.
Additionally, we needed to extract only the latitude and longitude from the correct
sentence and ignore others. This required accurate string manipulation and a solid
understanding of the GPS sentence structure, which was time-consuming to implement
and debug.
3. Calculating Distance Between Points
Another major challenge was figuring out how to calculate the distance between our
current location (as received from the GPS) and a predefined reference location. Since GPS
coordinates are based on Earth's curvature, simple linear equations don’t work. We had to
13 | P a g e
study and implement the Haversine formula, which calculates the great-circle distance
between two points on a sphere given their longitudes and latitudes.
This formula involves trigonometric functions, which needed to be carefully implemented
using the C math library while making sure the Tiva C’s floating-point unit (FPU) was
properly utilized. Debugging this part was tricky, especially when the distances calculated
seemed inaccurate at first due to incorrect conversions or wrong units (e.g., degrees vs
radians).
4. Hardware Wiring and Connections
On the hardware side, one of the challenges was making sure all components were
correctly connected to the Tiva C. The microcontroller operates on 3.3V logic, while the
GPS and LCD modules typically use 5V, which raised compatibility concerns. We had to
make sure that:
• GPS was powered with proper voltage,
• LCD was not damaged by logic level mismatch,
• All ground connections were properly shared.
Additionally, we had to manage limited GPIO pins while controlling multiple devices. Using
4-bit mode for the LCD helped reduce pin usage, but precise timing and control signals (RS,
EN, D4-D7) had to be handled carefully in software.
5. Integrating All Components Together
After getting each component (GPS and LCD) to work individually, another challenge was
combining them in a single integrated system. Timing conflicts, especially with UART
communication for GPS and LCD refresh rates, caused instability. We had to optimize our
main loop to avoid data corruption and ensure the LCD did not lag or display outdated
location information.
We also had to handle potential issues like GPS signal loss, slow updates, or delayed
response from the LCD, especially when debugging in outdoor environments with limited
satellite visibility.

14 | P a g e
Test benches:
To ensure the reliability and correctness of our hardware interfaces, we designed specific
test benches for both the GPS module and the LCD display. For the GPS module, we
developed a test bench that reads NMEA sentences through UART and displays the raw
data on a serial terminal. We also verified the parsing logic by extracting latitude and
longitude values and comparing them with a known fixed position. Additionally, we
introduced artificial delays and signal disruptions to test how the module handles GPS lock
loss and recovery. For the LCD display, we created a test bench that cycles through various
character outputs, cursor movements, and contrast adjustments using the potentiometer.
This allowed us to validate character rendering, proper line shifting, and brightness
variation of the backlight. These test procedures helped us identify and fix early integration
bugs and confirmed the robustness of our peripheral drivers before final deployment.

video of the project:


Link to the video

GITHUB code:
Link to the code

15 | P a g e
Conclusion
This project successfully demonstrated the integration of multiple embedded system
components to achieve a functional real-time location tracking system. By using the Tiva C
TM4C123G LaunchPad, the NEO-6M GPS module, and the 1602A LCD display, we were
able to receive live geographic coordinates and display them on screen in an
understandable format. Throughout the development process, we overcame a number of
technical challenges—ranging from hardware interfacing and voltage level mismatches to
complex string parsing and distance calculation using geographical formulas.
One of the key takeaways from this project was the importance of system integration.
While each component could function independently, combining them required careful
consideration of timing, data handling, and resource management. We also developed a
deeper understanding of UART communication, data parsing, and real-world testing
conditions, especially when dealing with GPS signal limitations.
Despite the obstacles faced, the project served as a solid foundation in embedded system
design, reinforcing our knowledge of microcontroller programming, sensor interfacing, and
user interface implementation. The skills and problem-solving strategies gained during this
project will be invaluable for future embedded and IoT projects.
Looking ahead, this system can be expanded with additional features such as SD card
logging, mobile connectivity, or a graphical display for maps and routes. The experience
gained here positions us well to take on more complex and feature-rich embedded
solutions.

16 | P a g e
List of references
1. Texas Instruments. Tiva™ C Series TM4C123GH6PM Microcontroller Data Sheet.
This datasheet provides detailed specifications and features of the TM4C123GH6PM microcontroller
used in the Tiva C LaunchPad.
https://www.ti.com/lit/ds/symlink/tm4c123gh6pm.pdf

2. Texas Instruments. Tiva™ C Series TM4C123G LaunchPad Evaluation Kit User's Manual.
This manual offers insights into the evaluation kit's hardware design, pin configurations, and usage
guidelines.
https://www.ti.com/lit/pdf/spmu296

3. u-blox. NEO-6 Data Sheet (GPS.G6-HW-09005).


This document details the specifications, features, and application information for the NEO-6 series
GPS modules.
https://content.u-blox.com/sites/default/files/products/documents/NEO-6_DataSheet_%28GPS.G6-
HW-09005%29.pdf

4. OpenHacks. Specification for LCD Module 1602A-1 (V1.2).


This specification sheet provides technical details, pin configurations, and operational guidelines for
the 1602A LCD module.
https://www.openhacks.com/uploadsproductos/eone-1602a1.pdf

5. Wikipedia. NMEA 0183.


An overview of the NMEA 0183 protocol, detailing its structure, sentence formats, and usage in GPS
communication.
https://en.wikipedia.org/wiki/NMEA_0183

6. Wikipedia. Haversine Formula.


A mathematical explanation of the Haversine formula used to calculate the great-circle distance
between two points on a sphere.
https://en.wikipedia.org/wiki/Haversine_formula

7. Movable Type Scripts. Calculate distance and bearing between two Latitude/Longitude points.
An interactive tool and explanation for calculating distances and bearings between geographic
coordinates using the Haversine formula.
https://www.movable-type.co.uk/scripts/latlong.html

8. Esri Community. Distance on a sphere: The Haversine Formula.


A blog post discussing the application of the Haversine formula in geographic information systems
(GIS).
https://community.esri.com/t5/coordinate-reference-systems-blog/distance-on-a-sphere-the-
haversine-formula/ba-p/902128

17 | P a g e

You might also like