Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
ULTRASONIC SENSOR
GROUP MEMBERS
No NAME ID. No.
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 ……………..
Approved by,
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.
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.
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
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
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.
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
Start
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
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.
Tactile sensors:
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.
The Arduino2560has several different kinds of pins each of which is labeled on the board and
use for different functions.
HC-SR04
Trig Trigger pin
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.
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
1 VSS Ground
2 VDD + 3 V or + 5 V
3 V0 Contrast adjustment
6 E H/ L enable signal
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.
CHAPTER THREE
Power supply
Buzzer
Left sensor
ARDIUNO UNO 328P
Back sensor
Right sensor
Automatic
braking and
Push button accelerating
system
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.
CHAPTER FOUR
Right side
Front Back
side side
Left side
Pressed PB
If back
If front
D<2
D <2
End
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.
Arduino
Proteus-8 software to build and run our circuit
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
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
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.
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
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
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.
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
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
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.
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
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
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.
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
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
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
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
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
CHAPTER FIVE
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.
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.
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
#include <LiquidCrystal.h>
int pbval=0;
int reval=0;
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);
pbval =digitalRead(pb);
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;
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
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);
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");
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(" ");