Collision Avoidance System Project

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

Collision Avoidance System Using

Arduino Uno

EMBEDDED SYSTEM PROJECT REPORTED BY:

S MEHARAJ

UNDER THE SUPERVISION OF TUTOR:

M DINESH BABU

1
CONTENTS

1. ABSTRACT
2. INTRODUCTION
3. METHODOLOGY
4. COMPONENTS REQUIRED
5. CIRCUIT DESIGN AND CONNECTIONS
6. SOURCE CODE
7. WORKING OF THE CIRCUIT (BASED ON THE SOURCE CODE)
8. OUTPUT (USING PROTEUS SIMULATION)
9. CONCLUSION

2
ABSTRACT

o As the number of vehicles increasing day by day, accidents are also


increasing rapidly. These accidents can be due to false estimation of
nearby vehicle, disturbance in mind of driver or any reasons due to
which driver can't keep focus on driving.

o So, not only the distance estimation of other surrounding vehicle is


required but also to take quick actions is necessary to avoid any kind of
accidents.

o This project is specifically based on the accident. This system can


measure the distance between the driving car and front object and can
calculate the safety distance of the driving car based on current speed.

o If the driver doesn't keep the minimum safety distance with front object,
it will warn driver to slow down the speed of car to avoid collision. And
if driver doesn't slow down vehicle this system will automatically slow
down and stop the car before collision could occur.

3
INTRODUCTION

o Invention of automobiles was one of the greatest commercial


achievements of mankind in the past century and has contributed in
many ways to the growth of a nation. However, we cannot ignore the
fact that thousands of people lose their life or suffer life changing
accidents due to vehicular collisions every year.

o Nearly 70% of highway traffic accidents are caused by not keeping


braking safety distance between moving cars. According to the Centre
for Disease Control and Prevention, the cost caused by automobile
crash injuries was over 99 billion dollars. The driver’s incorrect
judgment for braking safety distance is the main reason to cause traffic
accident in highway traffic system.

o Road accidents are now globally recognized as a serious public health


problem. The problem is much more serious in our country where close
to 5,00,000 road accidents caused nearly 1,46,000 deaths and left more
than thrice that number injured.

o In order to create an awareness for the drivers I had created a collision


avoidance system to ensure a better safety drive for every driver.

4
METHODOLOGY

o This is a simple Arduino based Collision Avoidance System. It is also


known as Forward Collision Warning System. Basically, it is an
advanced driver-assistance system designed to prevent or reduce the
severity of a collision. It will continuously monitor the distance
between the vehicles/objects in front of it, so that it can provide
warning to the driver if the vehicles get too close.

o The proposed method of Collision Avoidance System is mainly


composed of distance measurement of front object, calculating safety
distance, alarming driver and respond to driver’s action. When the
distance between front object and driving vehicle is less than the
minimum safety distance, then a buzzer will alarm the driver
indicating the possible collision.

o If driver slow down the vehicle and increase the distance between
front object and driving vehicle then it is okay. But if driver doesn’t
take any action within (1.5 sec) after the alarm is indicated, then the
system will automatically slow down the vehicle until the distance
between these two is over the minimum safety distance and if not then
will completely stop the vehicle.

5
COMPONENTS REQUIRED

1. Controllers: Arduino UNO

2. Sensor: HCSR04 Ultrasonic sensor

3. Piezo Buzzer: For providing sound

4. Three LEDs (RED, YELLOW, GREEN)

5. Three Resistors(1k)

6. DC Motor

7. Few jumper wires for connection

8. Breadboard

9. Proteus Simulation Software

6
CIRCUIT DESIGN AND CONNECTIONS

CIRCUIT DESIGN:

7
CIRCUIT CONNECTIONS:

Connect all the components to Arduino through wires!

Ultrasonic sensor (HCSR04) to Arduino Uno

• VCC pin of Ultrasonic sensor is connected to 5V power supply of Arduino.


• GND pin of Ultrasonic sensor is connected to GND pin of Arduino.
• TRIG pin of Ultrasonic sensor is connected to 7th pin of Arduino.
• ECHO pin of Ultrasonic sensor is connected to 4th pin of Arduino.

LED connections: It has two pins Anode (longer leg) and Cathode (shorter
leg).

• Green LED: Connect anode to resistor and then to 13th pin of Arduino.
Connect cathode to GND of Arduino.

• Yellow LED: Connect anode to resistor and then to 12th pin of Arduino.
Connect cathode to GND of Arduino.
• Red LED: Connect anode to resistor and then to 2nd pin of Arduino.
Connect cathode to GND of Arduino.

Buzzer

• Positive terminal of buzzer is connected to pin-10 on Arduino.


• Negative terminal is to GND of Arduino.

DC Motor

• It has two terminals.

Connect one terminal to pin-6 on Arduino and another one to GND of Arduino.

8
SOURCE CODE

const int trigPin = 7;

const int echoPin = 4;

int buzz = 10;

long duration;

int distance;

void setup ()

pinMode (trigPin, OUTPUT);

pinMode (echoPin, INPUT);

pinMode (13, OUTPUT);

pinMode (12, OUTPUT);

pinMode (2, OUTPUT);

pinMode (6, OUTPUT);


9
Serial.begin(9600);

void loop ()

digitalWrite (trigPin, LOW);

delayMicroseconds (2);

digitalWrite (trigPin, HIGH);

delayMicroseconds (10);

digitalWrite (trigPin, LOW);

duration = pulseIn (echoPin, HIGH);

distance= duration*0.034/2;

if (distance >= 20)

digitalWrite (6, HIGH);


10
}

else

digitalWrite (6, LOW);

if (distance >= 100)

digitalWrite (13, HIGH);

else

digitalWrite (13, LOW);

if (distance < 100 && distance >= 50)


11
{

digitalWrite (12, HIGH);

delay (400);

digitalWrite (12, LOW);

delay (400);

else

digitalWrite (12, LOW);

if (distance < 50 && distance >= 20)

digitalWrite (2, HIGH);

delay (600);
12
digitalWrite (2, LOW);

delay (600);

digitalWrite (buzz, HIGH);

tone (buzz, 2000);

delay (400);

noTone(buzz);

delay (100);

tone (buzz, 2000);

delay (400);

noTone(buzz);

delay (50);

tone (buzz, 2000);

delay (400);

noTone(buzz);
13
delay (50);

tone (buzz, 2000);

delay (400);

noTone(buzz);

delay (50);
}

else

digitalWrite (2, LOW);

14
WORKING OF THE CIRCUIT (BASED ON THE
SOURCE CODE)

Make those necessary circuit connection and upload the given code to the
Arduino using Arduino IDE. Now let's see about the working of our circuit.

It has four different zones:

Zone 1: No Warning (Safe zone)

Zone 2: Visual Warning

Zone 3: Visual and Audible Warning (Need to pay attention)

Zone 4: Auxiliary brake

Zone 1:

When the distance between the object in front of the Ultrasonic sensor is
greater than 100cm then no warning will be provided. Only green colour LED will
glow and motor will run, indicating that object is at a safe distance.

Zone 2:

If the distance between the object in front of the sensor is between 100-50cm,
then yellow colour LED will start blinking. This indicates that "Object is
approaching". Motor will continue to run.

15
Zone 3:

If the distance gets reduced between 50-20cm, then red colour LED will start
blinking. In addition to that a beep sound is also provided by the buzzer. Driver
needs to respond in this situation. In spite of the warning, the motor will continue
to run.

Zone 4:

This is the last zone. Here, if the distance between the object is even get
reduced to less than 20cm, then the motor will automatically stop functioning.

16
OUTPUT

Whenever a green led blinks it results that the vehicle is at a greater distance
about (100cm) this means that the distance between the vehicle and the nearing
object remains in a safe distance from each other.

17
Whenever a yellow led blinks it indicates that the distance between the object
in front of the sensor is between (100-50cm), This indicates that "Object is
approaching". Motor will continue to run.

18
Whenever a red led blinks, it indicates that the distance gets reduced between
(50-20cm). In addition to that a beep sound is also provided by the buzzer. Driver
needs to respond in this situation. In spite of the warning, the motor will continue
to run.

19
CONCLUSION

o The main focus of future is safety and automation of vehicle.

o Though the vehicles of today are not equipped with this system, through
this project we have detected distance between two vehicle and
calculated the safety distance, by which warning is given to the driver
and taken actions depending upon driver’s reaction by which collision
avoidance is achieved successfully using the system.

o Although this project is done using a simple prototype, it can be


implemented on actual cars also, as the basic concepts remain the same.

o And also, its main concept is created to ensure the driver safety as the
foremost priority.

20

You might also like