1.1 Introduction To Embedded Systems:: Vechicle Tracking On Google Maps Using Arduino, Esp8266 & Gps

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 60

VECHICLE TRACKING ON GOOGLE MAPS USING ARDUINO,ESP8266 & GPS

CHAPTER 1

INTRODUCTION

1.1 INTRODUCTION TO EMBEDDED SYSTEMS:

An embedded system is a system which is going to do a predefined specified task is


the embedded system and is even defined as combination of both software and hardware. A
general-purpose definition of embedded systems is that they are devices used to control,
monitor or assist the operation of equipment, machinery or plant. "Embedded" reflects the fact
that they are an integral part of the system. At the other extreme a general-purpose computer
may be used to control the operation of a large complex processing plant, and its presence will
be obvious.

All embedded systems are including computers or microprocessors. Some of these


computers are however very simple systems as compared with a personal computer.
The very simplest embedded systems are capable of performing only a single function or set
of functions to meet a single predetermined purpose. In more complex systems an application
program that enables the embedded system to be used for a particular purpose in a specific
application determines the functioning of the embedded system. The ability to have programs
means that the same embedded system can be used for a variety of different purposes. In some
cases a microprocessor may be designed in such a way that application software for a
particular purpose can be added to the basic software in a second process, after which it is not
possible to make further changes. The applications software on such processors is sometimes
referred to as firmware.
The simplest devices consist of a single microprocessor (often called a "chip”), which
may itself be packaged with other chips in a hybrid system or Application Specific Integrated
Circuit (ASIC). Its input comes from a detector or sensor and its output goes to a switch or
activator which (for example) may start or stop the operation of a machine or, by operating a
valve, may control the flow of fuel to an engine.

DEPT. OF ECE,LITS 1
VECHICLE TRACKING ON GOOGLE MAPS USING ARDUINO,ESP8266 & GPS

As the embedded system is the combination of both software and hardware Software
deals with the languages like ALP, C, and VB etc., and Hardware deals with Processors,
Peripherals, and Memory

Embedded

System

Software Hardware

o ALP o Processor
o C o Peripherals
o VB o memory
Etc.,

Fig1: Block diagram of Embedded System.

Memory: It is used to store data or address.


Peripherals: These are the external devices connected
Processor: It is an IC which is used to perform some task
Applications of embedded systems
 Manufacturing and process control
 Construction industry
 Transport
 Buildings and premises
 Domestic service
 Communications
 Office systems and mobile equipment
 Banking, finance and commercial
 Medical diagnostics, monitoring and life support
 Testing, monitoring and diagnostic systems

DEPT. OF ECE,LITS 2
VECHICLE TRACKING ON GOOGLE MAPS USING ARDUINO,ESP8266 & GPS

Processors are classified into four types like:


 Micro Processor (µp)
 Micro controller (µc)
 Digital Signal Processor (DSP)
 Application Specific Integrated Circuits (ASIC)
Micro Processor (µp):
A silicon chip that contains a CPU. In the world of personal computers, the terms
microprocessor and CPU are used interchangeably. At the heart of all personal computers and
most workstations sits a microprocessor. Microprocessors also control the logic of almost all
digital devices, from clock radios to fuel-injection systems for automobiles.

Three basic characteristics differentiate microprocessors:

 Instruction set: The set of instructions that the microprocessor can execute.
 Bandwidth : The number of bits processed in a single instruction.
 Clock speed : Given in megahertz (MHz), the clock speed determines how many
instructions per second the processor can execute.
In both cases, the higher the value, the more powerful the CPU. For example, a 32-bit
microprocessor that runs at 50MHz is more powerful than a 16-bit microprocessor that runs at
25MHz. In addition to bandwidth and clock speed, microprocessors are classified as being
either RISC (reduced instruction set computer) or CISC (complex instruction set computer).

A microprocessor has three basic elements, as shown above. The ALU performs all
arithmetic computations, such as addition, subtraction and logic operations (AND, OR, etc). It
is controlled by the Control Unit and receives its data from the Register Array. The Register
Array is a set of registers used for storing data. These registers can be accessed by the ALU
very quickly. Some registers have specific functions - we will deal with these later. The
Control Unit controls the entire process. It provides the timing and a control signal for getting
data into and out of the registers and the ALU and it synchronizes the execution of
instructions (we will deal with instruction execution at a later date).

DEPT. OF ECE,LITS 3
VECHICLE TRACKING ON GOOGLE MAPS USING ARDUINO,ESP8266 & GPS

Fig2: Basic Elements of a Microprocessor

Micro Controller (µc):


A microcontroller is a small computer on a single integrated circuit containing a processor
core, memory, and programmable input/output peripherals. Program memory in the form of
NOR flash or OTP ROM is also often included on chip, as well as a typically small amount
of RAM. Microcontrollers are designed for embedded applications, in contrast to the
microprocessors used in personal computers or other general purpose applications.

ALU

CU

Memory

Timer, Counter, serial


communication ROM,
ADC, DAC, Timers,
Fig3: Block Diagram of Micro
USART, Oscillators Controller (µc)
Digital Signal Processors (DSPs): Etc.,
Digital Signal Processors is one which performs scientific and mathematical operation. Digital
Signal Processor chips - specialized microprocessors with architectures designed specifically
for the types of operations required in digital signal processing. Like a general-purpose
microprocessor, a DSP is a programmable device, with its own native instruction code. DSP
chips are capable of carrying out millions of floating point operations per second, and like

DEPT. OF ECE,LITS 4
VECHICLE TRACKING ON GOOGLE MAPS USING ARDUINO,ESP8266 & GPS

their better-known general-purpose cousins, faster and more powerful versions are continually
being introduced. DSPs can also be embedded within complex "system-on-chip" devices,
often containing both analog and digital circuitry.
Application Specific Integrated Circuit (ASIC)
ASIC is a combination of digital and analog circuits packed into an IC to achieve the
desired control/computation function

ASIC typically contains

 CPU cores for computation and control


 Peripherals to control timing critical functions
 Memories to store data and program
 Analog circuits to provide clocks and interface to the real world which is
analog in nature
 I/Os to connect to external components like LEDs, memories, monitors etc.
Computer Instruction Set

There are two different types of computer instruction set there are:

1. RISC (Reduced Instruction Set Computer) and

2. CISC (Complex Instruction Set computer)

Reduced Instruction Set Computer (RISC)

A RISC (reduced instruction set computer) is a microprocessor that is designed to


perform a smaller number of types of computer instruction so that it can operate at a higher
speed (perform more million instructions per second, or millions of instructions per second).
Since each instruction type that a computer must perform requires additional transistors and
circuitry, a larger list or set of computer instructions tends to make the microprocessor more
complicated and slower in operation.

Besides performance improvement, some advantages of RISC and related design


improvements are:

DEPT. OF ECE,LITS 5
VECHICLE TRACKING ON GOOGLE MAPS USING ARDUINO,ESP8266 & GPS

 A new microprocessor can be developed and tested more quickly if one of its aims is
to be less complicated.
 Operating system and application programmers who use the microprocessor's
instructions will find it easier to develop code with a smaller instruction set.
 The simplicity of RISC allows more freedom to choose how to use the space on a
microprocessor.
Higher-level language compilers produce more efficient code than formerly because
they have always tended to use the smaller set of instructions to be found in a RISC computer.
RISC characteristics

 Simple instruction set:


In a RISC machine, the instruction set contains simple, basic instructions, from which
more complex instructions can be composed.
 Same length instructions:
Each instruction is the same length, so that it may be fetched in a single operation.
 machine-cycle instructions :
Most instructions complete in one machine cycle, which allows the processor to handle
several instructions at the same time. This pipelining is a key technique used to speed up RISC
machines.
Complex Instruction Set Computer (CISC)

CISC, which stands for Complex Instruction Set Computer, is a philosophy for
designing chips that are easy to program and which make efficient use of memory. Each
instruction in a CISC instruction set might perform a series of operations inside the processor.
This reduces the number of instructions required to implement a given program, and allows
the programmer to learn a small but flexible set of instructions.

The advantages of CISC:

At the time of their initial development, CISC machines used available technologies to
optimize computer performance.

 Microprogramming is as easy as assembly language to implement, and much less


expensive than hardwiring a control unit.

DEPT. OF ECE,LITS 6
VECHICLE TRACKING ON GOOGLE MAPS USING ARDUINO,ESP8266 & GPS

 The ease of micro-coding new instructions allowed designers to make CISC machines
upwardly compatible: a new computer could run the same programs as earlier computers
because the new computer would contain a superset of the instructions of the earlier
computers.
 As each instruction became more capable, fewer instructions could be used to
implement a given task. This made more efficient use of the relatively slow main memory.
 Because micro program instruction sets can be written to match the constructs of high-
level languages, the compiler does not have to be as complicated.
The disadvantages of CISC:

Still, designers soon realized that the CISC philosophy had its own problems,
including:

 Earlier generations of a processor family generally were contained as a subset in every


new version --- so instruction set & chip hardware become more complex with each
generation of computers.
 So that as many instructions as possible could be stored in memory with the least
possible wasted space, individual instructions could be of almost any length---this means that
different instructions will take different amounts of clock time to execute, slowing down the
overall performance of the machine.
 Many specialized instructions aren't used frequently enough to justify their existence --
- approximately 20% of the available instructions are used in a typical program.
 CISC instructions typically set the condition codes as a side effect of the instruction.
Not only does setting the condition codes take time, but programmers have to remember to
examine the condition code bits before a subsequent instruction changes them.
Memory Architecture

There two different type’s memory architectures there are:

 Harvard Architecture
 Von-Neumann Architecture

DEPT. OF ECE,LITS 7
VECHICLE TRACKING ON GOOGLE MAPS USING ARDUINO,ESP8266 & GPS

Harvard Architecture

Computers have separate memory areas for program instructions and data. There are
two or more internal data buses, which allow simultaneous access to both instructions and
data. The CPU fetches program instructions on the program memory bus.

The Harvard architecture is a computer architecture with physically separate storage


and signal pathways for instructions and data. The term originated from the Harvard Mark I
relay-based computer, which stored instructions on punched tape (24 bits wide) and data in
electro-mechanical counters. These early machines had limited data storage, entirely
contained within the central processing unit, and provided no access to the instruction storage
as data. Programs needed to be loaded by an operator, the processor could not boot itself.

Modern uses of the Harvard architecture:

The principal advantage of the pure Harvard architecture - simultaneous access to


more than one memory system - has been reduced by modified Harvard processors using
modern CPU cache systems. Relatively pure Harvard architecture machines are used mostly in
applications where tradeoffs, such as the cost and power savings from omitting caches,
outweigh the programming penalties from having distinct code and data address spaces.
 Digital signal processors (DSPs) generally execute small, highly-optimized audio or
video processing algorithms. They avoid caches because their behavior must be extremely
reproducible. The difficulties of coping with multiple address spaces are of secondary concern
to speed of execution. As a result, some DSPs have multiple data memories in distinct address
spaces to facilitate SIMD and VLIW processing. Texas Instruments TMS320 C55x
processors, as one example, have multiple parallel data busses (two write, three read) and one
instruction bus.
 Microcontrollers are characterized by having small amounts of program (flash
memory) and data (SRAM) memory, with no cache, and take advantage of the Harvard
architecture to speed processing by concurrent instruction and data access. The separate
storage means the program and data memories can have different bit depths, for example
using 16-bit wide instructions and 8-bit wide data. They also mean that instruction pre-fetch
can be performed in parallel with other activities. Examples include, the AVR by Atmel Corp,

DEPT. OF ECE,LITS 8
VECHICLE TRACKING ON GOOGLE MAPS USING ARDUINO,ESP8266 & GPS

the PIC by Microchip Technology, Inc. and the ARM Cortex-M3 processor (not all ARM
chips have Harvard architecture).
Even in these cases, it is common to have special instructions to access program memory as
data for read-only tables, or for reprogramming.
Von-Neumann Architecture

A computer has a single, common memory space in which both program instructions
and data are stored. There is a single internal data bus that fetches both instructions and data.
They cannot be performed at the same time

The von Neumann architecture is a design model for a stored-program digital


computer that uses a central processing unit (CPU) and a single separate storage structure
("memory") to hold both instructions and data. It is named after the mathematician and early
computer scientist John von Neumann.

The terms "von Neumann architecture" and "stored-program computer" are generally used
interchangeably, and that usage is followed in this article.

Fig4: Schematic of the Von-Neumann Architecture.

Basic Difference between Harvard and Von-Neumann Architecture

 The primary difference between Harvard architecture and the Von Neumann
architecture is in the Von Neumann architecture data and programs are stored in the same
memory and managed by the same information handling system.
 Whereas the Harvard architecture stores data and programs in separate memory
devices and they are handled by different subsystems.

DEPT. OF ECE,LITS 9
VECHICLE TRACKING ON GOOGLE MAPS USING ARDUINO,ESP8266 & GPS

 In a computer using the Von-Neumann architecture without cache; the central


processing unit (CPU) can either be reading and instruction or writing/reading data to/from the
memory. Both of these operations cannot occur simultaneously as the data and instructions
use the same system bus.
 In a computer using the Harvard architecture the CPU can both read an instruction and
access data memory at the same time without cache. This means that a computer with Harvard
architecture can potentially be faster for a given circuit complexity because data access and
instruction fetches do not contend for use of a single memory pathway.
 Today, the vast majority of computers are designed and built using the Von Neumann
architecture template primarily because of the dynamic capabilities and efficiencies gained in
designing, implementing, operating one memory system as opposed to two. Von Neumann
architecture may be somewhat slower than the contrasting Harvard Architecture for certain
specific tasks, but it is much more flexible and allows for many concepts unavailable to
Harvard architecture such as self programming, word processing and so on.
 Harvard architectures are typically only used in either specialized systems or for very
specific uses. It is used in specialized digital signal processing (DSP), typically for video and
audio processing products. It is also used in many small microcontrollers used in electronics
applications such as Advanced RISK Machine (ARM).

1.2 INTRODUCTION TO THE PROJECT:

A vehicle tracking system combines the use of automatic vehicle location in individual
vehicles with software that collects these fleet data for a comprehensive picture of vehicle
locations. Modern vehicle tracking systems commonly use GPS or GLONASS technology for
locating the vehicle, but other types of automatic vehicle location technology can also be used.
Vehicle information can be viewed on electronic maps via the Internet or specialized software.
Urban public transit authorities are an increasingly common user of vehicle tracking systems,
particularly in large cities.

Several types of vehicle tracking devices exist. Typically they are classified as "passive"
and "active". "Passive" devices store GPS location, speed, heading and sometimes a trigger
event such as key on/off, door open/closed. Once the vehicle returns to a predetermined point,

DEPT. OF ECE,LITS 10
VECHICLE TRACKING ON GOOGLE MAPS USING ARDUINO,ESP8266 & GPS

the device is removed and the data downloaded to a computer for evaluation. Passive systems
include auto download type that transfer data via wireless download. "Active" devices also
collect the same information but usually transmit the data in near-real-time
via cellular or satellite networks to a computer or data center for evaluation.

Many modern vehicle tracking devices combine both active and passive tracking abilities:
when a cellular network is available and a tracking device is connected it transmits data to a
server; when a network is not available the device stores data in internal memory and will
transmit stored data to the server later when the network becomes available again.

Historically, vehicle tracking has been accomplished by installing a box into the
vehicle, either self-powered with a battery or wired into the vehicle's power system. For
detailed vehicle locating and tracking this is still the predominant method; however, many
companies are increasingly interested in the emerging cell phone technologies that provide
tracking of multiple entities, such as both a salesperson and their vehicle. These systems also
offer tracking of calls, texts, web use and generally provide a wider range of options.

Major constituents of the GPS-based tracking are:

1. GPS tracking: The device fits into the vehicle and captures the GPS location
information apart from other vehicle information at regular intervals to a central
server. Other vehicle information can include fuel amount, engine temperature,
altitude, reverse geocoding, door open/close, tire pressure, cut off fuel, turn off
ignition, turn on headlight, turn on taillight, battery status, GSM area code/cell code
decoded, number of GPS satellites in view, glass open/close, fuel amount, emergency
button status, cumulative idling, computed odometer, engine RPM, throttle position,
GPRS status and a lot more. Capability of these devices actually decide the final
capability of the whole tracking system; most vehicle tracking systems, in addition to
providing the vehicle's location data, feature a wide range of communication ports that
can be used to integrate other on board systems, allowing to check their status and
control or automate their operation.
2. GPS tracking server: The tracking server has three responsibilities: receiving data from
the GPS tracking unit, securely storing it, and serving this information on demand to
the user.

DEPT. OF ECE,LITS 11
VECHICLE TRACKING ON GOOGLE MAPS USING ARDUINO,ESP8266 & GPS

3. User interface: The UI determines how one will be able to access information, view
vehicle data, and elicit important details from it.
Vehicle tracking systems are commonly used by fleet operators for fleet
management functions such as fleet tracking, routing, dispatching, on-board information and
security. Along with commercial fleet operators, urban transit agencies use the technology for
a number of purposes, including monitoring schedule adherence of buses in service, triggering
automatic changes of buses' destination sign displays once the vehicle approaches the bus
terminus (or other set location along a bus route such as a particular bus stop along the route),
and triggering pre-recorded (or even synthetic speech) bus stop, route (and its destination) or
service announcements for passengers.

The American Public Transportation Association estimated that, at the beginning of


2009, around half of all transit buses in the United States were already using a GPS-based
vehicle tracking system to trigger automated stop announcements. This can refer to external
announcements (triggered by the opening of the bus's door) at a bus stop, announcing the
vehicle's route number and destination, primarily for the benefit of visually
impaired customers, or to internal announcements (to passengers already on board) identifying
the next stop, as the bus (or tram) approaches a stop, or both; the latter are often also displayed
on an internal LED display or LCD monitor connected to the system while the loudspeakers
play them. Data collected as a transit vehicle follows its route is often continuously fed into a
computer program which compares the vehicle's actual location and time with its schedule,
and in turn produces a frequently updating display for the driver, telling him/her how early or
late he/she is at any given time, potentially making it easier to adhere more closely to the
published schedule.

Such programs are also used to provide customers with real-time information as to the
waiting time until arrival of the next bus or tram/streetcar at a given stop, based on the nearest
vehicles' actual progress at the time, rather than merely giving information as to
the scheduled time of the next arrival. Transit systems providing this kind of information
assign a unique number to each stop, and waiting passengers can obtain information by
entering the stop number into an automated telephone system or an application on the transit
system's website. Some transit agencies provide a virtual map on their website, with icons

DEPT. OF ECE,LITS 12
VECHICLE TRACKING ON GOOGLE MAPS USING ARDUINO,ESP8266 & GPS

depicting the current locations of buses in service on each route, for customers'
information, while others provide such information only to dispatchers or other employees.

With the GPS technology being enhanced day by day, companies are coming up with
devices that are compatible with phones and other modern gadgets. These devices provide live
time activity of the fleet on personal devices without even logging onto their website as well.
Keeping a track of fleet commander's actionable data, improving efficiency, reducing fuel cost
etc. also come under fleet tracking. These devices and software help in cost cutting.[5]

Other applications include monitoring driving behavior, such as an employer of an employee,


or a parent with a teen driver.

Vehicle tracking systems are also popular in consumer vehicles as a theft prevention,
monitoring and retrieval device. Police can simply follow the signal emitted by the tracking
system and locate the stolen vehicle. When used as a security system, a Vehicle Tracking
System may serve as either an addition to or replacement for a traditional car alarm. Some
vehicle tracking systems make it possible to control vehicle remotely, including block doors
or engine in case of emergency. The existence of vehicle tracking device then can be used to
reduce the insurance cost, because the loss-risk of the vehicle drops significantly.

Vehicle tracking systems are an integrated part of the "layered approach" to vehicle
protection, recommended by the National Insurance Crime Bureau (NICB) to prevent motor
vehicle theft. This approach recommends four layers of security based on the risk factors
pertaining to a specific vehicle. Vehicle Tracking Systems are one such layer, and are
described by the NICB as “very effective” in helping police recover stolen vehicles.

Some vehicle tracking systems integrate several security systems, for example by sending an
automatic alert to a phone or email if an alarm is triggered or the vehicle is moved without
authorization, or when it leaves or enters a geofence.

Other scenarios in which this technology is employed include:

 Stolen vehicle recovery: Both consumer and commercial vehicles can be outfitted with RF
or GPS units to allow police to do tracking and recovery. In the case of LoJack, the police
can activate the tracking unit in the vehicle directly and follow tracking signals.

DEPT. OF ECE,LITS 13
VECHICLE TRACKING ON GOOGLE MAPS USING ARDUINO,ESP8266 & GPS

 Fleet management: When managing a fleet of vehicles, knowing the real-time location of
all drivers allows management to meet customer needs more efficiently. Whether it is
delivery, service or other multi-vehicle enterprises, drivers now only need a mobile phone
with telephony or Internet connection to be inexpensively tracked by and dispatched
efficiently.
 Asset tracking: Companies needing to track valuable assets for insurance or other
monitoring purposes can now plot the real-time asset location on a map and closely
monitor movement and operating status.
 Field service management: Companies with a field service workforce for services such as
repair or maintenance, must be able to plan field workers’ time, schedule subsequent
customer visits and be able to operate these departments efficiently. Vehicle tracking
allows companies to quickly locate a field engineer and dispatch the closest one to meet a
new customer request or provide site arrival information.
 Field sales: Mobile sales professionals can access real-time locations. For example, in
unfamiliar areas, they can locate themselves as well as customers and prospects, get
driving directions and add nearby last-minute appointments to itineraries. Benefits include
increased productivity, reduced driving time and increased time spent with customers and
prospects.
 Trailer tracking: Haulage and Logistics companies often operate lorries with detachable
load carrying units. The part of the vehicle that drives the load is known as the cab and the
load carrying unit is known as the trailer. There are different types of trailer used for
different applications, e.g., flat bed, refrigerated, curtain sider, box container.
 Surveillance: A tracker may be placed on a vehicle to follow the vehicle's movements.
 Transit tracking: temporary tracking of assets or cargoes from one point to another. Users
will ensure that the assets do not stop on route or do a U-Turn in order to ensure the
security of the assets.
 Fuel Monitoring: monitor the fuel through tracking device (with help of fuel sensor
connected to the device).
 Distance Calculation: calculate the distance traveled by the fleet.
 OBD II - Plug and play interface which provides most of engine diagnostics information.

DEPT. OF ECE,LITS 14
VECHICLE TRACKING ON GOOGLE MAPS USING ARDUINO,ESP8266 & GPS

Vehicle tracking systems are widely used worldwide. Components come in various shapes and
forms but most utilize GPS technology and GSM services. While most will offer real-time
tracking, others record real time data and store it to be read, in a fashion similar to data
loggers. Systems like these track and record and allow reports after certain points have been
solved.

Unconventional use:
Industries not traditionally known to use vehicle tracking systems (logistics and
transportation industries are the ones that have traditionally incorporated vehicle tracking
system into their operations) have started to use it in creative ways to improve their processes
or businesses.

The hospitality industry have caught on to this technology to improve customer


service. For example, a luxury hotel in Singapore has installed vehicle tracking systems in
their limousines to ensure they can welcome their VIPs when they reach the hotel.

Vehicle tracking systems used in food delivery vans may alert if the temperature of the
refrigerated compartment moves outside of the range of safe food storage temperatures. Car
rental companies are also using it to monitor their rental fleets.

1.2.1Purpose of vehicle tracking:

 Security of your vehicle

 To find the shortest path between two vehicles

 To trace the location of your vehicle

 To update the vehicle location

 To find the stolen vehicle

1.2.2 Benefits of vehicle tracking system:

 Fuel and power saving

 Effective fleet control

 Instantaneous fuel level monitoring

DEPT. OF ECE,LITS 15
VECHICLE TRACKING ON GOOGLE MAPS USING ARDUINO,ESP8266 & GPS

 Decreasing the accident risk

 Driver and load security

 Evaluation of drivers perforamance

 Monitoring the delivery time

 Safer vehicle renting

DEPT. OF ECE,LITS 16
VECHICLE TRACKING ON GOOGLE MAPS USING ARDUINO,ESP8266 & GPS

CHAPTER 2

LITERATURE SURVEY

2.1 Existing technique


In the initial period of tracking only two radios were used to exchange the
information.one radio was attached to the vehicle while another at base station by which
drivers were enabled to talk to their masters.fleet operator could identify the progress through
their routes.

The technology was not without its limits.It was restricted by the distance which
became a hurdle in accuracy and better connectivity between drivers and fleet operators.Base
station was dependent on the driver for the information and a huge size fleet could not have
been managed depending on man-power only.

The scene of vehicle tracking underwent a change with the arrival of gps
technology.This reduced the dependence on man-power.Most of the work of tracking become
electronic.computers provide a great help in managing a large fleet of vehicle.This also made
the information authentic.As this technology was available at affordable cost all whether small
or big fleet could take benefit of this technology.

Because of cheap accessibility of the device computer tracking facilities has come to
stay and associated with enhanced management.Today each vehicle carriers tracking unit
which is monitored from the base station.Base station receives the data from the unit.

All these facilities require a heavy investment of capital for the installation of the
infrastructure of tracking system for monitoring and dispatching .

2.1 Cellular tracking:

This kind of vehicle tracking is the most economical system to set up. It uses cellular
phone to transmit fleet location information in which you will have the option to view the data
on the Internet using the supporting software. The system is not that updated; however,
location is relayed in either every five or 10 minutes, depending on your choice. You have to
pay a monthly fee to avail this system service.

DEPT. OF ECE,LITS 17
VECHICLE TRACKING ON GOOGLE MAPS USING ARDUINO,ESP8266 & GPS

The technology of locating is based on measuring power levels and antenna


patterns and uses the concept that a powered mobile phone always
communicates wirelessly with one of the closest base stations, so knowledge of the location of
the base station implies the cell phone is nearby.

Advanced systems determine the sector in which the mobile phone is located and
roughly estimate also the distance to the base station. Further approximation can be done
by interpolating signals between adjacent antenna towers. Qualified services may achieve a
precision of down to 50 meters in urban areas where mobile traffic and density of antenna
towers (base stations) is sufficiently high. Rural and desolate areas may see miles between
base stations and therefore determine locations less precisely.

GSM localization uses multilateration to determine the location of GSM mobile


phones, or dedicated trackers, usually with the intent to locate the user.

2.2 Disadvantage:
Reduced privacy is the primary drawback of cellphone tracking. According to the Electronic
Frontier Foundation, "Location information collected by cellphone companies can provide an
extraordinarily invasive glimpse into the private lives of cellphone users." For this reason, it is
possible to disable casual location tracking features such as the "Find My Friends" iPhone
application. Tracking information remains available to phone providers and emergency
services, however.

DEPT. OF ECE,LITS 18
VECHICLE TRACKING ON GOOGLE MAPS USING ARDUINO,ESP8266 & GPS

CHAPTER 3

BLOCK EXPLANATION
Block diagram:

To track the vehicle, we need to find the Coordinates of Vehicle by using GPS module.
GPS module communicates continuously with the satellite for getting coordinates. Then we
need to send these coordinates from GPS to our Arduino by using UART. And then Arduino
extract the required data from received data by GPS.

Fig5:Block diagram of vehicle tracking system


Before this, Arduino sends command to Wi-Fi Module ESP8266 for configuring &
connecting to the router and getting the IP address. After it Arduino initialize GPS for getting
coordinates and the LCD shows a ‘Page Refresh message’. That means, user needs to refresh
webpage. When user refreshes the webpage Arduino gets the GPS coordinates and sends the
same to webpage (local server) over Wi-Fi, with some additional information and a Google
maps link in it. Now by clicking this link user redirects to Google Maps with the coordinate
and then he/she will get the Vehicle Current Location at the Red spot on the Google Maps.

3.1 Introduction to the Arduino Board


The Arduino is a family of microcontroller boards to simplify electronic design,
prototyping and experimenting for artists, hackers, hobbyists, but also many professionals.
People use it as brains for their robots, to build new digital music instruments, or to build a
system that lets your house plants tweet you when they’re dry. Arduinos (we use the standard

DEPT. OF ECE,LITS 19
VECHICLE TRACKING ON GOOGLE MAPS USING ARDUINO,ESP8266 & GPS

Arduino Uno) are built around an ATmega microcontroller — essentially a complete


computer with CPU, RAM, Flash memory, and input/output pins, all on a single chip. Unlike,
say, a Raspberry Pi, it’s designed to attach all kinds of sensors, LEDs, small motors and
speakers, servos, etc. directly to these pins, which can read in or output digital or analog
voltages between 0 and 5 volts. The Arduino connects to your computer via USB, where you
program it in a simple language (C/C++, similar to Java) from inside the free Arduino IDE by
uploading your compiled code to the board. Once programmed, the Arduino can run with the
USB link back to your computer, or stand-alone without it no keyboard or screen needed, just
power.

Fig6: Structure of Arduino Board

Looking at the board from the top down, this is an outline of what you will see (parts
of the board you might interact with in the course of normal use are highlighted)

Fig7:Arduino Board
Starting clockwise from the top center:
 Analog Reference pin (orange)
 Digital Ground (light green)
 Digital Pins 2-13 (green)

DEPT. OF ECE,LITS 20
VECHICLE TRACKING ON GOOGLE MAPS USING ARDUINO,ESP8266 & GPS

 Digital Pins 0-1/Serial In/Out - TX/RX (dark green) - These pins cannot be used for
digital i/o (Digital Read and Digital Write) if you are also using serial communication
(e.g. Serial.begin).
 Reset Button - S1 (dark blue)
 In-circuit Serial Programmer (blue-green)
 Analog In Pins 0-5 (light blue)
 Power and Ground Pins (power: orange, grounds: light orange)
 External Power Supply In (9-12VDC) - X1 (pink)
 Toggles External Power and USB Power (place jumper on two pins closest to desired
supply) - SV1 (purple)
 USB (used for uploading sketches to the board and for serial communication between
the board and the computer; can be used to power the board) (yellow)
 Digital Pins
In addition to the specific functions listed below, the digital pins on an Arduino
board can be used for general purpose input and output via the pin Mode(), Digital
Read(), and Digital Write() commands. Each pin has an internal pull-up resistor which
can be turned on and off using digital Write() (w/ a value of HIGH or LOW,
respectively) when the pin is configured as an input. The maximum current per pin is
40mA.
 Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial data.
On the Arduino Diecimila, these pins are connected to the corresponding pins of the
FTDI USB-to-TTL Serial chip. On the Arduino BT, they are connected to the
corresponding pins of the WT11 Bluetooth module. On the Arduino Mini and LilyPad
Arduino, they are intended for use with an external TTL serial module (e.g. the Mini-
USB Adapter).
 External Interrupts: 2 and 3. These pins can be configured to trigger an interrupt on a
low value, a rising or falling edge, or a change in value. See the attach Interrupt()
function for details.
 PWM: 3, 5, 6, 9, 10, and 11 Provide 8-bit PWM output with the analog Write()
function. On boards with an ATmega8, PWM output is available only on pins 9, 10,
and 11.

DEPT. OF ECE,LITS 21
VECHICLE TRACKING ON GOOGLE MAPS USING ARDUINO,ESP8266 & GPS

 BT Reset: 7. (Arduino BT-only) Connected to the reset line of the bluetooth module.
 SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI
communication, which, although provided by the underlying hardware, is not currently
included in the Arduino language.
 LED: 13. On the Diecimila and LilyPad, there is a built-in LED connected to digital
pin 13. When the pin is HIGH value, the LED is on, when the pin is LOW, it's off.
Analog Pins
In addition to the specific functions listed below, the analog input pins support 10-bit
analog-to-digital conversion (ADC) using the analog Read() function. Most of the analog
inputs can also be used as digital pins: analog input 0 as digital pin 14 through analog input 5
as digital pin 19. Analog inputs 6 and 7 (present on the Mini and BT) cannot be used as digital
pins.
 I2C: 4 (SDA) and 5 (SCL). Support I2C (TWI) communication using the Wire library
(documentation on the Wiring website).
Power Pins
 VIN (sometimes labeled "9V"): The input voltage to the Arduino board when it's using
an external power source (as opposed to 5 volts from the USB connection or other
regulated power source). You can supply voltage through this pin, or, if supplying
voltage via the power jack, access it through this pin. Also note that the Lily Pad has
no VIN pin and accepts only a regulated input.
 5V: The regulated power supply used to power the microcontroller and other
components on the board. This can come either from VIN via an on-board regulator, or
be supplied by USB or another regulated 5V supply.
 3V3 (Diecimila-only) : A 3.3 volt supply generated by the on-board FTDI chip.
 GND: Ground pins.
Other Pins
 AREF: Reference voltage for the analog inputs. Used with analog Reference
 Reset: (Diecimila-only) Bring this line LOW to reset the microcontroller. Typically
used to add a reset button to shields which block the one on the board.

DEPT. OF ECE,LITS 22
VECHICLE TRACKING ON GOOGLE MAPS USING ARDUINO,ESP8266 & GPS

3.1.1 Arduino software Process

These are the steps to follow:

1. Get an Arduino board


2. Download the Arduino environment
3. Install the USB drivers
4. Connect the board
5. Upload a program
Get an Arduino board

The Arduino i/o board is a simple circuit featuring the ATmega8 processor from Atmel. The
board is composed of a printed circuit board (PCB) and electronic parts.

There are a few ways to get an Arduino board:

 buy a ready made board. See how you can buy a board or just the PCB.
o European distributor
o US distributor
 build your own board. If you want you can build your own PCB just by downloading
the CAD files from the Hardwarepage. Extract the .brd file and send it to a PCB
manufacturer. Be aware that manufacturing a single pcb will be very expensive. It's
better to get together with other people and make 20 or 30 at a time. Since you get the
full CAD files you can make your own customised version of Arduino. if you make
modifications or fix bugs please send us your changes!

DEPT. OF ECE,LITS 23
VECHICLE TRACKING ON GOOGLE MAPS USING ARDUINO,ESP8266 & GPS

o purchase parts. purchase the parts from any electronics store. The Serial version in
particular has been designed to use the most basic parts that can be found anywhere in the
world. The USB version on the other hand requires some advanced soldering skills because of
the FTDI chip that is an smd part. Here is a list of parts for the serial board.

o assemble the board. We put together a step by step guide on how to build an arduino
board. Newbies: never soldered before? afraid of trashing thousands of boards before getting
one properly soldered? fear not :) learn to master the art of soldering.
o program the bootloader. In order for the development environment to be able to program the
chip, this has to be programmed with a piece of code called bootloader. See
the bootloader page on how to program it on your chip.

2) Download the Arduino environment

To program the Arduino board you need the Arduino environment.

Download Arduino: From the software page.

Linux note: For help getting the Arduino IDE running on Debian, please see the FAQ ("How
can I run the Arduino IDE under Linux?").

Mac OS X note: After downloading the IDE, run the macosx_setup.command. It corrects
permission on a few files for use with the serial port and will prompt you for your password.
You may need to reboot after running this script.

DEPT. OF ECE,LITS 24
VECHICLE TRACKING ON GOOGLE MAPS USING ARDUINO,ESP8266 & GPS

For more information, see the guide to the Arduino environment.

3 | Install the USB drivers

If you are using a USB Arduino, you will need to install the drivers for the FTDI chip on the
board. These can be found in the drivers directory of the Arduino distribution.

On Windows, you will need to unzip FTDI USB Drivers.zip. Then, when you plug in the
Arduino board, point the Windows Add Hardware wizard to the FTDI USB Drivers directory.

On the Mac, mount the FTDIUSBSerialDriver_v2_1_6.dmg (on PPC machines) or


the FTDIUSBSerialDriver_v2_2_6_Intel.dmg (on Intel machines) disk image and run the
included FTDIUSBSerialDriver.pkg.

The latest version of the drivers can be found on the FTDI website.

DEPT. OF ECE,LITS 25
VECHICLE TRACKING ON GOOGLE MAPS USING ARDUINO,ESP8266 & GPS

4 | Connect the board

If you're using a serial board, power the board with an external power supply (6 to 25
volts DC, with the core of the connector positive). Connect the board to a serial port on your
computer.

On the USB boards, the power source is selected by the jumper between the USB and
power plugs. To power the board from the USB port (good for controlling low power devices
like LEDs), place the jumper on the two pins closest to the USB plug. To power the board
from an external power supply (needed for motors and other high current devices), place the
jumper on the two pins closest to the power plug. Either way, connect the board to a USB port
on your computer. On Windows, the Add New Hardware wizard will open; tell it you want to
specify the location to search for drivers and point to the folder containing the USB drivers
you unzipped in the previous step.

The power LED should go on.

5 | Upload a program

Open the LED blink example sketch: File > Sketchbook > Examples > led_blink.

DEPT. OF ECE,LITS 26
VECHICLE TRACKING ON GOOGLE MAPS USING ARDUINO,ESP8266 & GPS

Here's what the code for the LED blink example looks like.

Select the serial device of the Arduino board from the Tools | Serial Port menu. On
Windows, this should be COM1 or COM2 for a serial Arduino board, or COM3, COM4,
or COM5 for a USB board. On the Mac, this should be something like /dev/cu.usbserial-
1B1 for a USB board, or something like /dev/cu.USA19QW1b1P1.1 if using a Keyspan
adapter with a serial board (other USB-to-serial adapters use different names).

DEPT. OF ECE,LITS 27
VECHICLE TRACKING ON GOOGLE MAPS USING ARDUINO,ESP8266 & GPS

Push the reset button on the board then click the Upload button in the IDE. Wait a few
seconds. If successful, the message "Done uploading." will appear in the status bar.

If the Arduino board doesn't show up in the Tools | Serial Port menu, or you get an error while
uploading, please see the FAQ for troubleshooting suggestions.

A few seconds after the upload finishes, you should see the amber (yellow) LED on the board
start to blink.

DEPT. OF ECE,LITS 28
VECHICLE TRACKING ON GOOGLE MAPS USING ARDUINO,ESP8266 & GPS

3.2 WIFI module:


Wi-Fi, an acronym for "Wireless Fidelity", is a set of product compatibility
standards for Wireless Local Area Networks (WLAN) based on the IEEE 802.11
specifications. Wi-Fi was intended to be used for mobile devices and LANs, but is now often
used for Internet access. It enables a person with a wireless-enabled computer or personal
digital assistant (PDA) to connect to the Internet when in proximity of an access point.
Wireless Fidelity is the wireless way to handle networking. It is also known
as 802.11 networking and wireless networking. Using this technology we can connect
computers anywhere in a home or office without the need of any wires. The computers
connect to the network using radio signals, and they can be up to 100 feet or so apart.
Wi-Fi allows to connect to the internet from virtually anywhere at speeds of up to
54Mbps.The computers and handsets enabled with this technology use radio technologies
based on the IEEE 802.11 standard to send and receive data anywhere within the range of a
base station.
Wi-Fi goes beyond wirelessly connecting computers, it also connects people.
History:
· IEEE (Institute of Electrical and Electronics Engineers) established the 802.11 group in
1990.
· Initial speeds were 1 and 2 Mbps.
· IEEE modified the standard in 1999 to include 802.11a and b.
· 802.11g was added in 2003.
· 802.11 equipment first available, then a, followed by g.

3.2.1.Wireless network:
Wi-Fi’s Walkie-Talkie Network:

To understand the wire less technology let us consider a pair of Walkie-


Talkies.These are small radios that can transmit and receive radio signals.When we talk into a
Walkie-Talkie, our voice is picked up by a microphone, encoded onto a radio frequency and
transmitted with the antenna. Another Walkie-Talkie can receive the transmission with its
antenna, decode our voice from the radio signal and drive a speaker.Simple Walkie-Talkies

DEPT. OF ECE,LITS 29
VECHICLE TRACKING ON GOOGLE MAPS USING ARDUINO,ESP8266 & GPS

like this transmit at a signal strength of about 0.25 watts, and they can transmit about 500 to
1,000 feet.If we want to connect two computers together in a network using Walkie-Talkie
technology:

 Equip each computer with a Walkie-Talkie.


 Give each computer a way to set whether it wants to transmit or receive.
 Give the computer a way to turn its binary 1s and 0s into two different beeps that the
walkie-talkie could transmit and receive and convert back and forth between beeps and 1s/0s.
This would actually work. The only problem would be that the data rate would be very slow.
Walkie-talkie is designed to handle the human voice.So it is not being able to send very much
data in this way(may be 1,000 bits per second).
Any products tested and approved as "WiFi Certified" by the WiFi Alliance are
certified as interoperable with each other, even if they are from different manufacturers. A
user with a "Wi-Fi Certified" product can use any brand of access point with any other brand
of client hardware that also is certified. Typically, however, any Wi-Fi product using the same
radio frequency (for example, 2.4GHz for 802.11b or 11g, 5GHz for 802.11a) will work with
any other, even if not "Wi-Fi Certified."
Wi-Fi's Radio Technology:
The radios used in Wi-Fi are not so different from the radios used in walkie-talkies.
There are three big differences between Wi-Fi radios and Walkie-talkies.
 WiFi radios that work with the 802.11b and 802.11g standards transmit at 2.4 GHz,
while those that comply with the 802.11a standard transmit at 5 GHz. Normal walkie-talkies
normally operate at 49 MHz. The higher frequency allows higher data rates.
 WiFi radios use much more efficient coding techniques that also contribute to the
much higher data rates. For 802.11a and 802.11g, the technique is known as orthogonal
frequency-division multiplexing (OFDM). For 802.11b, it is called Complementary Code
Keying (CCK).
 The radios used for WiFi have the ability to change frequencies. 802.11b cards can
transmit directly on any of three bands, or they can split the available radio bandwidth into
dozens of channels and frequency hop rapidly between them. The advantage of frequency

DEPT. OF ECE,LITS 30
VECHICLE TRACKING ON GOOGLE MAPS USING ARDUINO,ESP8266 & GPS

hopping is that it is much more immune to interference and can allow dozens of WiFi cards to
talk simultaneously without interfering with each other.
Connecting Wi-Fi:
Adding WiFi to a Computer:
Many new laptops come with a Wi-Fi card built in. It is also easy to add a Wi-Fi card
to an older laptop or a desktop PC. The process is
 Take a 802.11a, 802.11b or 802.11g network card. 802.11g has the advantage of
higher speeds and good interoperability on 802.11b equipment.
 For a laptop, this card will normally be a PCMCIA card that slide into a
PCMCIA slot on laptop. Or take a small external adapter and plug it into a USB port.
 For a desktop machine, take a PCI card & install inside the machine, or a small
external adapter and connect to the computer with a USB cable.
Install the card
Install the drivers for the card
Find an 802.11 hotspot
Access the hotspot.
A hotspot is a connection point for a Wi-Fi network.
HOTSPOT:
It is a small box that is hardwired into the Internet. The box contains an 802.11
radio that can simultaneously talk to up to 100 or so 802.11 cards. There are many Wi-Fi
hotspots now available in public places like restaurants, hotels, libraries and airports. We can
create our own hotspot in our home.

DEPT. OF ECE,LITS 31
VECHICLE TRACKING ON GOOGLE MAPS USING ARDUINO,ESP8266 & GPS

Configuring WiFi:
On the newest machines, an 802.11 card will automatically connect with an
802.11 hotspot and a network connection will be established. As soon as we turn on our
machine, it will connect and we will be able to browse the web, send email, etc using Wi-Fi.
On older machines we often have to go through this simple 3-step process to connect to a
hotspot:
 Access the software for the 802.11 card- normally there is an icon for the card down in
the system tray at the bottom right of the screen.
 Click the "Search button" in the software. The card will search for all of the available
hotspots in the area and shows a list.
 Double-click on one of the hotspots to connect to it.
 On ancient 802.11 equipment, there is no automatic search feature. We have to find
what is known as the SSID (server set id) of the hotspot (usually a short word of 10 characters
or less) as well as the channel number (an integer between 1 and 11) and type these two pieces
of information in manually. All the search feature is doing is grabbing these two pieces of
information from the radio signals generated by the hotspot and displaying them for us.
Wi-Fi Security:
· Data Security /Encryption
§ Third Party solution-Fortress
§ Wi-FI protected Access(WPA)
§ Wired Equivalent privacy (WEP)-shared key.
· Access
§ WPA/WEP
§ Close system-No advertising
§ Mac Authentication –Mac address control
· Attack-Denial of service
· Client protection
· Antivirus/Firewall

DEPT. OF ECE,LITS 32
VECHICLE TRACKING ON GOOGLE MAPS USING ARDUINO,ESP8266 & GPS

Wi-Fi hotspots can be open or secure. If a hotspot is open, then anyone with a Wi-
Fi card can access the hotspot. If it is secure, then the user needs to know a WEP key to
connect.
Hotspot in Home:
Setting up a Hotspot in a Home:
It is very easy to set up a Wi-Fi hotspot in home. It can be done in one of the two
ways:
 If there are several computers hooked together on an Ethernet network and want to add
a wireless hotspot to the mix, purchase a Wireless Access Point and plug it into the Ethernet
network.
 If it is the first time to set up a network in home, or to upgrading, buy a Wireless
Access Point Router. This is a single box that contains: 1) a port to connect to cable
modem or DSLmodem, 2) a router, 3) an Ethernet hub, 4) a firewall and 5) a wireless access
point. Connect the computers to this box either with traditional Ethernet cables or with
wireless cards.
Either way, once turn our Wireless Access Point on, there is a Wi-Fi hotspot in house.
In a typical home, the new hotspot will provide coverage for about 100 feet (30.5 meters) in
all directions, although walls and floors do cut down on the range. Even so, we get good
coverage throughout a typical home. For a large home, buy inexpensive signal boosters to
increase the range of the Hotspot.
Configuring a New Hotspot in Home:

Searching for hotspot

DEPT. OF ECE,LITS 33
VECHICLE TRACKING ON GOOGLE MAPS USING ARDUINO,ESP8266 & GPS

Most wireless access points come with default values built-in. Once we plug them in,
they start working with these default values in 90 percent of the cases. However, we may want
to change things. You normally get to set three things on the access point:
 The SSID -- it will normally default to the manufacturer's name. We can set it to any
word or phrase.
 The channel -- normally it will default to channel 6. However, if a nearby neighbor is
also using an access point and it is set to channel 6, there can be interference. Choose any
other channel between 1 and 11. An easy way to see if our neighbors have access points is to
use the search feature that comes with your wireless card.
 The WEP key -- The default is to disable WEP. To turn it on, enter a WEP key and
turn on 128-bit encryption.
Access points come with simple instructions for changing these three values. Normally do it
with a Web browser. Once it is configured properly, we can use our new hotspot to access the
Internet from anywhere in our home.
Advantages of Wi-Fi:
1. Wi-Fi is a core technology in GPS Industries Applications.
2. Wi-Fi technology available in hotels, airports, etc., will be more inclined to bring laptop
with us when traveling for personal reasons.
3. Frees network devices from cables, allows for a more dynamic network to be grown.
Changes the way people live, communicate, work and play.
4. Many reliable and bug-free Wi-Fi products on the market
5.It helps to become more productive at home, like online shopping and banking;
6. Wi-Fi technology allows getting out of home office and working in other rooms.
Disadvantages of Wi-Fi:
1.The 802.11b and 802.11g flavors of Wi-Fi use the 2.4 GHz spectrum, which is crowded
with other devices such as Bluetooth, microwave ovens, cordless phones, or video sender
devices, among many others.
2.Power consumption is fairly high compared to other standards, making battery life and heat
a concern.
3.It is not always configured properly by users.

DEPT. OF ECE,LITS 34
VECHICLE TRACKING ON GOOGLE MAPS USING ARDUINO,ESP8266 & GPS

Future:
There will be a requirement for technologies such as WLAN in this application. In
the cellular terminal market there is room to accommodate numerous wireless technologies
and a feature set incorporating WLAN looks likely to be adopted in around 25% of terminals
by 2009.For the WLAN market, the notebook/laptop is proving to be one of the most
important growth areas for the technology. IMS Research has predicted WLAN penetration
into notebooks will be in excess of 90% by 2007.Generate more revenue as wireless internet
access attracting more business customers, corporate events and outlines.
3.3 LIQUID CRYSTAL DISPLAY:
A liquid crystal display (LCD) is a thin, flat display device made up of any number of
color or monochrome pixels arrayed in front of a light source or reflector. Each pixel consists
of a column of liquid crystal molecules suspended between two transparent electrodes, and
two polarizing filters, the axes of polarity of which are perpendicular to each other. Without
the liquid crystals between them, light passing through one would be blocked by the other.
The liquid crystal twists the polarization of light entering one filter to allow it to pass through
the other.

A program must interact with the outside world using input and output devices that
communicate directly with a human being. One of the most common devices attached to an
controller is an LCD display. Some of the most common LCDs connected to the contollers are
16X1, 16x2 and 20x2 displays. This means 16 characters per line by 1 line 16 characters per
line by 2 lines and 20 characters per line by 2 lines, respectively.

Many microcontroller devices use 'smart LCD' displays to output visual information.
LCD displays designed around LCD NT-C1611 module, are inexpensive, easy to use, and it is
even possible to produce a readout using the 5X7 dots plus cursor of the display. They have a
standard ASCII set of characters and mathematical symbols. For an 8-bit data bus, the display
requires a +5V supply plus 10 I/O lines (RS RW D7 D6 D5 D4 D3 D2 D1 D0). For a 4-bit
data bus it only requires the supply lines plus 6 extra lines(RS RW D7 D6 D5 D4). When the
LCD display is not enabled, data lines are tri-state and they do not interfere with the operation
of the microcontroller.

Features:

DEPT. OF ECE,LITS 35
Shapes and S
VECHICLE TRACKING ON GOOGLE MAPS USING ARDUINO,ESP8266 & GPS

(1) Interface with either 4-bit or 8-bit microprocessor.

(2) Display data RAM

(3) 80x8 bits (80 characters).

(4) Character generator ROM

(5). 160 different dot-matrix character patterns.

(6). Character generator RAM

(7) 8 different user programmed 5 7 dot-matrix patterns.

(8).Display data RAM and character generator RAM may be Accessed by the
microprocessor.

(9) Numerous instructions

(10) .Clear Display, Cursor Home, Display ON/OFF, Cursor ON/OFF,

Blink Character, Cursor Shift, Display Shift.

(11). Built-in reset circuit is triggered at power ON.

(12). Built-in oscillator.

Description Of 16x2:

This is the first interfacing example for the Parallel Port. We will start with something simple.
This example doesn't use the Bi-directional feature found on newer ports, thus it should work
with most, if no all Parallel Ports. It however doesn't show the use of the Status Port as an
input. So what are we interfacing? A 16 Character x 2 Line LCD Module to the Parallel Port.
These LCD Modules are very common these days, and are quite simple to work with, as all
the logic required to run them is on board.

Schematic Diagram:

DEPT. OF ECE,LITS 36
VECHICLE TRACKING ON GOOGLE MAPS USING ARDUINO,ESP8266 & GPS

Fig8:schematic diagram of lcd

Above is the quite simple schematic. The LCD panel's Enable and Register Select is
connected to the Control Port. The Control Port is an open collector / open drain output. While
most Parallel Ports have internal pull-up resistors, there are a few which don't. Therefore by
incorporating the two 10K external pull up resistors, the circuit is more portable for a wider
range of computers, some of which may have no internal pull up resistors.

o We make no effort to place the Data bus into reverse direction. Therefore we hard wire
the R/W line of the LCD panel, into write mode. This will cause no bus conflicts on the data
lines. As a result we cannot read back the LCD's internal Busy Flag which tells us if the LCD
has accepted and finished processing the last instruction. This problem is overcome by
inserting known delays into our program.
o The 10k Potentiometer controls the contrast of the LCD panel. Nothing fancy
here. As with all the examples, I've left the power supply out. You can use a
bench power supply set to 5v or use a onboard +5 regulator. Remember a few
de-coupling capacitors, especially if you have trouble with the circuit working
properly.

DEPT. OF ECE,LITS 37
VECHICLE TRACKING ON GOOGLE MAPS USING ARDUINO,ESP8266 & GPS

16 x 2 Alphanumeric LCD Module Features:

 Intelligent, with built-in Hitachi HD44780 compatible LCD controller and RAM
providing simple interfacing
 61 x 15.8 mm viewing area
 5 x 7 dot matrix format for 2.96 x 5.56 mm characters, plus cursor line
 Can display 224 different symbols
 Low power consumption (1 mA typical)
 Powerful command set and user-produced characters
 TTL and CMOS compatible
 Connector for standard 0.1-pitch pin headers

16 x 2 Alphanumeric LCD Module Specifications:

Symbol Level Function


Pin

1 VSS - Power, GND

2 VDD - Power, 5V

3 Vo - Power, for LCD Drive

Register Select Signal


4 RS H/L H: Data Input
L: Instruction Input

H: Data Read (LCD->MPU)


5 R/W H/L
L: Data Write (MPU->LCD)

6 E H,H->L Enable

7-14 DB0-DB7 H/L Data Bus; Software selectable 4- or 8-bit mode

DEPT. OF ECE,LITS 38
VECHICLE TRACKING ON GOOGLE MAPS USING ARDUINO,ESP8266 & GPS

15 NC - NOT CONNECTED

16 NC - NOT CONNECTED

FEATURES:

• 5 x 8 dots with cursor

• Built-in controller (KS 0066 or Equivalent)

• + 5V power supply (Also available for + 3V)

• 1/16 duty cycle

• B/L to be driven by pin 1, pin 2 or pin 15, pin 16 or A.K (LED)

• N.V. optional for + 3V power supply

Fig9: Address locations for a 1x16 line LCD

Even limited to character based modules, there is still a wide variety of shapes and
sizes available. Line lengths of 8,16,20,24,32 and 40 characters are all standard, in one, two
and four line versions.

Several different LC technologies exists. “supertwist” types, for example, offer


Improved contrast and viewing angle over the older “twisted nematic” types. Some modules
are available with back lighting, so that they can be viewed in dimly-lit conditions. The back
lighting may be either “electro-luminescent”, requiring a high voltage inverter circuit, or
simple LED illumination.

DEPT. OF ECE,LITS 39
VECHICLE TRACKING ON GOOGLE MAPS USING ARDUINO,ESP8266 & GPS

Fig10:Electrical Block Diagrm

Power supply for LCD driving:

Fig11:Power supply for LCD

PIN DESCRIPTION:

Most LCDs with 1 controller has 14 Pins and LCDs with 2 controller has 16 Pins (two
pins are extra in both for back-light LED connections).

DEPT. OF ECE,LITS 40
VECHICLE TRACKING ON GOOGLE MAPS USING ARDUINO,ESP8266 & GPS

Fig12: Pin diagram of 1x16 lines LCD

Tabel1: Pin specifications

CONTROL LINES:

EN: Line is called "Enable." This control line is used to tell the LCD that you are sending it
data. To send data to the LCD, your program should make sure this line is low (0) and then set
the other two control lines and/or put data on the data bus. When the other lines are
completely ready, bring EN high (1) and wait for the minimum amount of time required by the
LCD datasheet (this varies from LCD to LCD), and end by bringing it low (0) again.

RS:

Line is the "Register Select" line. When RS is low (0), the data is to be treated as a
command or special instruction (such as clear screen, position cursor, etc.). When RS is high

DEPT. OF ECE,LITS 41
VECHICLE TRACKING ON GOOGLE MAPS USING ARDUINO,ESP8266 & GPS

(1), the data being sent is text data which sould be displayed on the screen. For example, to
display the letter "T" on the screen you would set RS high.

RW:

Line is the "Read/Write" control line. When RW is low (0), the information on the data
bus is being written to the LCD. When RW is high (1), the program is effectively querying (or
reading) the LCD. Only one instruction ("Get LCD status") is a read command. All others are
write commands, so RW will almost always be low.

Finally, the data bus consists of 4 or 8 lines (depending on the mode of operation
selected by the user). In the case of an 8-bit data bus, the lines are referred to as DB0, DB1,
DB2, DB3, DB4, DB5, DB6, and DB7.

Logic status on control lines:

• E - 0 Access to LCD disabled

- 1 Access to LCD enabled

• R/W - 0 Writing data to LCD

- 1 Reading data from LCD

• RS - 0 Instructions

- 1 Character
Writing data to the LCD:

1) Set R/W bit to low

2) Set RS bit to logic 0 or 1 (instruction or character)

3) Set data to data lines (if it is writing)

4) Set E line to high

5) Set E line to low

DEPT. OF ECE,LITS 42
VECHICLE TRACKING ON GOOGLE MAPS USING ARDUINO,ESP8266 & GPS

Read data from data lines (if it is reading) on LCD:

1) Set R/W bit to high

2) Set RS bit to logic 0 or 1 (instruction or character)

3) Set data to data lines (if it is writing)

4) Set E line to high

5) Set E line to low

Entering Text:

First, a little tip: it is manually a lot easier to enter characters and commands in
hexadecimal rather than binary (although, of course, you will need to translate commands from
binary couple of sub-miniature hexadecimal rotary switches is a simple matter, although a little
bit into hex so that you know which bits you are setting). Replacing the d.i.l. switch pack with
a of re-wiring is necessary.

SWITCHES:

The switches must be the type where On = 0, so that when they are turned to the zero
position, all four outputs are shorted to the common pin, and in position “F”, all four outputs
are open circuit.

All the available characters that are built into the module are shown in Table 3.
Studying the table, you will see that codes associated with the characters are quoted in binary
and hexadecimal, most significant bits (“left-hand” four bits) across the top, and least
significant bits (“right-hand” four bits) down the left.

Most of the characters conform to the ASCII standard, although the Japanese and Greek
characters (and a few other things) are obvious exceptions. Since these intelligent modules
were designed in the “Land of the Rising Sun,” it seems only fair that their Katakana phonetic
symbols should also be incorporated. The more extensive Kanji character set, which the
Japanese share with the Chinese, consisting of several thousand different characters, is not
included!

DEPT. OF ECE,LITS 43
VECHICLE TRACKING ON GOOGLE MAPS USING ARDUINO,ESP8266 & GPS

Using the switches, of whatever type, and referring to Table 3, enter a few characters
onto the display, both letters and numbers. The RS switch (S10) must be “up” (logic 1) when
sending the characters, and switch E (S9) must be pressed for each of them. Thus the
operational order is: set RS high, enter character, trigger E, leave RS high, enter another
character, trigger E, and soon

3.4 GPS:

Basic concept of GPS

A GPS receiver calculates its position by precisely timing the signals sent by GPS
satellites high above the Earth. Each satellite continually transmits messages that include

 the time the message was transmitted


 precise orbital information (the ephemeris)
 the general system health and rough orbits of all GPS satellites (the almanac).

The receiver uses the messages it receives to determine the transit time of each message
and computes the distance to each satellite. These distances along with the satellites' locations
are used with the possible aid of trilateration, depending on which algorithm is used, to
compute the position of the receiver. This position is then displayed, perhaps with a moving
map display or latitude and longitude; elevation information may be included. Many GPS
units show derived information such as direction and speed, calculated from position changes.

DEPT. OF ECE,LITS 44
VECHICLE TRACKING ON GOOGLE MAPS USING ARDUINO,ESP8266 & GPS

Three satellites might seem enough to solve for position since space has three
dimensions and a position near the Earth's surface can be assumed. However, even a very
small clock error multiplied by the very large speed of light the speed at which satellite
signals propagate — results in a large positional error. Therefore receivers use four or more
satellites to solve for the receiver's location and time. The very accurately computed time is
effectively hidden by most GPS applications, which use only the location. A few specialized
GPS applications do however use the time; these include time transfer, traffic signal timing,
and synchronization of cell phone base stations Although four satellites are required for
normal operation, fewer apply in special cases. If one variable is already known, a receiver
can determine its position using only three satellites. For example, a ship or aircraft may have
known elevation. Some GPS receivers may use additional clues or assumptions (such as
reusing the last known altitude, dead reckoning, inertial navigation, or including information
from the vehicle computer) to give a less accurate (degraded) position when fewer than four
satellites are visible.

Position calculation introduction

Two sphere surfaces intersecting in a circle

DEPT. OF ECE,LITS 45
VECHICLE TRACKING ON GOOGLE MAPS USING ARDUINO,ESP8266 & GPS

Surface of sphere intersecting a circle (not a solid disk) at two points

To provide an introductory description of how a GPS receiver works, error effects are
deferred to a later section. Using messages received from a minimum of four visible satellites,
a GPS receiver is able to determine the times sent and then the satellite positions
corresponding to these times sent. The x, y, and z components of position, and the time sent,
are designated as where the subscript i is the satellite number and has the value 1,
2, 3, or 4. Knowing the indicated time the message was received , the GPS receiver could

compute the transit time of the message as , if would be equal to correct reception

time, . A pseudorange, , would be the traveling distance of the message,


assuming it traveled at the speed of light, c.

A satellite's position and pseudorange define a sphere, centered on the satellite, with
radius equal to the pseudorange. The position of the receiver is somewhere on the surface of
this sphere. Thus with four satellites, the indicated position of the GPS receiver is at or near
the intersection of the surfaces of four spheres. In the ideal case of no errors, the GPS receiver
would be at a precise intersection of the four surfaces.

If the surfaces of two spheres intersect at more than one point, they intersect in a
circle. The article trilateration shows this mathematically. A figure, Two Sphere Surfaces
Intersecting in a Circle, is shown below. Two points where the surfaces of the spheres
intersect are clearly shown in the figure. The distance between these two points is the diameter
of the circle of intersection. The intersection of a third spherical surface with the first two will
be its intersection with that circle; in most cases of practical interest, this means they intersect
at two points. Another figure, Surface of Sphere Intersecting a Circle (not a solid disk) at Two
Points, illustrates the intersection. The two intersections are marked with dots. Again the
article trilateration clearly shows this mathematically.

For automobiles and other near-earth vehicles, the correct position of the GPS receiver
is the intersection closest to the Earth's surface.[40] For space vehicles, the intersection farthest
from Earth may be the correct one.

DEPT. OF ECE,LITS 46
VECHICLE TRACKING ON GOOGLE MAPS USING ARDUINO,ESP8266 & GPS

The correct position for the GPS receiver is also the intersection closest to the surface
of the sphere corresponding to the fourth satellite.

3.5 Circuit Explanation:


Circuit for this ‘Vehicle Tracking using Google Maps project’ is very simple and we
mainly need an Arduino UNO, GPS Module and ESP8266 Wi-Fi module. There is a 16x2
LCD optionally connected for displaying the status. This LCD is connected at 14-19 (A0-A5)
Pins of Arduino.

Here Tx pin of GPS module is directly connected to digital pin number 10 of Arduino.
By using Software Serial Library here, we have allowed serial communication on pin 10 and
11, and made them Rx and Tx respectively and left the Rx pin of GPS Module open. By
default Pin 0 and 1 of Arduino are used for serial communication but by
using SoftwareSerial library, we can allow serial communication on other digital pins of the
Arduino. 12 Volt adaptor is used to power the GPS Module. Go through here to learn “How to
Use GPS with Arduino” and get the coordinates.

Fig13:Circuit explaination

Wi-Fi module ESP8266’s Vcc and GND pins are directly connected to 3.3V and GND
of Arduino and CH_PD is also connected with 3.3V. Tx and Rx pins of ESP8266 are directly
connected to pin 2 and 3 of Arduino. Software Serial Library is also used here to allow serial
communication on pin 2 and 3 of Arduino. We have already covered the Interfacing of

DEPT. OF ECE,LITS 47
VECHICLE TRACKING ON GOOGLE MAPS USING ARDUINO,ESP8266 & GPS

ESP8266 Wi-Fi module to Arduino in detail, also please go through “How to Send Data from
Arduino to Webpage using WiFi”.

ESP8266 has two LEDs, one is Red, for indicating Power and second is Blue that is
Data Communication LED. Blue LED blinks when ESP sends some data via its Tx pin. Also,
do not connect ESP to +5 volt supply otherwise your device may damage. Here in this project,
we have selected 9600 baud rate for all the UART communications.

DEPT. OF ECE,LITS 48
VECHICLE TRACKING ON GOOGLE MAPS USING ARDUINO,ESP8266 & GPS

CHAPTER 4

RESULTS AND FUTURE SCOPE

4.1Result:

Vehicle tracking system in which you can track vehicle on google maps.we will send
the location coordinates to the local server and you just need to open a ‘webpage’ on your
computer,where you will find a link to google maps with your vehicles location
coordinates.when you click on that link,it takes you on google maps,showing your vehicle
location.

4.2 FUTURE SCOPE:

• vehicle occupants from striking interior objects such aThis system can be interfaced
with vehicle airbag system that can prevent s the steering wheel or window.

• This can also be developed by interconnecting a camera to the controller module that
takes the photograph of accident spot that makes the tracking easier.

DEPT. OF ECE,LITS 49
VECHICLE TRACKING ON GOOGLE MAPS USING ARDUINO,ESP8266 & GPS

4.3 ADVANTAGES OF VEHICLE TRACKING SYSTEM

 Vehicle tracking systems can help to reduce running costs by specifically targeting
those who speed and waste fuel. By focussing upon these drivers it is possible to not
only reduce fuel and maintenance bills, but to also reduce insurance premiums.
 By using a system's automatic mileage reminder it is possible to reduce time wasted
through vehicle maintenance. In addition, by having a service that ensures your
vehicles are regularly serviced means that resale values for the fleet will also be
higher. It can also help to avoid penalties for issues such as bald tyres and tax as
reminders are clear and precise.
 Some insurance companies will offer around a thirty percent discount to companies
who implement a GPS vehicle tracking system. This is not only because it encourages
safer driving, but also helps recovery if thefts do occur.
 Productivity of workers can be increased by being able to keep track of lunch hours,
exposing unauthorised stops and breaks and by evaluating the overtime requests of
workers. By having detailed information on the whereabouts of vehicles at all times, it
is far easier to keep an eye on employee activities.
 Vehicle tracking systems will vastly reduce your phone bills as it is no longer a
necessity to constantly call employees to find their location.
 By having all the relevant information on one screen, those running the software have
easy access to answer enquiries rapidly and accurately.
 GPS systems reduce the amount of paperwork that drivers must fill out. By doing this
you not only soften the blow of introducing such a system, but also increase the
accuracy of your records.

DEPT. OF ECE,LITS 50
VECHICLE TRACKING ON GOOGLE MAPS USING ARDUINO,ESP8266 & GPS

CHAPTER 5

CODING

#include<LiquidCrystal.h>
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);
#include <SoftwareSerial.h>
SoftwareSerial gps(10,11); // RX, TX
//String str="";
char str[70];
String gpsString="";
char *test="$GPGGA";
String latitude="No Range ";
String longitude="No Range ";
int temp=0,i;
boolean gps_status=0;
void setup()
{
lcd.begin(16,2);
Serial.begin(9600);
gps.begin(9600);
lcd.print("Vehicle Tracking");
lcd.setCursor(0,1);
lcd.print(" System ");
delay(2000);
gsm_init();
lcd.clear();
Serial.println("AT+CNMI=2,2,0,0,0");
lcd.print("GPS Initializing");
lcd.setCursor(0,1);

DEPT. OF ECE,LITS 51
VECHICLE TRACKING ON GOOGLE MAPS USING ARDUINO,ESP8266 & GPS

lcd.print(" No GPS Range ");


get_gps();
delay(2000);
lcd.clear();
lcd.print("GPS Range Found");
lcd.setCursor(0,1);
lcd.print("GPS is Ready");
delay(2000);
lcd.clear();
lcd.print("System Ready");
temp=0;
}
void loop()
{
serialEvent();
if(temp)
{
get_gps();
tracking();
}
}
void serialEvent()
{
while(Serial.available())
{
if(Serial.find("Track Vehicle"))
{
temp=1;
break;
}
else

DEPT. OF ECE,LITS 52
VECHICLE TRACKING ON GOOGLE MAPS USING ARDUINO,ESP8266 & GPS

temp=0;
}
}
void gpsEvent()
{
gpsString="";
while(1)
{
while (gps.available()>0) //checking serial data from GPS
{
char inChar = (char)gps.read();
gpsString+= inChar; //store data from GPS into gpsString
i++;
if (i < 7)
{
if(gpsString[i-1] != test[i-1]) //checking for $GPGGA sentence
{
i=0;
gpsString="";
}
}
if(inChar=='\r')
{
if(i>65)
{
gps_status=1;
break;
}
else
{
i=0;

DEPT. OF ECE,LITS 53
VECHICLE TRACKING ON GOOGLE MAPS USING ARDUINO,ESP8266 & GPS

}
}
}
if(gps_status)
break;
}
}
void gsm_init()
{
lcd.clear();
lcd.print("Finding Module..");
boolean at_flag=1;
while(at_flag)
{
Serial.println("AT");
while(Serial.available()>0)
{
if(Serial.find("OK"))
at_flag=0;
}

delay(1000);
}
lcd.clear();
lcd.print("Module Connected..");
delay(1000);
lcd.clear();
lcd.print("Disabling ECHO");
boolean echo_flag=1;
while(echo_flag)
{

DEPT. OF ECE,LITS 54
VECHICLE TRACKING ON GOOGLE MAPS USING ARDUINO,ESP8266 & GPS

Serial.println("ATE0");
while(Serial.available()>0)
{
if(Serial.find("OK"))
echo_flag=0;
}
delay(1000);
}
lcd.clear();
lcd.print("Echo OFF");
delay(1000);
lcd.clear();
lcd.print("Finding Network..");
boolean net_flag=1;
while(net_flag)
{
Serial.println("AT+CPIN?");
while(Serial.available()>0)
{
if(Serial.find("+CPIN: READY"))
net_flag=0;
}
delay(1000);
}
lcd.clear();
lcd.print("Network Found..");
delay(1000);
lcd.clear();
}
void get_gps()
{

DEPT. OF ECE,LITS 55
VECHICLE TRACKING ON GOOGLE MAPS USING ARDUINO,ESP8266 & GPS

gps_status=0;
int x=0;
while(gps_status==0)
{
gpsEvent();
int str_lenth=i;
latitude="";
longitude="";
int comma=0;
while(x<str_lenth)
{
if(gpsString[x]==',')
comma++;
if(comma==2) //extract latitude from string
latitude+=gpsString[x+1];
else if(comma==4) //extract longitude from string
longitude+=gpsString[x+1];
x++;
}
int l1=latitude.length();
latitude[l1-1]=' ';
l1=longitude.length();
longitude[l1-1]=' ';
lcd.clear();
lcd.print("Lat:");
lcd.print(latitude);
lcd.setCursor(0,1);
lcd.print("Long:");
lcd.print(longitude);
i=0;x=0;
str_lenth=0;

DEPT. OF ECE,LITS 56
VECHICLE TRACKING ON GOOGLE MAPS USING ARDUINO,ESP8266 & GPS

delay(2000);
}
}
void init_sms()
{
Serial.println("AT+CMGF=1");
delay(400);
Serial.println("AT+CMGS=\"+91**********\""); // use your 10 digit cell no. here
delay(400);
}
void send_data(String message)
{
Serial.println(message);
delay(200);
}
void send_sms()
{
Serial.write(26);
}
void lcd_status()
{
lcd.clear();
lcd.print("Message Sent");
delay(2000);
lcd.clear();
lcd.print("System Ready");
return;
}
void tracking()
{
init_sms();

DEPT. OF ECE,LITS 57
VECHICLE TRACKING ON GOOGLE MAPS USING ARDUINO,ESP8266 & GPS

send_data("Vehicle Tracking Alert:");


send_data("Your Vehicle Current Location is:");
Serial.print("Latitude:");
send_data(latitude);
Serial.print("Longitude:");
send_data(longitude);
send_data("Please take some action soon..\nThankyou");
send_sms();
delay(2000);
lcd_status();
}

DEPT. OF ECE,LITS 58
VECHICLE TRACKING ON GOOGLE MAPS USING ARDUINO,ESP8266 & GPS

CONCLUSION

Vehicle tracking systems are very useful and important in large cities.Now a days
vehicle accidents and theft is rapidly increasing,with this project we can have a good control.
This technology can also help to advance the transportation system and can be used in
organizations for security purpose and tracking purpose.

DEPT. OF ECE,LITS 59
VECHICLE TRACKING ON GOOGLE MAPS USING ARDUINO,ESP8266 & GPS

BIBLIOGRAPHY AND REFERENCES

1. "Re: Comments to Access Board Docket Number 2007-1" (PDF). Office of Technical
Information Services, APTA. January 20, 2009. p. 3. Retrieved 2009-11-26.
2. ^ Jump up to:a b "Real-Time Muni Arrival Information Just a Free Call Away". San
Francisco MTA. July 13, 2005. Retrieved 2009-11-26.
3. Jump up^ "Cell phone bus tracking applications developed". Metro Magazine. April
2009. Retrieved 2009-11-26.
4. Jump up^ "WebWatch allows you to obtain 'real-time' schedule information for your
bus stop and (to) track buses in real time.". Duluth Transit Authority. 2007.
Retrieved 2009-11-26.
5. Jump up^ "Cost cutting and real time tracking". Retrieved 2 June 2016.
6. Jump up^ Claburn, Thomas (March 4, 2009). "Court Asked To Disallow Warrantless
GPS Tracking". Information Week. Retrieved 2009-03-18.

DEPT. OF ECE,LITS 60

You might also like