Sei sulla pagina 1di 50

DIRE DAWA UNIVERSITY

DIRE DAWA INSTITUTE TECHNOLOGY


DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING
POWER ENGINEERING STREAM
FINAL THESIS PROPOSAL REPORT
PROJECT TITLE: CAR COLLISION AVOIDANCE USING

ULTRASONIC SENSOR

ADVISOR NAME: Mr. TITO. T

GROUP MEMBERS
No NAME ID. No.

1 BEDEDA FEYISA R/1755/05

2 TSEGAYE ZEWDIE R/1264/04

3 AHMEDNUR MUZEMIL R/3989/04

4 ALEMU SITOTAW R/1664/05

Submission Date: June, 10, 2017 GC


DIRE DAWA, ETHIOPIA
CAR COLLISION AVOIDANCE USING ULTRASONIC SENSORS 2009E.C

Declaration
This is to certify that the thesis entitled “Car Collision Avoidance Using Ultrasonic Sensor”
has been carried out by students listed below. No portion of the work presented in this project
has been previously concurrently submitted in support of another award or qualification either at
this institution or elsewhere.

Name ID Signature
BEDEDA FEYISA R/1755/05 ……………..

TSEGAYE ZEWDIE R/1264/04 ……………...

ALEMU SITOTAW R/1664/05 ………………

AHMEDNUR MUZEMIL R/3989/04 ………………

DDIT POWER ENGINEERING FINAL THESIS Page i


CAR COLLISION AVOIDANCE USING ULTRASONIC SENSORS 2009E.C
Approval for Submission
This thesis entitled “Car Collision Avoidance Using Ultrasonic Sensor” was prepared by the
above listed students, and approved by the following examiners in partial fulfillment of the
requirements for the degree of Bachelor of Science in Electrical and Computer Engineering, in
Dire dawa University.

Approved by,

Advisor Name Signature Date

Mr. TITO TEDESSA ……………… …………..

DDIT POWER ENGINEERING FINAL THESIS Page ii


CAR COLLISION AVOIDANCE USING ULTRASONIC SENSORS 2009E.C
Acknowledgment
First of all, we would like to thank God for his blessing, granting us with wisdom, the
opportunity of an education and for letting me to finish this project.

Secondly, we would like to thank dire dawa university institute of technology especially
electrical and computer engineering department who give us many needed support,
encouragement and help throughout our project.

Thirdly, we have great pleasure in expressing our thanks and deep sense of gratitude to our
advisor Mr. Tito Tedessa for his constructive suggestion and critically review during this project.

Finally, thank you all those involved directly or in directly helping us out during our design and
simulation which we cannot state out every one of them. Mostly, special thanks also to our
family and friends for their external support throughout our academic career.

DDIT POWER ENGINEERING FINAL THESIS Page iii


CAR COLLISION AVOIDANCE USING ULTRASONIC SENSORS 2009E.C
Abstract
The main target of this project is, cars can automatically braking due to obstacles when the
sensors sense the obstacle. This system increases the safety feature of cars during navigation to
reduce accidents and it has ability to sense object coming to hit the car during this time activate
automatic braking system to accelerate or brake the speed of the vehicle. Also it has the ability to
avoid colliding with a vehicle or an obstacle in the way.

In the proposed work the system is going to be implemented using ARDUINO Uno 328P
microcontroller along with ultrasonic sensor module and push button are used as input device,
while LCD, buzzer and braking mechanism are output of the control unit. Ultrasonic sensors are
used to detect the obstacle in addition to this; manual operation (pedal) and automatic braking
system are included as an option for the driver safety.

DDIT POWER ENGINEERING FINAL THESIS Page iv


CAR COLLISION AVOIDANCE USING ULTRASONIC SENSORS 2009E.C

Table of Contents
Declaration ..................................................................................................................................................... i
Approval for Submission .............................................................................................................................. ii
Acknowledgment ......................................................................................................................................... iii
Abstract ........................................................................................................................................................ iv
CHAPTER ONE ........................................................................................................................................... 1
INTRODUCTION ........................................................................................................................................ 1
1.1 Background ......................................................................................................................................... 1
1.2Project Objective .................................................................................................................................. 2
1.2.1General Objective ......................................................................................................................... 2
1.2.2Specific Objective ......................................................................................................................... 2
1.3 Statement of the problem and motivation ........................................................................................... 3
1.4 Scope of the project ............................................................................................................................ 3
1.5 Methodology of the study ................................................................................................................... 3
CHAPTER TWO .......................................................................................................................................... 5
LITERATURE REVIEW ............................................................................................................................. 5
2.1 The fundamental of sensor .................................................................................................................. 5
2.2 The fundamental of ultrasonic sensor ................................................................................................. 6
2.2.1 Advantage of ultrasonic range sensor .......................................................................................... 7
2.2.2 Disadvantage of ultrasonic range sensor ...................................................................................... 7
2.3 Environmental factor that affect to ultrasonic sensor performance .................................................... 7
2.4 Hardware Components we use............................................................................................................ 7
CHAPTER THREE .................................................................................................................................... 16
SYSTEM BLOCK DIAGRAM OF THE PROPOSED SYSTEM ............................................................. 16
3.1 Block diagram ................................................................................................................................... 16
3.2 Working principle of the system ....................................................................................................... 17
CHAPTER FOUR....................................................................................................................................... 18
SYSTEM DESIGN AND IMPLEMENTATION ....................................................................................... 18
4.1 Hardware Design .............................................................................................................................. 18
4.2 Flow chart description....................................................................................................................... 20
4.3 Software Design ................................................................................................................................ 20

DDIT POWER ENGINEERING FINAL THESIS Page v


CAR COLLISION AVOIDANCE USING ULTRASONIC SENSORS 2009E.C
4.4 Car collision avoidance we have design (Hardware design) ............................................................ 21
4.5 The simulation result......................................................................................................................... 22
4.6 Simulation Result and Discussion..................................................................................................... 23
4.6 Component Cost estimation .............................................................................................................. 30
CHAPTER FIVE ........................................................................................................................................ 31
CONCLUSION AND RECOMMENDATION .......................................................................................... 31
5.1 Conclusion ........................................................................................................................................ 31
5.2 Recommendation .............................................................................................................................. 32
Reference .................................................................................................................................................... 33
APPENDIX ................................................................................................................................................. 34

DDIT POWER ENGINEERING FINAL THESIS Page vi


CAR COLLISION AVOIDANCE USING ULTRASONIC SENSORS 2009E.C
List of figure
Figure 1.1 methodology developments…………………………………………………………...4

Figure 2.1 Internal Structure of Arduino Uno 328p………………………………………………9

Figure 2.2 Ultrasonic sensors HC-SR04………………………………………………………...12


Figure 2.3 LCD display……………………………………………………………………….…14
Figure 3.1 Block diagram………………………………………………………………………..16

Figure 4.1 Sensor placement………………………………………………………………………………………………………………...18

Figure 4. 2 over all flow chart for system design………………………………………………..19

Figure 4.3 car collision avoidance designs (Hardware design)………………………….21

Figure 4.4 Circuit Diagram of the overall system……………………………………………….23

Figure 4.5 First simulation results………………………………….…………………………...25

Figure 4.6 First simulation results………………………………………..……………………..26

Figure 4.7 Third simulation results……………………………………………………………...27

Figure 4.8 Fourth simulation results………………………………………………………….....28

Figure 4. 9 Simulation result of the project……………………………………………………..29

DDIT POWER ENGINEERING FINAL THESIS Page vii


CAR COLLISION AVOIDANCE USING ULTRASONIC SENSORS 2009E.C
List of Tables
Table 2.1 specification of Arduino Uno328p…………………………………………………...11
Table 2.2 Module PIN definition………………………………………………………………..12

Table 2.3 Specification of ultrasonic sensor (HC - SR04)………………………………………13


Table 2.4 Mechanical Data of LCD 16x 4 Displays…………………………………………….13

Table 2.5 Interface Pin Function of LCD……………………………………………………….14

Table 4.1 Estimated cost………………………………………………………………………...30

DDIT POWER ENGINEERING FINAL THESIS Page viii


CAR COLLISION AVOIDANCE USING ULTRASONIC SENSORS 2009E.C

Acronyms
AC alternate current
AREF analog reference
ABS automatic braking system
CM centimeter
DC direct current
EEPROM electrical erasable programmable read only memory
GND ground
IDE integrated drive electronics
I/O input/output
IR infrared

KB kilobit
LCD liquid crystal display
LED light emitting diode
mA miliampere
mm millimeter
MHz megahertz
PWM pulse width modulation
PB push button
RADAR radio detection and ranging
RS reset
R/W read/write
Rx receiver
SRAM static random access memory
TX transmitter
USB universal serial bus

DDIT POWER ENGINEERING FINAL THESIS Page ix


CAR COLLISION AVOIDANCE USING ULTRASONIC SENSORS 2009E.C

CHAPTER ONE

INTRODUCTION
Accidents are considered as non-preventable and it occurs due to technical problems within the
vehicle or due to the mistakes of the driver. Sometimes the drivers may become tired and they
lose the control over the vehicle. The accident also occurs due to drunken drivers, rash driving
etc. in all this cases the accidents occurs because the brakes are not applied at the right time.
When the driver come to know the vehicle is going to collide they become nervous and they do
not apply the brake. Majority of accident occur only in this way. But surprisingly, the number of
people which are dead during the vehicle accidents is very large as compare to the other cause of
death. So, the implementation of a car collision avoidance using ultrasonic sensor automatic
braking system used to reduce such accidents.

The system design will prevent such accident it keeps truck of any vehicles in front, back, left,
and right side. It will continuously keep truck of the distance between the vehicles. When the
obstacles come dangerously close the microcontroller in the system will activate brakes and it
will slow down the vehicle speed and also it can accelerate when the other vehicles come from
the back side at high speed.

1.1 Background
Driving is a compulsory activity for most people. People use their vehicle to move from one
place to other place .The number of vehicle is increasing day to day it is produce coming
about tightly and risk to accident .Nowadays, the number of accident is so high and
uncertainly Accident will occur at any time and everywhere and cause worst damage, serious
injury and dead. These accidents are mostly caused by delay of the driver to hit the brake.
According to a survey large numbers of deaths in Ethiopia are caused by road accidents. The
way of detecting obstacle in real time is versatile and challenging task for road vehicle and
passenger safety. The first obstacle detection system was developed by Delco System
Operations; Goleta of California in 1988.This system was basically a safety system used to
detect the obstacle on road and alerts the driver and it also capable of detecting the moving
objects on nearby lane.

DDIT POWER ENGINEERING FINAL THESIS Page 1


CAR COLLISION AVOIDANCE USING ULTRASONIC SENSORS 2009E.C
This project is designed to develop a new system that can solve this problem where drivers
cannot brake manually but the vehicle can stop automatically due to obstacles. It is about a
system that can control system for safety. Using ultrasonic as ranging sensor, its function based
on ultrasonic wave system. After once it transmits by transmitter, the wave can reflect when
obstacle detected and receive by receiver.

The main aim of this project is, cars can automatically braking due to obstacles when the sensor
senses the obstacle. The braking system function is to brake the car automatically after received
from the sensor. Our proposed collision avoidance system is operates in the following way:
ultrasonic sensors are placed in all directions of the vehicle and these sensors are continuously
scans the road ahead for obstacles or vehicles and if any obstacle or vehicle find, then warning is
given to the driver. If any car is very close than predefined threshold value then automatically the
ARDUINO Uno 328p made a decision and display the output of the sensor on the LCD display
and the buzzer alert the driver.

1.2Project Objective

1.2.1General Objective
The main objective of this project is:

 To avoid the early accidents due to carelessness driving habit of the driver and blind spot.
 To develop a safety car braking system using ultrasonic sensor.

1.2.2Specific Objective
The specific objective of this project is:-

 The cars can automatically braking due to obstacles when the sensor senses the obstacle

 To Reduces maintenance cost for the cars due to collision

 To reduce car accident used by Ultrasonic sensors.

 To introduce advanced technology to the driver

 It helps the driver to parking car safely by Ultrasonic sensors

DDIT POWER ENGINEERING FINAL THESIS Page 2


CAR COLLISION AVOIDANCE USING ULTRASONIC SENSORS 2009E.C
1.3 Statement of the problem and motivation
There are many reasons and problems which motivate us to seek for solutions and suggestions.
The majority of car accidents are happen due to carelessness of the driver and blind spot. As
result, many of the people are died and various amount of property damaged due to car accident.
This initiate us to find a solution with the proposed work, the driver can reduce economic
damage and save humans life by monitoring their surrounding object and can prevent collisions
before it happens by stop automatically when there is obstacles.

1.4 Scope of the project


 To develop an ultrasonic sensor in order to detect the obstacle.
 For processing the output from the ultrasonic sensor to drive the dc-motor as actuator in
automatically braking mechanism.
 The scope of this project is combining of electrical, mechanical and programming part.
 The electrical part consists of electronic circuit for the microcontroller, ultrasonic sensor,
liquid crystal display transistor, power supply and Buzzer.
 The software part consists of ARDUINO Uno (ATmega 328p) which is a microcontroller
that used for control the entire project.

1.5 Methodology of the study


The system consists of hardware and software. The hardware part involves Arduino Uno AT
mega 328p microcontroller, four ultrasonic sensors, liquid crystal display (LCD), power supply,
buzzer and automatic braking systems. The software part is the Arduino Board is programmed
using the Arduino IDE software used to interface hardware. The Arduino Based car collision
avoidance system for social modernization of car driving system will be made according to the
following steps:
 Complete layout of the whole setup will be drawn inform of a block diagram.
 The ultrasonic sensor will first sense the obstacle and give its output to the Arduino
microcontroller & the ARDUINO UNO 328P displays respective distance output of the
ultrasonic sensor on the LCD.

DDIT POWER ENGINEERING FINAL THESIS Page 3


CAR COLLISION AVOIDANCE USING ULTRASONIC SENSORS 2009E.C

Start

Project Title Selection


Determination of hardware or
Software for the system Software development

Programming in Arduino
Hardware
using arduino

No
Yes
Ok

No
Integration hardware and Software
No

Ok
Yes

Analysis

Yes

End

Figure 1.1 methodology developments

DDIT POWER ENGINEERING FINAL THESIS Page 4


CAR COLLISION AVOIDANCE USING ULTRASONIC SENSORS 2009E.C

CHAPTER TWO

LITERATURE REVIEW
This chapter reviews some of the work related study of the car collision avoidance using
ultrasonic sensor based controls. Previous works of obstacle detection involves the use of
infrared sensors which were widely used as proximity sensor for obstacle avoidance system. As
IR sensor resembles nonlinear behavior and the basic concept depends on the reflection from
surrounding object, it produces error in the measured distance. So these sensors were not reliable
for precise measurements. Thus these sensors are suitable only to detect short distance
measurement up to 25 cm.

The image/vision technologies are also introduced for pedestrian safety and detection. It is the
most challenging and risky task as fast processing is needed to alert the driver as soon as
possible. Pedestrian has to be detected in every frame in which it appears. But the system using
image/vision technologies have some drawbacks. The system fails in some unfriendly whether
situations like fog, harsh and extreme rainy environment. The system sometimes produces error
to identify between shadows and pedestrian. This kind of technologies requires high resolution
cameras and implementation of such system is a difficult task that may produces error due to
damping and vibrations of the vehicles.

Recently ultrasonic sensors and radar sensors are used for obstacle detection and speed
determination techniques in vehicles .The advanced driver assistance system uses RADAR
because of its long detectable range and higher reliability. The LiDAR sensors are to use to scan
road boundaries and detects obstacle and generate a safe vehicle path. The downward looking
LiDAR sensors are used to sense the obstacle and detect the road side boundaries. But
implementation of such system is as difficult as it consumes more power and has higher cost, so
ultrasonic sensors are better approach for obstacle detection.

2.1 The fundamental of sensor


Sensor is an electrical device or component that maps an environmental attribute to a quantitative
measurement. It is used to collect information about the world. Each sensor works based on a
transduction principle which is conversion of energy from one form to another form.

DDIT POWER ENGINEERING FINAL THESIS Page 5


CAR COLLISION AVOIDANCE USING ULTRASONIC SENSORS 2009E.C
The common used ultrasonic sensors are listed below but for our case we prefer to use range
sensor to detect whether obstacle is happening there or not.

Tactile sensors:

 It detects distances through physical contact.


 They are usually set to detect obstacles at a fixed distance from the vehicle.
 Placed at front and extend long enough to ensure safe stopping distance.
 They simple- provide binary signal (“Yes” or “No” obstacle)
 Also should extend entire body width so as to detect successfully any obstacle
Proximity sensors:
 Are sensors that detect obstacles within a specific range from the vehicle
 Provide binary signal according to some threshold distance: obstacle.
 They operates using various medium such as light (infrared (IR)), Sound
(ultrasonic), Capacitance (electro statics filed) and Inductance (magnetic field).
Ultrasonic sensors:
 Emit a sound wave signal and measure the time it takes for that signal to be
returned emits and receives ultrasonic signal.
 Incoming echo is checked the time taken for sound to travel the distance is
detected and corresponding output signals is emitted.
 Blind zone exists: echo arrives before transducer is ready to receive as and objects
in this dead band cannot be detected reliably.

2.2 The fundamental of ultrasonic sensor


An ultrasonic sensor utilizes a transducer that produces an electrical output in response to
Received Ultrasonic energy. Any frequency above 20 kHz may be considered ultrasonic.
Ultrasound
 Is a sound wave with a frequency higher than the human audible limit, i.e. about 20 kHz
 It has a variety of applications: it is used to detect objects and measure distances.
 Ultrasonic imaging is used in both human and veterinary medicine.
 It is used to accelerate certain processes and also cleaning and mixing.

DDIT POWER ENGINEERING FINAL THESIS Page 6


CAR COLLISION AVOIDANCE USING ULTRASONIC SENSORS 2009E.C
Ultrasonic: is the application of ultrasound for various purposes. The various applications are:
 Long range sensor:
 Motion sensors:
 Long distance testing:
 Location detector:
 Imaging
 Acoustic microscopy
 Human medicine:

2.2.1 Advantage of ultrasonic range sensor


 Discrete distances to moving objects can be detected and measured
 Reliable with good precision
 Less affected by target materials and surfaces.
 Good maximum range
 In expensive

2.2.2 Disadvantage of ultrasonic range sensor


 Inference between the projected waves and the reflected waves takes place.
 Sensitive to smoothness and angle to obstacles.
 Poor resolution.
 Cannot detect obstacle too close.

2.3 Environmental factor that affect to ultrasonic sensor performance


 Temperature
 Atmospheric pressure
 Humidity
 Radio frequency interferences

2.4 Hardware Components we use


This project uses Arduino 328 microcontroller to controls the output of the all sensors. Follow
the schematic to connect the Arduino to the ultrasonic sensor, and Arduino to the LCD and
buzzer. The ultrasonic can measure up to 4m. The Arduino Board is programmed using the
Arduino IDE software. The ultrasonic sensor measures the distance of the obstacle in the road
and sends the signal to the Arduino if the obstacle distance is reach required threshold value then
DDIT POWER ENGINEERING FINAL THESIS Page 7
CAR COLLISION AVOIDANCE USING ULTRASONIC SENSORS 2009E.C
Arduino supply to the LCD and LCD display the output distance on the board and also the
Buzzer blow when the distance come be below the threshold value.
The components are as follows:-
 ARDUINO Uno ATmega328p
 Ultrasonic sensor (module HC-SR04)
 Crystal liquid display (LCD) (16x4)
 Buzzer
 power supply
The Arduino Uno AT mega 328p
Arduino is an open-source physical computing platform based on a simple microcontroller
board, and a development environment for writing software for the board. Arduino can be used
to develop interactive objects, taking inputs from a variety of switches and controlling a variety
of lights, motors, and other physical outputs. The Arduino programming language is an
implementation of Wiring, a similar physical computing platform, which is based on the
Processing multimedia programming environment.
This project uses The Arduino Uno ATMega 328p to controls the motor. Follow the schematic to
connect the Arduino to the ultrasonic sensor, and the ultrasonic sensor measure the relative
distance from the obstacle. The Arduino Board is programmed using the Arduino IDE software.
Performance
 Digital I/O 0-14.
 Analog I/O 0-6
 Input voltage: when connected to the USB without external power supply or external 5 v
output and external power input.

The Arduino Uno Mega328p can be powered via the USB connection or with an external power
supply. The power source is selected automatically. External (non-USB) power can come either
from an AC-to-DC adapter (wall-wart) or battery. The adapter can be connected by plugging a
2.1mm center-positive plug into the board's power jack. Leads from a battery can be inserted in
the Gnd and VIN pin headers of the power connector.

DDIT POWER ENGINEERING FINAL THESIS Page 8


CAR COLLISION AVOIDANCE USING ULTRASONIC SENSORS 2009E.C
The board can operate on an external supply of 6 to 20 volts. If supplied with less than 7V,
however, the 5V pin may supply less than five volts and the board may be unstable. If using
more than 12V, the voltage regulator may overheat and damage the board. The recommended
range is 7 to 12 volts.

The Arduino2560has several different kinds of pins each of which is labeled on the board and
use for different functions.

Figure 2.1 Internal Structure of Arduino Uno 328p

The power pins are as follows:-


 VIN: The input voltage to the Arduino board when it's using an external power source (as
opposed to 5 volts from the USB connection or other regulated power source). You can
supply voltage through this pin, or, if supplying voltage via the power jack, access it
through this pin.

DDIT POWER ENGINEERING FINAL THESIS Page 9


CAR COLLISION AVOIDANCE USING ULTRASONIC SENSORS 2009E.C
 Regulated power supply (5V): used to power the microcontroller and other components
on the board. This can come either from VIN via an on-board regulator, or be supplied by
USB or another regulated 5V supply.
 Volt supply (3.3v): generated by the on-board regulator. Maximum current draw is 50
mA.
 GND: Ground pins.
Memory
The ATmega328p has 32 KB of flash memory for storing code (of which0.5 KB is used for the
boot loader), 2 KB of SRAM and 1 KB of EEPROM (which can be read and written with the
EEPROM library).
Input/output
Each of the 14 digital pins on the Mega can be used as an input or output, using pin Mode (),
digital Write (), and digital Read () functions. They operate at 5 volts. Each pin can provide or
receive a maximum of 40 mA and has an internal pull-up resistor (disconnected by default) of
20-50 kΩ.
In addition, some pins have specialized functions:
 Serial: 0 (RX) and 1 (TX); Used to receive (RX) and transmit (TX) TTL serial data. TT
these pins are connected to the corresponding pins of the ATmega8U2 USB-to-TTL
Serial chip.
 External Interrupts: 2 and 3. These pins can be configured to trigger an interrupt on a
low value, a rising or falling edge, or a change in value. See the attach Interrupt ()
function for details.
 PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the analog Write ()
function.
 SPI: SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI
communication, which, although provided by the underlying hardware, is not currently
included in the Arduino language.
 LED: 13.There is a built-in LED connected to digital pin 13. When the pin is HIGH
value, the LED is on, when the pin is LOW, it's off.
 I2C: 4 (SDA) and 5 (SCL). Support I2C (TWI) communication using the Wire library.

DDIT POWER ENGINEERING FINAL THESIS Page 10


CAR COLLISION AVOIDANCE USING ULTRASONIC SENSORS 2009E.C
The Uno has 6 analog inputs, each of which provides 10 bits of resolution (i.e. 1024 different
values). By default they measure from ground to 5 volts, though is it possible to change the
upper end of their range using the AREF pin and the analog Reference () function.
There are a couple of other pins on the board:
 AREF. Reference voltage for the analog inputs. Used with analog Reference ().
 Reset. Bring this line LOW to reset the microcontroller. Typically it used to add a reset
button to shields which block the one on the board.
Table 2.1 specification of Arduino Uno328p
Feature Specification

Microcontroller ATmega328p ATmega328p


Operating voltage 5V
Input voltage(recommended) 7- 12V
Input Voltage (limits) 6- 20

Digital I/O pins 14 (of which 6 provide PWM output)


Analog Input pins 6 port
DC current per I/O pin 40Ma
DC current for 3.3v pin 50mA
Flash Memory 32 KB of which 0.5 KB used by boot loader
Clock Speed 16MHz
SRAM 2 KB
EEPROM 1KB

Ultrasonic sensor (Module HC - SR04)


The human ear can hear sound frequency of around 20Hz-20 KHz, and ultrasonic is the sound
wave beyond the human ability of 20 kHz it is 40 KHz. Ultrasonic ranging module HC - SR04
provides 2cm - 400cm non-contact measurement function, the ranging accuracy can reach to
3mm. The modules includes ultrasonic transmitters, receiver and control circuit.
The basic principle of work:

DDIT POWER ENGINEERING FINAL THESIS Page 11


CAR COLLISION AVOIDANCE USING ULTRASONIC SENSORS 2009E.C
 Using IO trigger for at least 10μs high level signal
 The Module automatically sends eight 40 kHz and detect whether there is a pulse signal
back.
Module operating Principle
Set low the Trig and Echo port when the module initializes , firstly, transmit at least 10μs high
level pulse to the Trig pin (module automatically sends eight 40K square wave), and then wait to
capture the rising edge output by echo port, at the same time, open the timer to start timing. Next,
once again capture the falling edge output by echo port, at the same time, read the time of the
counter, which is the ultrasonic running time in the air. According to the formula:
Test distance = (high level time * ultrasonic spreading velocity in air) / 2, you can calculate the
distance to the obstacle.

Figure 2.2 Ultrasonic sensors HC-SR04


Table 2.2 Module PIN definition
Types Pin Symbol Pin Function Description

VCC 5V power supply

HC-SR04
Trig Trigger pin

Echo Receive pin

GND Power ground

DDIT POWER ENGINEERING FINAL THESIS Page 12


CAR COLLISION AVOIDANCE USING ULTRASONIC SENSORS 2009E.C
Table 2.3 Specification of ultrasonic sensor (HC - SR04)
Electrical Parameters HC-SR04 Ultrasonic Module
Operating Voltage DC-5V
Operating Current 15mA
Operating Frequency 40KHZ
Farthest Range 4m
Nearest Range 2cm
Measuring Angle 15 Degree
Input Trigger Signal 10us TTL pulse

Output Echo Signal Output TTL level signal, proportional with


range
Dimensions 45*20*15mm

Product Feature

 Stable performance
 Accurate distance measurement
 High-density
 Small blind
Liquid crystal displays (LCD)
The voltage needed is preferable 2-20 V A.C. The voltage threshold for watch type LCD display
is 1to 2V. It is a 16 pin device with 16*4 displays. LCD used to display the output distance of the
ultrasonic sensor.

Table 2.4 Mechanical Data of LCD 16x 4 Displays

ITEM STANDARD VALUE


Module Dimension 70.6 x 60.0 mm
Viewing Area 60.0 x 32.6 mm
Dot Size 0.55 x 0.55 mm
Dot Pitch 0.60 x 0.60 mm
Mounting Hole 65.6 x 50.0 mm
Character Size 2.95 x 4.75 mm

DDIT POWER ENGINEERING FINAL THESIS Page 13


CAR COLLISION AVOIDANCE USING ULTRASONIC SENSORS 2009E.C

Figure 2.3 LCD display

Product Features

 Type: Character
 Display format: 16 x 4 characters
 Built-in controller: ST 7066 (or equivalent)
 Duty cycle: 1/16
 5 x 8 dots includes cursor
 5 V power supply (also available for + 3 V)
 B/L to be driven by pin 1, pin 2, pin 15, pin 16 or A and K

Table 2.5 Interface Pin Function of LCD

PIN NO. SYMBOL FUNCTION

1 VSS Ground

2 VDD + 3 V or + 5 V

3 V0 Contrast adjustment

4 RS H/L register select signal

5 R/W H/L read/write signal

6 E H/ L enable signal

DDIT POWER ENGINEERING FINAL THESIS Page 14


CAR COLLISION AVOIDANCE USING ULTRASONIC SENSORS 2009E.C
7 DB0 H/L data bus line

8 DB1 H/L data bus line

9 DB2 H/L data bus line

10 DB3 H/L data bus line

11 DB4 H/L data bus line

12 DB5 H/L data bus line

13 DB6 H/L data bus line

14 DB7 H/L data bus line

15 A/VEE + 4.2 V for LED (RA = 0 )/negative voltage output

16 K Power supply for B/L (0 V)

Power Supply

Almost all electronics circuit required DC power supply. DC power supply is the circuit which
we get from the car battery must be converted to 5V direct voltage of constant amplitude. An
ideal regulated power supply is designed to provide a pre-determined Dc voltage which is
independent of the current drown from the source.

Buzzer

The buzzer we use in this project is an electromechanical component we can use to make noise.
Inside the buzzer is a coil of wire and a small magnet .when current flows through the coil, it
becomes magnetized and pulls toward the magnet, creating a tiny “click’. The buzzer has two
pins: one is positive and the other is negative, the positive pin connects to the digital pin of
Arduino and the negative pin connects with the ground.

DDIT POWER ENGINEERING FINAL THESIS Page 15


CAR COLLISION AVOIDANCE USING ULTRASONIC SENSORS 2009E.C

CHAPTER THREE

SYSTEM BLOCK DIAGRAM OF THE PROPOSED SYSTEM


In this chapter, we will discuss about the interconnection of Arduino micro controller along with
four ultrasonic sensors, push button as input device and buzzer, LCD display and braking
mechanism as output devices.

3.1 Block diagram


The entire system can be represented as follows:-

Power supply

Front sensor LCD Display

Buzzer
Left sensor
ARDIUNO UNO 328P
Back sensor
Right sensor

Automatic
braking and
Push button accelerating
system

Figure 3.1 Block diagram

DDIT POWER ENGINEERING FINAL THESIS Page 16


CAR COLLISION AVOIDANCE USING ULTRASONIC SENSORS 2009E.C
3.2 Working principle of the system
This system will allow the driver to make decision about the braking or accelerating mechanism
of the car to be manual or automatic depending on conditions and as a wish of the driver using a
pushbutton and feedback system. If the pushbutton is not pressed the system will not function
which means, the driver will take the responsibility to control the car. This can be basically
needed for some condition, for example, when the driver wants to park the car. This system must
not affect the control mechanism because there could be objects including cars that are found in
lesser range than the specified range by the system that can activate the braking or accelerating
mechanism which is less than two meter.

When the driver allows the system to take control of the car braking or accelerating system when
he/she is unaware of the existence of obstacle by pressing the pushbutton, a DC power from the
car battery will be supplied to the Arduino 328p, ultrasonic sensor, liquid crystal display(LCD),
buzzer, electric dc motor and controlling relays. The Arduino will control and make decision
based on the ultrasonic sensors measurements and display on the LCD. It also controls the
outputs of the motor which is used as the actuator mechanism and the buzzer to give sound
signals for the driver when some conditions are fulfilled by the ultrasonic obstacle detection
measurement.

The Arduino micro controller will be connected as the following schematic with the pushbutton,
ultrasonic sensor, buzzer and motor. The push button and the ultrasonic sensor with the feedback
system will be the input of the Arduino, if the push button not pressed the Arduino will send a
message to be displayed on the LCD that shows the system is allowing a manual operation.
Which is taken over by the driver but if the push button is pressed the system takes control of the
braking and accelerating the system from the driver, of course there are some conditions he/she
will gives the control burden of the car. Even though, the push button is pressed, in this condition
the buzzer will alert the driver to take back to the control from the automatic system, and if this
condition is not satisfied or fulfilled again the automatic system take over the control and this is
done using a feedback system.

DDIT POWER ENGINEERING FINAL THESIS Page 17


CAR COLLISION AVOIDANCE USING ULTRASONIC SENSORS 2009E.C

CHAPTER FOUR

SYSTEM DESIGN AND IMPLEMENTATION


The wheel system is implemented using Arduino micro controller and proteous 8 professional to
simulate our design. Four ultrasonic sensors are necessary for this system. The front sensor use
to detect the obstacle in forward, the left and right side used to cover blind spot and the back
sensor used to detect the obstacle from backward. The entire sensors are connected through the
control unit. LCD display is used to show the distance between the car and obstacles, a buzzer is
used to alert the driver and the motor will activate braking or accelerating mechanism. The four
Ultrasonic sensors are placed as follow;

Right side

Front Back
side side

Left side

Figure 4.1 Sensor placement

4.1 Hardware Design


In these sections, the system component will be designed to operate the car collision avoidance
system properly and the overall idea of the project clarifies by flow chart as follow:

DDIT POWER ENGINEERING FINAL THESIS Page 18


CAR COLLISION AVOIDANCE USING ULTRASONIC SENSORS 2009E.C

Flow chart Start

Initialize, LCD, Buzzer, Push button, Ultrasonic sensors

Pressed PB

Read distance from


Ultrasonic sensors Display manual
operation on LCD

No If front and Yes


back D<2

Display manual operation, front and


back distance LCD, Buzzer is on
Display Front, back, left
and right D on LCD

If back
If front
D<2
D <2

Accelerating mechanism is on Braking mechanism is on

End

Figure 4. 2 over all flow chart for system design

DDIT POWER ENGINEERING FINAL THESIS Page 19


CAR COLLISION AVOIDANCE USING ULTRASONIC SENSORS 2009E.C

4.2 Flow chart description


When the system starts operating first it will initialize the LCD, buzzer, push button and
ultrasonic sensor. After initializing the system will wait for the decision that has to be made by
the driver and done through the push button. The push button allows the driver to choose
whether manual control by himself/herself. He/she has also the right to use automatic control by
the micro controller interfaced with the ultrasonic sensors and other input and output devices. If
push button is not pressed the driver will take over the control which means the car is in manual
operation, so a message will be displayed on the LCD to indicate this condition. If the push
button is pressed the system that we design will take care of the braking and accelerating
mechanism depending on some conditions. In this state the ultrasonic sensor will start reading
the distance of an obstacle with respect to the car and this measurement will be displayed on the
LCD.

If the front and back ultrasonic sensor measurement is less than the specified meter which is 2m
then the measurement will be displayed on the LCD and also the buzzer will alert the driver to
aware him or her .if he/she is in this condition, he/she has the right to make a decision either to
brake or accelerate the car. But if the measurement one or both of the front and back ultrasonic
sensors is greater than 2m, the system will go to check other conditions. The first condition is to
check whether the back ultrasonic measurement is less than or equal to 2m. If this is true then an
accelerating system will be activated and help the driver by avoiding collision from the back side
of the car, else the accelerating or braking system still will be in the hand of the driver. The
second condition will check whether the front ultrasonic measurement is less than or equal to
2m. If this condition is satisfied then the braking mechanism will be activated. But, if the above
two conditions are not satisfied the program will end up and starts from the beginning to check
all conditions again.

4.3 Software Design


In the software design part we choose two software’s for the simulation. These are:

 Arduino
 Proteus-8 software to build and run our circuit

DDIT POWER ENGINEERING FINAL THESIS Page 20


CAR COLLISION AVOIDANCE USING ULTRASONIC SENSORS 2009E.C
4.4 Car collision avoidance we have design (Hardware design)

Figure 4.3 car collision avoidance design (Hardware design)

DDIT POWER ENGINEERING FINAL THESIS Page 21


CAR COLLISION AVOIDANCE USING ULTRASONIC SENSORS 2009E.C
4.5 The simulation result
In the circuit Diagram we use a potentiometer (POT) or variable resistance to measures the
distance between the car and the obstacle. When the distance between the car and obstacle large
the conductivity is high and resistivity is low. Depending on this way the ultrasonic sensor
measures Relative distance from the obstacle. The output of POT connects to the test Pin of
ultrasonic sensor. If the relative distance is the desired range, POT sends the signals to the
ultrasonic sensor receiver. The ultrasonic receives signal and sends to the Arduino 328p
microcontroller through trigger pin and echo pin. Arduino receives that signal and calculate the
relative distance then display it on the liquid crystal display (LCD). The motor will be used to
accelerate the car if the back sensor reading is less than two meter and brake the car if the front
sensor reading is less than two meter. The other condition is that the system will be changed into
manual operation when both the back and front ultrasonic sensor readings are less than two
meter. In this case the driver can decide what to do, either to change the position of the car to left
side or right side of the road with the help of the measurement taken by the right and left side
sensors which has been displayed on the LCD.

DDIT POWER ENGINEERING FINAL THESIS Page 22


CAR COLLISION AVOIDANCE USING ULTRASONIC SENSORS 2009E.C
LCD2
LM041L

RV1 SONAR3 0
ULTRASONIC SENSOR
RV4
TestPin www.TheEngineeringProjects.com
SONAR4
100%

ULTRASONIC SENSOR

100%
TestPin www.TheEngineeringProjects.com

VDD
VSS

VEE

RW
10k

RS

D0
D1
D2
D3
D4
D5
D6
D7
E
Trigger

10k
Echo

1
2
3

4
5
6

7
8
9
10
11
12
13
14
1
Gnd
+5V

Trigger
Echo
Gnd
+5V
2
RL4(C1)
R1
R2
0.1k

RL4
G2R-2S-DC12 RL3(C1)
0.1k
ARD1 D2
1N4007
3
RL3
G2R-2S-DC12
RL1(C1) D3
R6 Q4 1N4007
TIP122
AREF 0.1k

RL1 PB5/SCK
13 +88.8
12V PB4/MISO
12
4
Q3
RESET 11 TIP122
~PB3/MOSI/OC2A
10
~ PB2/SS/OC1B
9 RL2(C1) BUZ1(1)
~ PB1/OC1A
8
PB0/ICP1/CLKO
ATMEGA328P-PU
1121

DIGITAL (~PWM)
ANALOG IN

7
PD7/AIN1
Q1 A0 ~ PD6/AIN0
6 RL2 BUZ1 R5
PC0/ADC0 5 12V 0.1k
A1 ~ PD5/T1
PC1/ADC1 4
A2 PD4/T0/XCK
PC2/ADC2 3
R3 A3
PC3/ADC3
~ PD3/INT1
2
5
A4 PD2/INT0 BUZZER
D1 0.1k A5
PC4/ADC4/SDA
TX PD1/TXD
1
1N4007 PC5/ADC5/SCL 0
RX PD0/RXD
TIP122
ARDUINO UNO R3 R4 Q2
TIP122
0.1k
6

RV2 SONAR2
ULTRASONIC SENSOR
RV3
SONAR1 7
TestPin www.TheEngineeringProjects.com
50%

ULTRASONIC SENSOR
0%

TestPin www.TheEngineeringProjects.com
10k

Trigger
10k

Echo
Gnd
+5V
Trigger

8
Echo
Gnd
+5V

FILE NAME: carcollision1.pdsprj DATE:

6/7/2017
DESIGN TITLE: carcollision1.pdsprj 9
PAGE:
PATH: C:\Users\Ahmednur\Desktop\02062017\carcollision1.pdsprj
1 of 1
BY: @AUTHOR REV:@REV TIME: 2:39:17 PM

Figure 4.4 Circuit Diagram of the overall system

4.6 Simulation Result and Discussion


When the push button is pressed the signal in the input port 11 will be low and depending on
program the system will enter into operation of the measurement or obstacle detection and
depending on the measurement the braking or accelerating mechanism will be activated. This
does not mean that the driver cannot do anything, the system will work cooperate with the driver.
The driver can decide to brake or accelerate while the system is functioning, the system will help
the driver while he/she is unaware of the situations. The four conditions that enable the system to
make decision are:

DDIT POWER ENGINEERING FINAL THESIS Page 23


CAR COLLISION AVOIDANCE USING ULTRASONIC SENSORS 2009E.C

 When the front and back ultrasonic sensors measure obstacles or objects that are found in
a distance less than or equal to 2m.

 When only the front ultrasonic sensors measure an obstacle or object that is found in a
distance less than or equal to 2m.

 When only the back ultrasonic sensor measure an obstacle or object that is found in a
distance less than or equal to 2m.

 .When both the front and back sensors measure an obstacle distance that is greater than
2m with respect to the car.
When the first conditions satisfied the output port 8 of the microcontroller will be high, this will
activate the relay using relay activating mechanism. To drive the relay using the current that is
delivered from the microcontroller is impossible since the current less than 40mA. So, we need
an external source to energize the relay, but the current that is driven from the microcontroller
can activate the transistor which acts as a switch in this case. When current pass through the base
of the transistor, the transistor will allow large amount of current that is derived from external to
pass through the collector and emitter then this current will pass through the coil of the relay to
activate it. When the relay is activated it will make input port 12 to be low, when the
microcontroller reads a low signal from port 12. Based on the program the microcontroller will
deactivate the braking and accelerating mechanism, so in this situation the driver will have a full
responsibility care of the control and in addition to this the buzzer will make a sound to alert the
driver to make him/her aware of the situation. The buzzer will be driven by the same relay
mechanism as mentioned in the above.

DDIT POWER ENGINEERING FINAL THESIS Page 24


CAR COLLISION AVOIDANCE USING ULTRASONIC SENSORS 2009E.C
LCD2
LM041L

RV1 SONAR3 0
ULTRASONIC SENSOR
RV4
TestPin www.TheEngineeringProjects.com
SONAR4
20%

ULTRASONIC SENSOR

19%
TestPin www.TheEngineeringProjects.com

VDD
VSS

VEE

RW
10k

RS

D0
D1
D2
D3
D4
D5
D6
D7
E
Trigger

10k
Echo

1
2
3

4
5
6

7
8
9
10
11
12
13
14
1
Gnd
+5V

Trigger
Echo
Gnd
+5V
2
RL4(C1)
R1
R2
0.1k

RL4
G2R-2S-DC12 RL3(C1)
0.1k
ARD1 D2
1N4007
3
RL3
G2R-2S-DC12
RL1(C1) D3
R6 Q4 1N4007
TIP122
AREF 0.1k

RL1 PB5/SCK
13 0.00
12V PB4/MISO
12
4
Q3
RESET 11 TIP122
~PB3/MOSI/OC2A
10
~ PB2/SS/OC1B
9 RL2(C1) BUZ1(1)
~ PB1/OC1A
8
PB0/ICP1/CLKO
ATMEGA328P-PU
1121

DIGITAL (~PWM)
ANALOG IN

7
PD7/AIN1
Q1 A0 ~ PD6/AIN0
6 RL2 BUZ1 R5
PC0/ADC0 5 12V 0.1k
A1 ~ PD5/T1
PC1/ADC1 4
A2 PD4/T0/XCK
PC2/ADC2 3
R3 A3
PC3/ADC3
~ PD3/INT1
2
5
A4 PD2/INT0 BUZZER
D1 0.1k A5
PC4/ADC4/SDA
TX PD1/TXD
1
1N4007 PC5/ADC5/SCL 0
RX PD0/RXD
TIP122
ARDUINO UNO R3 R4 Q2
TIP122
0.1k
6

RV2 SONAR2
ULTRASONIC SENSOR
RV3
SONAR1 7
TestPin www.TheEngineeringProjects.com

24%
ULTRASONIC SENSOR
24%

TestPin www.TheEngineeringProjects.com
10k

Trigger
10k

Echo
Gnd
+5V
Trigger

8
Echo
Gnd
+5V

FILE NAME: carcollision1.pdsprj DATE:

6/7/2017
DESIGN TITLE: carcollision1.pdsprj 9
PAGE:
PATH: C:\Users\Ahmednur\Desktop\02062017\carcollision1.pdsprj
1 of 1
BY: @AUTHOR REV:@REV TIME: 2:39:17 PM

Figure 4.5 First simulation results

When the second situation is fulfilled the braking will be activated by the motor. The
microcontroller output pin 9 will be high this will activate the relay by the same mechanism as
we discussed before since, the microcontroller cannot directly drive the motor will rotate
anticlockwise while doing this it will activate the braking mechanism.

DDIT POWER ENGINEERING FINAL THESIS Page 25


CAR COLLISION AVOIDANCE USING ULTRASONIC SENSORS 2009E.C
LCD2
LM041L

RV1 SONAR3 0
ULTRASONIC SENSOR
RV4
TestPin www.TheEngineeringProjects.com
SONAR4
20%

ULTRASONIC SENSOR

21%
TestPin www.TheEngineeringProjects.com

VDD
VSS

VEE

RW
10k

RS

D0
D1
D2
D3
D4
D5
D6
D7
E
Trigger

10k
Echo

1
2
3

4
5
6

7
8
9
10
11
12
13
14
1
Gnd
+5V

Trigger
Echo
Gnd
+5V
2
RL4(C1)
R1
R2
0.1k

RL4
G2R-2S-DC12 RL3(C1)
0.1k
ARD1 D2
1N4007
3
RL3
G2R-2S-DC12
RL1(C1) D3
R6 Q4 1N4007
TIP122
AREF 0.1k

RL1 PB5/SCK
13 0.00
12V PB4/MISO
12
4
Q3
RESET 11 TIP122
~PB3/MOSI/OC2A
10
~ PB2/SS/OC1B
9 RL2(C1) BUZ1(1)
~ PB1/OC1A
8
PB0/ICP1/CLKO
ATMEGA328P-PU
1121

DIGITAL (~PWM)
ANALOG IN

7
PD7/AIN1
Q1 A0 ~ PD6/AIN0
6 RL2 BUZ1 R5
PC0/ADC0 5 12V 0.1k
A1 ~ PD5/T1
PC1/ADC1 4
A2 PD4/T0/XCK
PC2/ADC2 3
R3 A3
PC3/ADC3
~ PD3/INT1
2
5
A4 PD2/INT0 BUZZER
D1 0.1k A5
PC4/ADC4/SDA
TX PD1/TXD
1
1N4007 PC5/ADC5/SCL 0
RX PD0/RXD
TIP122
ARDUINO UNO R3 R4 Q2
TIP122
0.1k
6

RV2 SONAR2
ULTRASONIC SENSOR
RV3
SONAR1 7
TestPin www.TheEngineeringProjects.com
24%

ULTRASONIC SENSOR
24%

TestPin www.TheEngineeringProjects.com
10k
Trigger

10k
Echo
Gnd
+5V
Trigger

8
Echo
Gnd
+5V

FILE NAME: carcollision1.pdsprj DATE:

6/7/2017
DESIGN TITLE: carcollision1.pdsprj 9
PAGE:
PATH: C:\Users\Ahmednur\Desktop\02062017\carcollision1.pdsprj
1 of 1
BY: @AUTHOR REV:@REV TIME: 2:39:17 PM

Figure 4.6 First simulation results

When the third condition is satisfied the accelerating system will be activate by the motor; the
motor wheel rotate clockwise will activate the accelerating system.

DDIT POWER ENGINEERING FINAL THESIS Page 26


CAR COLLISION AVOIDANCE USING ULTRASONIC SENSORS 2009E.C
LCD2
LM041L

RV1 SONAR3 0
ULTRASONIC SENSOR
RV4
TestPin www.TheEngineeringProjects.com
SONAR4
23%

ULTRASONIC SENSOR

22%
TestPin www.TheEngineeringProjects.com

VDD
VSS

VEE

RW
10k

RS

D0
D1
D2
D3
D4
D5
D6
D7
E
Trigger

10k
Echo

1
2
3

4
5
6

7
8
9
10
11
12
13
14
1
Gnd
+5V

Trigger
Echo
Gnd
+5V
2
RL4(C1)
R1
R2
0.1k

RL4
G2R-2S-DC12 RL3(C1)
0.1k
ARD1 D2
1N4007
3
RL3
G2R-2S-DC12
RL1(C1) D3
R6 Q4 1N4007
TIP122
AREF 0.1k

RL1 PB5/SCK
13 0.00
12V PB4/MISO
12
4
Q3
RESET 11 TIP122
~PB3/MOSI/OC2A
10
~ PB2/SS/OC1B
9 RL2(C1) BUZ1(1)
~ PB1/OC1A
8
PB0/ICP1/CLKO
ATMEGA328P-PU
1121

DIGITAL (~PWM)
ANALOG IN

7
PD7/AIN1
Q1 A0 ~ PD6/AIN0
6 RL2 BUZ1 R5
PC0/ADC0 5 12V 0.1k
A1 ~ PD5/T1
PC1/ADC1 4
A2 PD4/T0/XCK
PC2/ADC2 3
R3 A3
PC3/ADC3
~ PD3/INT1
2
5
A4 PD2/INT0 BUZZER
D1 0.1k A5
PC4/ADC4/SDA
TX PD1/TXD
1
1N4007 PC5/ADC5/SCL 0
RX PD0/RXD
TIP122
ARDUINO UNO R3 R4 Q2
TIP122
0.1k
6

RV2 SONAR2
ULTRASONIC SENSOR
RV3
SONAR1 7
TestPin www.TheEngineeringProjects.com
20%

ULTRASONIC SENSOR
24%

TestPin www.TheEngineeringProjects.com
10k
Trigger

10k
Echo
Gnd
+5V
Trigger

8
Echo
Gnd
+5V

FILE NAME: carcollision1.pdsprj DATE:

6/7/2017
DESIGN TITLE: carcollision1.pdsprj 9
PAGE:
PATH: C:\Users\Ahmednur\Desktop\02062017\carcollision1.pdsprj
1 of 1
BY: @AUTHOR REV:@REV TIME: 2:39:17 PM

Figure 4.7 Third simulation results

When the fourth condition is satisfied nothing will happen to the actuating motor. So, no braking
or accelerating system is activated. At this time the driver has a full responsibility to control the
car.

DDIT POWER ENGINEERING FINAL THESIS Page 27


CAR COLLISION AVOIDANCE USING ULTRASONIC SENSORS 2009E.C
LCD2
LM041L

RV1 SONAR3 0
ULTRASONIC SENSOR
RV4
TestPin www.TheEngineeringProjects.com
SONAR4
23%

ULTRASONIC SENSOR

22%
TestPin www.TheEngineeringProjects.com

VDD
VSS

VEE

RW
10k

RS

D0
D1
D2
D3
D4
D5
D6
D7
E
Trigger

10k
Echo

1
2
3

4
5
6

7
8
9
10
11
12
13
14
1
Gnd
+5V

Trigger
Echo
Gnd
+5V
2
RL4(C1)
R1
R2
0.1k

RL4
G2R-2S-DC12 RL3(C1)
0.1k
ARD1 D2
1N4007
3
RL3
G2R-2S-DC12
RL1(C1) D3
R6 Q4 1N4007
TIP122
AREF 0.1k

RL1 PB5/SCK
13 0.00
12V PB4/MISO
12
4
Q3
RESET 11 TIP122
~PB3/MOSI/OC2A
10
~ PB2/SS/OC1B
9 RL2(C1) BUZ1(1)
~ PB1/OC1A
8
PB0/ICP1/CLKO
ATMEGA328P-PU
1121

DIGITAL (~PWM)
ANALOG IN

7
PD7/AIN1
Q1 A0 ~ PD6/AIN0
6 RL2 BUZ1 R5
PC0/ADC0 5 12V 0.1k
A1 ~ PD5/T1
PC1/ADC1 4
A2 PD4/T0/XCK
PC2/ADC2 3
R3 A3
PC3/ADC3
~ PD3/INT1
2
5
A4 PD2/INT0 BUZZER
D1 0.1k A5
PC4/ADC4/SDA
TX PD1/TXD
1
1N4007 PC5/ADC5/SCL 0
RX PD0/RXD
TIP122
ARDUINO UNO R3 R4 Q2
TIP122
0.1k
6

RV2 SONAR2
ULTRASONIC SENSOR
RV3
SONAR1 7
TestPin www.TheEngineeringProjects.com
24%

ULTRASONIC SENSOR
24%

TestPin www.TheEngineeringProjects.com
10k
Trigger

10k
Echo
Gnd
+5V
Trigger

8
Echo
Gnd
+5V

FILE NAME: carcollision1.pdsprj DATE:

6/7/2017
DESIGN TITLE: carcollision1.pdsprj 9
PAGE:
PATH: C:\Users\Ahmednur\Desktop\02062017\carcollision1.pdsprj
1 of 1
BY: @AUTHOR REV:@REV TIME: 2:39:17 PM

Figure 4.8 Fourth simulation results

DDIT POWER ENGINEERING FINAL THESIS Page 28


CAR COLLISION AVOIDANCE USING ULTRASONIC SENSORS 2009E.C
In all conditions the measurement of the ultrasonic system will be displayed on the LCD
LCD2
LM041L

RV1 SONAR3 0
ULTRASONIC SENSOR
RV4
TestPin www.TheEngineeringProjects.com
SONAR4
18%

ULTRASONIC SENSOR

39%
TestPin www.TheEngineeringProjects.com

VDD
VSS

VEE

RW
10k

RS

D0
D1
D2
D3
D4
D5
D6
D7
E
Trigger

10k
Echo

1
2
3

4
5
6

7
8
9
10
11
12
13
14
1
Gnd
+5V

Trigger
Echo
Gnd
+5V
2
RL4(C1)
R1
R2
0.1k

RL4
G2R-2S-DC12 RL3(C1)
0.1k
ARD1 D2
1N4007
3
RL3
G2R-2S-DC12
RL1(C1) D3
R6 Q4 1N4007
TIP122
AREF 0.1k

RL1 PB5/SCK
13 0.00
12V PB4/MISO
12
4
Q3
RESET 11 TIP122
~PB3/MOSI/OC2A
10
~ PB2/SS/OC1B
9 RL2(C1) BUZ1(1)
~ PB1/OC1A
8
PB0/ICP1/CLKO
ATMEGA328P-PU
1121

DIGITAL (~PWM)
ANALOG IN

7
PD7/AIN1
Q1 A0 ~ PD6/AIN0
6 RL2 BUZ1 R5
PC0/ADC0 5 12V 0.1k
A1 ~ PD5/T1
PC1/ADC1 4
A2 PD4/T0/XCK
PC2/ADC2 3
R3 A3
PC3/ADC3
~ PD3/INT1
2
5
A4 PD2/INT0 BUZZER
D1 0.1k A5
PC4/ADC4/SDA
TX PD1/TXD
1
1N4007 PC5/ADC5/SCL 0
RX PD0/RXD
TIP122
ARDUINO UNO R3 R4 Q2
TIP122
0.1k
6

RV2 SONAR2
ULTRASONIC SENSOR
RV3
SONAR1 7
TestPin www.TheEngineeringProjects.com
8%

ULTRASONIC SENSOR
44%

TestPin www.TheEngineeringProjects.com
10k
Trigger

10k
Echo
Gnd
+5V
Trigger

8
Echo
Gnd
+5V

FILE NAME: carcollision1.pdsprj DATE:

6/7/2017
DESIGN TITLE: carcollision1.pdsprj 9
PAGE:
PATH: C:\Users\Ahmednur\Desktop\02062017\carcollision1.pdsprj
1 of 1
BY: @AUTHOR REV:@REV TIME: 2:39:17 PM

Figure 4. 9 Simulation result of the project

DDIT POWER ENGINEERING FINAL THESIS Page 29


CAR COLLISION AVOIDANCE USING ULTRASONIC SENSORS 2009E.C
4.6 Component Cost estimation
Table 4.1 Estimated cost

No Name of component Total Cost of


Number of component component(in
Ethiopian birr)
1 Arduino Uno R3(ATmega328p) 1 500

2 Ultrasonic sensor(moduleHCSR-04) 4 42.2

3 LCD(16x4) 1 300

4 Transistor 4 78.50

5 Buzzer 1 160.00

6 DC motor 1 1100

7 Push button 1 8

8 Diode 3 30

9 Resistor 6 60

10 Relay 4 110

11 Voltage regulator 4 60

Total 31 2448.7

DDIT POWER ENGINEERING FINAL THESIS Page 30


CAR COLLISION AVOIDANCE USING ULTRASONIC SENSORS 2009E.C

CHAPTER FIVE

CONCLUSION AND RECOMMENDATION

5.1 Conclusion
This Car Collision Avoidance Using Ultrasonic Sensor Based Control has been designed
successfully. It has been developed by integrated features of all the hardware components used.
Every component Presence has been reasoned out and placed properly, thus contributing to the
best working of the unit. We check system through simulation and it already simulates
successfully.
In this paper, an effective method is proposed for the collision avoidance system of a car to
detect the obstacle present in front, right, left and back side blind spot of the car. The driver is
made alert via a buzzer as the distance between car and obstacle reduces and the brake
automatically brakes the car depending on the code. The ultrasonic sensor detects the state of the
object whether it is in farther distance or near with respect to the car. This system is useful for
detecting vehicle, motorcycle, bicycle and pedestrians that pass by the lateral side of vehicle.

In the proposed work the system is going to be implemented using Arduino board along with
ultrasonic sensor module HC-SR04 and motor brake. The control unit is the main unit through
which all the other modules are connected. The ultrasonic sensor is a high range sensor which
can detect the obstacle up to eight meters. Ultrasonic sensor (module HC-SR04) is implemented
in the front of the car which serves as collision avoidance on forward position. The two HC -
SR04 sensor modules are used in this way that they can detect the obstacle in blind spot of the
car right and left side and the other one is in the back side of the car serves as backward vehicle
collision avoidance. The sensor can detect the distance between the car and the obstacle. Sensor
can calculate the distance by dividing the time taken to the transmitted and reflected wave by
two.

DDIT POWER ENGINEERING FINAL THESIS Page 31


CAR COLLISION AVOIDANCE USING ULTRASONIC SENSORS 2009E.C
5.2 Recommendation
We have designed a Car Collision Avoidance Using Ultrasonic Sensor Based Control but in
our design there are some parts which must be done in future. These are:

 We have used ultrasonic sensor to take the input by detecting the object around the car
and calculate relative distance but this project can be develop a system that can detect the
obstacles by implying image processing technology and can be able to measure the
distance of the obstacles which are beyond the range of the ultrasonic sensor module to
maximize efficiency of the system.
 We have used buzzer to alert the driver when the distance cross the minimum safe
distance and to automatically take measures. But this project can be modified by adding
principle of Doppler Effect to measure and inform the speed of car to police for security
purpose.
 The project can be modified by implanting ultrasonic sensor for detection purpose of real
time moving object and calculate the speed of the object.

DDIT POWER ENGINEERING FINAL THESIS Page 32


CAR COLLISION AVOIDANCE USING ULTRASONIC SENSORS 2009E.C
Reference
[1] Greenfield, J. (2000). Digital Design using Integrated Circuits
[2] Automobile blind-spot monitoring system, tri-city insurance news, April 20, 2016

Website

[4] Https: //www.micropik.com /PDF /arduino ATmega2560p.pdf. Accessed on April 25, 2016
[5] https://www.engineersgarage.com/16 x 4 LCD Datasheet _ 16x4 Character LCD Module
PINOUT - EngineersGarage.html. Accessed on April 27, 2016
[6] https://www.wikipedia.com/ moduleHC-SR04 ultrasonic sensor_Elecrow.html .Accessed on
May 01, 2016
[7] https://www.wikipedia.com/vehicleobstacle_ detector Wikipedia, the free encyclopedia.htm
.Accessed on May 12, 2016
[8] https//en.m.wikipidia.org/wiki/parking _sensor, the free encyclopedia.htm .Accessed on May
16, 2016.
[9] https://www.sparkfun.com/Electronic components with datasheets. Accessed on May 30,
2016
[10] https://www.emartee.com /product/41706/ArduinoUltrasonic-Sensor-HC-SR04. Accessed
on Jun 03, 2016

DDIT POWER ENGINEERING FINAL THESIS Page 33


CAR COLLISION AVOIDANCE USING ULTRASONIC SENSORS 2009E.C
APPENDIX
//arduino

#include <LiquidCrystal.h>

Liquid Crystal lcd(2,3,4,5,6,7);

//const int pb=7;

//const int re=1;

const int pb= 11;

const int re=12;

const int r=8;

const int forward=9;

const int reverse=10;

const int fsignal=A0;

const int fecho=A1;

const int lsignal=A2;

const int lecho=A3;

const int rsignal=A4;

const int recho=A5;

const int bsignal= 0;

const int becho= 1;

int pbval=0;

int reval=0;

DDIT POWER ENGINEERING FINAL THESIS Page 34


CAR COLLISION AVOIDANCE USING ULTRASONIC SENSORS 2009E.C

float ftime=0;

float fdistance=0;

float ltime=0;

float ldistance=0;

float rtime=0;

float rdistance=0;

float btime=0;

float bdistance=0;

void setup() {

lcd.begin(16,4);

pinMode(pb, INPUT);

pinMode(re, INPUT);

pinMode(r, OUTPUT);

pinMode(forward, OUTPUT);

pinMode(reverse, OUTPUT);

pinMode(fsignal,OUTPUT);

pinMode(fecho,INPUT);

pinMode(lsignal,OUTPUT);

pinMode(lecho,INPUT);

pinMode(rsignal,OUTPUT);

pinMode(recho,INPUT);

pinMode(bsignal,OUTPUT);

pinMode(becho,INPUT);

DDIT POWER ENGINEERING FINAL THESIS Page 35


CAR COLLISION AVOIDANCE USING ULTRASONIC SENSORS 2009E.C
void loop() {

pbval =digitalRead(pb);

reval = digitalRead (re);

if (pbval==0)

digitalWrite(fsignal,HIGH);

delayMicroseconds(10);

digitalWrite(fsignal,LOW);

ftime=pulseIn(fecho,HIGH);

fdistance=ftime*340/2000000;

digitalWrite(lsignal,HIGH);

delayMicroseconds(10);

digitalWrite(lsignal,LOW);

ltime=pulseIn(lecho,HIGH);

ldistance=ltime*340/2000000;

digitalWrite(rsignal,HIGH);

delayMicroseconds(10);

digitalWrite(rsignal,LOW);

rtime=pulseIn(recho,HIGH);

rdistance=rtime*340/2000000;

digitalWrite(bsignal,HIGH);

delayMicroseconds(10);

digitalWrite(bsignal,LOW);

btime=pulseIn(becho,HIGH);

bdistance=btime*340/2000000;

DDIT POWER ENGINEERING FINAL THESIS Page 36


CAR COLLISION AVOIDANCE USING ULTRASONIC SENSORS 2009E.C
if(bdistance<=1 && fdistance<=2)

digitalWrite(8,HIGH);

else

digitalWrite(8,LOW);

if(reval== 0 )

digitalWrite(0,HIGH);

lcd.setCursor(0,0);

lcd.print("mannual ");

lcd.setCursor(0,1);

lcd.print("operation ");

lcd.setCursor(0,2);

lcd.print("front= ");

lcd.print(fdistance);

lcd.print("m ");

lcd.setCursor(0,3);

lcd.print("back= ");

lcd.print(bdistance);

lcd.print("m ");

else

DDIT POWER ENGINEERING FINAL THESIS Page 37


CAR COLLISION AVOIDANCE USING ULTRASONIC SENSORS 2009E.C
{

digitalWrite(0,LOW);

if(fdistance<=2)

digitalWrite(forward,HIGH);

else

digitalWrite(forward,LOW);

if(ldistance<=2)

digitalWrite(reverse,HIGH);

else

digitalWrite(reverse,LOW);

if(rdistance<=2)

digitalWrite(reverse,HIGH);

else

digitalWrite(reverse,LOW);

DDIT POWER ENGINEERING FINAL THESIS Page 38


CAR COLLISION AVOIDANCE USING ULTRASONIC SENSORS 2009E.C
}

if(bdistance<=2)

digitalWrite(reverse,HIGH);

else

digitalWrite(reverse,LOW);

lcd.setCursor(0,0);

lcd.print("front= ");

lcd.print(fdistance);

lcd.print("m");

lcd.setCursor(0,1);

lcd.print("left= ");

lcd.print(ldistance);

lcd.print("m");

lcd.setCursor(0,2);

lcd.print("rigth= ");

lcd.print(rdistance);

lcd.print("m");

lcd.setCursor(0,3);

lcd.print("back= ");

lcd.print(bdistance);

lcd.print("m");

DDIT POWER ENGINEERING FINAL THESIS Page 39


CAR COLLISION AVOIDANCE USING ULTRASONIC SENSORS 2009E.C
}

else

digitalWrite(0,LOW);

digitalWrite(8,LOW);

digitalWrite(forward,LOW);

digitalWrite(reverse,LOW);

lcd.setCursor(0,0);

lcd.print("mannual ");

lcd.setCursor(0,1);

lcd.print("operation ");

lcd.setCursor(0,2);

lcd.print(" ");

lcd.setCursor(0,3);

lcd.print(" ");

DDIT POWER ENGINEERING FINAL THESIS Page 40

Potrebbero piacerti anche