You are on page 1of 34

VEHICLE TRACKING AND ACCIDENT ALERT

USING ANDROID APP

A PROJECT REPORT

Submitted by
SRIRAM KUMAR V 421613105083
SUSINDHAR S 421613105088
THIYAGARAJAN R 421613105094
GOWSIGAN E 421613105305

in partial fulfillment for the award of the degree

of

BACHELOR OF ENGINEERING
IN

ELECTRICAL AND ELECTRONICS ENGINEERING


MAILAM ENGINEERING COLLEGE, MAILAM

ANNA UNIVERSITY:: CHENNAI 600 025

APRIL 2017
ANNA UNIVERSITY: CHENNAI 600 025

BONAFIDE CERTIFICATE

Certified that this project report VEHICLE TRACKING AND


ACCIDENT ALERT USING ANDROID APP is the bonafide work of.

SRIRAM KUMAR V 421613105083


SUSINDHAR S 421613105088
THIYAGARAJAN R 421613105094
GOWSIGAN E 421613105305

Who carried out the research under my supervision

SIGNATURE SIGNATURE

Dr. N. MURALI KRISHNAN, Mr.M.VIJAYARAGAVAN,


HEAD OF THE DEPARTMENT SUPERVISOR
Electrical and Electronics Engineering Electrical and Electronics Engineering
Mailam Engineering College Mailam Engineering College
Mailam - 604 304 Mailam - 604 304

INTERNAL EXAMINER EXTERNAL EXAMINER


ACKNOWLEDGEMENT

I take immense pleasure in thanking our honorable Chairman and Managing


Director, SREE.M.DHANASEKARAN, and our honorable Vice Chairman
SREE.S.V.SUGUMARAN, for providing me with an environment to complete my project
successfully.

I wish to express my deep sense of gratitude to our principal Dr. S. SENTHIL, for
giving us this opportunity to showcase my technical ability with this project.

I would like to express my sincere thanks to our Dean Dr. R. RAJAPPAN, for his
kind patronage.

I am deeply indebted to our Head of the Department Dr. N. MURALI KRISHNAN,


for his unwavering support during the entire course of this project.

I express my sincere gratitude to my supervisor Mr. M.VIJAYARAGAVAN, for his


valuable guidance and useful suggestions, which helped me in completing the project
work in time.
Words are inadequate in offering my thanks to all the staff members of our
department for their constant encouragement and support throughout the course, especially
for the useful suggestions given during the project period.

Finally, yet importantly, I would like to express my heartfelt thanks to my beloved


parents for their blessings, my family and friends for their help and wishes for the successful
completion of this project. I also thank all the others who directly or indirectly were a source
of help to mean accomplishing this project.
ABSTRACT

On these days peoples started to use public transport system due to increase
of fuel cost, traffic and atmospheric pollution content. To use this transportation
System we must be more conscious on bus timings, The bus timings are not stable
due to some technical reasons so that we miss our routine activities, to reduce
this problem we have proposed this project, Our project consist of GPS and GSM
controlled by an Arduino Uno board, these combination helps the user to track the
exact location of the vehicle with his android mobile phone with a specialized
application. In addition with that our app provides alert to the passengers about
their destination place, our model consist of an accident alert system that
automatically alerts the nearby ambulance service with the vehicles registration
number and exact location of the vehicle using the GPS module attached to it
whenever a accident happens, by this project we save our time, faster recovery
service can be provided and more lives can be saved.

,
.

,
,
, Arduino
,
.
,

,
, .

TABLE OF CONTENTS

ABSTACT (ENGLISH)

ABSTRACT (TAMIL)

LIST OF FIGURES

Chapter 1: Introduction
1.1 Inroduction 10

1.2 Proposed System 11

1.3 Vehicle Tracking Features 11

1.4 Usage of tracking in India 12


1.5 Applications 12

Chapter 2: Methodology

2.1 Working 14

2.2 Block diagram15

2.2.1 Block diagram description..16

2.2.2 Concept and overview.17

2.3 Circuit Diagram..19

Chapter 3: Process & Requirement.21


3.1 Software Requirements.22

3.1.1 Arduino Compiler..22

3.1.2 Eagle Version23


3.1.3 Google Maps.23

3.2 Component List 24

3.2.1 Power Supply. 24

3.2.2 arduino uno 31

3.2.3 GSM Module......32

` 3.2.4 GPS Module. 33

3.2.5 Vibration sensor. 33


3.2.7 LCD. 37

3.2.8 LED...38

Chapter 4: Coding46

4.1 Coding. 47

Chapter 5: Advantages & Future Scope.64

5.1 Advantages.65

5.2 Future Scope..66

Chapter 6: Result & Conclusion..67

6.1 Result Analysis.68

6.2 Conclusion69

Chapter 7: Reference....70

7.1 References.71

Chapter 8 : Photo Gallery72


CHAPTER 1
INTRODUCTION

1.1 INTRODUCTION:-

Vehicle tracking system main aim is to help the people regarding the bus
timings. Accident alert system main aim is to rescuing people in accidents. This
also improved security systems for vehicles. The latest like GPS are highly useful
now a days, this system enables the owner to observe and track his vehicle and find
out vehicle movement and its past activities of vehicle. This new technology,
popularly called vehicle Tracking Systems which created many wonders in the
security of the vehicle. This hardware is fitted on to the vehicle in such a manner
that it is not visible to anyone who is inside or outside of the vehicle. Thus it is
used as a covert unit which continuously or by any interrupt to the system, sends
the location data to the monitoring unit.When the vehicle is stolen, the location
data from tracking system can be used to find the location and can be informed to
police for further action. Some Vehicle tracking System can even detect
unauthorized movements of the vehicle and then alert the owner. This gives an
edge over other pieces of technology for the same purpose.
This accident alert system in it detects the accident and the location of
the accident occurred and sends GPS coordinates to the specified mobile, computer
etc. The vibration sensor which is additionally interfaced to the microcontroller is
used to detect the obstacles and accidents, in any case if any mishap occurs then its
warning will be directly send to the intended receiver.

When a request by user is sent to the number at the modem, the system
automatically sends a return reply to that particular mobile indicating the position
of the vehicle in terms of latitude and longitude. A Program has been developed
which is used to locate the exact position of the vehicle and also to navigated track
of the moving vehicle on Google Map.

1.2 Proposed System :

The proposed system is used for positioning and navigating the vehicle with
an accuracy of 10 m. The Exact location is indicated in the form of latitude and
longitude along with the exact Navigated track on Google map.

The system tracks the location of particular vehicle and sends to users
mobile in form of data and also to arduino. The arrived data, in the form of latitude
and longitude is used to locate the Vehicle on the Google maps and also we can see
the output on the LCD.

1.3 VEHICLE TRACKING FEATURES:


It is mainly benefit for all peoples who depends on public transport system.
Since it can show the position of all vehicles in real time, so that they can plan
their trip accordingly. These tracking system can store the whole data where the
vehicle had gone, where did it stop, how much time it take at every stop and can
create whole data analysis. It is also used in cars and trains, to estimate how far are
they, how much time it takes for them to come to a particular stop. These systems
are used to data capture, data storage, data analysis and finally data transfer. By
adding additional sensor such as vibration sensor the system can be enabled to
obstacles.

1.4 USAGE OF TRACKING IN INDIA:

Tracking in India is mainly used by transport systems, taxi companies,


traffic operators. Taxi operators use this to estimate how far the vehicle is from a
particular area and send this information to call centers and they can inform
general public about the distance of the taxi location and time it takes tom come to
them. Another use is for traffic police if this system is located in every vehicle they
can estimate the traffic by looking on the map and if any accident is detected then
they can route the traffic in to another way. This is how tracking is useful because
India is one of busy traffic countries and this system can control many of the traffic
problems.

1.5 APPLICATIONS :

The project that has been introduced here can be used for variety of
applicatons

1. Car navigation

2. Fleet management/tracking
3. Palmtop, Laptop, PDA, and Handheld

4. Location Based Services enabled devices

Same methodology

Copy same content

2.2 BLOCK DIAGRAM :see feb 1


CHAPTER 3 PROCESS AND

REQUIREMENTS

Arduino same

3.1.3 Google maps: same

3.2 COMPONENT DESCRIPTION :


See feb 2
3.2.1 POWER SUPPLY:same

3.2.2 arduino uno

The Arduino Uno is a microcontroller board based on the ATmega328 (datasheet). It


has 14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs,
a 16 MHz ceramic resonator, a USB connection, a power jack, an ICSP header, and a reset
button. It contains everything
needed to support the microcontroller; simply connect it to a computer with a USB cable or
power it with a AC-to-DC adapter or battery to get started.
The Uno differs from all preceding boards in that it does not use the FTDI USB-to-serial
driver chip. Instead, it features the Atmega16U2 (Atmega8U2 up to version R2)
programmed as a USB-to-serial converter.
new features:
1.0 pinout: added SDA and SCL pins that are near to the AREF pin and two other new pins
placed near to the RESET pin, the IOREF that allow the shields to adapt to the voltage
provided
from the board. In future, shields will be compatible both with the board that use the AVR,
which operate with 5V and with the Arduino Due that operate with 3.3V. The second one is a
not connected pin, that is reserved for future purposes.
Stronger RESET circuit.
Atmega 16U2 replace the 8U2.

Summary
Microcontroller- ATmega328
Operating - Voltage 5V
Input Voltage (recommended)- 7-12V
Input Voltage (limits) -6-20V
Digital I/O Pins- 14 (of which 6 provide PWM output)
Analog Input Pins -6
DC Current per I/O Pin- 40 mA
DC Current for 3.3V Pin -50 mA
Flash Memory -32 KB (ATmega328) of which 0.5 KB used by bootloader
SRAM -2 KB (ATmega328)
EEPROM- 1 KB (ATmega328)
Clock Speed -16 MHz

Power
The Arduino Uno can be powered via the USB connection or with an external power supply.
The power
source is selected automatically.
External (non-USB) power can come either from an AC-to-DC adapter (wall-wart) or battery.
The
adapter can be connected by plugging a 2.1mm center-positive plug into the board's power
jack. Leads
from a battery can be inserted in the Gnd and Vin pin headers of the POWER connector.
The board can operate on an external supply of 6 to 20 volts. If supplied with less than 7V,
however,
the 5V pin may supply less than five volts and the board may be unstable. If using more
than 12V, the
voltage regulator may overheat and damage the board. The recommended range is 7 to 12
volts.
The power pins are as follows:
VIN. 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.
5V.This pin outputs a regulated 5V from the regulator on the board. The board can be
supplied
with power either from the DC power jack (7 - 12V), the USB connector (5V), or the VIN pin
of
the board (7-12V). Supplying voltage via the 5V or 3.3V pins bypasses the regulator, and
can
damage your board. We don't advise it.
3V3. A 3.3 volt supply generated by the on-board regulator. Maximum current draw is 50
mA.
GND. Ground pins.
Memory
The ATmega328 has 32 KB (with 0.5 KB used for the bootloader). It also has 2 KB of SRAM
and 1 KB
of EEPROM (which can be read and written with the EEPROM library).
Input and Output
Each of the 14 digital pins on the Uno can be used as an input or output, using pinMode(),
digitalWrite(), and digitalRead() functions. They operate at 5 volts. Each pin can provide or
receive a
maximum of 40 mA and has an internal pull-up resistor (disconnected by default) of 20-50
kOhms. In
addition, some pins have specialized functions:
Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial data. These
pins
are connected to the corresponding pins of the ATmega8U2 USB-to-TTL Serial chip.
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 attachInterrupt() function for
details.
PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the analogWrite() function.
SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI communication
using the SPI library.
LED: 13. 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.
The Uno has 6 analog inputs, labeled A0 through A5, each of which provide 10 bits of
resolution (i.e.
1024 different values). By default they measure from ground to 5 volts, though is it possible
to change
the upper end of their range using the AREF pin and the analogReference() function.
Additionally, some
pins have specialized functionality:
TWI: A4 or SDA pin and A5 or SCL pin. Support TWI communication using the Wire
library.
There are a couple of other pins on the board:
AREF. Reference voltage for the analog inputs. Used with analogReference().
Reset. Bring this line LOW to reset the microcontroller. Typically used to add a reset
button to
shields which block the one on the board.
See also the mapping between Arduino pins and ATmega328 ports. The mapping for the
Atmega8,
168, and 328 is identical.
Communication
The Arduino Uno has a number of facilities for communicating with a computer, another
Arduino, or
other microcontrollers. The ATmega328 provides UART TTL (5V) serial communication,
which is
available on digital pins 0 (RX) and 1 (TX). An ATmega16U2 on the board channels this
serial
communication over USB and appears as a virtual com port to software on the computer.
The '16U2
firmware uses the standard USB COM drivers, and no external driver is needed. However, on
Windows,
a .inf file is required. The Arduino software includes a serial monitor which allows simple
textual data to
be sent to and from the Arduino board. The RX and TX LEDs on the board will flash when
data is being
transmitted via the USB-to-serial chip and USB connection to the computer (but not for
serial
communication on pins 0 and 1).
A SoftwareSerial library allows for serial communication on any of the Uno's digital pins.
The ATmega328 also supports I2C (TWI) and SPI communication. The Arduino software
includes a
Wire library to simplify use of the I2C bus; see the documentation for details. For SPI
communication,
use the SPI library.
Programming
The Arduino Uno can be programmed with the Arduino software (download). Select "Arduino
Uno from
the Tools > Board menu (according to the microcontroller on your board). For details, see
the
reference and tutorials.
The ATmega328 on the Arduino Uno comes preburned with a bootloader that allows you to
upload new
code to it without the use of an external hardware programmer. It communicates using the
original
STK500 protocol (reference, C header files).
You can also bypass the bootloader and program the microcontroller through the ICSP (In-
Circuit
Serial Programming) header; see these instructions for details.
The ATmega16U2 (or 8U2 in the rev1 and rev2 boards) firmware source code is available .
The
ATmega16U2/8U2 is loaded with a DFU bootloader, which can be activated by:
On Rev1 boards: connecting the solder jumper on the back of the board (near the map of
Italy)
and then resetting the 8U2.
On Rev2 or later boards: there is a resistor that pulling the 8U2/16U2 HWB line to ground,
making it easier to put into DFU mode.
You can then use Atmel's FLIP software (Windows) or the DFU programmer (Mac OS X and
Linux) to
load a new firmware. Or you can use the ISP header with an external programmer
(overwriting the
DFU bootloader). See this user-contributed tutorial for more information.
Automatic (Software) Reset
Rather than requiring a physical press of the reset button before an upload, the Arduino Uno
is
designed in a way that allows it to be reset by software running on a connected computer.
One of the
hardware flow control lines (DTR) of the ATmega8U2/16U2 is connected to the reset line of
the
ATmega328 via a 100 nanofarad capacitor. When this line is asserted (taken low), the reset
line drops
long enough to reset the chip. The Arduino software uses this capability to allow you to
upload code by
simply pressing the upload button in the Arduino environment. This means that the
bootloader can
have a shorter timeout, as the lowering of DTR can be well-coordinated with the start of the
upload.
This setup has other implications. When the Uno is connected to either a computer running
Mac OS X
or Linux, it resets each time a connection is made to it from software (via USB). For the
following halfsecond
or so, the bootloader is running on the Uno. While it is programmed to ignore malformed
data
(i.e. anything besides an upload of new code), it will intercept the first few bytes of data
sent to the
board after a connection is opened. If a sketch running on the board receives one-time
configuration or
other data when it first starts, make sure that the software with which it communicates
waits a second
after opening the connection and before sending this data.
The Uno contains a trace that can be cut to disable the auto-reset. The pads on either side
of the trace
can be soldered together to re-enable it. It's labeled "RESET-EN". You may also be able to
disable the
auto-reset by connecting a 110 ohm resistor from 5V to the reset line; see this forum
thread for
details.
USB Overcurrent Protection
The Arduino Uno has a resettable polyfuse that protects your computer's USB ports from
shorts and
overcurrent. Although most computers provide their own internal protection, the fuse
provides an extra
layer of protection. If more than 500 mA is applied to the USB port, the fuse will
automatically break
the connection until the short or overload is removed.
Physical Characteristics
The maximum length and width of the Uno PCB are 2.7 and 2.1 inches respectively, with the
USB
connector and power jack extending beyond the former dimension. Four screw holes allow
the board to
be attached to a surface or case. Note that the distance between digital pins 7 and 8 is 160
mil
Gsm module same

Gps module same


Lcd same

Vibration sensor

Refer feb03
CHAPTER 4 CODING

Co ding i s as fo llo ws..

#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="";
String longitude="";

int temp=0,k=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);
lcd.print(" No GPS Range ");
get_gps();
show_coordinate();
delay(2000);
lcd.clear();
lcd.print("GPS Range Found");
lcd.setCursor(0,1);
lcd.print("GPS is Ready");
delay(2000);
lcd.clear();
lcd.print("Latitide:");
lcd.print(latitude);
lcd.setCursor(0,1);
lcd.print("Longitude:");
lcd.print(longitude);
temp=0;
}
void loop()
{
serialEvent();
if(temp)
{
get_gps();
tracking();
}
}
void serialEvent()
{
while(Serial.available())
{
if(Serial.find("Track Vehicle"))
{
temp=1;
break;
}
else
temp=0;
}
}
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)
{
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()
{
gps_status=0;
int x=0;
while(gps_status==0)
{
gpsEvent();
int str_lenth=i;
latitude="";
longitude="";
coordinate2dec();
i=0;x=0;
str_lenth=0;

}
}
void show_coordinate()
{
lcd.clear();
lcd.print("Latitide:");
lcd.print(latitude);
lcd.setCursor(0,1);
lcd.print("Longitude:");
lcd.print(longitude);
Serial.print("Latitude:");
Serial.println(latitude);
Serial.print("Longitude:");
Serial.println(longitude);
}
void gpsEvent()
{
gpsString="";
while(1)
{
while (gps.available()>0) //Serial incoming data from GPS
{
char inChar = (char)gps.read();
gpsString+= inChar; //store incoming data from GPS to temporary
string str[]
i++;
if (i < 7)
{
if(gpsString[i-1] != test[i-1]) //check for right string
{
i=0;
gpsString="";
}
}
if(inChar=='\r')
{
if(i>65)
{
gps_status=1;
break;
}
else
{
i=0;
}
}
}
if(gps_status)
break;
}
}
void coordinate2dec()
{

//j=0;
String lat_degree="";
for(i=18;i<20;i++) //extract latitude from string
lat_degree+=gpsString[i];

String lat_minut="";
for(i=20;i<28;i++)
lat_minut+=gpsString[i];

String long_degree="";
for(i=30;i<33;i++) //extract longitude from string
long_degree+=gpsString[i];

String long_minut="";
for(i=33;i<41;i++)
long_minut+=gpsString[i];

float minut= lat_minut.toFloat();


minut=minut/60;
float degree=lat_degree.toFloat();
latitude=degree+minut;

minut= long_minut.toFloat();
minut=minut/60;
degree=long_degree.toFloat();
longitude=degree+minut-52.67;
}
void init_sms()
{
Serial.println("AT+CMGF=1");
delay(400);
Serial.println("AT+CMGS=\"+919629619780\""); // 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("Latitide:");
lcd.print(latitude);
lcd.setCursor(0,1);
lcd.print("Longitude:");
lcd.print(longitude);
return;
}
void tracking()
{
init_sms();
send_data("Vehicle Tracking Alert:");
send_data("Your Vehicle Current Location is:");
Serial.print("Latitude:");

//Serial.print(1.0004, 4); // print floating point variable showing four digits after
decimal point.
send_data(latitude);
Serial.print("Longitude:");
send_data(longitude);

Serial.print("https://www.google.co.in/maps/@12.1173511,79.6157358,321m/d
ata=!3m1!1e3");
send_sms();
delay(2000);
lcd_status();
}
From here all are
same but change
the wordings like
helping passenger
to find the
destination point
and helping the
people waiting at
the busstop abt
the bus timings
and exact time to
reach the
place
.
Photos:

You might also like