Anda di halaman 1dari 71

COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

CHAPTER -1

INTRODUCTION
1.1 MOTIVATION
The basic motivation behind this idea is to use sensor networks and in turn next
generation networks in making the travelling safe as well as trying to prevent the
circumstances from any undesired event. If any undesired situation had occurred then
to see that the loss is reduced at the least. Road traffic accidents (RTAs) had become an
important factor in public health and development problem in India. RTAs involve
high percentage of damages in human life in various levels. Although there are various
measures had been taken to reduce accidents. A survey by ministry of road transport
highway in 2015 reports around 5 lakh accidents in India in which 1.3 lakh people
were dead and 5.2 lakh were injured. RTAs Kill almost 1.2 million people a year and
injuring or disabling between 20-50 million people around the world. This clearly
shows the importance of a crash prevention and avoidance systems in todays
automotive industry.

This project aims to create a low cost, retrospective solution that cancan be
implemented in large scale to help reduce a significant number of accidents. This is by
no means a fully autonomous system as it is, but an effective driver assistance system
which helps the driver use an automobile in a safe way without getting into a crash
situation from which the driver may find it hard to get out of.

The system can also help a panicking driver to safely get out of the crash
scenario. This system contains two levels of assistance, the first level being a driver
alerting system followed by a controlled braking process. One of the major causes of
road accident in the world is driving too fast, recent studies shows that one third of the
serious road accidents are due to inappropriate speed, as well as change in road way
(like presence of road work or unexpected obstacles).So in order to avoid such kind of
accidents and to alert the drivers and to control their vehicle speed in such kind of
places the highway department have placed the signboards.

But sometimes it may not too possible to view that kind of signboards and
there is a chance for accidents. So there is an utmost need to design a system which

DEPARTMENT OF ECE, ALIET Page 1


COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

can control the speed of vehicles. Here we are designing a speed control system for
vehicles which can intimate the driver about the zones and limit speed of the vehicle
automatically.

1.2 CAUSES FOR ROAD ACCIDENTS

Fig 1.1: PRESENT STATISTICS IN ROAD ACCIDENTS

Not following traffic signals- We cross the junctions even on a red light
manoeuvring our way.
Jaywalking is a normal thing for people; please understand that its very
difficult to apply brakes in a split second if someone just emerges in front of your
vehicle.
Dangerous lane shifting- Not a single car or bike ever gave any indication
before changing lanes. Further, the government has marked lanes on every road for
people to drive in the lanes and not between the lanes.
Overtaking from the left please be advised that nobody looks to the left and
expects anyone overtaking from there. This is a blind spot and a cause for accidents
Not a single pillion rider was wearing a helmet on a two wheelers. Helmets
have been made compulsory only for YOUR protection. It is for the safety of the
wearer. Even during low speed collusion a person can be badly injured if he is not

DEPARTMENT OF ECE, ALIET Page 2


COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

wearing a helmet. To know more about how motorcycle helmets saves lives read this
post.
Seat belts- I hardly saw people wearing a seatbelt. During a crash any object
not tied to the car becomes a projectile, including humans. A seatbelt saves you from
becoming a projectile.
Bikes try to overtake from all directions; even in fast moving traffic, they try to
wriggle their way in front of cars / large vehicles from small gaps. This is very
dangerous and in case the car/ large vehicle is unable to apply brakes, a small nick on a
high speed, can dis-balance a 2 wheeler causing a serious accident.

1.3 AIM OF OUR PROJECT

In our project we can monitor the vehicle speed and implements and action
when the vehicle is detected to be exceeding the speed displayed in the speed display
(sign) boards. The speed display boards are working as per the highway speed limiting
protocol. The driver should take great attention on the speed of the vehicle especially
when driving through busy junctions, railway crossings, school and college zones etc.
The citizens are ought to obey the speed enforcement rules in order to avoid the
accidents, any violation in this are considered as a greater offence. Traffic Police are
authorized to check every vehicle and take actions against the violation. We also
monitor the gas leakages, vibrations and also the alcohol level of the driver and make
the vehicle stop if any of the above parameters are detected. We have also
implemented a GSM system in order to respond immediately through an SMS service
by including the location of the vehicle using GPS.

DEPARTMENT OF ECE, ALIET Page 3


COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

CHAPTER -2

BACKGROUND
2.1 BACKGROUND OF INTERSECTION TRAFFIC CONTROL
DEVICES.
Intersection traffic control devices are comprised of signs, signals, roundabouts
or pavement markings that can be placed alongside the intersection. They are used to
move vehicles and pedestrians safely and efficiently, consequently preventing
collisions by providing the right-of-way principle assignment. The Federal Highway
Administration periodically publishes recommendations on how to setup specific
control devices in its manual on Uniform Traffic Control Devices (MUTCD) [6], thus
ensuring safety by standardizing operations. The most extensively used devices for
current traffic control include traffic signals, stop signs and roundabouts. These are
explained in this section.

2.2 REQUIREMENTS OF TRAFFIC CONTROL DEVICES.


The requirements of traffic control devices are listed below:

The control device should fulfil a need: Each device must have a specific
purpose for the safe and efficient operation of traffic flow. The superfluous devices
should not be used.
It should command attention from the road users: This affects the design of
signs. For commanding attention, proper visibility should be there. Also the sign
should be distinctive and clear. The sign should be placed in such a way that the driver
requires no extra effort to see the sign.
It should convey a clear, simple meaning: Clarity and simplicity of message
is essential for the driver to properly understand the meaning in short time. The use of
colour, shape and legend as codes becomes important in this regard. The legend should
be kept short and simple so that even a less educated driver could understand the
message in less time.

DEPARTMENT OF ECE, ALIET Page 4


COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

Road users must respect the signs: Respect is commanded only when the
drivers are conditioned to expect that all devices carry meaningful and important
messages. Overuse, misuse and confusing messages of devices tend the drivers to
ignore them.

The control device should provide adequate time for proper response from
the road users: This is again related to the design aspect of traffic control devices. The
sign boards should be placed at a distance such that the driver could see it and gets
sufficient time to respond to the situation. For example, the STOP sign which is always
placed at the stop line of the intersection should be visible for at least one safe stopping
sight distance away from the stop line

2.3 TYPES OF TRAFFIC SIGNS

There is several hundreds of traffic signs available covering wide variety of traffic
situations. They can be classified into three main categories.
Regulatory signs: These signs require the driver to obey the signs for the
safety of other road users.

Warning signs: These signs are for the safety of oneself who is driving and
advice the drivers to obey these signs.

Informative signs: These signs provide information to the driver about the
facilities available ahead, and the route and distance to reach the specific destinations

DEPARTMENT OF ECE, ALIET Page 5


COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

CHAPTER -3

LITERATURE SURVEY

The main motive behind this paper is to reduce these reckless accidents for
which we propose a system that governs and controls the speed of the vehicle without
any direct inconvenience to the driver. There are instances where the speed of the
automobile is beyond the expected speed limit or the driver does not obey the traffic
signals. Thus we are using optical character recognition algorithm by placing a camera
inside the vehicle and this camera will recognize the speed signs along the roads, thus
compares the vehicle speed and control the speed of the vehicle if it does not obey the
speed limits or exceeding the speed. With India reporting as many as 1.34 lakh
fatalities in road accidents every year, a vast 70 per cent of them being due to drunken
driving, questions are now being raised on whether the mushrooming growth of liquor
vends along the highways is responsible for costing precious lives in an untimely
manner.14% of accidents are due to gas leakages . So in order to monitor all these
from inside a car, our project mainly includes real time sensors like GAS, ALCOHOL,
IR and Vibration sensor. These sensors are used for continuous monitoring of the
alcohol levels or gas leakages if any inside the car.

3.1 ACCIDENTS ARE HAPPENED WHILE DRIVING


Nowadays people are driving very fast; accidents are occurring frequently, we
lost our valuable life by making small mistake while driving. This world most of the
people can met with an accident which happening in day by day. Even though there
was much rapid increase in technology, the mortality rate was also increasing which
is mainly due to lack of sufficient information given to the police and hospitals
immediately after it happens. Considering if the accident happens in the any interior
area such as travel in forest area, etc . . . . where no one to help and also emergency
information cannot be passed to police and hospital which finally leads to death. So in
order to avoid such kind of accidents and to alert the drivers and to control their
vehicle speed by considering all these sensors.

DEPARTMENT OF ECE, ALIET Page 6


COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

3.2 RELATED WORK


A number of research projects headed by different research institutes and automobile
manufacturers around the world have been focusing on accident prevention and
detection systems.
Lih-Jen Kauet al proposed A Smart Phone-Based Pocket Fall Accident
Detection, Positioning, and Rescue System, published in IEEE JOURNAL
OF BIOMEDICAL AND HEALTH INFORMATICS. The author
suggested the use of architecture for the fall accident detection and
corresponding wide area rescue system based on a smart phone and the third
generation (3G) networks. To realize the fall detection algorithm, the angles
acquired by the electronic compass (e-compass) and the waveform sequence of
the tri-axial accelerometer on the smart phone are used as the system inputs.
The acquired signals are then used to generate an ordered feature sequence and
then examined in a sequential manner by the proposed cascade classifier for
recognition purpose. Once the corresponding feature is verified by the classifier
at current state, it can proceed to next state; otherwise, the system will reset to
the initial state and wait for the appearance of another feature sequence. Once a
fall accident event is detected, the users position can be acquired by the global
positioning system (GPS) or the assisted GPS, and sent to the rescue centre via
the 3G communication network so that the user can get medical help
immediately. However the key factors inhibiting the vehicles ability i.e.
electronic compass (e-compass) and the waveform sequence of the tri-axial
accelerometer involves complexity and high cost.

Shusuke kamijo et al proposed Traffic Monitoring and Accident


Detection at Intersections[9]-This algorithm models a tracking problem by
determining the state of each pixel in an image and its transit, and how such
states transit along both the image axes as well as the time axes. Vehicles, of
course, are of various shapes and they move in random fashion, thereby leading
to full or partial occlusion at intersections.

DEPARTMENT OF ECE, ALIET Page 7


COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

Yong-Kul et al proposed A Traffic Accident Recording and Reporting


Model at Intersections[8]-This model first extracts the vehicles from the
video image of the charge couple-device camera, tracks the moving vehicles
(MVs), and extracts features such as the variation rate of the velocity, position,
area, and direction of MVs. The model then makes decisions on the traffic
accident based on the extracted features.

Manuel and Fransico et al proposed Automatic Accident Detection [6]-In


this article, the device allows fast detection of traffic accidents, improving the
assistance to injured passengers by reducing the response time of emergency
services through the efficient communication of relevant information about the
accident using a combination of V2V and V2I communications. The proposed
system requires installing On-board Unit (OBUs) in the vehicles, in charge of
detecting accidents and notifying them to an external Control Unit (CU), which
will estimate the severity of the accident and inform the appropriate emergency
services about the incident.

DEPARTMENT OF ECE, ALIET Page 8


COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

CHAPTER 4

BLOCK DIAGRAM
4.1 BLOCK DIAGRAM

FIG 4.1: BLOCKDIAGRAM FOR COLLISION AVOIDANCE AND DRIVER SAFE


SYSTEM

DEPARTMENT OF ECE, ALIET Page 9


COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

4.2 WORKING MODEL

We can monitor the vehicle speed and implements and action when the vehicle
is detected to be exceeding the speed displayed in the speed display (sign) boards. The
speed display boards are working as per the highway speed limiting protocol. The
driver should take great attention on the speed of the vehicle especially when driving
through busy junctions, railway crossings, school and college zones etc. The citizens
are ought to obey the speed enforcement rules in order to avoid the accidents, any
violation in this are considered as a greater offence. Traffic Police are authorized to
check every vehicle and take actions against the violation. We also monitor the gas
leakages, vibrations and also the alcohol level of the driver and make the vehicle stop if
any of the above parameters are detected. We have also implemented a GSM system in
order to respond immediately through an SMS service by including the location of the
vehicle using GPS.

This project is mainly for cars, for making them more intelligent and provides a
better drive safe system. By using Raspberry pi 3 this system becomes more reliable,
effective and efficient for avoiding accidents on roads. There are very few systems that
are developed for detection and controlling the vehicle without the involvement of
human. In this paper we are proposing a prototype which controls the vehicle speed by
recognizing the speed signs that are setup along the roads and also continuously
monitor various parameters that lead to accidents. The main components of this system
are Raspberry pi3, Pi Camera and few sensors like Alcohol, Gas, Infrared and a
Vibration sensor, GSM module and a GPS receiver to find out the location of the
vehicle.

DEPARTMENT OF ECE, ALIET Page 10


COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

CHAPTER 5

HARDWARE DESCRIPTION

5.1 RASPBERRY PI 3

5.1.1 INTRODUCTION

The Raspberry Pi 3 Model B is the third generation Raspberry Pi. This powerful credit-
card sized single board computer can be used for many applications and supersedes the
original Raspberry Pi Model B+ and Raspberry Pi 2 Model B. Whilst maintaining the
popular board format the Raspberry Pi 3 Model-B brings you a more powerful
processer, 10x faster than the first generation Raspberry Pi. Additionally it adds
wireless LAN & Bluetooth connectivity making it the ideal solution for powerful
connected designs.

FIG 5.1: RASPBERRY PI 3

DEPARTMENT OF ECE, ALIET Page 11


COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

5.1.2 SPECIFICATIONS
PROCESSOR Broadcom BCM2387 chipset.

1.2GHZ QUAD CORE ARM Cortex-


A53

802.11 b/g/n Wireless LAN and


Bluetooth 4.1 (Bluetooth Classic and
LE)

GPU Dual Core Video Core IV


Multimedia

ES 2.0, hardware-accelerated Open


VG, and 1080p30 H.264 high-
profile decode.

Capable of 1Gpixel/s, 1.5Gtexel/s or


24GFLOPs with texture filtering and

DMA infrastructure Memory 1GB LPDDR2


Operating System Boots from Micro SD card
Dimensions 85 x 56 x 17mm
Power Micro USB socket 5V1, 2.5A

5.1.3 CONNECTORS
Ethernet 10/100 BaseT Ethernet socket
Video Output HDMI (rev 1.3 & 1.4Composite RCA (PAL and
NTSC)
Audio Output Audio Output 3.5mm jack, HDMIUSB 4 x USB
2.0
Memory Card Slot Push/pull Micro SDIO
Camera Connector 15-pin MIPI Camera Serial Interface (CSI-2)

DEPARTMENT OF ECE, ALIET Page 12


COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

5.1.4 KEY BENEFITS


Low cost
Consistent board format
10x faster processing
Added connectivity

5.1.5 KEY APPLICATIONS


Low cost PC/tablet/laptop
IoT applications
Media centre
Robotics
Industrial/Home automation
Server/cloud server
Print server
Security monitoring
Web camera
Gaming
Wireless access point
Environmental sensing/monitoring (e.g. weather station).

5.2 PI CAM
5.2.1 INTRODUCTION
The Raspberry Pi Camera v2 is the new official camera board released by the
Raspberry Pi Foundation. The Raspberry Pi Camera Module v2 is a high quality 8
megapixel Sony IMX219 image sensor custom designed add-on board for Raspberry
Pi, featuring a fixed focus lens. The Raspberry Pi Zero now comes complete with a
camera port! Using the new Raspberry Pi Zero Camera Adapter, you can now use a
Raspberry Pi camera to your Zero. It's capable of 3280 x 2464 pixel static images, and
also supports 1080p30, 720p60 and640x480p90 video. It attaches to Pi by way of one

DEPARTMENT OF ECE, ALIET Page 13


COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

of the small sockets on the board upper surface and uses the dedicated CSI interface,
designed especially for interfacing to cameras.

5.2.2 FEATURES:

Fixed focus lens on-board

8 megapixel native resolution sensor-capable of 3280 x 2464 pixel static images

Supports 1080p30, 720p60 and 640x480p90 video

Size 25mm x 23mm x 9mm

Weight just over 3g

Connects to the Raspberry Pi board via a short ribbon cable (supplied)

Camera v2 is supported in the latest version of Raspbian, Raspberry Pi's preferred


operating system

FIG 5.2: PI CAMERA

5.2.3 SPECIFICATIONS
Image Sensor : Sony IMX 219 PQ CMOS image sensor in a fixed-focus
module.
Resolution: 8-megapixel
Still picture resolution :3280 x 2464
Max image transfer rate: 1080p: 30fps (encode and decode)
720p: 60fps

DEPARTMENT OF ECE, ALIET Page 14


COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

Connection to Raspberry Pi: 15-pin ribbon cable, to the dedicated 15-pin


MIPI Camera Serial Interface (CSI-2).
Image control functions: Automatic exposure control
Automatic white balance
Automatic band filter
Automatic 50/60 Hz luminance detection
Automatic black level calibration
Temp range Operating: -20 to 60
Stable image: -20 to 60
Lens size :1/4
Dimensions: 23.86 x 25 x 9mm.

5.3 ALCOHOL SENSORS (MQ6)


5.3.1 INTRODUCTION
The MQ-6 LPG - Isobutene - Propane Gas Sensor is a semiconductor gas sensor that
detects the presence of LPG, Isobutene, and Propane gas at concentrations from 300
ppm to 10,000 ppm, a range suitable for detecting gas leaks. The sensors simple
analog voltage interface requires only one analog input pin from your microcontroller.
The MQ-6 LPG - Isobutene - Propane Gas Sensor detects the concentration of gas in
the air and outputs its reading as an analog voltage. The concentration sensing range of
300 ppm to 10,000 ppm is suitable for leak detection. The sensor can operate at
temperatures from -10 to 50C and consumes less than 150 mA at 5.High Sensitivity to
LPG, iso-butane, propane. Small sensitivity to alcohol, smoke.

5.3.2 FEATURES:
5V DC or AC circuit.
Requires heater voltage.
Operation Temperature: -10 to 70 degrees C.
Heater consumption: less than 750mW.
Dimensions: 16.8mm diameter, 9.3 mm height without the pins.

DEPARTMENT OF ECE, ALIET Page 15


COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

5.3.3 DESCRIPTION
This is a simple-to-use liquefied petroleum gas (LPG) sensor, suitable for sensing LPG
(composed of mostly propane and butane) concentrations in the air. The MQ-6 can
detect gas concentrations anywhere from 200 to 10000ppm. This sensor has a high
sensitivity and fast response time. The sensors output is an analog resistance. The
drive circuit is very simple; all you need to do is power the heater coil with 5V, add a
load resistance, and connect the output to an ADC. MQ-6 gas sensor can detect kinds
of flammable gases, especially has high sensitivity to LPG (propane). It is a kind of low-
cost sensor for many applications.

5.3.4CAUTIONS
1. Following conditions must be prohibited

1.1 Exposed to organic silicon steam sensing material will lose sensitivity and never
recover if the sensor absorbs organic silicon steam. Sensors must avoid exposing to
silicon bond, fixtures, silicon latex, putty or plastic contain silicon environment.

1.2 High Corrosive gas if the sensors are exposed to high concentration corrosive gas
(such as H2 S, SOX , Cl2, HCl etc.), it will not only result in corrosion of sensors
structure, also it cause sincere sensitivity attenuation.

1.3 Alkali, Alkali metals salt, halogen pollution .The sensors performance will be
changed badly if sensors be sprayed polluted by alkali metals salt especially brine, or
are exposed to halogen such as fluorine.

1.4 Touch water Sensitivity of the sensors will be reduced when spattered or dipped in
water.

1.5 Freezing do avoid icing on sensors surface, otherwise sensing material will be
broken and lost sensitivity.

1.6 Applied higher voltage Applied voltage on sensor should not be higher than
stipulated value, even if the sensor is not physically damaged or broken, it causes
down-line or heater damaged, and bring on sensors sensitivity characteristic changed
badly.

DEPARTMENT OF ECE, ALIET Page 16


COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

1.7 Voltage on wrong pins For 6 pins sensor, Pin 2&5 is heating electrodes, Pin
(1,3)/(4,6) are testing electrodes (Pin 1 connects with Pin 3, while Pin 4 connects with
Pin 6).If apply voltage on Pin 1&3 or 4&6, it will make lead broken; and no signal
putout if apply on pins 2&4. Fig8. Lead sketch .

2 .Following conditions must be avoided

2.1 Water Condensation Indoor conditions, slight water condensation will influence
sensors performance lightly. However, if water condensation on sensors surface and
keep a certain period, sensors sensitive will be decreased.

2.2 Used in high gas concentration No matter the sensor is electrified or not, if it is
placed in high gas concentration for long time, sensors characteristic will be affected.
If lighter gas sprays the sensor, it will cause extremely damage.

2.3 Long time storage the sensors resistance will drift reversibly if its stored for long
time without electrify, this drift is related with storage conditions. Sensors should be
stored in airproof bag without volatile silicon compound. For the sensors with long
time storage but no electrify, they need long galvanic aging time for stability before
using.

5.3.5 SENSITVITY ADJUSTMENT


Resistance value of MQ-6 is difference to various kinds and various
concentration gases. So, when using these components, sensitivity adjustment is very
necessary. We recommend that calibrate the detector for 1000ppm of LPG
concentration in air and use value of Load resistance (RL) about 20K(10K to
47K). When accurately measuring, the proper alarm point for the gas detector should
be determined after considering the temperature and humidity influence

DEPARTMENT OF ECE, ALIET Page 17


COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

FIG 5.3 ALCOHOL SENSOR

5.4 GSM COMMUNICATION


5.4.1 Introduction
Global System for Mobile Communication (GSM) is a set of ETSI
standards specifying the infrastructure for a digital cellular service. The
standard is used in approx. 85 countries in the world including such locations
as Europe, Japan and Australia.

5.4.2 GSM Call Routing


Mobile Subscriber Roaming

When a mobile subscriber roams into a new location area (new VLR), the VLR
automatically determines that it must update the HLR with the new location
information, which it does using an SS7 Location Update Request Message. The
Location Update Message is routed to the HLR through the SS7 network, based on the
global title translation of the IMSI that is stored within the SCCP Called Party Address
portion of the message. The HLR responds with a message that informs the VLR
whether the subscriber should be provided service in the new location.
DEPARTMENT OF ECE, ALIET Page 18
COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

Mobile Subscriber Isdn Number (MSISDN) Call Routing

When a user dials a GSM mobile subscriber's MSISDN, the PSTN routes the
call to the Home MSC based on the dialled telephone number. The MSC must then
query the HLR based on the MSISDN, to attain routing information required to route
the call to the subscribers' current location.

The MSC stores global title translation tables that are used to determine the
HLR associated with the MSISDN. When only one HLR exists, the translation tables
are trivial. When more than one HLR is used however, the translations become
extremely challenging; with one translation record per subscriber (see the example
below). Having determined the appropriate HLR address, the MSC sends a Routing
Information Request to it.

When the HLR receives the Routing Information Request, it maps the MSISDN to the
IMSI, and ascertains the subscribers' profile including the current VLR at which the
subscriber is registered. The HLR then queries the VLR for a Mobile Station Roaming
Number (MSRN). The MSRN is essentially an ISDN telephone number at which the
mobile subscriber can currently be reached. The MSRN is a temporary number that is
valid only for the duration of a single call.

The HLR generates a response message, which includes the MSRN, and sends
it back across the SS7 network to the MSC. Finally, the MSC attempts to complete the
call using the MSRN provided.

DEPARTMENT OF ECE, ALIET Page 19


COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

FIG5.4: MOBILE SUBSCRIBER ISDN NUMBER (MSISDN) CALL ROUTING

GSM (Global System for Mobile communication) is a digital mobile telephone


system that is widely used in many parts of the world. GSM uses a variation of Time
Division Multiple Access (TDMA) and is the most widely used of the three digital
wireless telephone technologies (TDMA, GSM, and CDMA). GSM digitizes and
compresses data, then sends it down a channel with two other streams of user data,
each in its own time slot. GSM operates in the 900MHz, 1800MHz, or 1900 MHz
frequency bands.

GSM has been the backbone of the phenomenal success in mobile telecoms over
the last decade. Now, at the dawn of the era of true broadband services, GSM
continues to evolve to meet new demands. One of GSM's great strengths is its
international roaming capability, giving consumers a seamless service. This has been a
vital driver in growth, with around 300 million. In the Americas, today's 7 million
subscribers are set to grow rapidly, with market potential of 500 million in population,
due to the introduction of GSM 800, which allows operators using the 800 MHz band
to have access to GSM technology too

GSM together with other technologies is part of an evolution of wireless


mobile telecommunication that includes High-Speed Circuit-Switched Data (HCSD),

DEPARTMENT OF ECE, ALIET Page 20


COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

General Packet Radio System (GPRS), Enhanced Data GSM Environment (EDGE),
and Universal Mobile Telecommunications Service (UMTS).

GSM security issues such as theft of service, privacy, and legal interception
continue to raise significant interest in the GSM community. The purpose of this portal
is to raise awareness of these issues with GSM security.

The mobile communications has become one of the driving forces of the
digital revolution. Every day, millions of people are making phone calls by pressing a
few buttons. Little is known about how one person's voice reaches the other person's
phone that is thousands of miles away. Even less is known about the security measures
and protection behind the system. The complexity of the cell phone is increasing as
people begin sending text messages and digital pictures to their friends and family. The
cell phone is slowly turning into a handheld computer. All the features and
advancements in cell phone technology require a backbone to support it. The system
has to provide security and the capability for growth to accommodate future
enhancements. General System for Mobile Communications, GSM, is one of the many
solutions out there. GSM has been dubbed the "Wireless Revolution" and it doesn't
take much to realize why GSM provides a secure and confidential method of
communication.

Digital containers offer an alternative way of securely delivering content to


consumers. They can offer many advantages, particularly for content delivery over
mobile phone networks:

Scalability
Micro transactions/Micropayments compatibility
Content channel neutrality (heterogeneous networks, unicast/multicast/broadcast etc.)
Possibility of DRM
Consumer anonymity.

DEPARTMENT OF ECE, ALIET Page 21


COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

5.4.3 ARCHITECTURE

A GSM network is composed of several functional entities, whose functions and


interfaces are defined. Figure 1 shows the layout of a generic GSM network.

FIG 5.5: GSM ARCHITECTURE

The GSM network can be divided into three broad parts. The Mobile
Station is carried by the subscriber. The Base Station subsystem controls the
radio link with the Mobile Station. The Network Subsystem, the main part of
which is the Mobile services Switching Centre (MSC), performs the switching
of calls between the mobile and fixed network users. The Mobile Station and
the Base Station subsystem communicate across the Um interface, also known
as the air interface or radio link. The Base Station Subsystem communicates
with the Mobile service Switching Centre across the A interface.

Mobile Station (MS)


The mobile station (MS) consists of:

Mobile Equipment (ME)


Subscriber Identity Module (SIM)

DEPARTMENT OF ECE, ALIET Page 22


COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

Mobile Equipment (ME)


Portable, vehicle mounted, hand held device
Uniquely identified by the International Mobile Equipment Identity (IMEI)

Voice and data transmission

Monitoring power and quality of surrounding cells for optimum handover

160 character long SMS

Subscriber Identity Module (SIM)

Contains the International Mobile Subscriber Identity (IMSI)

Allows users to send and receive calls and receive other subscriber services

Encoded network identification details- key kick and A3,A5 and A8 algorithms

Protected by a password or pin

Can be moved from phone to phone-contains key information to activate the phone

By inserting the SIM card into another GSM cellular phone, the user is able to receive
calls at that phone, make calls from that phone.

Base Station Subsystem (BSS)


The Base Station Subsystem is composed of two parts:

Base Transceiver Station (BTS)


Base Station Controller (BSC)

Base Transceiver Station (BTS)


Encodes, encrypts, multiplexes, modulates and feeds the RF signals to the
antenna
Frequency hoping
Communicates with mobile station and BSC
DEPARTMENT OF ECE, ALIET Page 23
COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

Consists of Transceivers (TRX) unit

Base Station Controller (BSC)


Manages the radio resources for BTS
Assigns frequency and time slots for all MSs in its area

Handles call set up

Transcoding and rate adaptation functionality

Handover for each MS

Radio power control

Communicates with MSC and BTS

Mobile Switching Centre (MSC)

Central component of the Network Subsystem

Manages communication between GSM and other networks


Acts like a normal switching node of the PSTN or ISDN
Provides functionality such as registration, authentication, handovers
Home Location Register (HLR)
Permanent database about mobile subscribers in a large service area (generally
one per GSM network operator)
Database contains IMSI, MS ISDN, pre-paid/post-paid, roaming restrictions
and supplementary services
Visitor Location Register (VLR)
Temporary database which updates whenever new MS enter its area, by HLR
database
Controls those mobiles roaming in its area
Reduces number of quires to HLR.
Database contains IMSI, MS ISDN, MSRN, location area, authentication key

DEPARTMENT OF ECE, ALIET Page 24


COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

Authentication Centre (AC)


Protected database that stores a copy of secret key stored in each subscriber's SIM
card
Maintains authentication keys and algorithms and provides security triplets
(RAND,SRES,Kc)
Associated with HLR

Equipment Identity Register (EIR)

Database used to track the handsets using the IMEI


Database contains a list of all valid mobile equipment on the network.
Only one EIR per public land mobile network.

5.4.4 GSM Characteristics


TDMA over radio carriers(200Khz carrier spacing)
8 full rate or 16 half rate TDMA channels per carrier
User or terminal authentication for fraud control
Encryption of speech and data transmission over the radio path
Low speed data services (up to 9.6 Kb/s)
Support of short message service(SMS)

5.4.5 Advantages OF GSM

Capacity increases
Reduced RF transmission power and longer battery life
International roaming capability
Better security against fraud
Encryption capability for information security and privacy
Compatibility with ISDN, leading to wider range of services.

DEPARTMENT OF ECE, ALIET Page 25


COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

5.4.6 GSM which is used in Practical

FIG 5.6: GSM MODEM

Here we are using micro controller. It has antenna which is in the form of wire.
It has external slot for SIM allocation. We can keep any network SIM which is a GSM
model. It wants external power supply; this is given by using adaptor which supports
9v and 2A. It has two LEDs for indication of power and network signalling
respectively. Power LED emits light continuously. Network signalling LED, at starting
blinks fatly and after sometime it starts blinking slowly like single blink per minute.
This indicates the SIM got signal according to its network. Then it can send message to
any network

5.4.7 GSM Applications


Mobile telephony
Telemetry system
Fleet management
Automatic meter reading
Toll collection

DEPARTMENT OF ECE, ALIET Page 26


COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

5.5 POWER SUPPLY


5.5.1 Introduction
The Power Supply is a Primary requirement for the project work. The required
DC power supply for the base unit as well as for the recharging unit is derived from the
mains line. For this purpose centre tapped secondary of 12V-012V transformer is used.
From this transformer we getting 5V power supply. In this +5V output is a regulated
output and it is designed using 7805 positive voltage regulator. This is a 3 Pin voltage
regulator, can deliver current up to 800 milliamps. Rectification is a process of
rendering an alternating current or voltage into a unidirectional one. The component
used for rectification is called Rectifier. A rectifier perm its current to flow only
during positive half cycles of the applied AC voltage. Thus, pulsating DC is obtained
to obtain smooth DC power additional filter circuits required.

5.5.2 Block Diagram

FIG 5.7: BLOCK DIAGRAM OF POWERSUPPLY

DEPARTMENT OF ECE, ALIET Page 27


COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

5.5.3 Components Used

Capacitors
100F/25v for +12v
Step down transformer
230v / 12v- 0 -12v/ 500mA Transformer
Diodes: 1N4007

A diode can be used as rectifier. There are various types of diodes. However,
semiconductor diodes are very popularly used as rectifiers. A semiconductor diode is a
solid-state device consisting of two elements is being an electron emitter or cathode,
the other an electron collector or anode. Since electrons in a semiconductor diode can
flow in one direction only-form emitter to collector-the diode provides the unilateral
conduction necessary for rectification. The rectified Output is filtered for smoothening
the DC, for this purpose capacitor is used in the filter circuit. The filter capacitors are
usually connected in parallel with the rectifier output and the load. The AC can pass
through a capacitor but DC cannot, the ripples are thus limited and the output becomes
smoothed. When the voltage across the capacitor plates tends to rise, it stores up
energy back into voltage and current. Thus, the fluctuation in the output voltage is
reduced considerable

5.5.4 Regulator (Lm7805)


A variable regulated power supply, also called a variable bench power supply,
is one where you can continuously adjust the output voltage to your requirements.
Varying the output of the power supply is the recommended way to test a project after
having double checked parts placement against circuit drawings and the parts
placement guide. This type of regulation is ideal for having a simple variable bench
power supply. Actually this is quite important because one of the first projects a
hobbyist should undertake is the construction of a variable regulated power supply.
While a dedicated supply is quite handy e.g. 5V or 12V, its much handier to have a
variable supply on hand, especially for testing. Most digital logic circuits and
processors need a 5 volt power supply. To use these parts we need to build a regulated
5 volt source. Usually you start with an unregulated power supply ranging from 9 volts
to 24 volts DC (A 12 volt power supply is included with the Beginner Kit and the

DEPARTMENT OF ECE, ALIET Page 28


COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

Microcontroller Beginner Kit.). To make a 5 volt power supply, we use a LM7805


voltage regulator IC (Integrated Circuit). The IC is shown below.

FIG 5.8: COMPONENT OF REGULATOR

5.5.5 Features
Output Current up to 1A
Output Voltages of 5, 6, 8, 9, 10, 12, 15, 18, 24V
Thermal Overload Protection
Short Circuit Protection
Output Transistor Safe Operating Area Protection

The LM7805 is simple to use. You simply connect the positive lead of
your unregulated DC power supply (anything from 9VDC to 24VDC) to the
Input pin, connect the negative lead to the Common pin and then when you turn
on the power, you get a 5 volt supply from the Output pin.

DEPARTMENT OF ECE, ALIET Page 29


COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

5.6 GAS SENSORS(MQ2)

5.6.1INTRODUCTION
In current technology scenario, monitoring of gases produced is very important.
From home appliances such as air conditioners to electric chimneys and safety systems
at industries monitoring of gases is very crucial. Gas sensors are very important part
of such systems. Small like a nose, gas sensors spontaneously react to the gas present,
thus keeping the system updated about any alterations that occur in the concentration
of molecules at gaseous state. The gas sensor can have certain constant pressure value
when pressure of the wheel reducing the beyond the constant value, it will sent a
signal to the processor then buzzer sound will indicate the low pressure in tier tubes. .

5.6.2 WORKING OF GAS SENSORS


Gas sensors are available in wide specifications depending on the sensitivity
levels, type of gas to be sensed, physical dimensions and numerous other factors. This
Insight covers a methane gas sensor that can sense gases such as ammonia which
might get produced from methane.

When a gas interacts with this sensor, it is first ionized into its constituents and
is then adsorbed by the sensing element. This adsorption creates a potential difference
on the element which is conveyed to the processor unit through output pins in form of
current. The gas sensor module consists of a steel exoskeleton under which a sensing
element is housed. This sensing element is subjected to current through connecting
leads.

This current is known as heating current through it, the gases coming close to
the sensing element get ionized and are absorbed by the sensing element. This changes
the resistance of the sensing element which alters the value of the current going out of
it.

DEPARTMENT OF ECE, ALIET Page 30


COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

FIG 5.9 :GAS SENSORS

5.6.3 DIFFERENT TYPES OF GAS SENSORS.

SENSOR GAS TYPE


MQ2 Combustible Gas ,Smoke
MQ3 Alcohol Vapour
MQ5 Lpg, Natural Gas , Town Gas
MQ9 Carbon Monoxide, Coal Gas, Liquefied Gas

TABLE :TYPES OF GAS SENSORS

5.6.4 FEATURES

Wide detecting scope.


Stable and long lifetime.
Fast response and High sensitivity.

DEPARTMENT OF ECE, ALIET Page 31


COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

5.6.5 SPECIFICATIONS

ITEM PARAMETER MIN TYPICAL MAX UNIT


VCC WORKING 4.9 5 5.1 V
VOLTAGE
PH HEATING 0.5 - 800 Mv
CONSUMPTION
RL LOAD - ADJUSTABLE - -
RESISTANCE
RH HEATER - 33 -
RESISTANCE
RS SENSING 3 30 - K
RESISTANCE

5.6.6 SENSITIVITY ADJUSTMENT


Resistance value of MQ-2 is difference to various kinds and various concentration
gases. So, when using these components, sensitivity adjustment is very necessary. We
recommend that you calibrate the detector for 1000ppm liquefied petroleum gas, or
1000ppm iso-butane concentration in air and use value of Load resistance that( RL)
about 20 K(5K to 47 K). When accurately measuring, the proper alarm point for
the gas detector should be determined after considering the temperature and humidity
influence.

5.7 GLOBAL POSITIONING SYSTEM

5.7.1 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


satellite position at time of message transmission

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

DEPARTMENT OF ECE, ALIET Page 32


COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

satellites locations are used with the possible aid of trilateration, to compute the
position of the receiver. This position is then displayed, with a moving map display or
latitude and longitude. Many GPS units show derived information such as direction
and speed, calculate from position changes.

FIG 5.10: GPS SATELLITE IN EARTHS ORBIT

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 both the receiver's location and time. 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. Some GPS receivers may use additional clues or assumptions (such as
reusing the last known altitude, or including information from the vehicle computer) to
give a less accurate (degraded) position when fewer than four satellites are visible.

5.7.2 Position Calculation


A satellite's position and pseudo range define a sphere, cantered on the
satellite, with radius equal to the pseudo range. 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.

DEPARTMENT OF ECE, ALIET Page 33


COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

For automobiles and other near-earth vehicles, the correct position of the GPS
receiver is the intersection closest to the Earth's surface. For space vehicles, the
intersection farthest from Earth is the correct one .The correct position for the GPS
receiver is also on the intersection with the surface of the sphere corresponding to the
fourth satellite.

5.7.3 Working Principle of GPS

GPS works in five logical steps

The basis of GPS is triangulation from satellites.


To triangulate a GPS receiver measures distance using the travel time of radio
signals.
To measure travel time GPS needs very accurate timing.
Along with the distance we need to know where exactly the satellites are in
space.
If the signal experiences any delays when it travels through the atmosphere,
they must be corrected.

5.7.4 GPS which is used in Practical

FIG 5.11: GPS MODEM

The above figure indicates the GPS MODEM. It is manufactured at Taiwan. It has
antenna named as GPS ANTENNA which is connected externally. It also wants
additional adaptor for power supply.

The adaptor gives 9v and 2A. It consists of a switch for on and off purpose.

The following figure shows the GPS antenna.

DEPARTMENT OF ECE, ALIET Page 34


COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

FIG 5.12: GPS ANTENNA

The GPS antenna provides 1575.42MHz frequency for signal grasping and it wants
3v-6v for operation.

5.7.5 Applications

GPS is usable everywhere except where it is impossible to receive signals such


as inside buildings, in caves and other subterranean location and under water. Various
military weapons systems use GPS to track potential ground and air targets before
flagging them as hostile. Downed pilots can be located faster if their position is
known. Patrol movement can be managed more closely. Surveyors use absolute
locations to make maps and determine property boundaries. Self-navigating,
autonomous robots use GPS sensors, which calculate latitude, longitude, time, speed,
and heading. Provides digitally precise velocity and orientation measurements to
navigators.

1. Science

Archaeology, Atmospheric science, oceanography

Environmental, Geology and Geo physics, Wild life

2. Transportation

Aviation, Marine and Space

DEPARTMENT OF ECE, ALIET Page 35


COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

5.8 RELAY
5.8.1 INTRODUCTION

A relay is an electrically operating switch. Current flowing through the coil of


the relay creates a magnetic field which attracts a lever and changes the switch
contacts. The coil current can be ON or OFF so relays have two switch positions and
they are double through (changeover) switches.

FIG 5.13 RELAY OPERATION

It is a mechanical switch which is operated electrically to turn ON or OFF current in an


electrical switch. Some of the advantages by using relays are
The relay requires a small power for its operation. This permits to control a large
power in the load by a small power to the relay circuit. Thus a relay acts as a power
amplifier i.e. it combines control with power amplification.
The switch in the relay coil carries a small current as compared to the load current.
This permits the use of a smaller switch in the relay coil circuit.
The operator can turn ON or OFF power to a load even from a distance. This is a very
important advantage when high voltages are to be handled.
There is no danger sparking as the turning ON or OFF is carried by the relay coil
switch which carries a small current. But the speed operation is very small
Notice that there are two different kinds:

NO normally open. The contacts are open until the coil of the relay is
energised, whereupon they are closed to complete the outside circuit.
NC - normally closed. The contacts are closed until the coil of the relay is
energised, whereupon they are opened to break the outside circuit, switching it
off.
Many relays have multiple contacts, half of which are NO and half NC.

DEPARTMENT OF ECE, ALIET Page 36


COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

Relays are electromagnetic devices which have a certain amount


of inductance. When they are turned off, the collapse of the magnetic field can
produce a momentary spike of high reverse voltage that can wreck a transistor or
integrated circuit. Therefore a reverse biased diode is placed in parallel to short out
the voltage spike, thereby protecting the circuit.

FIG 5.14 :CIRCUIT DIAGRAM OF RELAY

Most relays are designed for PCB mounting but you can solder wires directly to the
pins providing you take care to avoid melting the plastic case of the relay.

5.8.2 WORKING OF RELAY


All relays contain a sensing unit, the electric coil, which is powered by AC or DC
current. When the applied current or voltage exceeds a threshold value, the coil activates the
armature, which operates either to close the open contacts or to open the closed magnetic
force that actuates the switch mechanism. The magnetic force is, in effects, relaying the action
from one circuit to another. The first circuit is called the control circuit; the second is called
the load circuit.

DEPARTMENT OF ECE, ALIET Page 37


COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

FIG 5.15 :WORKING OF RELAY


There are three basic functions of a relay: On/Off Control Limit Control and
Logic Operation.

On/Off Control: Example: Air Conditioning control, used to limit and control a high power
load, such as a compressor.

Limit Control Example: Motor Speed Control, used to disconnect a motor if it runs slower or
faster than the desired speed .

Logic Operation: Example: Test Equipment, used to connect the instrument to a number of
testing points on the device under test

5.8.3 Advantages of relays:


Relays can switch AC and DC.
Relays can switch high voltages.
Relays are a better choice for switching large currents(> 5A)
Relays can switch many contacts at once.

DEPARTMENT OF ECE, ALIET Page 38


COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

5.8.4 Disadvantages of relays:


Relays are bulkier than transistors for switching small currents.
Relays cannot switch rapidly.
Relays use more power due to the current flowing through their coil.

5.9 DISPLAY
5.9.1 INTRODUCTION

A computer monitor or a computer display is an electronic visual


display for computers. A monitor usually comprises the display device, circuitry,
casing, and power supply. The display device in modern monitors is typically a thin
film transistor liquid crystal display (TFT-LCD) or a flat panel LED display, while
older monitors used a cathode ray tubes (CRT). It can be connected to the computer
via VGA, DVI, HDMI, Display Port, Thunderbolt, LVDS (Low-voltage differential
signalling) or other proprietary connectors and signals.

FIG 5.16 DISPLAY

DEPARTMENT OF ECE, ALIET Page 39


COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

5.9.2MEASUREMENTS OF PERFORMANCE

The performance of a monitor is measured by the following parameters:

Luminance is measured in candelas per square meter (cd/m2 also called a Nit).
Aspect ratio is the ratio of the horizontal length to the vertical length. Monitors
usually have the aspect ratio 4:3, 5:4, 16:10 or 16:9.
Viewable image size is usually measured diagonally, but the actual widths and
heights are more informative since they are not affected by the aspect ratio in the
same way. For CRTs, the viewable size is typically 1 in (25 mm) smaller than the
tube itself.
Display resolution is the number of distinct pixels in each dimension that can be
displayed. For a given display size, maximum resolution is limited by dot pitch.
Dot pitch is the distance between sub-pixels of the same color in millimetres. In
general, the smaller the dot pitch, the sharper the picture will appear.
Refresh rate is the number of times in a second that a display is illuminated.
Maximum refresh rate is limited by response time.
Response time is the time a pixel in a monitor takes to go from active (white) to
inactive (black) and back to active (white) again, measured in milliseconds. Lower
numbers mean faster transitions and therefore fewer visible image artefacts.
Contrast ratio is the ratio of the luminosity of the brightest color (white) to that of
the darkest color (black) that the monitor is capable of producing.
Power consumption is measured in watts.
Delta-E: Color accuracy is measured in delta-E; the lower the delta-E, the more
accurate the color representation. A delta-E of below 1 is imperceptible to the
human eye. Delta-Es of 2 to 4 are considered good and require a sensitive eye to
spot the difference.
Viewing angle is the maximum angle at which images on the monitor can be
viewed, without excessive degradation to the image. It is measured in degrees
horizontally and vertically.

DEPARTMENT OF ECE, ALIET Page 40


COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

5.9.3 FEATURES
SIZE
The size of a display is usually by monitor manufacturers given by the
diagonal, i.e. the distance between two opposite screen corners. This method of
measurement is inherited from the method used for the first generation of CRT
television, when picture tubes with circular faces were in common use The estimation
of the monitor size by the distance between opposite corners does not take into account
the display aspect ratio, so that for example a 16:9 21-inch (53 cm) widescreen display
has less area, than a 21-inch (53 cm) 4:3 screen. The 4:3 screen has dimensions of
16.8 in 12.6 in (43 cm 32 cm) and area 211 sq. in (1,360 cm2), while the
widescreen is 18.3 in 10.3 in (46 cm 26 cm), 188 sq. in (1,210 cm2).
ASPECTS RATIO
Computer monitors had a 4:3 aspect ratio and some had 5:4
RESOLUTION
The resolution for computer monitors has increased over time. Major display
manufacturers had released 3840x2160 resolution displays.

Power saving [edit]

Most modern monitors will switch to a power-saving mode if no video-input


signal is received. This allows modern operating systems to turn off a monitor after a
specified period of inactivity. This also extends the monitor's service life.

Some monitors will also switch themselves off after a time period on standby.

5.10 MOTOR DRIVER (L293D)


5.10.1 Introduction
We discuss about L293D motor driver working for motors. The L293 and
L293D are quadruple high-current half-H drivers. Here we learn about hybrid bridges
(H-BRIDGE). The h-bridges which are mainly used in change of polarities. There are
two polarities in every motor. In L293D two h-bridges are present. Four transistors are
present in each h-bridge. If we give logic bits 1, 0 then current flow is Vcc to motor
positive after that motor positive to negative and then flows to ground. Then motor
DEPARTMENT OF ECE, ALIET Page 41
COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

rotates in one direction. We change the logic bits as 0, 1 then current flow is Vcc to
motor negative after that motor negative to positive and then flows to ground. Then
motor rotate in opposite direction. If we give logic bits 1, 1 then Vcc and ground are
short. So motor does not rotate. If we give logic bits 0, 0 then motor does not start.
Because two pins are given to zero.

Fig 5.17: Motor


The L293 is designed to provide bidirectional drive currents of up to 1 A at
voltages from 4.5 V to 36 V. The L293D is designed to provide bidirectional drive
currents of up to600-mA at voltages from 4.5 V to 36 V. Both devices are designed to
drive inductive loads such as relays, solenoids, dc and bipolar stepping motors, as well
as other high-current/high-voltage loads in positive-supply applications. All inputs are
TTL compatible. Each output is a complete totem-pole drive circuit, with a Darlington
transistor sink and a pseudo-Darlington source. Drivers are enabled in pairs, with
drivers 1 and 2 enabled by 1,2EN and drivers 3 and 4 enabled by 3,4EN. When an
enable input is high, the associated drivers are enabled and their outputs are active and
in phase with their inputs. When the enable input is low, those drivers are disabled and
their outputs are off and in the high-impedance state. With the proper data inputs, each
pair of drivers forms a full-H (or bridge) reversible drive suitable for solenoid or motor
applications.
On the L293, external high-speed output clamp diodes should be used for
inductive transient suppression. A VCC1 terminal, separate from VCC2, is provided
for the logic inputs to minimize device power dissipation. The L293and L293D is
characterized for operation from 0C to 70C.

DEPARTMENT OF ECE, ALIET Page 42


COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

5.10.2 PIN DIAGRAM

FIG 5.18: PINDIAGRAM OF L293D

5.10.3 FEATURES

Output Current 1A Per Channel (600mA for L293D)


Peak Output Current 2A Per Channel (1.2A for L293D)
Inhibit Facility
High Noise Immunity
Separate Logic Supply
Over-Temperature Protection

5.10.4 STATE DIAGRAM

TABLE 5.19: STATE DIAGRAM

DEPARTMENT OF ECE, ALIET Page 43


COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

5.11 IR SENSORS
5.11.1 Introduction
They are the modern technology used to pick up an area of the light
spectrum which the eyes are not capable of seeing; they also known
as thermography, infrared detectors are used in construction, public service and
science.
The infrared sensors emit and/or receive the infrared waves in the form of the
heat, while most the infrared sensors transmit and receive infrared waves, some can
receive them only; these types of infrared sensors are known as Passive Infrared
Sensors (PIR sensors) or motion detectors .
The infrared detectors are the pyro-electric sensors which detect the light
spectrums infrared wavelength , They are usually emitters as well , They can be made
of a phototransistor , photodiode , or photo resistor as these are basically the same
device , They have many uses and they are essential to the transference of infrared
light .

5.11.2 IR LED
Here the 5v is applied to IR LED via 330 ohms resistor in forward bias; the IR
LED emits constant IR light in the free space. The light is focused on the photo diode
kept at opposite to the IR LED, connected in reverse bias in series with 10 k ohms
resistor. The junction is connected to the port P1.0 of Microcontroller. When the IR
light is focused on the photo diode that maintains very low resistance due to that the
P1.0 maintains low i.e. 0 V. When any obstruction is there in between IR LED and
photo diode, there is no IR focused on the photo diode that maintains very high
resistance due to that the port maintains high signal i.e. 5V (bit-1)

Like this we are connected 8 sensors for port 1 (P1.0 to P1.7). These 8 sensors
are organized in 4 rows of each 2 sensors.

DEPARTMENT OF ECE, ALIET Page 44


COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

5.11.3 Photodiode
A photodiode is a type of photo detector capable of converting light into either
current or voltage, depending upon the mode of operation. Photodiodes are similar to
regular semiconductor diodes except that they may be either exposed (to detect
vacuum UV or X-rays) or packaged with a window or optical fibre connection to allow
light to reach the sensitive part of the device. Many diodes designed for use
specifically as a photodiode will also use a PIN junction rather than the typical PN
junction.

5.11.4 Principle of Operation


A photodiode is a PN junction or PIN structure. When a photon of sufficient
energy strikes the diode, it excites an electron, thereby creating a mobile electron and a
positively charged electron hole. If the absorption occurs in the junction's depletion
region, or one diffusion length away from it, these carriers are swept from the junction
by the built-in field of the depletion region. Thus holes move toward the anode, and
electrons toward the cathode, and a photocurrent is produced.

FIG 5.20: PRINCIPLE OF OPERATION OF IR SENSORS

DEPARTMENT OF ECE, ALIET Page 45


COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

5.11.5 Photovoltaic Mode


When used in zero bias or photovoltaic mode, the flow of photocurrent out of the
device is restricted and a voltage builds up. The diode becomes forward biased and
"dark current" begins to flow across the junction in the direction opposite to the
photocurrent. This mode is responsible for the photovoltaic effect, which is the basis
for solar cellsin fact, a solar cell is just a large area photodiode.

5.11.6 IR-Photodiode Assembly


The common 5V IR and Photo diode was found to be sufficient. The IR is
powered using one of the digital pin of the LPC 2148. The photo diode and a 45k
resistor form a potential divider arrangement. The output of the potential divider is
given to one of the analog input channel of the LPC 2148.

5.11.7Working Mechanism
An IR sensor is basically a device which consists of a pair of an IR LED and a
photodiode which are collectively called a photo-coupler or an opto-coupler. The IR
LED emits IR radiation, reception and/or intensity of reception of which by the
photodiode dictates the output of the sensor. Now, there are so many ways by which
the radiation may or may not be able to reach the photodiode. Lets discuss a few types
of IR sensors as below.
1. Direct Incidence
We may hold the IR LED directly in front of the photodiode, such that almost
all the radiation emitted, reaches the photodiode. This creates an invisible line of IR
radiation between the IR LED and the photodiode. Now, if an opaque object is placed
obstructing this line, the radiation will not reach the photodiode and will get either
reflected or absorbed by the obstructing object. This mechanism is used in object
counters and burglar alarms.
2. Indirect Incidence
High school physics taught us that black colour absorbs all radiation, and the
colour white reflects all radiation. We use this very knowledge to build our IR sensor.
If we place the IR LED and the photodiode side by side, close together, the radiation
from the IR LED will get emitted straight in the direction to which the IR LED is

DEPARTMENT OF ECE, ALIET Page 46


COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

pointing towards, and so is the photodiode, and hence there will be no incidence of the
radiation on the photodiode. Please refer to the right part of the illustration given below
for better understanding. But, if we place an opaque object in front the two, two cases
occur:
3. Reflective Surface
If the object is reflective, (White or some other light colour), then most of the radiation
will get reflected by it, and will get incident on the photodiode. For further
understanding, please refer to the left part of the illustration below.

4. Non-Reflective Surface
If the object is non-reflective, (Black or some other dark colour), then most of the
radiation will get absorbed by it, and will not become incident on the photodiode. It is
similar to there being no surface (object) at all, for the sensor, as in both the cases, it
does not receive any radiation.

5.11.8 Advantages
Infrared detectors has the ability to be applied to a large area, they are operating
in the real time. They pick up the movement, so, they are very useful in a variety of
circumstance. They are used by many fire departments and they help the fire fighters to
see through the smoke.

Infrared detectors can receive the infrared light which is irradiated from both
living and non-living objects which is very important for many of the applications
that infrared sensors are used for.
Infrared sensors can detect the infrared light from far distances over a large
area, they detect the movement, making them ideal for the security purposes, and they
help the humans see what the other devices do not allow them to see, such as
the leaks in underground pipes.

DEPARTMENT OF ECE, ALIET Page 47


COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

5.11.9 Applications
Infrared detectors are used in a wide variety of applications, they can be used in
any situation that requires thermal energy detection, and they are most used in the
conjunction with an infrared emitter to transfer the infrared light.
Infrared detectors are used as motion detectors to open the doors, track the
objects, or activate specific systems based on the thermal energy which is irradiated
from the people, the animals and moving objects.
Infrared detectors are used in night-vision applications, laser range
finding and heat-seeking missiles, Television remotes emit infrared light to change the
channels and the television itself has a built-in infrared sensor to receive the remotes
signals.

511.10 Features
Very low supply current
Photo detector and preamplifier in one package
Internal filter for PCM frequency
Supply voltage: 2.5 V to 5.5 V
Improved immunity against ambient light

DEPARTMENT OF ECE, ALIET Page 48


COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

CHAPTER 6

SOFTWARE DESCRIPTION

6.1 PYTHON
6.1.1 INTRODUCTION

Python is an interpreter, object-oriented, high-level programming language


with dynamic semantics. Its high-level built in data structures, combined with dynamic
typing and dynamic binding; make it very attractive for Rapid Application
Development, as well as for use as a scripting or glue language to connect existing
components together. Python's simple, easy to learn syntax emphasizes readability and
therefore reduces the cost of program maintenance. Python supports modules and
packages, which encourages program modularity and code reuse. The Python
interpreter and the extensive standard library are available in source or binary form
without charge for all major platforms, and can be freely distributed.

Often, programmers fall in love with Python because of the increased


productivity it provides. Since there is no compilation step, the edit-test-debug cycle is
incredibly fast. Debugging Python programs is easy: a bug or bad input will never
cause a segmentation fault. Instead, when the interpreter discovers an error, it raises an
exception. When the program doesn't catch the exception, the interpreter prints a stack
trace. A source level debugger allows inspection of local and global variables,
evaluation of arbitrary expressions, setting breakpoints, stepping through the code a
line at a time, and so on. The debugger is written in Python itself, testifying to Python's
introspective power. On the other hand, often the quickest way to debug a program is to
add a few print statements to the source: the fast edit-test-debug cycle makes this
simple approach very effective.

DEPARTMENT OF ECE, ALIET Page 49


COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

6.2 COMPARING PYTHON TO OTHER LANGUAGES


Python is often compared to other interpreted languages such as Java,
JavaScript, Perl, Tcl, or Smalltalk. Comparisons to C++, Common Lisp and Scheme
can also be enlightening. In this section I will briefly compare Python to each of these
languages. These comparisons concentrate on language issues only. In practice, the
choice of a programming language is often dictated by other real-world constraints such
as cost, availability, training, and prior investment, or even emotional attachment. Since
these aspects are highly variable, it seems a waste of time to consider them much for
this comparison.

JAVA:

Python programs are generally expected to run slower than Java programs, but
they also take much less time to develop. Python programs are typically 3-5 times
shorter than equivalent Java programs. This difference can be attributed to Python's
built-in high-level data types and its dynamic typing. For example, a Python
programmer wastes no time declaring the types of arguments or variables, and Python's
powerful polymorphic list and dictionary types, for which rich syntactic support is built
straight into the language, find a use in almost every Python program. Because of the
run-time typing, Python's run time must work harder than Java's. For example, when
evaluating the expression a+b, it must first inspect the objects a and b to find out their
type, which is not known at compile time. It then invokes the appropriate addition
operation, which may be an overloaded user-defined method. Java, on the other hand,
can perform an efficient integer or floating point addition, but requires variable
declarations for a and b, and does not allow overloading of the + operator for instances
of user-defined classes.

For these reasons, Python is much better suited as a "glue" language, while
Java is better characterized as a low-level implementation language. In fact, the two
together make an excellent combination. Components can be developed in Java and
combined to form applications in Python; Python can also be used to prototype
components until their design can be "hardened" in a Java implementation. To support
this type of development, a Python implementation written in Java is under

DEPARTMENT OF ECE, ALIET Page 50


COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

development, which allows calling Python code from Java and vice versa. In this
implementation, Python source code is translated to Java byte code (with help from a
run-time library to support Python's dynamic semantics).

JAVASCRIPT :

Python's "object-based" subset is roughly equivalent to JavaScript. Like


JavaScript (and unlike Java), Python supports a programming style that uses simple
functions and variables without engaging in class definitions. However, for JavaScript,
that's all there is. Python, on the other hand, supports writing much larger programs and
better code reuse through a true object-oriented programming style, where classes and
inheritance play an important role.

PERL :

Python and Perl come from a similar background (UNIX scripting, which both
have long outgrown), and sport many similar features, but have a different philosophy.
Perl emphasizes support for common application-oriented tasks, e.g. by having built-in
regular expressions, file scanning and report generating features. Python emphasizes
support for common programming methodologies such as data structure design and
object-oriented programming, and encourages programmers to write readable (and thus
maintainable) code by providing an elegant but not overly cryptic notation. As a
consequence, Python comes close to Perl but rarely beats it in its original application
domain; however Python has an applicability well beyond Perl's niche.

TCL :

Like Python, Tcl is usable as an application extension language, as well as a


stand-alone programming language. However, Tcl, which traditionally stores all data as
strings, is weak on data structures, and executes typical code much slower than Python.
Tcl also lacks features needed for writing large programs, such as modular namespaces.
Thus, while a "typical" large application using Tcl usually contains Tcl extensions
written in C or C++ that are specific to that application, an equivalent Python
application can often be written in "pure Python". Of course, pure Python development
is much quicker than having to write and debug a C or C++ component. It has been said

DEPARTMENT OF ECE, ALIET Page 51


COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

that Tcl's one redeeming quality is the Tk toolkit. Python has adopted an interface to Tk
as its standard GUI component library.

Tcl 8.0 addresses the speed issues by providing a byte code compiler with
limited data type support, and adds namespaces. However, it is still a much more
cumbersome programming language.

SMALL TALK :

Perhaps the biggest difference between Python and Smalltalk is Python's more
"mainstream" syntax, which gives it a leg up on programmer training. Like Smalltalk,
Python has dynamic typing and binding, and everything in Python is an object.
However, Python distinguishes built-in object types from user-defined classes, and
currently doesn't allow inheritance from built-in types. Smalltalk's standard library of
collection data types is more refined, while Python's library has more facilities for
dealing with Internet and WWW realities such as email, HTML and FTP.

Python has a different philosophy regarding the development environment and


distribution of code. Where Smalltalk traditionally has a monolithic "system image"
which comprises both the environment and the user's program, Python stores both
standard modules and user modules in individual files which can easily be rearranged
or distributed outside the system. One consequence is that there is more than one option
for attaching a Graphical User Interface (GUI) to a Python program, since the GUI is
not built into the system.

C++ :

Almost everything said for Java also applies for C++, just more so: where
Python code is typically 3-5 times shorter than equivalent Java code, it is often 5-10
times shorter than equivalent C++ code! Anecdotal evidence suggests that one Python
programmer can finish in two months what two C++ programmers can't complete in a
year. Python shines as a glue language, used to combine components written in C++.

DEPARTMENT OF ECE, ALIET Page 52


COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

6.3 HOW TO INSTALL THE OPERATING SYSTEM TO YOUR


RASPBERRY PI :
Raspberry Pi doesnt come with an operating system. This is not a weakness,
however, rather a feature that means you can choose from a wide of OSs, each of
which can be flashed to an SD card (or micro SD card for the Raspberry Pi B+) in a
few simple steps. Heres how to get a new OS installed and running on your Pi and
how to clone your perfect setup for quick disaster recovery.

Operating systems such as the recommended Raspbian, Arch Linux, Risc OS


and even Android come ready to run on your Raspberry Pi. Ill show you the two main
ways add an operating system and once youve got your Pi setup how you want it,
well look at how to clone the card so that it can be restored following errors (or for
temporary reuse of your SD card).

6.3.1FLASH AN OS TO SD AND BOOT YOUR RASPBERRY PI


Whichever operating system you download for your Raspberry Pi, the process
of writing it to an SD card is the same. However, there are some differences in SD card
writing between desktop operating systems. Youll also need to ensure that your card
is blank and formatted, and at least 2 GB.

FIG 6.1 SD FORMATTER V4.0

For Windows users (and also those of you with Mac OS X) the tool of choice for
writing a Raspberry Pi OS image to SD card is SD Formatter, from the SD
Association. With the card inserted into your computers card reader, and ensuring you

DEPARTMENT OF ECE, ALIET Page 53


COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

have the correct Drive letter selected in the drop down menu, open the Option menu
and select Full (Erase) and On. This ensures that the full capacity of the storage card
will be available.

Click OK, then Format to begin.

To write the disk image, use Win32DiskImager, available from Source forge.
You may need to run with administrator privileges. Select the correct drive letter for
your SD card, browse to the image file and click Write to commence the process.
Win32DiskImager will inform you when the data has been written.

If writing the disk image seems too much hassle or is beyond your abilities, it is
possible to purchase SD cards with Raspbian pre-installed.

6.3.2BOOTING RASPBIAN FOR THE FIRST TIME

With Raspbian installed, youll need to login with the following credentials:

Username: pi

Password: raspberry

For other operating systems, check the documentation to find the default login
credentials.

Remember that the password will not be displayed as you type it; there are no
Windows-style * symbols representing the letters. Instead, it will appear that you
havent entered a password. This is a security feature in Linux to prevent people
guessing the length of your passphrase. Just type the password regardless.

In Raspbian, you can change your password by running

Sudo raspi-config

And selecting the Change Password option.

DEPARTMENT OF ECE, ALIET Page 54


COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

6.4 Install Raspbian, XBMC, Risc OS, OpenElec & ArchLinux Easily
With NOOBS.
For a simpler, more streamlined install of the more popular Raspberry Pi
distros such as Raspbian, ArchLinux, XBMC and OpenElec media centres, as well as
Risc OS and Pidora you can employ NOOBS, the New out Of Box Software
installation system.

FIG 6.2 NOOBS V.1.2

NOOBS is available from http://www.raspberrypi.org/downloads and


doesnt require writing to SD card in the way Raspbian and other Pi
operating systems are. You will need a card greater than 4GB and should use
the SD Formatter tool to format (Full Erase On, Format Size Adjustment On).
When downloading NOOBS note that offline and online installers are
available, differing in size; the smaller download will require that your
Raspberry Pi is connected to the Internet via Ethernet.

A keyboard and/or mouse will be required to install an OS with NOOBS, as


will a HDMI display.

With the Raspberry Pi booted into the NOOBS interface, you can choose your
operating system(s).

DEPARTMENT OF ECE, ALIET Page 55


COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

6.4PERFECTING YOUR RASPBERRY PI OS

Different Raspberry Pi projects require a varying amount of software; it really


all depends on what youre planning to do.

For instance, if you want to use your Raspberry Pi as a media centre, then
you might use NOOBS to install XBMC or (the better option, in my opinion)
OpenElec.

Disaster Management: Cloning the OS


The point at which youre happy with the installed OS is precisely when you
should make a clone of it. This is a full backup image of the SD card saved to
your hard disk drive (or second SD card) that can be easily flashed should you
run into trouble.

Windows users can again employ Win32DiskImager here, ensuring that


the perfected Raspberry Pi SD card is inserted in your Windows card reader
before launching the utility.

FIG 6.3 WINDISK IMAGER

Find the Image File field, and browse to the folder where you will be saving
your SD card image; in the Device box, select the drive letter of the SD card,
and after confirming both are correct, click Read to begin the cloning,
following any on-screen instructions. Give the process time to complete before
proceeding.

Should you need to revert the SD card back to its perfect state later on, youll
need to remove all partitions (WIN+R to launch Disk Management, right-click the SD
DEPARTMENT OF ECE, ALIET Page 56
COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

card and select Delete) before restoring the image. You might also reformat using SD
Formatter, as explained above.

Again using Win32DiskImager, browse for the image file, set the Device drive
letter and then click Write. Once the process is complete, your SD card will be
reverted to the perfect configuration you worked on earlier, and your Raspberry Pi
should be ready to put to use once more.

6.5 CONCLUSION: MAKE THE SD CARD WORK FOR YOU

One thing is clear about the Raspberry Pi: it relies on the SD card to on extent
or another. As such, understanding how to use this type of media with the little
computer is vital.

Writing an operating system to SD card is the Raspberry Pi equivalent of


installing an operating system. As youll have noticed, its much quicker than
installing Windows to a HDD, and with NOOBS doing the hard work, even
simpler!

We cant underline enough how important it is to make an image of your SD


card. With the various ways in which you can find your Pi not working
correctly, having a quick restore file saved to a HDD is really quite important.

6.6 EXTRACT TEXT WITH OCR FOR ALL IMAGE TYPES IN


PYTHON USING PYTESSERACT

Optical Character Recognition (OCR) is the process of electronically extracting


text from images or any documents like PDF and reusing it in a variety of ways such as
full text searches.

PYTESSERACT:

It will recognize and read the text present in images. It can read all image types
- png, jpeg, gif, tiff, bmp etc. Its widely used to process everything from scanned
documents.
DEPARTMENT OF ECE, ALIET Page 57
COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

Installation:

$ sudo pip installs pytesseract

Requirements:

Requires python 2.5 or later versions.

And requires Python Imaging Library (PIL).

USAGE:

From the shell:


$ ./pytesseract.py test.png

Above command prints the recognized text from image 'test.png'.

$ ./pytesseract.py -l eng test-english.jpg

Above command recognizes English text.

In Python Script:

import Image

from tesseract import image_to_string

print image_to_string (Image. Open ('test.png'))

print image_to_string (Image. Open ('test-english.jpg'), lang='eng')

DEPARTMENT OF ECE, ALIET Page 58


COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

CHAPTER 7

ADVANTAGES AND APPLICATIONS


7.1 ADVANTAGES
Collision avoidance systems seek to improve your visibility so you can be
confident, comfortable, and in control while on the road.

Enhanced Safety:

The most important advantage that a collision avoidance system will bring to
the table is an enhanced sense of safety. This isnt just crucial for your driver; its
crucial for pedestrians, bicyclists, and other drivers on the road as well. Collision
avoidance systems will use radar and video technologies to minimize the likelihood of
accidents, thus creating a safer road for anyone who traverses it.

Reduced Expenses:

An accident can be a frightening experience for all who are involved, and it can
result in damage to both vehicles and people. In addition, it can substantially reduce the
efficiency of your operation. When you use a collision avoidance system, you can rely
on your technology to prevent accidents from occurring. This keeps everybody safe,
prevents damage to company vehicles, and ensures that the driver stays on track.

Protection of property: If people know they are being taped, they are less likely
to engage in damaging or dangerous activities with your vehicle. This can protect your
car from vandalism and theft. In the case of corporate vehicles, it reduces liability as
people are less likely to mess with your company fleet.

Increased accountability: Parents with teen drivers will appreciate technology


that monitors their children while on the road. Teens are more prone to having poor
driving habits and engaging in dangerous distractions, such as texting. Having an in-car
camera will help keep teens responsible. In the case of corporate vehicles, these
systems can help employees use the vehicle more responsibly as well.

Improved safety: Since monitoring drivers with a camera system helps increase
accountability, it also improves safety by extension. Drivers will be more likely to obey
traffic laws and avoid dangerous activities, such as drinking while driving

DEPARTMENT OF ECE, ALIET Page 59


COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

7.2 APPLICATIONS
Can control over speed vehicles
Can stop drunk drivers
Can detect any kind of internal gas leakage
Can prevent collisions
Used to find out the location of the vehicle with a SMS notification
immediately after any kind of accident

DEPARTMENT OF ECE, ALIET Page 60


COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

CHAPTER 8

RESULTS, CONCLUSION AND FUTURE SCOPE

8.1 SPEED BOARDS DESIGNED

FIG 8.1: SPEED BOARDS

DEPARTMENT OF ECE, ALIET Page 61


COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

8.2 ACCIDENT ALERT :

FIG 8.2: SMS RECEIVED ON THE MOBILE PHONE WITH THE


ACCIDENT INFORMATION AND LOCATION OF THE VEHICLE.

DEPARTMENT OF ECE, ALIET Page 62


COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

FIG 8.4: 90KMPH SPEED SIGN DETECTED

FIG 8.4: 120KMPH SPEED SIGN DETECTED

DEPARTMENT OF ECE, ALIET Page 63


COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

8.3 CONCLUSION

We will limit the speed of the car according to the sign boards that are placed
on the roads and also continuously scan for various parameters like alcohol, gas and
also scan for any obstacle and stop the vehicle if any accident occurs. We also send a
sms alert whenever any kind of accident occurs. If accident happened, by using
vibration sensors we are able to found out on which side the impact occurred. After
collecting all information which is stored in internal memory, C send this data to
emergency services like ambulance unit via SMS using GSM modem.

8.4 FUTURE SCOPE

Road edge and barrier detection with steer assist helps the driver avoid
accidental road departures. The technology detects if the car is about to drive off the
road and autonomously applies steering torque to bring the vehicle back on track. A
forward-looking camera and radar cooperate to monitor the road edge and different
kinds of road barriers. The technology acts immediately if the driver shows signs of
unintentionally drifting too close to the edge.

DEPARTMENT OF ECE, ALIET Page 64


COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

BIBLOGRAPHY:

[1] A Velocity Control Strategy for Vehicular Collision Avoidance System Mingyuan
Bian, Keqiang Li, Dafeng Jin and Xiaomin Lian State Key Lab of Automotive Safety
and Energy Tsinghua University Beijing 100084, P.R.China bmy@tsinghua.edu.cn.

[2] Sensored Car , 2009 Second International Conference on Computer and Electrical
Engineering , Mrs.Bhavna Ambudkar Department of Electronics Padmashree
Dr.D.Y.Patil Institute of Engineering & Technology, Pimpri , Pune-411018.,
Maharashtra, India Email: bhavnada@yahoo.co.in

[3] Real-time crash avoidance system on crossroads based on 802.11 devices and GPS
receivers , Proceedings of the IEEE ITSC 2006 2006 IEEE Intelligent Transportation
Systems Conference Toronto, Canada, September 17-20, 2006 , Samer Ammoun
Fawzi Nashashibi Claude Laurgeau.

[4] Optical Character Recognition, International Journal of Emerging Technology and


Advanced Engineering Website: www.ijetae.com (ISSN 2250-2459, ISO 9001:2008
Certified Journal, Volume 4, Issue 5, May 2014) , Jagruti Chandarana1, Mayank
Kapadia2 1Department of Electronics and Communication Engineering, UKA
TARSADIA University 2Assistant Professor, Department of Electronics and
Communication Engineering, UKA TARSADIA University.

[5] Accident Avoidance and Detection on highways , International Journal of


Engineering Trends and Technology- Volume3Issue2- 2012 , S.P. Bhumkar1, V.V.
Deotare2, R.V.Babar3 1Sinhgad Institute Of Technology, Lonavala, Pune, India
2Department of Electronics and Telecommunication engineering, SIT, Lonavala, Pune,
India 3Department of Electronics and Telecommunication engineering, SIT, Lonavala,
Pune, India.

[6] Traffic Road Sign Detection and Recognition for Automotive Vehicles ,
International Journal of Computer Applications (0975 8887) Volume 120 No.24,
June 2015 , Md. Safaet Hossain , Zakir Hyder - Department of Electrical Engineering
and Computer Science North South University, Dhaka Bangladesh.

DEPARTMENT OF ECE, ALIET Page 65


COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

APPENDIX 1

CODE:

# _*_ coding: utf-8 _*_


#------------------------------------ Start of OCR - Code -----------------------------------------
----------#
import RPi.GPIO as gpio
import serial
import time
import picamera
import re
import string
import cv2
from PIL import Image
from pytesser import *
#import pytesser
from curses import ascii
import os
import traceback
import sys
import crop
adrport = serial.Serial(
port="/dev/ttyAMA0",
baudrate=9600,
parity=serial.PARITY_NONE,
stopbits=serial.STOPBITS_ONE,
bytesize=serial.EIGHTBITS,
timeout=None)
camera = picamera.PiCamera()
vib = 2
alc = 22
gas = 27
buz = 25
rly = 23
global vflag,gflag,aflag
vflag = False
gflag = False
aflag = False
#------------------------------------------------------
def camini():
camera.resolution = (1024,768)
camera.framerate = 30
time.sleep(2)
camera.shutter_speed = camera.exposure_speed
camera.exposure_mode = 'off'
g=camera.awb_gains
camera.awb_mode = 'off'
DEPARTMENT OF ECE, ALIET Page 66
COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

camera.awb_gains = g
time.sleep(2)
return
#-----------------------------------------------------
def capture():
camera.start_preview()
time.sleep(1)
camera.capture('source.jpg')
camera.stop_preview()
#camera.close()
def preprocess():
img = cv2.imread('source.jpg') #---Read colour image
grey = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) #--- Convert into grayscale
cv2.imwrite('grey.jpg',grey)
kernel = cv2.getStructuringElement(cv2.MORPH_ELLIPSE,(3,3)) #---Get kernal of
cross shaped with size of 3x3
dilated = cv2.dilate(grey,kernel,iterations=2) #---Apply kernel and iterations on
threshold for dilation
cv2.imwrite('dilate.jpg',dilated)
eroded = cv2.erode(dilated,kernel,iterations=2) #---Apply kernel and iterations on
threshold for erosion
cv2.imwrite('erode.jpg',eroded)
smooth = cv2.blur(eroded,(3,3))
cv2.imwrite('smooth.jpg',smooth)
#thresh =
cv2.adaptiveThreshold(grey,255,cv2.ADAPTIVE_THRESH_GAUSSIAN_C,cv2.TH
RESH_BINARY,11,4)
#thresh =
cv2.adaptiveThreshold(smooth,255,cv2.ADAPTIVE_THRESH_MEAN_C,cv2.THRE
SH_BINARY,11,4)
#(thresh,im_bw) = cv2.threshold(grey,50,255,cv2.THRESH_BINARY |
cv2.THRESH_OTSU)
ret,thresh = cv2.threshold(dilated,80,255,cv2.THRESH_BINARY)
print("return value: {}".format(ret))
cv2.imwrite('thresh.jpg',thresh)
return
#------------------------------------------------------
def ocr_do():
#image_file = 'fonts_test.png'
txt = ""
"""
inpath = 'thresh.jpg'
outpath = 'thresh.crop.jpg'
print ("waiting for cropping.....")
crop.process_image(inpath, outpath)
time.sleep(1)
"""
image_file = 'thresh.jpg'
im = Image.open(image_file)
DEPARTMENT OF ECE, ALIET Page 67
COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

#text = image_file_to_string(image_file,graceful_errors = True)


text = image_to_string(im,True)
#print "======================output====================\n"
print ('Length of text: {}'.format(len(text)))
if len(text) > 0:
#print "======================output===================="
#print text
#print "======================output===================="
#--Seperate Only Alphabets -----------------------------
#print "Extracting Alphabets [Characters in lower case only] ...\n"
#text = text.lower()
txt = re.sub('[^A-Z0-9]','',text)
txt = ' '.join(txt.split())
txt = text
print ('Length of text: {}'.format(len(txt)))
print txt
return text
#------------------------------------------------------
def scan():
global vflag,gflag,aflag
status = False
if(gpio.input(vib) == False):
print("Accident detected")
vflag = True
else:
vflag = False
if(gpio.input(alc) == True):
print("Alcohol sensor activated")
aflag = True
else:
aflag = False
if(gpio.input(gas) == True):
print("Gas leakage detected")
gflag = True
else:
gflag = False
#------------------------
if((aflag or gflag or vflag)==True):
status = True
else:
status = False
return status
#-----------------------------------------------------
def gpsread():
rdata = ''
mstr = ''
cread = ''
while(adrport.read() !='$'):
time.sleep(0.001)
DEPARTMENT OF ECE, ALIET Page 68
COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

while(cread!='\n'):
cread = adrport.read()
mstr += cread
print mstr
return mstr
#-----------------------------------------------------
def displl():
flag = False
qry = "GPGGA"
lat = ''
lon = ''
while(flag == False):
data = gpsread()
i = data.find(qry)
if(i==0):
flag = True
print("GPGGA string identified...")
n = data.find('N')
e = data.find('E')
#print(n,e)
lat = data[n-10:n+1]
lon = data[e-10:e+1]
lat = re.sub('[^A-Z.0-9]',' ',lat)
lon = re.sub('[^A-Z.0-9]',' ',lon)
print("latitude: {} longitude: {}".format(lat,lon))
return lat,lon
#------------ SMS Sending Loop ---------------------
def smstx(msg,num):
lat,lon = displl()
adrport.write('AT+CMGF=1\r\n')
time.sleep(0.5)
adrport.write('AT+CMGS="{}"\r\n'.format(num))
#print('AT+CMGS="%s"\r\n' %dnum)
time.sleep(0.5)
adrport.write("{}.Location is latitude:{}, longitude:{} -Vehicle security
system.\r\n".format(msg,lat,lon))
time.sleep(0.5)
adrport.write(ascii.ctrl('z'))
time.sleep(8)
return
#-----------------------------------------------------
def signdetect():
print ("Taking Picture...\n")
capture() #--Capture Image with Specified Settings ---------------
print ("Preprocessing image for OCR...")
time.sleep(2)
preprocess()
print ("Running OCR...\n")
time.sleep(2)
DEPARTMENT OF ECE, ALIET Page 69
COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

lmt = ocr_do() #--Run OCR Algorithm on Captured Image --------------


print("lmt value:{}".format(lmt))
lmt = re.sub('Q','0',lmt)
lmt = re.sub('S','5',lmt)
#lmt = re.sub('Q','0',lmt)
start = lmt.find('L')
end = lmt.find('K')
limit = lmt[start+1:end]
print("limit value:{}".format(limit))
limit = re.sub('[^0-9]','',limit)
limit = ''.join(limit.split())
#limit = "30"
print("Detected speed limit: {}Km/hr".format(limit))
if(len(limit)>0):
if(int(limit)<100):
gpio.output(buz,True)
gpio.output(rly,True)
return
#---------------------------------
def beep(count):
for i in range(count):
gpio.output(buz,True)
time.sleep(0.3)
gpio.output(buz,False)
time.sleep(0.3)
return
#-------------------------------------------Main Program -----------------------------------------
def main():
global vflag,gflag,aflag
gpio.setwarnings(False)
gpio.setmode(gpio.BCM)
gpio.setup(vib,gpio.IN)
gpio.setup(alc,gpio.IN)
gpio.setup(gas,gpio.IN)
gpio.setup(buz,gpio.OUT,initial=0)
gpio.setup(rly,gpio.OUT,initial=0)
#---------------------------------------
print ("Initilizing Camera...\n")
#camini() #--Camera Settings to Capture Best Possible Image --
time.sleep(5)
beep(5)
while (True):
if(scan()==True):
print("Sensors are activated....")
gpio.output(buz,True)
gpio.output(rly,True)
if(vflag == True):
smstx('Accident occurred,please take care','9030305111')
elif(gflag == True):
DEPARTMENT OF ECE, ALIET Page 70
COLLISION AVOIDANCE AND DRIVE SAFE SYSTEM

smstx('Gas leakage occurred ,please take care','9030305111')


elif(aflag == True):
smstx('Alcohol sensor activated, please take care','9030305111')
else:
#print("Sensors are not activated....")
gpio.output(buz,False)
gpio.output(rly,False)
signdetect()
time.sleep(5)
gpio.output(buz,False)
gpio.output(rly,False)
#-----------------------------------------------END ---------------------------------------------
if __name__ == '__main__':
try:
main()
except KeyboardInterrupt:
pass
finally:
gpio.cleanup() #except KeyboardInterrupt:
print "-------- Program Terminated -----------"

DEPARTMENT OF ECE, ALIET Page 71

Anda mungkin juga menyukai