You are on page 1of 66

Automatic accident Detection System and Rescue

CHAPTER1
INTRODUCTION

The population of the world has been increasing, with China and India being the two most
densely populated countries. Road traffic has also been getting more and more congested,
as a higher population and increased business activities result in greater demand for cars
and vehicles for transportation. This increased vehicle density leads to many road accidents.
In road accident due to lack of emergency services people lose their lives. The main aim of
this project is a scheme to detect accident, find accident location and provide a smooth flow
for ambulance to reach hospital in time in emergency. In proposed system the unit installed
in vehicle automatically informs accident to the preprogrammed numbers of rescue team of
ambulance.

GPS tracking system are used for accident detection. When accident occurs, this
system sends short message to rescue team in the ambulance via GSM modem. Message
will give longitude and latitude values. From these location coordinates accident can be
determined. So, the rescue team in the ambulance can immediately trace the location by
putting geographical location coordinates in Google earth application or any other GPS
viewer application. After conforming the location of accident spot the ambulance unit will
starts its rescue operation. If the person meets with a small accident or if there is no serious
threat to anyone`s life, then the alert message can be terminated by the driver by a switch
provided in order to avoid wasting the valuable time of the medical rescue team. At present
criteria, we cannot detect where the accident has occurred and hence no information related
to it, leading to the death of an individual.

Dept. of ECE, MTIET, Palamaner 1


Automatic accident Detection System and Rescue

CHAPTER 2
EXISTING SYSTEM

The ideal scenario for a victim of an accident is that police and ambulances arrive on the
scene immediately but in reality, victims do not always have this luxury. For instance,
numerous accidents in Abu Dhabi or Dubai occur in places where no bystander or passing
car is available to notify the police. Furthermore, as many accidents occur on highways,
vehicles passing by at high speeds often ignore their duty to notify the police/ambulance.
The response time of the police/ambulance varies due to the detection time, which is
dependent on the drivers in accident, passing by drivers or bystanders’ information. As
human lives are at stake, the detection and response time are crucial variables for the
victims of a vehicle accident as well as the governing agencies.

Rescue time in an hour in existing system

Rescue time Hospital time

Figure 2.1: Rescue time in an hour in existing system

Even a slight reduction in the response time can decrease the percentage of fatalities
and economic loss by a huge margin. Using an incident detection program in the United

Dept. of ECE, MTIET, Palamaner 2


Automatic accident Detection System and Rescue

States, a reduction in the response time from 5.2 minutes to 3 minutes would have saved
246 lives, a reduction by 11% whereas by reducing the response time to 2 minutes, 356
lives would be saved annually. While it is easy to claim a reduction in lives due to reduction
in response time, an actual example helps in the cementing of the argument: a reduction in
accident notification time from 5.2 minutes to 4.28 minutes has led to an 18% reduction of
fatalities. Similarly, the cost associated with fatalities and deaths were staggering in the
United States. Cost is less if the rescue time is small.

2.1 FLOW CHART:


If any one of the step in the process is delayed then emergency services are also delayed
which might lead to loss of life.

START

ACCIDENT OCCURED

NOTICED BY WITNESS

MADE A PHONE CALL

RESCUE TEAM REACHED TO


THE ACCIDENT SPOT

EMERGENCY SERVICES

STOP

Figure 2.2: Process flow in existing system

Dept. of ECE, MTIET, Palamaner 3


Automatic accident Detection System and Rescue

2.2 DISADVANTAGES:
• About 1.24 million people die each every year due to crashes on road.
• No witness to call ambulance in remote areas.
• Location cannot be accurately mentioned in remote areas.
• Rescue time is large which results in death of victim.

Dept. of ECE, MTIET, Palamaner 4


Automatic accident Detection System and Rescue

CHAPTER 3
PROPOSED SYSTEM

This functions as a detection and notification service that can be installed in a vehicle and in
case of accident detection, requires the smartphone of the driver to send a text message to
the response team. The detection of an accident is based on sensors, using four parameters
like temperature and tilt angle to calculate a collision index and if the threshold of the index
is met, the smartphone issues and sends a notification text message. This eliminates the
need of the passing by drivers or bystanders to notify the police of the accident.

Sales

Rescue time Hospital treatment

Figure 3.1: Rescue time in an hour in proposed system

Proposed system is demonstrated by using GSM and GPS technologies. The GPS
satellites are used to identify the exact location of incident, speed, time and direction. In a
typical microcontroller-based road accident detection and communication system, MEMS
sensor is used to detect accident. In case of an accident, the system determines longitude
and latitude of a position where an accident occurs through the GPS module. Then it sends
a message which contains the position of vehicle to the emergency department.

Dept. of ECE, MTIET, Palamaner 5


Automatic accident Detection System and Rescue

3.1 WORKING:
Here our system can detect the accident using Mems sensor. Mems sensor changes its
resistance depending upon amount of bend due to accident. This sensor is connected to
Arduino microcontroller. There are threshold values of these sensor outputs. If sensor's
output is more than this threshold value then it indicates that accident has occurred. But
when the condition of breaking comes it is extremely difficult. In this case the system will
calculate coordinates (latitude, longitude and altitude) using GPS. These co-ordinates will
be messaged to rescue team. GPS module used here is to detect the location of accident and
is compact, high performance, and low power consumption GPS module.

3.2 FLOW CHART:

START

ACCIDENT OCCURED

OCCURANCE DETECTED USING


SENSORS

SENT ALERT TO RESCUE AMBULANCE


POLICE AND FIRE ENGINE

EMERGENCY SERVIES

STOP

Figure 3.2: Process flow in proposed system

Dept. of ECE, MTIET, Palamaner 6


Automatic accident Detection System and Rescue

CHAPTER 4
HARDWARE DESCRIPTION

4.1 BLOCK DIAGRAM:

POWER SUPPLY

DHT11 LCD
Sensor ARDUINO
UNO
GSM
MEMS
Sensor

GPS

Figure 4.1: Vehicle unit

4.2 HARDWARE REQUIREMENTS:


1. Power supply

2. Arduino Uno

3. MEMS sensor

5. LCD

6. GSM

7. GPS

Dept. of ECE, MTIET, Palamaner 7


Automatic accident Detection System and Rescue

4.3 HARDWARE DESCRIPTION:


4.3.1 Power supply and its basic components:
Control supplies, occasionally called control connectors, or just connectors, are accessible
in different voltages, with changing current purposes of repression, which is quite recently
the most phenomenal most extreme of a compel supply to pass on current to a stack.
Subsequently, on the off chance that you create one yourself, you will always know how to
repair it, as you will know effectively what area/some part of the circuit is doing what.
Also, further, knowing how to make one will permit you to repair the ones you have
inception at now got, without squandering your cash on another.

4.3.1.1 Adapter:
It is a type of external power supply, often enclosed in a case similar to an AC plug. Each
AC/DC adapter is specifically designed to accept a certain AC input and convert in to
particular DC output.

Figure 4.2: Adapter


4.3.1.2 Transformers:
Transformers are contraptions which wander down a for the most part higher AC
information Voltage into a lower AC yield voltage. To find the data and yield terminals of a
transformer is outstandingly crude.

Dept. of ECE, MTIET, Palamaner 8


Automatic accident Detection System and Rescue

Figure 4.3: Transformer


Basically, there are two sides in a transformer where the bend bowing inside the
transformer closes. Both terminations have two wires each. On the transformer, one side
will have three terminals and the other will have two. The one with the three terminals is
the wandered down yield of the transformer, and the one with the two terminals is the place
the data voltage is to be acclimated.

4.3.1.3 Rectifier:
Rectifier is a gadget which is utilized to change over AC voltage to DC voltage. It is for the
most part separated into Full wave and Half wave rectifiers. At the point when forward one-
sided there will be voltage drop in diodes of around 0.7v.In this manner when two diodes
are combined together for allowance of light of the path there will be a voltage drop of 1.4v
since every diode as a voltage drop of 0.7v. However, on account of full wave connect
rectifier there will be a voltage drop of 0.7v as it were. The voltage controller needs 2 volts
more than its yield voltage. For in the event that we are interfacing 12v connector for our
motivation and henceforth we require 14v according to the yield voltage.

Figure 4.4: Rectifier

Dept. of ECE, MTIET, Palamaner 9


Automatic accident Detection System and Rescue

So the yield of the diodes (which goes into the voltage controller) will must be more
than or vague to 14 Volts. According to the diode data voltage the diode voltage in the
voltage controller will be 14v. The voltage drop will be 1.4v totally, so the proportionate
aggregate voltage will be 15.4 volts of which 14v in addition to 1.4v. so it is ideal to utilize
18 volt venture down transformer from 220 volt input voltage. In this manner transformer
yield voltage will be of 3.4v of rough esteem.

4.3.1.4 Capacitors:
Capacitors are utilized to get the immaculate and smoothest DC voltage in which the
rectifier is utilized to get throbbing DC voltage which is utilized as a part of the light of the
present destiny, from the connector. Capacitors are utilized to get square DC from AC
current experience of the present channels so they are used as a touch of parallel to the
yield. Moreover, if there is a swell in the data or yield, a capacitor changes it by discharging
the charge set away in it.

Figure 4.5: Capacitor

4.3.1.5 Voltage regulator:


The 78XX voltage controller is principally overall utilized controller for voltage controllers.
The XX speaks to the voltage of which the voltage controller delivers as the yield to the
specific gadget. 7805 will deliver and control the yield voltage of 5v and 7812 will create
the yield voltage of 12v. The voltage controllers are that they require no under 2 volts more
than their yield voltage as information. For instance, 7805 will require no under 7V, and

Dept. of ECE, MTIET, Palamaner 10


Automatic accident Detection System and Rescue

7812, no under 14 volts as information sources. This voltage which ought to be given
tovoltage controllers is called Dropout Voltage.

Figure 4.6: Voltage regulator

4.3.2 Arduino:
The Arduino microcontroller is an easy to use yet powerful single board computer that has
gained a considerable traction in the hobby and professional market. The Arduino is open-
source, which means hardware is reasonably priced and development software is free. This

Figure 4.7: Arduino UNO board

Dept. of ECE, MTIET, Palamaner 11


Automatic accident Detection System and Rescue

guide is for students in ME 2011, or students anywhere who are confronting the Arduino
for the first time. For advanced Arduino users, prowl the web; there are lots of resources.
This is what the Arduino board looks like.

The Arduino programming language is a simplified version of C/C++. If you know


C, programming the Arduino will be familiar. If you do not know C, no need to worry as
only a few commands are needed to perform useful functions.

An important feature of the Arduino is that you can create a control program on the
host PC, download it to the Arduino and it will run automatically. Remove the USB cable
connection to the PC, and the program will still run from the top each time you push the
reset button. Remove the battery and put the Arduino board in a closet for six months.
When you reconnect the battery, the last program you stored will run. This means that you
connect the board to the host PC to develop and debug your program, but once that is done,
you no longer need the PC to run the program.

4.3.2.1 Arduino hardware:


The power of the Arduino is not its ability to crunch code, but rather its ability to interact
with the outside world through its input-output (I/O) pins. The Arduino has 14 digital I/O
pins labeled 0 to 13 that can be used to turn motors and lights on and off and read the state
of switches.

Each digital pin can sink or source about 40 mA of current. This is more than
adequate for interfacing to most devices, but does mean that interface circuits are needed to
control devices other than simple LED's. In other words, you cannot run a motor directly
using the current available from an Arduino pin, but rather must have the pin drive an
interface circuit that in turn drives the motor. A later section of this document shows how to
interface to a small motor.

To interact with the outside world, the program sets digital pins to a high or low
value using C code instructions, which corresponds to +5 V or 0 V at the pin. The pin is

Dept. of ECE, MTIET, Palamaner 12


Automatic accident Detection System and Rescue

connected to external interface electronics and then to the device being switched on and off.
The sequence of events is shown in this figure.

Figure 4.8: The sequence of events to interact with external world

To determine the state of switches and other sensors, the Arduino is able to read the
voltage value applied to its pins as a binary number. The interface circuitry translates the
sensor signal into a 0 or +5 V signal applied to the digital I/O pin. Through a program
command, the Arduino interrogates the state of the pin. If the pin is at 0 V, the program will
read it as a 0 or LOW. If it is at +5 V, the program will read it as a 1 or HIGH. If more than
+5 V is applied, you may blow out your board, so be careful. The sequence of events to
read a pin is shown in this figure.

Dept. of ECE, MTIET, Palamaner 13


Automatic accident Detection System and Rescue

Figure 4.9: The sequence of events to read a pin

Interacting with the world has two sides. First, the designer must create electronic
interface circuits that allow motors and other devices to be controlled by a low (1-10 mA)
current signal that switches between 0 and 5 V, and other circuits that convert sensor
readings into a switched 0 or 5 V signal. Second, the designer must write a program using
the set of Arduino commands that set and read the I/O pins. Examples of both can be found
in the Arduino resources section of the ME2011 web site.

4.3.2.2 Technical specifications:


• Microcontroller: Microchip ATmega328P [7]
• Operating Voltage: 5 Volts

Dept. of ECE, MTIET, Palamaner 14


Automatic accident Detection System and Rescue

• Input Voltage: 7 to 20 Volts


• Digital I/O Pins: 14 (of which 6 provide PWM output)
• Analog Input Pins: 6
• DC Current per I/O Pin: 20 mA
• DC Current for 3.3V Pin: 50 mA
• Flash Memory: 32 KB of which 0.5 KB used by bootloader
• SRAM: 2 KB
• EEPROM: 1 KB
• Clock Speed: 16 MHz
• Length: 68.6 mm
• Width: 53.4 mm
• Weight: 25 g
4.3.2.3 Pin configurations:

Figure 4.10: Plastic Dual In-Line Package (PDIP)

Dept. of ECE, MTIET, Palamaner 15


Automatic accident Detection System and Rescue

Figure 4.11: Top View of Thin Quad Flat Package

Dept. of ECE, MTIET, Palamaner 16


Automatic accident Detection System and Rescue

Figure 4.12: Top View of Micro Lead Frame

4.3.2.4 Atmega328p features:


➢ High Performance, Low Power AVR® 8-Bit Microcontroller
➢ Advanced RISC Architecture

– 131 Powerful Instructions

– Most Single Clock Cycle Execution

– 32 x 8 General Purpose Working Registers

– Fully Static Operation

– Up to 20 MIPS Throughput at 20 MHz

Dept. of ECE, MTIET, Palamaner 17


Automatic accident Detection System and Rescue

– On-chip 2-cycle Multiplier

➢ High Endurance Non-volatile Memory Segments

– 4/8/16/32K Bytes of In-System Self-Programmable Flash progam memory


(ATmega48PA/88PA/168PA/328P)

– 256/512/512/1K Bytes EEPROM (ATmega48PA/88PA/168PA/328P)

– 512/1K/1K/2K Bytes Internal SRAM (ATmega48PA/88PA/168PA/328P)

– Write/Erase Cycles: 10,000 Flash/100,000 EEPROM

– Data retention: 20 years at 85°C/100 years at 25°C(1)

– Optional Boot Code Section with Independent Lock Bits In-System Programming
by On-chip Boot Program True Read-While-Write Operation

– Programming Lock for Software Security

➢ Peripheral Features

– Two 8-bit Timer/Counters with Separate Prescaler and Compare Mode

– One 16-bit Timer/Counter with Separate Prescaler, Compare Mode, and Capture
Mode

– Real Time Counter with Separate Oscillator

– Six PWM Channels – 8-channel 10-bit ADC in TQFP and QFN/MLF package
Temperature Measurement – 6-channel 10-bit ADC in PDIP Package Temperature
Measurement

– Programmable Serial USART

– Master/Slave SPI Serial Interface

– Byte-oriented 2-wire Serial Interface (Philips I2 C compatible)

Dept. of ECE, MTIET, Palamaner 18


Automatic accident Detection System and Rescue

– Programmable Watchdog Timer with Separate On-chip Oscillator

– On-chip Analog Comparator

– Interrupt and Wake-up on Pin Change

➢ Special Microcontroller Features

– Power-on Reset and Programmable Brown-out Detection

– Internal Calibrated Oscillator

– External and Internal Interrupt Sources

– Six Sleep Modes: Idle, ADC Noise Reduction, Power-save, Power-down,


Standby, and Extended Standby

4.3.2.5 Overview:
The ATmega48PA/88PA/168PA/328P is a low-power CMOS 8-bit microcontroller based
on the AVR enhanced RISC architecture. By executing powerful instructions in a single
clock cycle, the ATmega48PA/88PA/168PA/328P achieves throughputs approaching 1
MIPS per MHz allowing the system designer to optimize power consumption versus
processing speed.

The AVR core combines a rich instruction set with 32 general purpose working
registers. All the 32 registers are directly connected to the Arithmetic Logic Unit (ALU),
allowing two independent registers to be accessed in one single instruction executed in one
clock cycle. The resulting architecture is more code efficient while achieving throughputs
up to ten times faster than conventional CISC microcontrollers.

Dept. of ECE, MTIET, Palamaner 19


Automatic accident Detection System and Rescue

Figure 4.13: Architecture of Atmega328

The ATmega48PA/88PA/168PA/328P provides the following features: 4/8/16/32K


bytes of In System Programmable Flash with Read-While-Write capabilities,
256/512/512/1K bytes EEPROM, 512/1K/1K/2K bytes SRAM, 23 general purpose I/O
lines, 32 general purpose working registers, three flexible Timer/Counters with compare
modes, internal and external interrupts, a serial programmable USART, a byte-oriented 2-

Dept. of ECE, MTIET, Palamaner 20


Automatic accident Detection System and Rescue

wire Serial Interface, an SPI serial port, a 6-channel 10-bit ADC (8 channels in TQFP and
QFN/MLF packages), a programmable Watchdog Timer with internal Oscillator, and five
software selectable power saving modes. The Idle mode stops the CPU while allowing the
SRAM, Timer/Counters, USART, 2-wire Serial Interface, SPI port, and interrupt system to
continue functioning. The Power-down mode saves the register contents but freezes the
Oscillator, disabling all other chip functions until the next interrupt or hardware reset. In
Power-save mode, the asynchronous timer continues to run, allowing the user to maintain a
timer base while the rest of the device is sleeping. The ADC Noise Reduction mode stops
the CPU and all I/O modules except asynchronous timer and ADC, to minimize switching
noise during ADC conversions. In Standby mode, the crystal/resonator Oscillator is running
while the rest of the device is sleeping. This allows very fast start-up combined with low
power consumption.

The device is manufactured using Atmel’s high-density non-volatile memory


technology. The On-chip ISP Flash allows the program memory to be reprogrammed In-
System through an SPI serial interface, by a conventional non-volatile memory
programmer, or by an On-chip Boot program running on the AVR core. The Boot program
can use any interface to download the application program in the Application Flash
memory. Software in the Boot Flash section will continue to run while the Application
Flash section is updated, providing true Read-While-Write operation. By combining an 8-
bit RISC CPU with In-System Self-Programmable Flash on a monolithic chip, the Atmel
ATmega48PA/88PA/168PA/328P is a powerful microcontroller that provides a highly
flexible and cost-effective solution to many embedded control applications. The
ATmega48PA/88PA/168PA/328P AVR is supported with a full suite of program and
system development tools that will include the C Compilers, Macro Assemblers, Program
Debugger/Simulators, In-Circuit Emulators, and Evaluation kits.

4.3.2.6 Power:
The Arduino Board can be energized with a USB connector or with an external power unit.
The Energy supplied to the Board is about 12v AC but the Arduino Board contains the

Dept. of ECE, MTIET, Palamaner 21


Automatic accident Detection System and Rescue

inbuilt Voltage Regulator, which regulates the Voltage from 12v to 5v and Rectifier
converts the AC current to DC Current to this 5V supply another regulator is used to reduce
the voltage to 3v.
• V-IN: The I/P to the Board is given through external power supply
• 5V:A 5V volts supply exists in the board due to the regulator in it
• Gnd: Ground pins.

4.3.2.7 Memory:
The ATmega328 has 32 KB (with 0.5 KB used for the boot loader). It also has 2 KB of
SRAM and 1 KB of EEPROM (which can be read and written with the EEPROM library).

4.3.2.8 Input and Output:


The pins in the Board either can be used as I/p or O/p, its usage depends upon the client as
pinMode(), digitalWrite() and digitalRead() functions. These can be handled at 5V. Each
pin contains internal Pull-up resistor of 20-50 ohms.

• To transmit the data serially a Receiver and a Transmitter is required, here in this
Arduino Board has pins(0,1) as RX and TX these internally connected to the TTL
serial Chip.
• 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.

4.3.2.9 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

Dept. of ECE, MTIET, Palamaner 22


Automatic accident Detection System and Rescue

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 Software Serial 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.

4.3.2.10 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 boot loader 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 boot loader 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

Dept. of ECE, MTIET, Palamaner 23


Automatic accident Detection System and Rescue

programmer (overwriting the DFU bootloader). See this user-contributed tutorial for more
information.

4.3.2.11 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 nano farad 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.

4.3.2.12 USB Over current Protection:


The Arduino Uno has a resettable polyfuse that protects your computer's USB ports from
shorts and over current. Although most computers provide their own internal protection, the

Dept. of ECE, MTIET, Palamaner 24


Automatic accident Detection System and Rescue

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.

4.3.3 LCD:
LCD (Liquid Crystal Display) screen is an electronic display module and find a wide range
of applications. A 16x2 LCD display is very basic module and is very commonly used in
various devices and circuits. These modules are preferred over seven segments and other
multi segment LEDs.

LCDs are economical; easily programmable; have no limitation of displaying


special & even custom characters (unlike in seven segments), animations and so on.

A 16x2 LCD means it can display 16 characters per line and there are 2 such lines.
In this LCD each character is displayed in 5x7 pixel matrix. This LCD has two registers,
namely, Command and Data.

The command register stores the command instructions given to the LCD. A command is
an instruction given to LCD to do a predefined task like initializing it, clearing its screen,
setting the cursor position, controlling display etc. The data register stores the data to be
displayed on the LCD. The data is the ASCII value of the character to be displayed on the
LCD. Click to learn more about internal structure of a LCD.

Dept. of ECE, MTIET, Palamaner 25


Automatic accident Detection System and Rescue

4.3.3.1 Pin diagram:

4.3.2.2 Pin Description:

Figure 4.14: Pin diagram of LCD

Dept. of ECE, MTIET, Palamaner 26


Automatic accident Detection System and Rescue

Table 4.1: Pin Description of LCD

Pin
Function Name
No
1 Ground (0V) Ground
2 Supply voltage; 5V (4.7V – 5.3V) Vcc
3 Contrast adjustment; through a variable resistor VEE
Selects command register when low; and data register Register
4
when high Select
Low to write to the register; High to read from the
5 Read/write
register
Sends data to data pins when a high to low pulse is
6 Enable
given
7 DB0
8 DB1
9 DB2
10 DB3
8-bit data pins
11 DB4
12 DB5
13 DB6
14 DB7
15 Backlight VCC (5V) Led+
16 Backlight Ground (0V) Led-

The fee enlists shops the summon directions given to the LCD. A summon is a
direction given to LCD to do a predefined undertaking like introducing it, clearing its
display, placing the cursor function, controlling showcase and so on. The statistics enlist
shops the statistics to be shown on the LCD. The facts are the ASCII estimation of the
character to be proven at the LCD. Snap to soak up more about inner structure of a LCD.

Dept. of ECE, MTIET, Palamaner 27


Automatic accident Detection System and Rescue

There are numerous styles of LCD’s like 16x2 and 20x4. Here on this challenge we use
16x2 LCD. Here we use dot matrix LCD.

4.3.3.2 Block Diagram of LCD Display:

Figure 4.15: LCD Display

Dept. of ECE, MTIET, Palamaner 28


Automatic accident Detection System and Rescue

4.3.3.3: LCD Display Interfacing Flowchart:

Figure 4.16: Flow chart of interfacing LCD display

4.3.3.4 8bit mode:


There is lot of stuff that can be done with the LCDs, to start with we will simple display a
couple of strings on the 2 lines of the LCD as shown in the image.

4.3.4.3 Schematic description:


• Data Lines: In this mode, all of the 8 data lines DB0 to DB7 are connected from the
microcontroller to a LCD module as shown the schematic.
• Control Lines:' The RS, RW and E are control lines, as discussed earlier.

Dept. of ECE, MTIET, Palamaner 29


Automatic accident Detection System and Rescue

• Power &contrast: Apart from that the LCD should be powered with 5V between PIN
2(VCC) and PIN 1(gnd). PIN 3 is the contrast pin and is output of center terminal of
potentiometer (voltage divider) which varies voltage between 0 to 5v to vary the
contrast.
• Back-light: The PIN 15 and 16 are used as backlight. The led backlight can be
powered through a simple current limiting resistor as we do with normal led’s.

4.3.4 GSM:
GSM stands for Global System for Mobile Communications. It is a standard set developed
by the European Telecommunications Standards Institute (ETSI) to describe protocols for
second generation (2G) digital cellular networks used by mobile phones. A Modem is a
device which modulates and demodulates signals as required to meet the communication
requirements. It modulates an analog carrier signal to encode digital information, and also
demodulates such a carrier signal to decode the transmitted information.

A GSM Modem is a device that modulates and demodulates the GSM signals and in
this particular case 2G signals. The modem we are using is SIMCOM SIM900. It is a Tri-
band GSM/GPRS Modem as it can detect and operate at three frequencies (EGSM 900
MHz, DCS 1800 MHz and PCS1900 MHz). Default operating frequencies are EGSM
900MHz and DCS 1800MHz.

Sim900 is a widely used in many projects and hence many variants of development
boards for this have been developed. These development boards are equipped with various
features to make it easy to communicate with the SIM900 module. Some boards provide
only TTL interface while some boards include an RS232 interface and some others include
an USB interface. If your PC has a serial port(DB9) you can buy a GSM Modem that has
both TTL and RS232 interfacings in economy.

4.3.4.1 Use of GSM:


GSM Technology has grown so much, that literally there isn’t a place on earth where there
is no GSM signal. In such a scenario GSM provides us a wide scope in controlling things

Dept. of ECE, MTIET, Palamaner 30


Automatic accident Detection System and Rescue

remotely from any place just with our finger tips. GSM also provides ease to easily
communicate in a more robust way.

A GSM module has an RS232 interface for serial communication with an external
peripheral. In this case, the transmit pin (Tx) of the computer’s Serial port is connected with
the receive pin (Rx) of the GSM module’s RS-232 interface. The transmit pin (Tx) of the
RS-232 of GSM module is connected to receive pin (Rx) of microcontroller’s serial
transmission pin. And the serial transmit pin of the microcontroller is connected to the
receive pin of the computer’s Serial port. Therefore, the commands and their results are
transmitted and received in a triangular fashion as depicted below.

Figure 4.17: Process Flow of Commands

In subsequent projects ( MC075 & MC076), the HyperTerminal will be replaced by


the microcontroller itself; thus avoiding the need of using a Computer to establish an
interface. This would lead to an independent GSM based system.

The microcontroller is programmed to receive and transmit data at a baud rate of


9600. For more details on setting the baud rate of microcontroller, refer serial
communication with 8051.

Dept. of ECE, MTIET, Palamaner 31


Automatic accident Detection System and Rescue

The controller can receive data signals either by polling or by making use of serial
interrupt (ES). Serial interrupt has been explained in interrupt programming. In polling, the
controller continuously scans serial port for incoming data from the GSM module.

4.3.5 GPS:
GPS is used in vehicles for both tracking and navigation. Tracking systems enable a base
station to keep track of the vehicles without the intervention of the driver where, as
navigation system helps the driver to reach the destination. Whether navigation system or
tracking system, the architecture is more or less similar. When an accident occurred in any
place then GPS system tracks the position of the vehicle and sends the information to the
particular person through GSM by alerting the person through SMS or by a call.

4.3.5.1 Introduction to GPS Functions/Features:


GPS use satellite data to calculate an accurate position on the earth. These calculations can
relate the user’s position to almost any map projection within milli-seconds. All GPS work
in a similar manner but they often look very different and have different software. The most
significant difference between GPS receivers is the number of satellites they can
simultaneously communicate with. Most receivers are described as 12 channel meaning
they can communicate with 12 satellites. Older models may be 8 or even 5 channel with
more modern receivers capable of communicating with 14 – 20. Given the current (2005)
makeup of the GPS satellite’s constellation 12 channel is more than adequate.

4.3.6 MEMS Sensor:


The MEMS accelerometers can be divided into two important micro system architectures:
piezo resistive and capacitive. Even though both of these two types of accelerometers
possess internal proof masses which are excited by acceleration, the differences of these
two architectures lie in the transduction mechanism which is used to the movement
correlation of the internal proof mass to accelerate.

The Capacitive accelerometers possess a differential capacitor whose balance is


disrupted by the proof mass movement. Piezo resistive accelerometers commonly rely on

Dept. of ECE, MTIET, Palamaner 32


Automatic accident Detection System and Rescue

inducing, which attach the proof mass to the sensor which is used for identification of the
movement of the mass.

Fujitsu successfully developed the ‘FAR-S2AB’ series, 3-axis Accelerometer, using


state-of-the-art MEMS technology. This small and highly sensitive accelerometer can
detect acceleration, inclination and vibration by measuring the motion in the x-, y-, and z-
axis simultaneously. The MEMS 3-axis accelerometer consists of a Mass at the centre of
the sensor’s chip, which is suspended by 4 Beams doped with Piezo resistive material.

4.3.7 DHT11 sensor (Temperature/humidity sensor):


This DHT11 Temperature and Humidity Sensor include an adjusted advanced flag yield
with the temperature and mugginess sensor complex. Its innovation guarantees the high
dependability and magnificent long haul solidness. An elite 8-bit microcontroller is
associated. This sensor incorporates a resistive component and a feeling of wet NTC
temperature measuring gadgets. It has superb quality, quick reaction, hostile to impedance
capacity and high cost execution points of interest. Each DHT11 sensors highlights to a
great degree exact adjustment of dampness alignment chamber.

The adjustment coefficients put away in the OTP program memory, inner sensors
identify motions all the while, we should call these alignment coefficients. The single-wire
serial interface framework is coordinated to end up noticeably snappy and simple. Little
size, low power, flag transmission remove up to 20 meters, making it an assortment of
utilizations and even the most requesting applications. The item is 4-stick single column
stick bundle. Advantageous association, uncommon bundles can be given by clients require.

Dept. of ECE, MTIET, Palamaner 33


Automatic accident Detection System and Rescue

Figure 4.17: DHT11 Sensor

4.3.7.1 Specification:

• Supply Voltage: +5 V
• Temperature range :0-50 °C error of ± 2 °C
• Humidity :20-90% RH ± 5% RH error
• Interface: Digital

Dept. of ECE, MTIET, Palamaner 34


Automatic accident Detection System and Rescue

CHAPTER 5
SOFTWARE DESCRIPTION

5.1 SOFTWARE REQUIREMENTS:


• Arduino IDE
• Embedded c
• Proteus Design Suite

5.1.1 Arduino IDE:


The Arduino integrated development environment (IDE) is a cross-platform application (for
Windows, macOS, Linux) that is written in the programming language Java. It is used to
write and upload programs to Arduino board.

The source code for the IDE is released under the GNU General Public License,
version. The Arduino IDE supports the languages C and C++ using special rules of code
structuring. The Arduino IDE supplies a software library from the Wiring project, which
provides many common input and output procedures. User-written code only requires two
basic functions, for starting the sketch and the main program loop, that are compiled and
linked with a program stub main () into an executable cyclic executive program with the
GNU tool chain, also included with the IDE distribution. The Arduino IDE employs the
program to convert the executable code into a text file in hexadecimal encoding that is
loaded into the Arduino board by a loader program in the board's firmware.

Dept. of ECE, MTIET, Palamaner 35


Automatic accident Detection System and Rescue

Figure 5.1: Arduino IDE

Depending on what type of Arduino you have, you may also have a USB connector
to enable it to be connected to a PC or Mac to upload or retrieve data. The board exposes
the microcontroller's I/O (Input/output) pins to enable you to connect those pins to other
circuits or to sensors, etc.

Now that you are a proud owner of an Arduino, or an Arduino clone, it might help
if you knew what it was and what you can do with it.

In its simplest form, an Arduino is a tiny computer that you can program to process
inputs and outputs going to and from the chip.

The Arduino is what is known as a Physical or Embedded Computing platform,


which means that it is an interactive system, that through the use of hardware and
software can interact with it's environment.

For example, a simple use of the Arduino would be to turn a light on for a set
period of time, let's say 30 seconds, after a button has been pressed (we will build this
very same project later in the book). In this example, the Arduino would have a lamp
connected to it as well as a button. The Arduino would sit patiently waiting for the button
to be pressed. When you press the button, it would then turn the lamp on andstart
counting. Once it had counted 30 seconds it would then turn the lamp off and then carry
on sitting there waiting for another button press. You could use this set-up to control a

Dept. of ECE, MTIET, Palamaner 36


Automatic accident Detection System and Rescue

lamp in an under-stair’s cupboard for example. You could extend this example to sense
when the cupboard door was opened and automatically turn the light on, turning it
off after a set period of time.

The Arduino can be used to develop stand-alone interactive objects or it can be


connected to a computer to retrieve or send data to the Arduino and then act on that data
(e.g. Send sensor data out to the internet).The Arduino can be connected to LEDʼs. Dot
Matrix displays, LED displays, buttons, switches, motors, temperature sensors, pressure
sensors, distance sensors, webcams, printers, GPS receivers, ethernet modules.

To program the Arduino (make it do what you want it to) you also use the Arduino
IDE (Integrated Development Environment), which is a free software.

Figure 5.2: Arduino Code using IDE

The Arduino hardware and software are both Open Source, which means the code,
the schematics, design, etc. are all open for anyone to take freely and do what they like
with it.This means there is nothing stopping anyone from taking the schematics and PCB
designs of the Arduino and making their own and selling them. This is perfectly legal, and
indeed the whole purpose of Open Source, and indeed the Fredonia that comes with the
Earthshine Design Arduino Starter Kit is a perfect example of where someone has taken
the Arduino PCB design, made their own and are selling it under the Fredonia name. You

Dept. of ECE, MTIET, Palamaner 37


Automatic accident Detection System and Rescue

could even make your ownArduino, with just a few cheap components, on a breadboard.

The only stipulation that the Arduino development team put on outside developers
is that the Arduino name can only be used exclusively by them on their own products and
hence the clone boards have names such as Fredonia, Boarding, Borodino, etc.

As the designs are open source, any clone board, such as the Fredonia, is 100%
compatible with the Arduino and therefore any software, hardware, shields, etc. will all
be 100% compatible with a genuine Arduino. The Arduino can also be extended with the
use of shields which are circuit boards containing other devices (e.g. GPS

Figure 5.3: Arduino Circuit Board

receivers, LCD Displays, Ethernet connections, etc.) that you can simply slot into
the top of your Arduino to get extra functionality. You don’t have to use a shield if you
don’t want to as you can make the exact same circuitry using a breadboard, some
overboard or even by making your own PCBʼs.

There are many different variants of the Arduino available. The most common one
is the Diecimila or the Duemilanove. You can also get Mini, Nano and Bluetooth

Dept. of ECE, MTIET, Palamaner 38


Automatic accident Detection System and Rescue

Arduinoʼs. New to the product line is the new Arduino Mega with increased memory and
number of I/O pins.

Probably the most versatile Arduino, and hence the reason it is the most popular, is
the Duemilanove. This is because it uses a standard 28 pin chip, attached to an IC Socket.
The beauty of this systems is that if you make something neat with the Arduino and then
want to turn it into something permanent (e.g. Or under- stairs cupboard light), then
instead of using the relatively expensive Arduino board, you can simply use the Arduino
to develop your device, then pop the chip out of the board and place it into your own
circuit board in your custom device. You would then have made a custom embedded
device, which is really cool.

Then, for a couple of quid or bucks you can replace theAVR chip in your Arduino
with a new one. The chip must be pre-programmed with the Arduino Bootloader to enable
it to work with the Arduino IDE, but you can either burn the Bootloader yourself if you
purchase an AVR Programmer, or you can buy these pre- programmed from many
suppliers around the world. Of course, Earthshine Design provide pre- programmed
Arduino chips in itstore for a very reasonable price.

If you do a search on the Internet by simply typing Arduino into the search box of
your favorite search engine, you will be amazed at the huge amount of websites dedicated
to the Arduino. You can find amind-boggling amount of information on projects made
with the Arduino and if you have a project in mind, will easily find information that will
help you to get your project up and running easily.

The Arduino is an amazing device and will enable you to make anything from
interactive works of art to robots. With a little enthusiasm to learn how to program the
Arduino and make it interact with other components a well as a bit of imagination, you can
build anything you want. This book and the kit will give you the necessary skills needed to
get started in this exciting and creative hobby. So, now you know what an Arduino is and
what you can do with it, let’s open up the starter kit and dive right in.

Dept. of ECE, MTIET, Palamaner 39


Automatic accident Detection System and Rescue

Figure 5.4: Arduino

5.1.2 Get the Freeduino and the USB Cable:


Firstly, get your Freeduino board and lay it on the table in front of you. Take the USB cable
and plug the B plug (the fatter squarer end) into the USB socket on the Freeduino.

Figure 5.5: USB cable of Arduino

At this stage do NOT connect the Freeduino to your PC or Mac yet. Download the
Arduino IDE.

Download the Arduino IDE from the Arduino download page. As of the time of
writing this book, the latest IDE version is 0015. The file is a ZIP file so you will need to
uncompress it. Once the download has finished, unzip the file, making sure that you
preserve the folder structure as it is and do not make any changes.

Dept. of ECE, MTIET, Palamaner 40


Automatic accident Detection System and Rescue

If you double-click the folder, you will see a few files and sub-folders inside. Install
the USB Drivers.

If you are using Windows you will find the drivers in the
drivers/FTDIUSBDrivers directory of the Arduino distribution. In the next stage
(“Connect the Freeduino”), you will point windows Add New Hardware wizard to these
drivers.

If you have a Mac these are in the driver’s directory. If you have an older Mac
like a PowerBook, iBook, G4 or G5, you should use the PPC drivers:
FTDIUSBSerialDriver_v2_1_9.dmg. If you have a newer Mac with an Intel chip, you
need the Intel drivers: FTDIUSBSerialDriver_v2_2_9_Intel.dmg. Double-click to
mount the disk image and run the included FTDIUSBSerialDriver.pkg.

First, make sure that the little power jumper, between the power and USB sockets,
is set to USB and not external power (not applicable if you have a Roboduino board,
which has an Auto Power Select function).

Now, connect the other end of the USB cable into the USB socket on your PC or
Mac. You will now see the small power LED (marked PWR above the RESET switch)
light up to show you have power to the board.

Dept. of ECE, MTIET, Palamaner 41


Automatic accident Detection System and Rescue

If you have a Mac, this stage of the process is complete and you can move on to
the next Chapter. If you are using Windows, there are a few more steps to complete
(Damn you Bill Gates!).

On Windows they Found New Hardware Wizard will now open up as Windows
will have detected that you have connected a new piece of hardware (your Freeduino
board) to your PC. Tell it NOT to connect to Windows update (Select No, not at this
time) and then click Next.

On the next page select “Install from a list or specific location (Advanced)” and

Click Next. Make sure that “Search for the best driver in these locations” is checked.

Dept. of ECE, MTIET, Palamaner 42


Automatic accident Detection System and Rescue

Uncheck “Search removable media”. Check “Include this location in the

search” and then click the Browse button. Browse to the location of the USB drivers and
then click Next.

The wizard will now search for a suitable driver and then tell you that a
“USB Serial Convertor” has been found and that the hardware wizard is now complete.
Click the Finish. You are now ready to upload your first Sketch.

Dept. of ECE, MTIET, Palamaner 43


Automatic accident Detection System and Rescue

5.1.3 Upload the program:

you will see the Sketch inside the white code window.

Dept. of ECE, MTIET, Palamaner 44


Automatic accident Detection System and Rescue

Now, before we upload the Sketch, we need to tell the IDE what kind of Arduino
we are using and the details of our USB port. Go to the file menu and click Tools, then
clock on Board. You will be presented with a list of all of the different kinds of Arduino
board that can be connected to the IDE. Our Freeduino board will either be fitted with an
Atmega328 or an Atmega168 chip so choose “Arduino Duemilanove w/ATmega328” if
you have a 328 chip or “Arduino Diecimila or Duemilanove w/ ATmega328P” if you have
a 328 chip.

Now that your Freeduino has been connected and the drivers for the USB chip have
been installed, we are now ready to try out the Arduino for the first time and upload your
first Sketch.

Navigate to your newly unzipped Arduino folder and look for the Arduino IDE
icon.

Double click the ICON to open up the IDE. You will then be presented with a blue
and white screen with a default sketch loaded inside.

This is the Arduino IDE (Integrated Development Environment) and is where you
will write your Sketches (programs) to upload to your Arduino board.

We will take a look at the IDE in a little more detail in the next chapter. For now,
simply click File in the file menu and scroll down to Sketchbook. Then scroll down to
Examples and click it. You will be presented with a list of Example sketches that you can
use to try out your Arduino. Now click on Digital and inside there you will find an example
Sketch called Blink. Click on this. The Blink Sketch will now loaded into the IDE.

Dept. of ECE, MTIET, Palamaner 45


Automatic accident Detection System and Rescue

Now you need to tell the IDE the details of your USB port, so now click on Tools
again, scroll down to Serial Port and a list of the available serial ports on your systemwill
be displayed.

You need to choose the one that refers to your USB cable, which is usually listed as
something like /dev/tty.usbserial-xxxxona Mac or something like Com 4 on Windows so
click on that. If not sure, try each one till you find one that works Now that you have
selected the correct board and USB port you are ready to upload the Blink Sketch to the
board.

Dept. of ECE, MTIET, Palamaner 46


Automatic accident Detection System and Rescue

th
You can either click the Upload button, which is the 6 button from the left at the
top with an arrow pointing to the right (however your mouse pointer over the buttons to
see what they are) or by clicking on File in the file menu and scrolling down to Upload to
I/O Board and clicking on that.

Presuming everything has been set up correctly you will now see the RX and TX
LEDʼs (and also LED 13) on the Freeduino flash on and off very quickly as data is
uploaded to the board.

Once the data has been uploaded to the board successfully you will get a Done
Uploading message in the IDE and the RX/TX LEDʼs will stop flashing.

The Arduino will now reset itself and immediately start to run the Sketch that you

Dept. of ECE, MTIET, Palamaner 47


Automatic accident Detection System and Rescue

have just uploaded.

The Blink sketch is a very simple sketch that blinks LED 13, which is a tiny green
LED soldered to the board and also connected to Digital Pin 13 from the Microcontroller,
and will make it flash on and off every 1000 milliseconds, or 1 second. If your sketch has
uploaded successfully, you will now see this LED happily flashing on and off slowly on
your board.

If so, congratulations, you have just successfully installed your Arduino, uploaded
and ran your first sketch.

We will now explain a bit more about the Arduino IDE and how to use it before
moving onto the projects that you can carry out using the hardware supplied with the kit.
For our first project we will carry out this Blink LED sketch again, but this time using an
LED that we will physically connect to one of the digital output pins on the Arduino. We
will also explain the hardware and software involved in this simple project. But first, letʼs
take a closer look at the Arduino IDE.

Dept. of ECE, MTIET, Palamaner 48


Automatic accident Detection System and Rescue

When you open up the Arduino IDE it will look very similar to the image above. If
you are using Windows or Linux there will be some slight differences but the IDE is pretty
much the same no matter what OS you are using.

The IDE is split up into the Toolbar across the top, the code or Sketch Window in
The Toolbar consists of 7 buttons, underneath the Toolbar is a tab, or set of tabs, with the
filename of the code within the tab. There is also one further button on the far right hand
side.

Along the top is the file menu with drop down menus headed under File, Edit,
Sketch, Tools and Help. The buttons in the Toolbar provide convenient access to the most
commonly used functions within this file menu.

Dept. of ECE, MTIET, Palamaner 49


Automatic accident Detection System and Rescue

5.1.4 Serial Monitor:


The Toolbar buttons are listed above. The functions of each button are as follows

Verify/Compile Checks the code for errors

S t o p Stops the serial monitor, or un-highlights other buttons

N e w Creates a new blank Sketch

O p e n Shows a list of Sketches in your sketchbook

S a v e Saves the current Sketch

U p l o a d Uploads the current Sketch to the Arduino

Serial Monitor Displays serial data being sent from the Arduino
:-

The Verify/Compile button is used to check that your code is correct, before you
upload it to your Arduino.

The Stop button will stop the Serial Monitor from operating. It will also un-
highlight other selected buttons. Whilst the Serial Monitor is operating you may wish to
press the Stop button to obtain a ʻsnapshotʼ of the serial data so far to examine it. This is
particularly useful if you are sending data out to the Serial Monitor quicker than you can
read it.
The New button will create a completely new and blank Sketch read for you to enter
code into. The IDE will ask you to enter a name and a location for your Sketch (try to use
the default location if possible) and will then give you a blank Sketch ready to be coded.
The tab at the top of the Sketch will now contain the name you have given to your new

Dept. of ECE, MTIET, Palamaner 50


Automatic accident Detection System and Rescue

sketch.

The Open button will present you with a list of Sketches stored within your
sketchbook as well as a list of Example sketches you can try out with various peripherals
once connected.

The Save button will save the code within the sketch window to your sketch file.
Once complete you will get a ʻDone Saving message at the bottom of the code window.

The Upload to I/O Board button will upload the code within the current sketch
window to your Arduino. You need to make sure that you have the correct board and port
selected (in the Tools menu) before uploading. It is essential that you Save your sketch
before you upload it to your board in case a strange error causes your system to hang or
the IDE to crash. It is also advisable to Verify/Compile the code before you upload to
ensure there are no errors that need to be debugged first.

The Serial Monitor is a very useful tool, especially for debugging your code. The
monitor displays serial data being sent out from your Arduino (USB or Serial board). You
can also send serial data back to the Arduino using the Serial Monitor. If you click the
Serial Monitor button you will be presented with an image like the one above.

On the left hand side you can select the Baud Rate that the serial data is to be sent
to/from the Arduino. The Baud Rate is the rate, per second, that characters (data) is sent
to/from the board. The default setting is 9600 baud, which means that if youwere to send a
text novel over the serial communications line (in this case your USB cable) then 9600
letters, or symbols, of the novel, would be sent per second.

Dept. of ECE, MTIET, Palamaner 51


Automatic accident Detection System and Rescue

To the right of this is a blank text box for you to enter text to send back to the
Arduino and a Send button to send the text within that field. Note that no serial data can be
received by the Serial Monitor unless you have set up the code inside your sketch to do so.
Similarly, the Arduino will not receive any data sent unless you have coded it to do so.

Finally, the black area is where your serial data will be displayed. In the image
above, the Arduinos running the ASCII able sketch that can be found in the
Communications examples. This program outputs ASCII characters, from the Arduino via
serial (the USB cable) to the PC where the Serial monitor then displays them. To start the
Serial Monitor press the Serial Monitor button and to stop it press the Stop button. On a
Mac or in Linux, Arduino board will reset itself (rerun the code from the beginning) when
you click the Serial Monitor button.

Once you are proficient at communicating via serial to and from the Arduino you
can use other programs such as Processing, Flash, Max MSP, etc. To communicate
between the Arduino and your PC.

We will make use of the Serial Monitor later on in our projects when we read data
from sensors and get the Arduino to send that data to the Serial Monitor, in human
readable form, for us to see.

Dept. of ECE, MTIET, Palamaner 52


Automatic accident Detection System and Rescue

The Serial Monitor window is also were you will see error messages (in red text)
that the IDE will display to you when trying to connect to your board, upload code or
verify code.

Below the Serial Monitor at the bottom left you will see a number. This is the
current line that the cursor, within the code window, is at. If you have code in your window
and you move down the lines of code (using the ↓ key on your keyboard) you will see the
number increase as you move down the lines of code. This is useful for finding bugs
highlighted by error messages. Across the top of the IDE window (or across the top of your
screen if you are using a Mac) you will see the various menus that you can click on to
access more menu items.

The menu bar across the top of the IDE looks like the image above (and slightly
different in Windows and Linux). I will explain the menus as they are on a Mac, the details

will also apply to the Windows and Linux versions of the IDE.

The first menu is the Arduino menu. Within this is the About Arduino option,
which when pressed will show you the current version number, a list of the people involved
in making this amazing device and some further information.

Dept. of ECE, MTIET, Palamaner 53


Automatic accident Detection System and Rescue

Underneath that is the Preferences option. This will


brings up the Preferences window where you can change various
options, such as were you default Sketchbook is stored, etc.Also, is
the Quit option, which will Quit the program.

The next menu is the File menu. In here you get access to options to create New
sketch, take a look at Sketches stored in your Sketchbook (as well as the Example
Sketches), options to Save your Sketch (or Save As if you want to give it a different
name).
You also have the option to upload your sketch to the I/O Board (Arduino) as well
as the Print options for printing out your code.

Next is the Edit menu. In here you get options to enable you to Cut, Copy and Paste
sections of code. Select All of your code as well as Find certain words or phrases within the
code. Also included are the useful Undo and Redo options which come in handy when you

make a mistake.

Our next menu is the Sketch menu which gives us access to the Verify/Compile
functions and some other useful functions you will use later on. These include the Import
Library option, which when clicked will bring up a list of the available libraries, stored
within your menu.

Dept. of ECE, MTIET, Palamaner 54


Automatic accident Detection System and Rescue

The next menu in the IDE is the Tools menu. Within this are the options to
select the Board and Serial Port we are using, as we did when setting up the Arduino for
the first time. Also we have the Auto Format function that formats your code to make it
look nicer.

The Copy for Forum option will copy the code within the Sketch window, but in a
format that when pasted into the Arduino forum (or most other Forums for that matter)
will show up the same as it is in the IDE, along with syntax coloring, etc.
The Archive Sketch option will enable you to compress your sketch into a ZIP file
and asks you were you want to store it.

5.2 I/O PORTS:


• 3 8-bit ports(B,C,D)
• Each port controlled by 3 8-bit register
• Each bit controls 1 i/o pin.
• DDRX- Direction register.
• Defines whether a pin is an input(0) or output(1)
• PINx- Pin input value
• Reading this" register" returns value of pin
• PORTx- Pin output value
Writing this register sets value of pin.

Dept. of ECE, MTIET, Palamaner 55


Automatic accident Detection System and Rescue

5.3 Embedded C:
Embedded C is a set of language extensions for the C programming language by the C
Standards Committee to address commonality issues that exist between C extensions for
different embedded systems.

Historically, embedded C programming requires nonstandard extensions to the C


language in order to support exotic features such as fixed-point arithmetic, multiple distinct
memory banks, and basic I/O operations. In 2008, the C Standards Committee extended the
C language to address these issues by providing a common standard for all implementations
to adhere to. It includes a number of features not available in normal C, such as fixed-point
arithmetic, named address spaces and basic I/O hardware addressing. Embedded C uses
most of the syntax and semantics of standard C, e.g., main() function, variable definition,
data type declaration, conditional statements (if, switch case), loops (while, for), functions,
arrays and strings, structures and union, bit operations, macros, etc.

5.4 Proteus Design Suite:


The Proteus Design Suite is a proprietary software tool suite used primarily for electronic
design automation. The software is used mainly by electronic design engineers and
technicians to create schematics and electronic prints for manufacturing printed circuit
boards. It was developed in Yorkshire, England by Lab center Electronics Ltd and is
available in English, French, Spanish and Chinese languages.

The first version of what is now the Proteus Design Suite was called PC-B and was
written by the company chairman, John Jameson, for DOS in 1988. Schematic Capture
support followed in 1990, with a port to the Windows environment shortly thereafter.
Mixed mode SPICE Simulation was first integrated into Proteus in 1996 and
microcontroller simulation then arrived in Proteus in 1998. Shape based auto routing was
added in 2002 and 2006 saw another major product update with 3D Board Visualization.
More recently, a dedicated IDE for simulation was added in 2011 and MCAD import/export
was included in 2015. Support for high speed design was added in 2017. Feature led

Dept. of ECE, MTIET, Palamaner 56


Automatic accident Detection System and Rescue

product releases are typically biannual, while maintenance-based service packs are released
as required.

Dept. of ECE, MTIET, Palamaner 57


Automatic accident Detection System and Rescue

CHAPTER 6
ADVANTAGES

6.1 ADVANTAGES:

• Occurrence of accident is detected without huge intervening time


• Immediate medication is provided to the accident victims even if the accident has
occurred in remote areas.
• Death percentage due to accidents can be immensely reduced due to less rescue
time.

Dept. of ECE, MTIET, Palamaner 58


Automatic accident Detection System and Rescue

CHAPTER 7
APPLICATIONS

• Can be implemented in vehicles for helping the accident victims. So that the death
rate can be reduced due accidents.
• Can be implemented in any buildings like Institutes, Industries, Hospitals etc., to
detect the fire accident.

Dept. of ECE, MTIET, Palamaner 59


Automatic accident Detection System and Rescue

CHAPTER 8
RESULTS
8.1 AUTOMATIC ACCIDENT DETECTION AND RESCUE:

Figure 8.1: Automatic Accident Detection and Rescue Hardware Kit

Dept. of ECE, MTIET, Palamaner 60


Automatic accident Detection System and Rescue

Figure 8.2: Displaying DATA READING ON LCD

Dept. of ECE, MTIET, Palamaner 61


Automatic accident Detection System and Rescue

Figure 8.3: Displaying the Latitude and Longitude Coordinates of the location

Dept. of ECE, MTIET, Palamaner 62


Automatic accident Detection System and Rescue

Figure 8.4: The message received

Dept. of ECE, MTIET, Palamaner 63


Automatic accident Detection System and Rescue

Figure 8.5: The location of the vehicle in Google Maps

Dept. of ECE, MTIET, Palamaner 64


Automatic accident Detection System and Rescue

CHAPTER 9
CONCLUSION & FUTURE SCOPE

This project gives a design which has many benefits like low cost, portability, small size.
This system uses the microcontroller in conjunction with MEMS sensor, GPS and GSM
interfacing which reduces the alarm time to a large level and gives the location of accident
accurately. It can also overcome the issue of lack of automated system for the detection of
the site of accident. As a result, the time for detecting the site is reduced and the person can
be treated as soon as possible which will save many lives. As per the above survey, the
scope of the work can be listed as follows.

In future we can interface different sensors with this paper, such as alcohol detector,
drowsiness detector, heart rate detector, etc. In terms of these we can really prevent accident
and save life. Security sensors to identify theft can also be added. It can be reprogrammed
to switch off vehicle and track the vehicle in theft. A wireless webcam can be added in this
for capturing the images which will help in providing driver`s assistance.

Dept. of ECE, MTIET, Palamaner 65


Automatic accident Detection System and Rescue

CHAPTER 10
REFERENCES

[1] Abid Khan, Ravi Mishra ―GPS – GSM Based Tracking System‖, International Journal
of Engineering Trends and Technology,Volume3, Issue2, Pp: 161-169, 2012.

[2] S.P. Bhumkar, V.V. Deotare, R.V.Babar ―Intelligent Car System for Accident
Prevention Using ARM-7‖, International Journal of Emerging Technology and Advanced
Engineering, Volume 2, Issue 4, Pp: 56-78, 2012

[3] Partheeban , R. Rani Hemamalini, ‖Vehicular Emission Monitoring Using Internet GPS
and Sensors‖, International Conference on Environment, Energy and Biotechnology vol.33 ,
Issue5,Pp:80 -96,201

[4] BaburaoKodavati, V.K.Raju―GSM AND GPS BASED VEHICLE LOCATION AND


TRACKING SYSTEM‖ International Journal of Engineering Research and Applications,
Vol. 1, issue no.3, PP16-6252012

Dept. of ECE, MTIET, Palamaner 66

You might also like