Jimma University: Jimma Institute of Technology (Jit)

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 36

JIMMA UNIVERSITY

JIMMA INSTITUTE OF TECHNOLOGY (JiT)


SCHOOL OF ELECTRICAL AND COMPUTER ENGINEERING
(ECEG)
ELECTRONIC COMMUNICATION ENGINEERING STREAM
GROUP 15
PROJECT ON
Car Collision Avoidance System using Arduino and ultrasonic sensor

A Project submitted to the School of Electrical and Computer Engineering

ADVISOR:
Isayiyas Nigatu

Feb, 1/ 2016
JIMMA UNIVERSITY, JIT
JIMMA, ETHIOPIA
Car Collision Avoidance System using Arduino and ultrasonic sensor 2016

GROUP MEMBERS
№ Name ID e-mail Phone №
1 Bazezew Mulu 01230/04 bazezewm@gmail.com +251923778512
2 Husen Oli 02165/04 Livefortomorrow172@gmail.com +251917260419
3 Berhanu Girma 01290/04 brenegn@gmail.com +251926149580
4 Alhamdu Menji 01014/04 +251923695442
5 Daniel Abate 01442/04 danielabate60@gmail.com +251913605458

JIMMA INSTITUTE OF TECHNOLOGY (JIT), ELECTRONIC COMMUNICATION STREAM Page ii


Car Collision Avoidance System using Arduino and ultrasonic sensor 2016

Declaration
We declare that the work entitled Car Collision Avoidance System using Arduino and
ultrasonic sensor is our original work. We have not copied from any other students’ work or from any
other sources except where due reference or acknowledgement is made explicitly in the text, nor has any
part been written for us by another person.

We are:
Bazezew Mulu Berhanu Girma
Signature: __________ signature: ____________
Alhamdu Menji Daniel Abate
Signature: __________ signature: _____________
Husen Oli
Signature: _________

Place: Jimma, Ethiopia


Feb, 1/ 2016.

Advisor’s Declaration
Isayiyas Nigatu
Signature: ____________________

Hereby certifies that the work entitled Car Collision Avoidance System using Arduino and
ultrasonic sensor was prepared by the above named student, and was submitted to the School of
Electrical and Computer Engineering (ECEg), JIT as a partial/full fulfillment for the
conferment of BSC and the aforementioned work, to the best of our knowledge, is the said
student’s work.

Received for examination by: _____________________ Date: ____________________


Signature: ____________________

JIMMA INSTITUTE OF TECHNOLOGY (JIT), ELECTRONIC COMMUNICATION STREAM Page iii


Car Collision Avoidance System using Arduino and ultrasonic sensor 2016

Acknowledgment
We have immense pleasure in expressing our thanks and deep sense of gratitude to our advisor
Intr. Isayiyas Nigatu for his constructive suggestion and critically reviewing of this proposal. Without
his help this project would not have been possible. We would also acknowledge the School of Electrical
and Computer Engineering for allowing us to do this proposal. We also express our sincere thanks to
Mr. Solomon for extending his help and we express our great thank to all members of school
staff for their valuable advice and help to complete the project successfully.
Finally, we would like to thank everybody who was important to the successful realization of the project,
as well as expressing our apology that we could not mention personally one by one.

JIMMA INSTITUTE OF TECHNOLOGY (JIT), ELECTRONIC COMMUNICATION STREAM Page iv


Car Collision Avoidance System using Arduino and ultrasonic sensor 2016

Abstract
Car collision avoidance system is a safety feature in cars to avoid colliding with
a vehicle or an obstacle in the way. The main objective of this system is to help driver
prevent car collisions due to blind spots and their carelessness while driving. We use different
components on this project such as Arduino 2560p microcontroller, four ultrasonic sensors,
Buzzer and LCD display. The sensors in the car would be capable of detecting even in the poor
conditions and would inform the driver distance from the various objects around the car which
will help the driver to drive safely in such poor conditions and a central Arduino microcontroller
would also be able take decisions according to different situations.

In the proposed work the system is going to be implemented using ARDUINO 2560
microcontroller along with ultrasonic sensor module. The control unit is the main processing unit
through which all the other modules are connected. The ultrasonic sensor modules HC - SR04 is
a high range sensor. This sensor module is implemented in the front and back of the vehicle
which serves as backward and forward vehicle collision avoidance. The other two right and left
side sensor modules HC - SR04 are used in such a way that they can detect the obstacle in blind
spot of the vehicle. The sensor can detect the distance between the vehicle and the obstacle. The
calculated distance can be displayed on the LCD and a buzzer is blown to alert the driver if the
distance between the obstacle and vehicle crosses the minimum safe distance.

JIMMA INSTITUTE OF TECHNOLOGY (JIT), ELECTRONIC COMMUNICATION STREAM Page v


Car Collision Avoidance System using Arduino and ultrasonic sensor 2016

Contents
Declaration ................................................................................................................................................... iii
Acknowledgment ......................................................................................................................................... iv
Abstract ......................................................................................................................................................... v
List of figure ............................................................................................................................................... viii
List of Table .................................................................................................................................................. ix
Acronyms ...................................................................................................................................................... x
CHAPER ONE ................................................................................................................................................. 1
1. Introduction .......................................................................................................................................... 1
1.1 Background ................................................................................................................................... 1
1.2 Project Objective ........................................................................................................................... 2
1.2.1 General Objective ................................................................................................................. 2
1.2.2 Specific Objective: ................................................................................................................. 2
1.3 Statement of the problem and motivation ................................................................................... 2
1.4 Scope of the project ...................................................................................................................... 2
1.5 Methodology of the study ............................................................................................................ 2
CHAPTER TWO .............................................................................................................................................. 4
2 LITRATURE REVIW ................................................................................................................................. 4
2.1 Related Work ................................................................................................................................ 4
2.2 Hardware Components we use..................................................................................................... 4
2.2.1 The Arduino AT mega 2560p................................................................................................. 5
2.2.2 Ultrasonic sensor (Module HC - SR04) .................................................................................. 8
2.2.3 Liquid crystal displays (LCD) ................................................................................................ 11
2.2.4 Power Supply ...................................................................................................................... 13
2.2.5 Buzzer .................................................................................................................................. 13
CHAPTER THREE .......................................................................................................................................... 14
3 System design and Simulation Results................................................................................................ 14
3.1 BLOCK DIAGRAM ......................................................................................................................... 14
3.2 Working principle of the system ................................................................................................. 14
3.3 System design and implementation ........................................................................................... 15
3.3.1 Hardware Design ................................................................................................................. 15
3.3.2 Software Design .................................................................................................................. 17
3.4 System Implementation .............................................................................................................. 17

JIMMA INSTITUTE OF TECHNOLOGY (JIT), ELECTRONIC COMMUNICATION STREAM Page vi


Car Collision Avoidance System using Arduino and ultrasonic sensor 2016

3.5 Simulation Result and Discussion ............................................................................................... 18


3.6 Component Cost estimation ....................................................................................................... 19
CHAPTER FOUR ........................................................................................................................................... 20
4 CONCLUSIONS AND RECOMMENDATIONS ......................................................................................... 20
4.1 CONCLUSIONS ............................................................................................................................. 20
4.2 RECOMMENDATIONS.................................................................................................................. 21
Reference .................................................................................................................................................... 22
APPENDIX .................................................................................................................................................... 23

JIMMA INSTITUTE OF TECHNOLOGY (JIT), ELECTRONIC COMMUNICATION STREAM Page vii


Car Collision Avoidance System using Arduino and ultrasonic sensor 2016

List of figure
Figure 2-1 Internal structure of arduino 2560 ............................................................................................... 6
Figure 2-2 ultrasonic sensor .......................................................................................................................... 9
Figure 2-3 Timing diagram ......................................................................................................................... 10
Figure 2-4 LCD display .............................................................................................................................. 11
Figure 3-1ultrasonic sensor placement on car............................................................................................. 15
Figure 3-2 Circuit Diagram of the overall system ...................................................................................... 18
Figure 3-3 simulation result of the project .................................................................................................. 19

JIMMA INSTITUTE OF TECHNOLOGY (JIT), ELECTRONIC COMMUNICATION STREAM Page viii


Car Collision Avoidance System using Arduino and ultrasonic sensor 2016

List of Table
Table 2-1 specification of Arduino 2560 ...................................................................................................... 8
Table 2-2 module PIN definition .................................................................................................................. 9
Table 2-3 specification of ultrasonic sensor (HC - SR04) .......................................................................... 10
Table 2-4 Mechanical Data of LCD 16x4 Display ..................................................................................... 11
Table 2-5 Electrical Characteristics of LCD ............................................................................................... 12
Table 2-6 Interface Pin Function of LCD [5] ............................................................................................. 13
Table 3-1estimated cost .............................................................................................................................. 19

JIMMA INSTITUTE OF TECHNOLOGY (JIT), ELECTRONIC COMMUNICATION STREAM Page ix


Car Collision Avoidance System using Arduino and ultrasonic sensor 2016

Acronyms
AC alternate current
AREF analog reference
CM centimeter
DB data bus
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
RADAR radio detection and ranging
RS reset
R/W read/write
Rx receiver
SRAM static random access memory
TX transmitter
USB universal serial bus

JIMMA INSTITUTE OF TECHNOLOGY (JIT), ELECTRONIC COMMUNICATION STREAM Page x


Car Collision Avoidance System using Arduino and ultrasonic sensor 2016

CHAPER ONE
1. Introduction
The increasing demand for flexibility as well as technological Even though there are several
advanced technological innovations are available today for vehicle safety, the growth in the
number of accidents is continues regularly. And most of these accidents are especially due to
collision or intersectional accidents carelessness of the deriver.

1.1 Background
With the emerging of new technologies in different field of science the human life has become
more comfortable and effortless. Advancement of embedded technologies in automotive
industries makes the human life safer and convenient for living. According to a survey large
numbers of deaths in Ethiopia which are caused by road accidents. The obstacle detection in real
time is the most versatile and challenging task for road vehicle and passenger safety.[1][3][7]

The first obstacle detection system was developed by Delco System Operations, Goleta of
California in 1988. This system was basically a safety system which detects the obstacle on rad
and alerts the driver. This system was also capable of detecting the moving objects on nearby
lane. After this system, another object detection technique is implied in automotive that make use
of infrared sensor, radar and ultrasound sensors.[3]

The increasing demand of embedded technologies in automotive industry provides a better and
reliable safety feature for the passenger and driver safety. A number of obstacle detection system
are introduced which provides safety measures and increase the transport efficiency.
Autonomous vehicle technology are implemented in most of the vehicles nowadays which
includes a number of sensors to detect the obstacles in front , side and rear of the vehicle . The
main work of this paper contributes to the detection of obstacles in lateral blind spot of the
vehicle and in front of the vehicle. The system will alert the driver so that the driver
may apply brakes or steer the wheels and avoid collision. In this proposed ultrasonic sensor are
planned to be implant for the detection purpose as they can detect the object very close to the
vehicle and have an immediate response and generates an accurate distance between the obstacle
and the vehicle.[1][3]

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 regularly scans the road ahead for
obstacles or vehicles and if any obstacle or vehicle find, then warning is given to the driver. If
any vehicle is very near than predefined threshold value then automatically the ARDUINO 2560
made a decision and display the output of the sensor on the LCD display and the buzzer alert the
driver. [7]

JIMMA INSTITUTE OF TECHNOLOGY (JIT), ELECTRONIC COMMUNICATION STREAM Page 1


Car Collision Avoidance System using Arduino and ultrasonic sensor 2016

1.2 Project Objective


1.2.1 General Objective
The main objective of the car collision avoidance is to avoid the early accidents due carelessness
driving habit of the driver and high traffic intensity in the road.

1.2.2 Specific Objective:


The specific objectives of this project are:

 To Reduces maintenance cost for the cars due to collision


 To reduce rate of car accident
 To introduce advanced technology to the driver
 It helps the driver to parking car safely

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 many peoples are
died and huge amount of property damaged due to car accident. With the proposed work, the
driver can reduce economic damage and save humans life by monitoring their surrounding object
to prevent collisions before it happens.

1.4 Scope of the project


In this project, it is trying to simulate the model by using proteus program in the
computer application and also we try to implement the material on appropriate model and
size. The simulation of this project is depends on proteus software and ARDUINO R3
(ATmega2560p) because the microcontroller and other materials consisted in this project are
needs to commanded by programming language.
The scope of this project is combining of electrical part 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
R3(ATmega2560p). Microcontroller circuit are 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
mega328p microcontroller, 4 ultrasonic sensor, liquid crystal display (LCD), power supply and
buzzer. 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 in 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 displays respective distance output of the
ultrasonic sensor on the LCD

JIMMA INSTITUTE OF TECHNOLOGY (JIT), ELECTRONIC COMMUNICATION STREAM Page 2


Car Collision Avoidance System using Arduino and ultrasonic sensor 2016

Start

Project Review

Electronic design Software design

Built the System Program the


Circuit Arduino using C-
Code

Integrate the
system
Check the design

Is the simulation
work?

End

JIMMA INSTITUTE OF TECHNOLOGY (JIT), ELECTRONIC COMMUNICATION STREAM Page 3


Car Collision Avoidance System using Arduino and ultrasonic sensor 2016

CHAPTER TWO

2 LITRATURE REVIW
2.1 Related Work
Previous works of obstacle detection involves the use of infrared sensors which were widely
used as proximity sensor for obstacle avoidance. 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 for short distance measurement up to 25 cms. [1][3][7]

The image/vision technologies are also introduced for pedestrian safety and detection. It is the
most challenging 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 differentiate between shadows and pedestrian. The system requires high resolution cameras
and implementation of such system is a difficult task as it produces error due to damping and
vibrations of the vehicles. [3]

Recently ultrasonic sensors and radar sensors are used for obstacle detection 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
detect the obstacle and detect the road side boundaries. But implementation of such system is not
easy as it consumes more power and has higher cost, so ultrasonic sensors are better approach for
obstacle detection.[3][7]

2.2 Hardware Components we use


This project uses Arduino 2560 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 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 ATmega2560
 Ultrasonic sensor (module HC-SR04)
 Crystal liquid display (LCD) (16x4)
 Buzzer

JIMMA INSTITUTE OF TECHNOLOGY (JIT), ELECTRONIC COMMUNICATION STREAM Page 4


Car Collision Avoidance System using Arduino and ultrasonic sensor 2016

 power supply

2.2.1 The Arduino AT mega 2560p


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 or sensors, and controlling
a variety of lights, motors, and other physical outputs. The boards can be assembled by hand or
purchased preassembled; the open-source IDE can be downloaded for free. The Arduino
programming language is an implementation of Wiring, a similar physical computing platform,
which is based on the Processing multimedia programming environment. [4][9]

This project uses The Arduino Mega 2560 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. [9]

Performance

 Digital I/O 0~53.


 Analog I/O 0-15
 Input voltage: when connected to the USB without external power supply or external 5 v
output and external power input.
 Arduino size: width of 70 mm X high 54 mm.
The Arduino Mega2560 can be powered via the USB connection or with an external power
supply. The power source is selected automatically. External (non-USB) power can come either
from an AC-to-DC adapter (wall-wart) or battery. The adapter can be connected by plugging a
2.1mm center-positive plug into the board's power jack. Leads from a battery can be inserted in
the Gnd and VIN pin headers of the POWER connector.

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

The Mega2560 differs from all preceding boards in that it does not use the FTDI USB-to-serial
driver chip. Instead, it features the Atmega8U2 programmed as a USB-to-serial converter.

JIMMA INSTITUTE OF TECHNOLOGY (JIT), ELECTRONIC COMMUNICATION STREAM Page 5


Car Collision Avoidance System using Arduino and ultrasonic sensor 2016

The Arduino 2560 has 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 2560

The power pins are as follows:

• VIN.The input voltage to the Arduino board when it's using an external power source (as
opposed to 5 volts from the USB connection or other regulated power source). You can supply
voltage through this pin, or, if supplying voltage via the power jack, access it through this pin.
• 5V.The regulated power supply 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.
• 3.3v. A 3.3 volt supply generated by the on-board regulator. Maximum current draw is 50 mA.
• GND.Ground pins. [2][4][9]

Memory
The ATmega2560 has 256 KB of flash memory for storing code (of which 8 KB is used for the
boot loader), 8 KB of SRAM and 4 KB of EEPROM (which can be read and written with the
EEPROM library). [4]

JIMMA INSTITUTE OF TECHNOLOGY (JIT), ELECTRONIC COMMUNICATION STREAM Page 6


Car Collision Avoidance System using Arduino and ultrasonic sensor 2016

INPUT/OUT
Each of the 54 digital pins on the Mega can be used as an input or output, using pinMode(),
digitalWrite(), and digitalRead() functions. They operate at 5 volts. Each pin can provide or
receive a maximum of 40 mA and has an internal pull-up resistor (disconnected by default) of
20-50 kΩ. In addition, some pins have specialized functions:

 Serial: 0 (RX) and 1 (TX); Serial 1: 19 (RX) and 18 (TX); Serial 2: 17 (RX) and 16 (TX);
Serial 3: 15 (RX) and 14 (TX). Used to receive (RX) and transmit (TX) TTL serial data.
Pins 0 and 1 are also connected to the corresponding pins of the ATmega8U2 USB-to-
TTL Serial chip.
 External Interrupts: 2 (interrupt 0), 3 (interrupt 1), 18 (interrupt 5), 19 (interrupt 4), 20
(interrupt 3), and 21 (interrupt 2).These pins can be configured to trigger an interrupt on a
low value, a rising or falling edge, or a change in value.
 PWM: 0 to 13.Provide 8-bit PWM output with the analogWrite () function.
 SPI: 50 (MISO), 51 (MOSI), 52 (SCK), 53 (SS). 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: 20 (SDA) and 21 (SCL).Support I2C (TWI) communication using the Wire library
(documentation on the Wiring website). Note that these pins are not in the same location
as the I2C pins on the Duemilanove.

The Mega2560 has 16 analog inputs, each of which provides 10 bits of resolution. 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 analog Reference () function.
There are a couple of other pins on the board:
• AREF. Reference voltage for the analog inputs. Used with analogReference().

• Reset. Bring this line LOW to reset the microcontroller. Typically it used to add a reset button
to shields which block the one on the board. [2][4][9]

JIMMA INSTITUTE OF TECHNOLOGY (JIT), ELECTRONIC COMMUNICATION STREAM Page 7


Car Collision Avoidance System using Arduino and ultrasonic sensor 2016

Table 2-1 specification of Arduino 2560

Feature Specification
Microcontroller ATmega2560 ATmega2560
Operating voltage 7-12V
Input voltage (limits) 6-20v
Digital I/O pins 54 (of which 14 provide PWM output)
Analog Input pins 16 port
DC current per I/O pin 40Ma
DC current for 3.3v pin 50mA
Flash Memory 256 KB of which 8 KB used by boot loader
Clock Speed 16MHz
SRAM 8 KB
EEPROM 4 KB

2.2.2 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. [4]

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. [4]
The basic principle of work:
(1) Using IO trigger for at least 10µs high level signal

(2) The Module automatically sends eight 40 kHz and detect whether there is a pulse signal
back.
(3) IF the signal back, through high level , time of high output IO duration is the time from
sending ultrasonic to returning. Test distance = (high level time × velocity of sound (340M/S) /
2. [4][6]

Wire connecting direct as following:


 5V Supply
 Trigger Pulse Input
 Echo Pulse Output
 0V Ground

JIMMA INSTITUTE OF TECHNOLOGY (JIT), ELECTRONIC COMMUNICATION STREAM Page 8


Car Collision Avoidance System using Arduino and ultrasonic sensor 2016

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. [4]

Figure 2-2 ultrasonic sensor

Table 2-2 module PIN definition

Types Pin Symbol Pin Function Description

VCC 5V power supply

Trig Trigger pin

HC-SR04
Echo Receive pin

GND Power ground

JIMMA INSTITUTE OF TECHNOLOGY (JIT), ELECTRONIC COMMUNICATION STREAM Page 9


Car Collision Avoidance System using Arduino and ultrasonic sensor 2016

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 TTL level signal, proportional
Output Echo Signal
with range
Dimensions 45*20*15mm

Product Features [10]


 Stable performance
 Accurate distance measurement
 High-density
 Small blind

Timing diagram
The Timing diagram is shown below. You only need to supply a short 10uS pulse to the trigger
input to start the ranging, and then the module will send out an 8 cycle burst of ultrasound at 40
kHz and raise its echo. The Echo is a distance object that is pulse width and the range in
proportion .You can calculate the range through the time interval between sending trigger signal
and receiving echo signal. Formula: uS / 58 = centimeters or uS / 148 =inch; or: the range = high
level time * velocity (340M/S) / 2; we suggest to use over 60ms measurement cycle, in order to
prevent trigger signal to the echo signal. [4][6][10]

Figure 2-3 Timing diagram

JIMMA INSTITUTE OF TECHNOLOGY (JIT), ELECTRONIC COMMUNICATION STREAM Page 10


Car Collision Avoidance System using Arduino and ultrasonic sensor 2016

2.2.3 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. [2][4][5]

Table 2-4 Mechanical Data of LCD 16x4 Display

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

Figure 2-4 LCD display

JIMMA INSTITUTE OF TECHNOLOGY (JIT), ELECTRONIC COMMUNICATION STREAM Page 11


Car Collision Avoidance System using Arduino and ultrasonic sensor 2016

Table 2-5 Electrical Characteristics of LCD

standard value
Item Symbol condition Unit
min. typ. Max.
VDD = + 5 V 4.7 5.0 5.3
Input Voltage VDD V
VDD = + 3 V 2.7 3.0 5.3
Supply Current IDD VDD = + 5 V - 1.65 - Ma
- 20 °C 5.0 5.1 5.7
Recommended LC
Driving 0 °C 4.6 4.8 5.2
Voltage for Normal VDD to V0 25 °C 4.1 4.5 4.7 V
Temperature 50 °C 3.9 4.2 4.5
Version Module
70 °C 3.7 3.9 4.3
EL Power Supply IEL VEL = 110 - - 5.0 mA
Current VAC, 400 Hz

Product Features [2][4][5]


 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
 N.V. optional for + 3 V power supply

JIMMA INSTITUTE OF TECHNOLOGY (JIT), ELECTRONIC COMMUNICATION STREAM Page 12


Car Collision Avoidance System using Arduino and ultrasonic sensor 2016

Table 2-6 Interface Pin Function of LCD [5]

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
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)

2.2.4 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.

2.2.5 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’. When we do these thousands of times per second, we
create tones. The Arduino has a built-in command called tone () which clicks the buzzer at a certain
frequency. [4]

The buzzer has two pins: one is positive and the other is negative, the positive pin connect to the digital
pin of Arduino and the negative pin connect with the ground. [9][4]

JIMMA INSTITUTE OF TECHNOLOGY (JIT), ELECTRONIC COMMUNICATION STREAM Page 13


Car Collision Avoidance System using Arduino and ultrasonic sensor 2016

CHAPTER THREE

3 System design and Simulation Results


In this chapter we describes the methodology, the working principle and software (using proteus
8 professional for the simulation of the project) simulation of the entire design procedure of car
collision avoidance system using Arduino microcontroller and ultrasonic sensor.

3.1 BLOCK DIAGRAM

Power supply

LCD Display
Front
sensor

ARDUNIO Buzzer
Left (ATmega2560P)
sensor

Back
Right
sensor sensor

3.2 Working principle of the system


The power supply provides power to the Arduino 2560, to the ultrasonic sensor, liquid crystal
display (LCD) and Buzzer. The Arduino 2560 used to controls and made a decision based on the
output of the ultrasonic sensor and displayed it on to the LCD. Follow the schematic to connect
the Arduino to the ultrasonic sensor and the ultrasonic sensor output of the target distance is
input for the Arduino 2560 microcontroller, and connect liquid crystal display (LCD).if the
output of the ultrasonic sensor is less than the required threshold value then it receives and gives
to the LCD and LCD display it. If the distance is less the minimum safe distance, the Buzzer pin
is in on state and generates alert sound.

JIMMA INSTITUTE OF TECHNOLOGY (JIT), ELECTRONIC COMMUNICATION STREAM Page 14


Car Collision Avoidance System using Arduino and ultrasonic sensor 2016

3.3 System design and implementation


The whole system is implemented using Arduino microcontroller and proteus 8 professional to
simulate our design. Four ultrasonic sensors are used in this system. One in front to detect the
obstacle in forward, two on left and right side to cover the blind spot and one in back to detect
the obstacle in backward. All the four sensors are connected through the control unit. LCD
display is used to show the distance between the car and obstacle and a buzzer is used to alert the
driver.
The four ultrasonic sensors are placed as follow:

Right side

Back side
Front side

Left side

Figure 3-1ultrasonic sensor placement on car

3.3.1 Hardware Design


The Arduino Based car collision avoidance system controller interface module is designed to
simulate the four direction of the ultrasonic output. The liquid crystal display (LCD) the output
distance. The buzzer alerts the driver.

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:

JIMMA INSTITUTE OF TECHNOLOGY (JIT), ELECTRONIC COMMUNICATION STREAM Page 15


Car Collision Avoidance System using Arduino and ultrasonic sensor 2016

Flow chart

Start

Initialize LCD, Buzzer and ultrasonic


sensor

Read the output distance from the ultrasonic sensor

Display output distance on LCD

Is distance <0.5m?

YES NO

Buzzer is on Buzzer is off

End

JIMMA INSTITUTE OF TECHNOLOGY (JIT), ELECTRONIC COMMUNICATION STREAM Page 16


Car Collision Avoidance System using Arduino and ultrasonic sensor 2016

3.3.1.1 Flow chart description


As described in the flow chart at the first step initialize all components in the system and when
the ultrasonic sensor detect the obstacle then calculate respective distance from car and display it
on liquid crystal display (LCD). As soon as the car approaches to the obstacle the Buzzer starts
ringing when the output distance is less desired value (0.5m) otherwise the Buzzer stay on off
state.

3.3.2 Software Design


In the software design we have select two types of software’s to simulate our project. These are:

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

Arduino
The Arduino development environment contains a text editor for writing code, a message area, a
text console, a toolbar with buttons for common functions, and a series of menus. It connects to
the Arduino hardware to upload programs and communicate with them.

Proteus-8.1 professional
Proteus 8.1 is a single application with many service modules offering different
functionality (schematic capture, PCB layout, etc.).

3.4 System Implementation


ATMEGA 2560P MICRO CONTROLLER is the brain of the project which receives the output
of ultrasonic sensor and display on LCD. The Buzzer is automatically on and off by making the
corresponding port pin of the microcontroller high and low. So the sound of Buzzer indicates the
approaching to the obstacle.

JIMMA INSTITUTE OF TECHNOLOGY (JIT), ELECTRONIC COMMUNICATION STREAM Page 17


Car Collision Avoidance System using Arduino and ultrasonic sensor 2016

Figure 3-2 Circuit Diagram of the overall system

In the circuit Diagram we use a potentiometer (POT) meter 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 2560
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).when the distance less than
the threshold value the Buzzer gives sound and we use transistor to amplify current to the buzzer.

3.5 Simulation Result and Discussion


In this over all simulation diagram, we try to clarify the overall output of our project.
The ultrasonic sensor are connected to the micro controller and this controller will be
accept information from the sensors and also sends to LCD display. The Buzzer is controlled by
the microcontroller based on the relative distance.
We used proteus 8.1 professional software to simulate the circuit .the output of the system is:

JIMMA INSTITUTE OF TECHNOLOGY (JIT), ELECTRONIC COMMUNICATION STREAM Page 18


Car Collision Avoidance System using Arduino and ultrasonic sensor 2016

Figure 3-3 simulation result of the project

3.6 Component Cost estimation

Table 3-1estimated cost


[11]
No. Name of component Number of Total Cost
component of component(in Ethiopian birr)
1. Arduino R3(ATmega2560p) 1 1660.00
2. Ultrasonic sensor(module HCSR-04) 4 960.00
3. LCD(16x4) 1 260.00
4. Transistor 1 35.00
5. Buzzer 1 160.00
Total cost 3075.00

JIMMA INSTITUTE OF TECHNOLOGY (JIT), ELECTRONIC COMMUNICATION STREAM Page 19


Car Collision Avoidance System using Arduino and ultrasonic sensor 2016

CHAPTER FOUR

4 CONCLUSIONS AND RECOMMENDATIONS


4.1 CONCLUSIONS
This “CAR COLLISION AVOIDANCE SYSTEM USING ARDUINO AND ULTRASONIC
SENSOR” has been designed successfully. It has been developed by integrated features of
all the hardware components used. Presence of every module has been reasoned out and
placed carefully, thus contributing to the best working of the unit. The system has been
tested to function automatically.

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 is displayed on
display board. 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. The control unit is the main processing unit through which
all the other modules are connected. The ultrasonic sensor is a high range sensor which can
detect the obstacle up to 8 meters. Ultrasonic sensor (module HC-SR04) is implemented in the
front of the car which serves as forward car collision avoidance. The two sensor modules HC -
SR04 are used in such a 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. The calculated
distance can be displayed on the LCD and a buzzer is blown to alert the driver if the distance
between the obstacle and car crosses the minimum safe distance.

JIMMA INSTITUTE OF TECHNOLOGY (JIT), ELECTRONIC COMMUNICATION STREAM Page 20


Car Collision Avoidance System using Arduino and ultrasonic sensor 2016

4.2 RECOMMENDATIONS
We have designed a “CAR COLLISION AVOIDANCE SYSTEM USING ARDUINO AND
ULTRASONIC SENSOR “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 to measure relative distance but this project can be develop a system that can detect
the obstacles by implying image processing methodology 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. But this project can be modified by applying the brake automatically through
stepper and accelerate or decelerate the car according to the relative distance.
 The project can be modified by implanting ultrasonic sensor for detection purpose of
real time moving object and calculate the speed of the object

JIMMA INSTITUTE OF TECHNOLOGY (JIT), ELECTRONIC COMMUNICATION STREAM Page 21


Car Collision Avoidance System using Arduino and ultrasonic sensor 2016

Reference
Books
[1] Automobile blind-spot monitoring system, tri-city insurance news, January 27, 2016
[2] Greenfield, J. (2000). Digital Design using Integrated Circuits

[3] G. Benet, F. Blanes, J.E. Simó, P. Pérez, “Using Infrared Sensors for Distance Measurement
in Mobile Robots”, ELSEVIER Robotics and Autonomous Systems

Website
[4] https://www.sparkfun.com/ Electronic components with datasheets. Accessed on January25,
2016

[5] https://www.engineersgarage.com /16 x 4 LCD Datasheet _ 16x4 Character LCD Module


PINOUT - EngineersGarage.html. Accessed on January20, 2016

[6] https://www.wikipedia.com/ module HC-SR04 ultrasonic sensor_Elecrow.html .Accessed on


January29, 2016

[7] https://www.wikipedia.com/vehicle obstacle_ detector Wikipedia, the free encyclopedia.htm


.Accessed on January29, 2016

[8] https//en.m.wikipidia.org/wiki/parking _sensor, the free encyclopedia.htm .Accessed on


January11, 2016

[9] https: //www.micropik.com /PDF/arduino ATmega2560p.pdf. Accessed on January 30, 2016

[10] https://www.emartee.com /product/41706/ArduinoUltrasonic-Sensor-HC-SR04. Accessed


on January 28, 2016

[11] https://www.amazon.com /product/41706/electronic component prices. Accessed on January


30, 2016

JIMMA INSTITUTE OF TECHNOLOGY (JIT), ELECTRONIC COMMUNICATION STREAM Page 22


Car Collision Avoidance System using Arduino and ultrasonic sensor 2016

APPENDIX
Arduino c code
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int fsignal=A15; int fecho=A14;
int bu=13;
int lsignal=A12; int lecho=A11;
int rsignal=A4; int recho=A6;
int bsignal=A0; int becho=A1;
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(13, 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);
}
void loop()
{

JIMMA INSTITUTE OF TECHNOLOGY (JIT), ELECTRONIC COMMUNICATION STREAM Page 23


Car Collision Avoidance System using Arduino and ultrasonic sensor 2016

digitalWrite(fsignal,LOW);
delayMicroseconds(2);
digitalWrite(fsignal,HIGH);
delayMicroseconds(10);
digitalWrite(fsignal,LOW);
delayMicroseconds(2);
ftime=pulseIn(fecho,HIGH);
fdistance=ftime*340/2000000;
if(fdistance<=1)
{
digitalWrite(bu,HIGH);
}
else {
digitalWrite(bu,LOW);
}
digitalWrite(lsignal,LOW);
delayMicroseconds(2);
digitalWrite(lsignal,HIGH);
delayMicroseconds(10);
digitalWrite(lsignal,LOW);
delayMicroseconds(2);
ltime=pulseIn(lecho,HIGH);
ldistance=ltime*340/2000000;
if(ldistance<=1)
{
digitalWrite(bu,HIGH);
}

JIMMA INSTITUTE OF TECHNOLOGY (JIT), ELECTRONIC COMMUNICATION STREAM Page 24


Car Collision Avoidance System using Arduino and ultrasonic sensor 2016

else {
digitalWrite(bu,LOW);
}
digitalWrite(rsignal,LOW);
delayMicroseconds(2);
digitalWrite(rsignal,HIGH);
delayMicroseconds(10);
digitalWrite(rsignal,LOW);
delayMicroseconds(2);
rtime=pulseIn(recho,HIGH);
rdistance=rtime*340/2000000;
if(rdistance<=1)
{
digitalWrite(bu,HIGH);
}
else {
digitalWrite(bu,LOW);
}
digitalWrite(bsignal,LOW);
delayMicroseconds(2);
digitalWrite(bsignal,HIGH);
delayMicroseconds(10);
digitalWrite(bsignal,LOW);
delayMicroseconds(2);
btime=pulseIn(becho,HIGH);
bdistance=btime*340/2000000;
if(bdistance<=1)

JIMMA INSTITUTE OF TECHNOLOGY (JIT), ELECTRONIC COMMUNICATION STREAM Page 25


Car Collision Avoidance System using Arduino and ultrasonic sensor 2016

{
digitalWrite(bu,HIGH);
}
else {
digitalWrite(bu,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");
delay(100);
}

JIMMA INSTITUTE OF TECHNOLOGY (JIT), ELECTRONIC COMMUNICATION STREAM Page 26

You might also like