AUTO CRASH AUTOMOBILE EVASION SYSTEM - FULL PROJECT

68
MASINDE MULIRO UNIVERSITY OF SCIENCE AND TECHNOLOGY. (The University of Choice) AUTO CRASH AUTOMOBILE EVASION SYSTEM. BY WAMBASI FRED BUTETE. ECE/0026/09. Project Proposal Submitted in partial fulfillment of the requirement for the award of Bachelor of Science Degree In Electrical and Communication Engineering of Masinde Muliro University Of Science And Technology. COURSE: ENGINEERING PROJECT II: ECE 590 Email: [email protected] Telephone: 0724051124 February 2014 COURSE LECTURER: MR JUMA R.W.

Transcript of AUTO CRASH AUTOMOBILE EVASION SYSTEM - FULL PROJECT

MASINDE MULIRO UNIVERSITY OF SCIENCE AND TECHNOLOGY.

(The University of Choice)

AUTO CRASH AUTOMOBILE EVASION SYSTEM.BY

WAMBASI FRED BUTETE.

ECE/0026/09.

Project Proposal Submitted in partial fulfillment of the requirement for theaward of Bachelor of Science Degree In Electrical and CommunicationEngineering of Masinde Muliro University Of Science And Technology.

COURSE: ENGINEERING PROJECT II: ECE 590

Email: [email protected]

Telephone: 0724051124

February 2014

COURSE LECTURER: MR JUMA R.W.

i

DECLARATION BY CANDIDATE.

I hereby declare that this project submitted for the degree Bachelor of Science Degree in

Electrical and Communication Engineering at Masinde Muliro University of Science and

Technology is my original work and has not been previously presented in any other

Institution of higher education. I further declare that all sources cited or quoted are indicated

and acknowledged by means of a comprehensive list of references.

WAMBASI FRED BUTETE Date.

7/5/2014

ii

DEDICATION

To my parents Esther and Patrick, you are wonderful people!

iii

ACKNOWLEDGEMENTS.

It is with my deep gratitude and reverence that I express my sincere thanks first to GOD for

granting me strength, wisdom and knowledge to accomplish this project.

Then, to my supervisor Mr. Juma R.W. for the guidance and technical support he accorded me.

I also thank my friends Timothy, Emmanuel and Sydney for their suggestions and criticism on

my research problems.

Finally I would like to thank the Department of Electrical and Communication Engineering for

their guidance, help and useful suggestions and individual help that made it possible for me to

come up with this work.

iv

ABSTRACT

Collisions in automobiles have become a major safety concern; cases of damage and death due to

collisions are reported every hour.Occurence of collisions leads to damage of automobiles,

destruction of property and sometimes even the death of persons onboard. The number of

pedestrians are knocked to death by automobiles is also on the rise in busy towns and highways.

Further into the game reserves wild animals are knocked to death by automobiles. The cost of a

Life cannot be estimated, expensive automobiles on damage impacts negatively on investment;

the role of wild animals still remains pertinent in national revenue generation. In most cases

drivers fail to notice the presence of obstacles ahead and brakes too need a driver’s response to

operate thus increasing the response time, hence reducing their reliability by positively skewing

the response curve. Crash evasion systems aim at reducing the possibility for the occurrence of

collisions thus preventing loss of lives, property damages and automobile repair costs.

This project Implements’ an intelligent microcontroller based Crash evasion system that will

employ obstacle detection and distance measurement using ultrasonic sensors to detect obstacles

and their distances. Once the obstacle has been detected and safe separation distance is not

provided, the automobile will perform safety braking and further decrease in separation distance

will cause the system to initiate steering control so as to reduce the severity of the collision. A

warning signal is provided to the driver to alert them before the system takes automobile steering

into control. Hazard lights are turned ON the moment a collision is detected and Brake lights are

turned ON after activation of the brake assist system and the brakes which are preferably ABS.

Dash board displays of LEDs are incorporated to make the system more interactive. The system

provides for manual control by the driver when they find need to operate the automobile without

it as in case of parking and testing or driving in narrow confined paths.

v

TABLE OF CONTENTS

CONTENTS PAGE

DECLARATION BY CANDIDATE………………………………….……………....……i

DEDICATION…………………………………………………………………………..….ii

ACKNOWLEDGEMENTS……………………………………………..………………….iii

ABSTRACT………………………………………………………………………………..iv

TABLE OF CONTENTS……………………………………………………….…………..v

LIST OF FIGURES………………………………………………………….………….…ix

LIST OF PHOTOS………………………………………………………………………...ix

LIST OF TABLES……………………………………………………..……………….….x

ABBREVIATIONS AND ACRONYMS……………………………………..…………..xi

CHAPTER 1…………………………………………….…………………….……………1

1. INTRODUCTION……………………………………….……………………….…..….1

1.1 Background…………………………………….……………..…….……..........1

1.2 Motivation…………………………………….………...……….…….…....…..1

1.3 Problem Statement……………………………………………………...…...….2

1.3.1 Sub Problem 1………………………………………………….....…..2

1.3.2 Sub Problem 2…………………………….…………………….....….2

1.3.3 Sub Problem 3……………………….……………………...….….….3

1.4 Delimitations………………………………….………………………...…..….3

vi

1.5 Assumptions…………………………………………………...…..…………….3

1.6 Project Methodology…………………………………….………...……...……..3

1.7 Benefit of the Project……………………………….………...….………………4

1.8 Outline of the Project report…………………………………….....…………….4

CHAPTER 2…………………………………………………………………...……...……..6

OVERVIEW OF AUTOMOBILE CRASH EVASION SYSTEMS………….…......…..….6

2.1 Introduction……………………………………………………………….....…..6

2.2 Trends in Automobile collision safety systems…………………….….......……6

2.2.1 Introduction…………………………………………….............…..….6

2.2.2 Automobile Brakes……………………………...…..…….……….....7

2.2.3 Side Mirrors………………………………………………...…….….7

2.2.4 Car Turn signals, Brake and Hazard Lights…………….……...….….8

2.2.5 Intelligent systems……………………………………..…...........…..8

2.3 Need for Automobile Crash Evasion system……………………………...……9

2.4 Conclusion…………………………...………………..…………..…....……10

CHAPTER 3………………………………………………………..….……..……..……11

LITERATURE REVIEW………………………………………..…………...……...……11

3.1 Introduction………………………..…………………..………………...….....11

3.2 Vehicle Safe Drive System………………………………..………….........….11

3.3 Evasion Systems Using Laser Beams…………………..…………....……..…12

3.4 Crash Evasion Systems Using Radar systems…………..……………....….…13

3.5 The Automobile Crash Evasion System proposed………..………..…..…..….15

3.6 Conclusion.........................................................................................................16

vii

CHAPTER 4..........................................................................................................................17

DESIGN OF THE AUTO CRASH AUTOMOBILE EVASION SYSTEM.........................17

4.1 Introduction........................................................................................................17

4.2. Block Diagram…………………………………………………….………….17

4.3 Design of System……………………………………………………..…….…19

4.3.1 The power supply system……………………………..……..………19

4.3.2 Range Detecting Sub-System………………………….…….………22

4.3.2.1 Introduction…………………………………..…….…..…..22

4.3.2.2 Power and Signal Connections…………………….…..…..22

4.3.2.3 Distance calculation………………………….………..……23

4.3.2.4 Code for arduino…………………………….………...……23

4.3.2.5 Physical dimensions…………………..…………...………24

4.3.4 Speed Encoding subsystem and Gear shifting encoder……………...24

4.3.4.1 Design of Vehicle Speed Variation subsystem…….......….24

4.3.4.2 Design and Interfacing the Gear switching….………….….25

4.3.5 Warning Subsystem…………………………………....…………….26

4.3.5.1 Introduction…………………….………….………....…….26

4.3.5.2 Design and Interfacing for LEDs………………………….26

4.3.5.3 The electric buzzer and switching transistor..……………...28

4.3.5.4 Design of Hazard Lights……………………………..……29

viii

4.3.6 Servo Motors………………………………………………………..32

4.3.7 The Microcontroller Selection……..………………………..…..…...33

4.3.8 The Control subsystem………………..…………….………..…..…..34

4.4 circuit diagram....................................................................................................35

4.5 Conclusion.........................................................................................................37

CHAPTER FIVE..................................................................................................................38

OPERATION, TESTING AND PROGRAM CODE ..........................................................38

5.1 Introduction..............................................................................................................38

5.2 Operation..........................................................................................................38

5.3 Test Points........................................................................................................40

5.4 Programming....................................................................................................41

5.4.1 Introduction........................................................................................41

5.4.2 Program Code....................................................................................41

CHAPTER 6......................................................................................................................48

CONCLUSION AND FUTURE WORK.........................................................................48

6.1 Overview of the project objective.....................................................................48

6.2 Project Achievements.......................................................................................48

6.3 Recommendations for Future Study.................................................................48

6.4 Project Summary and Conclusion....................................................................49

ix

LIST OF FIGURES

Figure 4.1a: Generalized Block Diagram……………………………….………………..17

Figure 4.1b Block diagram of the system………………………………………………..18

Figure 4.2 Power supply system using LM 7805 Voltage Regulator........................……20

Figure 4.3 Ripples on supply voltage…………………………………………………....21

Figure 4.4 Stable filtered dc voltage……………………………………………………..21

Figure 4.5 Physical dimensions of Ultrasonic sensor………………………………….…24

Figure 4.6 Speed varying using potentiometer……………………………………………25

Figure 4.8 Gear switching circuit……………………………………………….……..…..26

Figure 4.9 Determination of LED resistor…………………………………………….…..27

Figure 4.10 Transistor switching using BC337 Transistor……………………………….29

Figure 4.11 Hazard lighting system………………………………………………....…….30

Figure 4.12 Interfacing for switching of hazard lamps…………………………….…...…31

Figure 4.13 Atmega 328p pinouts with Arduino mapping……….…………….…..……..34

Figure 4.14 The Arduino control circuit………………………………….….…..….…….35

Figure 4.15 Circuit diagram for the prototype……………………………….…....………36

LIST OF PHOTOS

Photo 4.1 LM 7805 Voltage Regulator………………………………………………..…..20

Photo 4.2 HC-SR04 ultrasonic range sensor………………………………………………22

Photo 4.3 SG 90 Servo motor……………………………………………………………...33

Photo 5.1 Safety warning and braking action……………………………...…….…....…....39

Photo 5.2: Arduino Uno Programming and prototype development board............................41

x

LIST OF TABLES

Table :A1 System Components Requirements……………………………………………50

Table 4.1 Ultrasonic Sensor Specifications…………………….…………………………50

Table 4.2 Typical LED characteristics……………………………………………………51

Table 4.3 SG Servo motor specifications…………………………………..……………..51

OPERATION OF SYSTEM COMPONENTS

B1 Operation of HCSR04 Ultrasonic range sensor…………...…………….……………..52

B2 Operation of Hazard Lights…………………………………………………………….52

xi

ABBREVIATIONS AND ACRONYMS.

LCD…………………………………….………Liquid Crystal Display.

LED………………………………………….…Light Emitting Diode.

ABS ………………………….…………….…..Anti-Lock Brake System

GM………………………………….…….……General Motors

IO………………………………………….……Input-Output

DC……………………………………..……….Direct Current.

AC…………………………..………………….Alternating Current.

ADC…………………………….. …………….Analog to Digital Converter

PWM……………………………..……………..Pulse Width Modulated Signal.

LM…………… ………………………………Linear Monolithic

SONAR…………………………………….…..Sound Navigation and Ranging.

LH……………………………………..……….Left Hand

RH………………………………………….…..Right Hand

GND………………………………...…….……Ground

CHAPTER 1 INTRODUCTION

1

INTRODUCTION

CHAPTER 1

1.1 Background.

With the high increase in accidents as a result of an automobile colliding with another

automobile or obstacles, the problem of designing an intelligent system that will avoid such

scenario is gaining a lot of importance. In the past fewer automobiles were on highways and

streets, pedestrians were fewer and automobile collisions were a rare occurrence, Side mirrors

and Automobile warning Lights were sufficient to provide desired driving safety, however with

changing living standards and civilization automobiles are found on every road around the world.

This increase in traffic increases the mathematical probability of occurrence of a collision at any

instance. The solution to this lies in modifying or redesigning the current automobiles or

manufacture of vehicles to include collision evasion systems integrated in automobiles in order

to provide for collision evasion in case of an obstacle. Also automobiles should be designed to

automatically activate countermeasures through activation of braking systems and steering

control, this will serve important in minimizing and avoiding collisions.

1.2 Motivation

The need to contain the number and frequency of occurrence of automobile based collisions has

sparked a global desire to reduce the number of collisions. With increasing number of

automobiles on roads and rise in pedestrian population, drivers are expected to be more alert

while driving than in the past. Expensive damages in automobiles have to be checked and loss of

lives avoided.

The project proposes a prototype automobile crash prevention system that will be used to

demonstrate the capabilities of crash evasion system described herein in reduction of collisions

in automobiles, crash into solid structures and collision with pedestrians and animals along

highways and other types of roads. The system once implemented will be able to warn the driver

CHAPTER 1 INTRODUCTION

2

of obstacles ahead within unsafe distance, develop braking and implement steering control and

inform the driver on the same. The motivation behind automatic steering control is the existing

history of fatality of accidents being reduced upon the driver noticing possibility of collision and

steering the car in a safer direction, however pre-collision scenarios are usually instant and shock

causing, the driver might therefore fail to steer the automobile appropriately hence an automated

system is necessary. Braking will reduce automobile speed thus reducing force of impact during

crash. Warnings are necessary to provide appropriate signaling to drivers and other road users.

1.3 Problem Statement.

Automobile collision has become a major safety concern in the present world. Such collisions

lead to damage of automobiles and sometimes even the death of the crew on board. Cases of

pedestrians being knocked to death by automobiles is also on the rise in busy towns and

highways, Wildlife remains a precious investment and wild animals are constantly being

knocked by vehicles on highways passing through animal parks .This scenarios however have to

be avoided using a crash evasion system. In most cases drivers fail to notice the presence of

obstacles ahead and brakes too need a driver’s response to operate thus increasing the response

time, hence reducing their reliability.

This project aims at designing a system that is intelligent and capable of engaging precautionary

measures as it warns the driver upon risk of collision. The system proposed herein is a model

concept for coming up with an automatic, easy to integrate and cost effective electronic system

that will serve important in the reduction of collisions. Additionally the display features and

warning system will give the modern automobile a further internal beauty.

1.3.1 Sub Problem 1.

The sensing sub-system for obstacles and automobiles needs to be implemented.

1.3.2 Sub Problem 2.

Implement visual display sub-systems; LEDs and hazard lights and warning sub-systems using abuzzer for minimum distance.

CHAPTER 1 INTRODUCTION

3

1.3.3 Sub Problem 3.

Design output signal sources for automatically activate braking system and steering control.

1.4 Delimitations.

This project focuses on most important aspects and limits its scope as follows:

i. The system will be automatically engaged by the driver upon starting the automobile but

gives driver optional control to cater for short distance cruising, driving in confined

curved paths, under traffic control, parking or automobile testing.

ii. The speed control by braking will be automatic for purposes of collision evasion by the

implemented system and operated by the driver manually.

1.5 Assumptions.

This project is conducted basing on the following assumptions:

i. The system will detect obstacles whether in motion or stationary, animals, buildings and

any other objects.

ii. It is assumed that the driver will take over control of the automobile after, during or even

before automobile collision depending on their alertness and nature of situation at hand.

The system can thus be disengaged.

1.6 Project Methodology.

This project work is split into a number of phases to achieve the research objectives. The phases

followed are listed below.

i. A review of related literature on Automobile crash evasion systems.

ii. A review on related research works that have addressed crash evasion technology, review

is entirely on intelligent approaches to crash evasion.

iii. Design of the proposed system.

Based on the review of related work on crash evasion, a new crash evasion approach at

minimum cost in designed, the system is implemented based on microcontroller

CHAPTER 1 INTRODUCTION

4

technology and employs use of differential distance measurement using ultrasonic

sensors, a warning system based on audio sounding buzzer display system of LEDs,

activation of braking system, control steering for the purpose of collision evasion and

operation of hazard lights to warn of the danger of collision. The design of obstacle

detection system, development of control program for the controller, design of speed

simulator using potentiometer, transistor switching ,hazard lighting and LED systems was

performed.

iv. Possible simulation performance using proteus ISIS professional and development of

code using arduino platform for the control program.

v. Implementation of the design to produce a prototype crash safety car with auto crash

automobile evasion system is performed.

1.7 Benefit of the Project report.

The project brings benefit to the drivers, automobile owners, pedestrians, owners of property

vulnerable to crash into by vehicles and protection of wildlife. The repair costs for automobiles

will be greatly reduce if automobiles are fitted with the system since crash incidences will

reduce, the fatality of accidents will reduce hence fewer deaths due to accidents by reducing the

crash degree. Pedestrian and animal knocks will be eliminated through preventive braking;

property along highways for which drivers might unconsciously knock into will be protected

from knockdown.

1.8 Outline of the report.

In this section a brief overview of the chapters is presented.

Chapter 1 gives a brief introduction of the project and offers an overview of automobile crash

evasion systems. The background, motivation, problem statement, delimitations, assumptions,

project methodology and benefits of the project.

Chapter 2 discusses automobile crash evasion systems and their development.

CHAPTER 1 INTRODUCTION

5

Chapter 3 reviews related research works that have addressed crash evasion technology, with

special attention to intelligent approaches.

Chapter 4 Discusses the system design, design of peripherals, microcontroller selection and

desired system behaviour.

Chapter 5 Discusses system implementation, test points, program coding and simulation.

Chapter 6 Presents overview of project objective, project achievements, recommendation for

future work, project summary and conclusion.

CHAPTER 2 OVERVIEW OF AUTOMOBILE CRASH EVASION SYSTEMS

6

CHAPTER 2

OVERVIEW OF AUTOMOBILE CRASH EVASION SYSTEMS.

2.1 Introduction

Crash evasion system is an automobile safety system designed to reduce the possibility and

severity of an accident. These systems have evolved over time from the dumb systems to current

intelligent systems in operation and under research. Modern intelligent systems are also known

as precrash systems, forward collision warning systems or collision mitigating systems; they

use electronic circuitry coupled with distance sensors and sometimes camera sensors to detect an

imminent crash. Once the detection is done, these systems either provide a warning to the driver

when there is an imminent collision or take action autonomously without any driver input by

braking. According to [9],Collision prevention constitutes the first set of countermeasures that

assist the driver to better control the vehicle such as stability control systems, and to warn the

driver of an impending crash such crash warning systems. Crash severity reduction represents the

second set of countermeasures that act to mitigate the impact severity of crashes deemed

unavoidable by pre-crash sensing such as the use of enhanced crash-imminent automatic braking

systems. Occupant injury mitigation forms the third set of countermeasures that alleviate

potential severe injuries of an imminent impact by preparing crashworthiness systems using pre-

crash sensing such as next-generation air bags and advanced seat belts. Post crash is also part of

total vehicle safety in which appropriate emergency assistance is automatically summoned to

provide medical attention.

2.2 Trends in Automobile crash evasion safety systems.

2.2.1 Introduction.

There have been a number of approaches to minimize collisions by automobiles since the

invention of the first car.

CHAPTER 2 OVERVIEW OF AUTOMOBILE CRASH EVASION SYSTEMS

7

2.2.2 Automobile Brakes.

Brakes have been serving as manually operated collision evasion systems and have too evolved

through time. In automobile development, early braking systems to be used in vehicles with steel

rimmed wheels consisted of a block of wood and a lever system, by pulling the lever, this made

the wood block bear against the wheel thus providing braking, operation is illustrated in [1],in

1885,after steel wheels were replaced by rubber tyre,mechanical brakes were implemented in

automobiles in form of drum brakes explained in [3] ,the brakes played a rather subordinate role

because the friction in the drive train was so great that a vehicle was slowed sufficiently even

without the brakes being used. Increasing power and speed as well as constantly increasing

traffic density led to the consideration in the early 1920s of hydraulic braking systems which

were the invention by Malcolm Loughead in [1], providing an appropriate brake system that

could provide a counterbalance to greater power and driving performance. Later the advanced

wheel spin control systems were implemented providing a better braking and counterbalance.

But only after advances in electronics and microelectronics could systems be developed which

could react fast enough in emergency situations. The invention which was ancestor of the

electronic brake systems is the ABS, which, since its introduction in 1978, has been continuously

further developed and extended by additional functions. These functions intervene actively in the

driving process to increase driving stability. Currently, the trend in development is to driver

support systems such as the brake assist system. Since 2000, the brake assist system was

developed to support the driver in critical braking situations; the brake assist system supports the

driver when braking in emergency situations to achieve the shortest possible brake path while

maintaining steering ability. At Volkswagen, the hydraulic brake assist system is currently being

used in the 2002 Polo, the 2001 Passat and the D-class vehicle; this is discussed [2].

2.2.3 Side Mirrors.

These are visual aids that enable the driver to see vehicles coming from behind them and

obstacles on the rear of the automobile. Commonly side view mirrors and rear view mirrors are

used; side view mirrors once fixed require adjustments to give the correct view of obstacles. The

CHAPTER 2 OVERVIEW OF AUTOMOBILE CRASH EVASION SYSTEMS

8

rear view mirror is fixed on the windshield on a double swivel mounting to allow for

adjustments, allows the driver to see rearward through the vehicles backlight, description of

types is given in [4].The earliest known was in use in 1906, but first appearance was in 1911.In

[5], it is stated that in 1950’s anti-glare rear mirrors were developed to counter glare due to

headlamps of cars following from the back. Mirrors cannot operate in adverse weather conditions

like fog, mist and heavy rain thus the risk of collision with obstacles is high.

2.2.4 Car Turn signals, Brake Lights and Hazard Lights.

Car indicator lights/turn signals are used for safety when making turns so as to prevent accident

occurrence, this turn signals are also called directional signals they are used as turn signals. They

are supposed to be conspicuous both at night and in full daylight and not to dazzle those who

view them. Turn signals date back to 1907, [6] explains the evolution of turn signals, most

modern turn signal was patented in 1938 with reference to [6].Brake lights are also known as

stop lights and will indicate the coming road user of a stop in the vehicle in front, they are

activated when the driver applies the vehicles brakes, they are fitted symmetrically in two at the

left and right edges of the rear of every vehicle. Hazard Flashers are warning signs; they actuate

left and right directional signs, front and rear, all at the same time in phase. They are meant to

indicate a hazard such as a vehicle stopped in or near moving traffic so as to avoid collision, a

disabled vehicle, a vehicle moving substantially slower than the flow of traffic such as a truck

climbing a steep grade, presence of stopped or slow traffic ahead on a high speed road.

2.2.5 Intelligent automobile collision evasion systems.

With the aim of reducing injury and accident severity, intelligent pre-crash sensing and crash

evasion is becoming an area of active research among automotive manufacturers, suppliers and

universities. Several national and international projects have been launched over the last five

years to investigate new technologies for improving safety and accident prevention. In [7], it is

stated that vehicle accident statistics disclose that the main threats a driver is facing are from

collision with other vehicles or obstacles. Consequently, an on-board automotive driver

assistance system aiming to alert a driver about driving environments, and possible collision with

CHAPTER 2 OVERVIEW OF AUTOMOBILE CRASH EVASION SYSTEMS

9

other vehicles has attracted a lot of attention. In these systems, robust and reliable vehicle

detection is the first step; a successful vehicle detection algorithm will pave the way for collision

evasion. Vehicle based microcomputer safety systems or programmable controllers are thus

coming up, this illustrations are discussed in [7].Intelligent systems are used in three ways as

explained in art 2.1 above in [7] a detailed explanation is provided. The Most modern systems

provide for warning and braking. In [8] explanation is given on various implemented systems in

vehicles, currently this systems are the purview of luxury models. For the 2013 model year, Most

USA manufactured luxury vehicles had optional forward-collision warning and some of them

having autonomous braking. Forward collision warning is standard on the Acura ZDX, BMW

760i, Honda Crosstour AWD, Hyundai Equus, and Toyota Land Cruiser. A forward-collision

avoidance system is standard on the Mercedes-Benz G-Class, and City Safety is standard on

the Volvo S60, S80, XC60, and XC70.Subaru has an optional system that is relatively

affordable, called Eyesight, for the Legacy and Outback which initiates preventive braking,

GM’s collision alert system is featured in the 2012 GMC Terrain SUVs and uses a camera to

provide warning when there is a vehicle ahead or obstacle.

2.3 Need for the Automobile Crash Evasion systems.

Currently a lot research is being undertaken on crash evasion technologies for improving safety

and accident prevention. The need for collision safety started long in as discussed in [6],in

1880’s implementation of brakes in automobiles, later side mirrors were included and safety

lighting in form of turn lights, stop lights and hazard were incorporated in automobiles.

Intelligent systems too have attracted a lot of professionals to research into collision evasion,

intelligent systems providing warning signals and braking have been implemented and tested to

reduce collision risk.

The motivation for intelligent Crash Evasion systems is that once implemented they reduce the

number of fatalities and injuries on the roads. Crash evasion technology constantly evaluates a

driver's position as well as any objects on the road, in order to prevent or minimize damage that

may be caused by an accident. The associated costs of repair are thus avoided and pedestrian

safety guaranteed.

CHAPTER 2 OVERVIEW OF AUTOMOBILE CRASH EVASION SYSTEMS

10

2.4 Conclusion.

This chapter presented an overview and general introduction to Automobile crash evasion

systems, special interest was on the evolution and operation of the systems. The existing

systems of crash avoidance are discussed with the emphasis on their roles in reduction collision

and roles explained. There is need for more advanced intelligent collision evasion systems. In

the next chapter intelligent approaches are analyzed identifying their limitations and an

improved intelligent system which can be implemented at a low cost is proposed.

CHAPTER 3 LITERATURE REVIEW

11

CHAPTER 3

LITERATURE REVIEW.

3.1 Introduction.

In the recent past a number of crash evasion systems have been developed, this chapter reviews

related research works that have addressed evasion technology, review is entirely on intelligent

approaches to evasion.The methods of obstacle detection and corresponding countermeasures

are discussed for each system discussed. An earlier presentation on drive safety is discussed that

employed sonar sensors to provide a driver with warning, Systems using Laser beams and Radar

are discussed and their limitations stated, the proposed system is the introduced and its strengths

over its predecessors outlined.

3.2 Vehicle Safe Drive System.

This system was implemented as a research project at Masinde Muliro University of science and

technology in the year April, 2012; By Mwagudza Nyemi.As explained [16], it is a driver assist

system that enhances safety during the driving of an automobile. The vehicle safe drive System

is an embedded system that sought to minimize collision and damages when automobiles

especially vehicles are making reverse and forward movements and also when driving normally

on a highway without taking the precaution of maintaining the safe following distance on the

vehicle ahead. According to the discussion in [16], the vehicle safe drive system focused on two

main automobile maneuvers; Forward and reverse motion. Two range sensors were used, one for

forward and another for reverse. It detected obstacles when a minimum distance separation is

reached. It comprised of a number of subsystems. The obstacle and distance sensing subsystem

consisting of sonar range sensors, Warning system consisting of Blinking LEDS, an LCD to

display distance from obstacle and a buzzer to give a warning signal when the minimum

separation distance was reached, the system worked as an electronic drivers aid signaling the

driver the on presence of obstacles, the system makes the practice of driving much easier and

controlled by ensuring safe separation distances are maintained. This technology has been tested.

The system is however limited to detection of obstacles and giving warning signals, no

countermeasures are however automatically engaged to avoid collision.

CHAPTER 3 LITERATURE REVIEW

12

3.3 Evasion Systems Using Laser Beams

An example of this system is described in [9]; the paper describes a vehicle crash evasion system

using laser beams. First, the system estimates the position in which the vehicle will be 1 second

later, and projects it onto the road surface by laser beams. Second the system captures positions

of the each laser beams using a special camera installed in the vehicle. And the system calculates

the difference between the positions on normal roads and that of an abnormal road like an

obstacle on the road. As discussed in [10,] the driver too is provided with a display from the

camera for the 1 second reach displacement, driver is able to recognize their danger earlier by

projecting the position which the own vehicle will reach 1 second later as laser illuminated spots

on the road surface, drivers are also able to judge whether or not their vehicle is able to fit

through a narrow space and know if their car is going through the center of the lane by the

estimated area. The area consists twenty laser spots. In order to recognize dim projections during

the daytime in bright places, projection is captured using two filters; one for strengthening the

laser spotlight, and another for deleting. To extract edges from the picture which the laser spot is

emphasized Deriche filter is used as discussed in [11]. And the detected spot light edge forms

and difference of two pictures is analyzed .The researchers define the area, which consists of the

laser spots detected by the system as the detected area. Since their method is able to extract the

laser spots from difference of two pictures, the researchers assert that their system is effective in

many situations, such as head-on encounters at a blind corner, merging roads and changing lanes.

The validity of the system was evaluated on the basis of the detection rate of the laser beams, the

obstacle detection rate and the crash avoidance rate with other vehicles. The measurements as a

result of processing successive frames captured by a high resolution camera were obtained and

either used to provide warning signals for drivers or to be synthesized for use in actuating

braking. The Concept in similarity of this operation principle has been implemented as in the

case of Ford's Crash Warning with Brake Support, introduced in 2009 on the Lincoln MKS and

MKT and the Ford Taurus vehicles. This system provides a warning through a Head up Display

that visually resembles brake lamps. If the driver does not react, the system pre-charges the

brakes to enable preventive braking. Ford demonstrated its obstacle Avoidance technology

relying on a laser beams and camera sensors; this is explained in [10]. The most advantageous

CHAPTER 3 LITERATURE REVIEW

13

aspect of these systems is that they engage measures through braking to reduce possible of crash

in addition to giving signals of warning to the driver.

However in environments with high luminosity it was difficult to detect laser beams. Also

Vehicle detection based on optical sensors (camera and laser) is very challenging due to huge

within-class variabilities. Also lasers are dangerous for use in such an application because of

their harm to human beings, consideration of safety to the human eyes is thus a concern.

Additionally in cases where the other automobile(s) does not use laser, crash still can occur

especially in blind corners. The driver is expected to recognize their danger earlier by projecting

the position which their own vehicle will reach 1 second later as illuminated spots on the road

surface, this form of judgment is so fast for ordinary humans and might not work effectively

while cruising at even light speeds. Also the detection rate falls remarkably according to the

situation of a road surface, in rainy periods detection is with considerable noise factor thus

yielding false results in terms of automatic control. Lasers are expensive and continuous

operation will demand good power supply, this might be impossible to implement in ordinary

affordable cars and utility cars.

3.4 Crash Evasion Systems Using Radar systems.

Currently there are several crash evasion systems in use to enhance driver awareness and safety

based on radar. Most intelligent radar based systems utilize the millimeter radar for detection and

ranging. These systems were the earliest to be researched on, they use radar to monitor

automobiles ahead of the vehicle, and a warning is given to the driver if he gets too close to the

Vehicle ahead, also, in some systems hazard lights are flashed automatically as a warning to

drivers of vehicles in risk of crash, once the crash judgment computer judges that there is a high

risk of a crash. In illustrations provided in [12], Several Japanese-market cars and trucks are

equipped with such systems, while in America Eaton-VORAD produces front looking radar for

its crash warning system for heavy vehicles which have been installed on trucks and buses.

According to [12] Development continues in areas of human factors ;how to most effectively

indicate the level of threat to the driver and processing algorithms to correctly determine the

level of threat. It is stated that in the near future crash avoidance systems may automatically take

CHAPTER 3 LITERATURE REVIEW

14

corrective actions if the driver does not respond in time. An outline on Audi vehicles given in

[13], the system uses radar sensors and is used in crash evasion in Audi Sports Utility cars,

designed to reduce the consequences of crash; the system was introduced in 2010 on the

2011 Audi A8. The full version of the system:Pre-Sense Plus; works in four phases. In the first

phase, the system provides warning of an impending accident, while the hazard warning lights

are activated. In the second phase, the warning is followed by light braking, strong enough to

win the driver's attention. The third phase initiates autonomous partial braking at a rate of 3 m/s².

The fourth phase decelerates the car at 5 m/s² followed by automatic deceleration at full braking

power, roughly half a second before projected impact. In the article in [15], In March 2009, on

the Toyota Crown Majesta front-side millimeter-wave radar to detect potential crashes was

added, the system was to detect obstacles and warn the driver on time. As per [14], received the

radar based imminent braking. In the 2014 Chevrolet Impala Radar technology detects a possible

threat and alerts the driver. If the driver does not appear to react quickly enough or doesn’t react

at all, this feature intervenes to apply the brakes in an effort to avoid the crash. In [12] the

distance is calculated by dividing the distance to the vehicle approaching by the relative velocity,

Doppler’s effect in radar is the main principle employed in wave radar. In general, the size of

radar devices depends on the size of the antenna, and higher frequencies require smaller

antennas. Since the size of the radar sensor is critical for installation in various types of vehicles,

high-frequency 76 GHz millimeter wave radar is the standard adapted. This frequency has

already been allocated for vehicle-installed radars throughout the world. The millimeter wave

radar detects the distance, relative velocity, and directional angle of vehicles approaching with an

update cycle of approximately 20 msec, and transmits the detection data to the crash judgment

computer. The crash judgment computers contains a programmed microprocessor used in

conjunction with radar, the detection data from the millimeter wave radar is send to the

computers processor to calculate the estimated paths of vehicles approaching or in vicinity.

Radar based crash evasion system provide for detection of obstacles and warning the driver

appropriately, in some car models the system controls the braking of automobiles thus reducing

severity of an accident. However there are cases when the oncoming obstacle vehicle is

persistent or the driver out of shock loses consciousness and is unable to steer the automobile,

the systems implemented on radar do not provide for steering control and do not provide for

CHAPTER 3 LITERATURE REVIEW

15

activation of the brake assist systems which reduce the braking effort needed by the driver. Radar

systems too are expensive technology to implement on cars thus remains a preserve for luxury

vehicles only.

3.5 The Automobile Crash Evasion System proposed.

The Automobile Crash Evasion system proposed in this project aims to implement an intelligent

microcontroller based Evasion System that will employ obstacle detection by use of ultrasonic

sensors an distance measurement using ultrasonic sensors to detect obstacles and their distances.

Once the obstacle has been detected and safe separation distance is not provided, the automobile

will perform safety braking if the driver does not react, the system pre-charges the brakes and

increases the brake assist sensitivity to maximize driver braking performance braking, further

decrease in separation distance will cause the system to initiate steering control so as to reduce

the severity of the crash, the steering direction will be determined by the traffic on each lane but

away from the direction of the obstacle. A warning signal is provided to the driver to alert them

before the system takes automobile cruising into control by steering. Hazard lights are turned ON

the moment a possibility for crash is detected and Brake lights are turned ON after activation of

the brake assist system and the brakes which are preferably ABS. Dash board displays on LCD

and LEDs are incorporated to make the system more interactive. The system can be disabled by

the driver when they find need to operate the automobile without it. As opposed to Radar

systems which are too expensive technology to implement on cars thus remaining a preserve for

luxury vehicles only, Ultrasonic detection is an affordable implementation that can be used in

any automobile. The proposed system further provides a signal for steering control which is not

provided for in earlier versions of Crash Evasion systems employing radar and laser. The

ultrasonic sensor works at a frequency ranges of 40-60Khz depending on the specific model,

this burst is harmless to humans and living things, Laser method is dangerous to the eyes and

therefore ultrasonic sensors proves to be advantageous. The use of ultrasonic sensors can be

applied to detect any obstacle and have a relatively inexpensive cost; hence a low cost

implementation is possible, light weight, low power consumption, and low computational effort,

compared to other ranging sensors. In some applications, such as in rainy, foggy, misty and low-

visibility environments, ultrasonic is often the only viable sensing modality. The proposed

system is also easy to integrate in both new and old automobiles.

CHAPTER 3 LITERATURE REVIEW

16

3.6 Conclusion

In this chapter, I reviewed the related research works that have addressed evasion technology,

and corresponding crash evasion measures adopted by each upon the danger of crash. A

discussion on the earlier presentation on drive safety is discussed that employed sonar sensors to

provide a driver with warning, Systems using Laser beams and radar have been discussed in

detail discussed and their limitations stated, the proposed system was introduced and its strengths

over its predecessors outlined. The next chapter presents the design and implementation details

of the proposed Crash Evasion system. Components selection and circuit parameters

determination through design is explained with the objective of arriving at a low cost and easy to

integrate Crash Evasion System.

CHAPTER 4 DESIGN OF THE AUTO CRASH AUTOMOBILE EVASION SYSTEM

17

CHAPTER 4

DESIGN OF THE AUTO CRASH AUTOMOBILE EVASION SYSTEM.

4.1 Introduction.

There is a high increase in accidents as a result of automobiles colliding with stationary or

dynamic obstacles. The solution to this lies in modifying or redesigning the current automobiles

to include crash collision evasion systems.

This chapter focuses on the design of the proposed automobile crash evasion system. The

chapter is structured as follows, a presentation of the block diagram of the system is done, and

the design of system blocks is performed and finally integrated in a complete circuit diagram for

the prototype.

4.2. Block Diagram.

Fig 4.1b below is a block diagram of the auto crash automobile evasion system.

Fig 4.1 a: Generalized Block diagram.

Power Unit.

Ultrasonic sensors.

Output devices.

LEDs

Buzzer.

Servo motors.

Hazard Lamps.Speed encoder.

Input Sensors.

Gear switch.

Control subsystem

Atmega 328p on ArduinoSteering Control.

Braking system.

CHAPTER 4 DESIGN OF THE AUTO CRASH AUTOMOBILE EVASION SYSTEM

18

Fig 4.1b; Block diagram of the auto crash automobile evasion system.

12V D.c

LCD Module

Servo Motor

FowardUltrasonic

Sensor

VoltageRegulator

Servo Motor

ReverseUltrasonic

Sensor

Buzzer

PWM based Brakingand Braking assist

Servo BasedSteering Control

LED Displays

Hazard Lights ON

Steering Control ON

Braking System Engaged

RH motion indicator

LH motion indicator

Power Indicator

Direction control

Speed encoder

+5 V

Microcontroller

(Atmega328p)

12V D.c

+5 VVoltage

Regulator

S1pole 1.

S1pole 2.

CHAPTER 4 DESIGN OF THE AUTO CRASH AUTOMOBILE EVASION SYSTEM

19

The block diagram above Comprises;

i. Power supply Unit which takes 12V dc from car battery and supplies 5V dc to

microcontroller sensors and Output devices.

ii. Range sensing subsystem having forward and reverse ultrasonic range sensors for

distance measurement.

iii. Speed Sensing subsystem for encoding the automobile speed.

iv. Direction control sensing system for detection forward and reverse motion.

v. Servo motor control for swinging sensors and steering control.

vi. Warning subsystem consisting of Buzzer, Hazard Lights, LCD and LED displays to

provide warning signals to driver of vehicle, other drivers and/or road users.

vii. Braking subsystem having control for brakes and brake assist for braking purposes.

viii. Steering control subsystem for automatic control of steering wheel in the case of

occurrence of a collision risk.

4.3 Design of System.

In this design, the process comes up with the desired system, the system power supply is

designed, designs for the obstacle detection and sensing subsystem are performed, the

microcontroller is selected and programming platform chosen, and output transistor switching

and interfacing design for LEDS is performed. Interfacing a servo motors for use swinging of

range sensors and in steering control is discussed and interfacing design explained. Hazard

lighting system is designed. Design of speed and direction simulation system is also performed.

Once packaged into a single system; the prototype will simulate a model collision evasion safety

car implementable at low cost and easy to install and integrate in automobiles.

4.3.1 The power supply system.

The power supply system designed is to supply to the microcontroller and the buzzer, LCD and

LEDs with the desired voltage. The system operates at a voltage of 5Vdc.Therefore from a

voltage source of (9-12V) dc in our case 9V battery will be used to power the prototype, however

CHAPTER 4 DESIGN OF THE AUTO CRASH AUTOMOBILE EVASION SYSTEM

20

a 12V car battery can replace the 9V without circuit modifications since the input voltage range

limits for any practical application are 5-12v .a voltage regulator is used to give standard stable 5

volts dc, However the regulated output usually will vary between 4.8-5.2v.

Photo 4.1: LM 7805 Voltage Regulator.

Fig 4.2 : Power supply system using LM 7805 Voltage regulator.

Fig 4.2 is the power supply systems for 5V d.c.To ensure stability of the voltage to the system

capacitors are used to chop off the ripples developed on the DC voltage converted from AC

voltage.

For heat sinkmounting

Pin Connections

CHAPTER 4 DESIGN OF THE AUTO CRASH AUTOMOBILE EVASION SYSTEM

20

a 12V car battery can replace the 9V without circuit modifications since the input voltage range

limits for any practical application are 5-12v .a voltage regulator is used to give standard stable 5

volts dc, However the regulated output usually will vary between 4.8-5.2v.

Photo 4.1: LM 7805 Voltage Regulator.

Fig 4.2 : Power supply system using LM 7805 Voltage regulator.

Fig 4.2 is the power supply systems for 5V d.c.To ensure stability of the voltage to the system

capacitors are used to chop off the ripples developed on the DC voltage converted from AC

voltage.

For heat sinkmounting

Pin Connections

CHAPTER 4 DESIGN OF THE AUTO CRASH AUTOMOBILE EVASION SYSTEM

20

a 12V car battery can replace the 9V without circuit modifications since the input voltage range

limits for any practical application are 5-12v .a voltage regulator is used to give standard stable 5

volts dc, However the regulated output usually will vary between 4.8-5.2v.

Photo 4.1: LM 7805 Voltage Regulator.

Fig 4.2 : Power supply system using LM 7805 Voltage regulator.

Fig 4.2 is the power supply systems for 5V d.c.To ensure stability of the voltage to the system

capacitors are used to chop off the ripples developed on the DC voltage converted from AC

voltage.

For heat sinkmounting

Pin Connections

CHAPTER 4 DESIGN OF THE AUTO CRASH AUTOMOBILE EVASION SYSTEM

21

The input capacitor Ci is used to cancel the inductive effects associated with lower power

distribution leads. The Output capacitor Co improves transient response. The Two capacitors

thus smoothen ripples so as to have a smooth output, thus keep steady power and decouple parts

of the circuits.

Fig 4.3.Ripples on supply voltage.

Shown below is the filtered dc output.

The constant output is obtained by filtering using capacitors.

Fig 4.4 Stable filtered dc voltage.

+V

-V

Time

Constant magnitude filtered dc voltage.

CHAPTER 4 DESIGN OF THE AUTO CRASH AUTOMOBILE EVASION SYSTEM

21

The input capacitor Ci is used to cancel the inductive effects associated with lower power

distribution leads. The Output capacitor Co improves transient response. The Two capacitors

thus smoothen ripples so as to have a smooth output, thus keep steady power and decouple parts

of the circuits.

Fig 4.3.Ripples on supply voltage.

Shown below is the filtered dc output.

The constant output is obtained by filtering using capacitors.

Fig 4.4 Stable filtered dc voltage.

+V

-V

Time

Constant magnitude filtered dc voltage.

CHAPTER 4 DESIGN OF THE AUTO CRASH AUTOMOBILE EVASION SYSTEM

21

The input capacitor Ci is used to cancel the inductive effects associated with lower power

distribution leads. The Output capacitor Co improves transient response. The Two capacitors

thus smoothen ripples so as to have a smooth output, thus keep steady power and decouple parts

of the circuits.

Fig 4.3.Ripples on supply voltage.

Shown below is the filtered dc output.

The constant output is obtained by filtering using capacitors.

Fig 4.4 Stable filtered dc voltage.

+V

-V

Time

Constant magnitude filtered dc voltage.

CHAPTER 4 DESIGN OF THE AUTO CRASH AUTOMOBILE EVASION SYSTEM

22

4.3.2 Range Detecting Sub-System.

4.3.2.1 Introduction.

The distance detection mechanism the is made up of range ultrasonic sensors. The HC-SR04

ultrasonic sensor modules are used in this project. The range sensor uses sonar to determine

distance. In [17] it is stated that HC-SR04 offers excellent range accuracy and stable readings in

an easy-to-use package. It operation is not affected by sunlight or black material like IR range

sensors.

Photo 4.2: HC-SR04 Ultrasonic range sensor.

Ultrasonic ranging module HC - SR04 modules includes ultrasonic transmitters, receiver and

control circuit.

Table 4.1 included herein gives the specifications for the sensor as provided in [17].

4.3.2.2 Power and Signal Connections.

Wire connecting for the ultrasonic sensor modules direct as following in [17][18]:

VCC Connected to 5V Supply.

Trig which is Trigger Pulse Input Connected to microcontroller digital input/output pin.

Echo which is Echo Pulse Output Connected to microcontroller digital input/output pin.

GND Connected to 0V Ground.

CHAPTER 4 DESIGN OF THE AUTO CRASH AUTOMOBILE EVASION SYSTEM

23

4.3.2.3 Distance calculation.

The time of high output IO duration is captured which represents the time from sending

ultrasonic to returning.

Since sound travels at a velocity of 340m/s in air or 1130 feet per second.= ℎ ℎ /2 4.1

Division by two is because the high time includes sending time to object and receiving time for

the echo.

Temperature adjustments are given by the formula:

c = 331.5 + 0.6 * [air temperature in degrees Celsius]

At 20°C, = 331.5 + 0.6 ∗ 20 = 343.5 / 4.2

Instead of using the Speed of Sound, we can also use the "Pace of Sound" as described in [18].ℎ =1

4.3

= . = 29.1 µ / 4.4

Therefore,

= ℎ ℎ 2 1 .4.5

4.3.2.4 Code for arduino.

This code section illustrates the ranging by the ultrasonic sensors.

#define trigPin 7 //setting pin for trigger pin#define echoPin 8 //setting pin for echo pin and signalpinMode (trigPin, OUTPUT); /setting trigger pin as outputpinMode (echoPin, INPUT); /setting echo pin as input

digitalWrite (trigPin, LOW) ; //first setting low pulse to obtain a clean high pulse

delayMicroseconds (2);

CHAPTER 4 DESIGN OF THE AUTO CRASH AUTOMOBILE EVASION SYSTEM

24

digitalWrite(trigPin, HIGH);

delayMicroseconds(10);

int duration, distance; //variable declaration

duration = pulseIn(echoPin, HIGH); //pulseIn function is used for capturing time duration as a high pulse

distance= (duration/2)/29.1; //calculation of distance in cm using pace of sound

4.3.2.5 Physical dimensions.

Fig 4.5 : physical dimensions of Ultrasonic sensor .

4.3.4 Speed Encoding subsystem and Gear shifting encoder.

4.3.4.1 Design of Vehicle Speed Variation Using Potentiometer for speed encoding.

To simulate the speed of an automobile during forward movement, I use a potentiometer to

illustrate speed variation as resistance is varied. Below 10Km/h the system will understand that

the vehicle is making slow forward maneuvers. Above 10km/h the system will understand that

the vehicle is moving on a highway.

CHAPTER 4 DESIGN OF THE AUTO CRASH AUTOMOBILE EVASION SYSTEM

25

To simulate speed on the potentiometer, the 10K ohms are distributed over (0-5) volts with

0 Ohms having 0V and 10K having 5V.to vary the speed upto 180km/h the voltage input to the

microcontroller is multiplied by a factor 36 i.e. for maximum voltage, speed is, 36*5=180.

The microcontroller has a digital to analog converter which has 1024 steps, thus the 0-5V is

mapped into 0-1024 steps.

Fig 4.6 Speed varying using potentiometer.

Since Vs=5V; 4.6= (%) 5 ; 4.7

Therefore; the arduino code will contain the following section for speed,

speedValue = analogRead(speedpin);

voltage= speedValue*5/1024;

Speed =voltage*36; // in Km/h.

4.3.4.2 Design and Interfacing the Gear switching for direction detection.

The switching subsystem lets the microcontroller to know whether the vehicle is moving on

reverse or forward movement. It consists of a switch connected to the analog pin as shown in the

CHAPTER 4 DESIGN OF THE AUTO CRASH AUTOMOBILE EVASION SYSTEM

25

To simulate speed on the potentiometer, the 10K ohms are distributed over (0-5) volts with

0 Ohms having 0V and 10K having 5V.to vary the speed upto 180km/h the voltage input to the

microcontroller is multiplied by a factor 36 i.e. for maximum voltage, speed is, 36*5=180.

The microcontroller has a digital to analog converter which has 1024 steps, thus the 0-5V is

mapped into 0-1024 steps.

Fig 4.6 Speed varying using potentiometer.

Since Vs=5V; 4.6= (%) 5 ; 4.7

Therefore; the arduino code will contain the following section for speed,

speedValue = analogRead(speedpin);

voltage= speedValue*5/1024;

Speed =voltage*36; // in Km/h.

4.3.4.2 Design and Interfacing the Gear switching for direction detection.

The switching subsystem lets the microcontroller to know whether the vehicle is moving on

reverse or forward movement. It consists of a switch connected to the analog pin as shown in the

CHAPTER 4 DESIGN OF THE AUTO CRASH AUTOMOBILE EVASION SYSTEM

25

To simulate speed on the potentiometer, the 10K ohms are distributed over (0-5) volts with

0 Ohms having 0V and 10K having 5V.to vary the speed upto 180km/h the voltage input to the

microcontroller is multiplied by a factor 36 i.e. for maximum voltage, speed is, 36*5=180.

The microcontroller has a digital to analog converter which has 1024 steps, thus the 0-5V is

mapped into 0-1024 steps.

Fig 4.6 Speed varying using potentiometer.

Since Vs=5V; 4.6= (%) 5 ; 4.7

Therefore; the arduino code will contain the following section for speed,

speedValue = analogRead(speedpin);

voltage= speedValue*5/1024;

Speed =voltage*36; // in Km/h.

4.3.4.2 Design and Interfacing the Gear switching for direction detection.

The switching subsystem lets the microcontroller to know whether the vehicle is moving on

reverse or forward movement. It consists of a switch connected to the analog pin as shown in the

CHAPTER 4 DESIGN OF THE AUTO CRASH AUTOMOBILE EVASION SYSTEM

26

diagram below. The illustration below is used for basic forward and reverse gear encoding.

Fig 4.8: Gear switching circuit.

When the switch is closed the pin state is HIGH and when open the pin state is LOW i.e.

connected to ground through the pull down resistor. Therefore the two states can be used to

assign the forward and reverse code execution. The rear end collision prevention thus prevents

collision from the automobile rear end.

The code for reverse and forward is extracted and briefly commented against as shown below,

const int buttonPin = 2; //declaring pin for input of button state and variable type

int buttonState = 0; //initializing button state for stability of readings

pinMode(buttonPin, INPUT); //setting the pin as an input

buttonState = digitalRead(buttonPin); //command for reading button state

4.3.5 Warning Subsystem.

4.3.5.1 Introduction.

This subsystem comprises of LEDs, Buzzer and a Hazard Lights.

4.3.5.2 Design and Interfacing for LEDs.

LEDs are operated from a low voltage DC supply, with a series resistor to limit the forward

current to a suitable value from say 5-6mA for a simple pilot lamp or status indicator application

+5V

Gear Switch

10K

Digital Pin

Gnd

CHAPTER 4 DESIGN OF THE AUTO CRASH AUTOMOBILE EVASION SYSTEM

27

to 20mA or more where more light output is needed as per [18] . A series resistor is needed and

its value is easily worked out knowing the required operating current I, the supply voltage and

the LED’s forward voltage drop at this current level.

The approximate current required to pass through an LED for normal operation is 15mA as per

[19] [20]. Using the following circuit we are able to come up with the following value of

resistance.

Fig 4.9: Determination of LED resistor.

Since; Vs is supply voltage, = 5 4.8

But supply drops across LED and RL, thus,5 = + 4.9

But;= 4.10Thus; = (5 − )/ 4.11

The value of current through LED being 20mA in our case.

Table 4.2 included herein gives the calculated values of limiting resistors for various LEDs as

used in this project, each coluor has its own voltage drop according to [20].

From the table 4.2 the desired resistor values for various LED colours is as listed below.

+5V

Gnd

RL

Analog Pin

VRL

VLED

5VLED

CHAPTER 4 DESIGN OF THE AUTO CRASH AUTOMOBILE EVASION SYSTEM

28

Red Led is powered through RL =220 Ohms.

Orange Led is powered through RL=220 Ohms.

Yellow Led is powered through RL=180 Ohms.

Green Led is powered through RL=180 Ohms.

Blue Led is powered through RL=100 Ohms.

White Led is powered through RL=100 Ohms.

LEDs are either driven in this project directly from 5V for power indicator, from 5V digital

input/output pins for status indication or by a body microcontroller as for the case of Hazard

lighting.

4.3.5.3 The electric buzzer and switching transistor.

The electric buzzer is the audible warning system that gives a warning signal at variable rates

depending on the detected range of the obstacle.

The electric buzzer is switched ON/OFF by BC 338 Transistor which acts as a switch.

Two operating points exist and are utilized which are;

The cut-off state which the collector Current is cut off IB=0.

The Collector-Emitter Saturation Voltage IC=500mA, IB=5OmA.

The interfacing of the transistor is shown below. The connection of the buzzer in the switching

circuit is as indicated in this diagram.

Rb

Buzzer

5V

GND

Analogpin.

BC 337 Transistor.

CHAPTER 4 DESIGN OF THE AUTO CRASH AUTOMOBILE EVASION SYSTEM

29

Fig 4.10: Transistor switching using BC 337 Transistor.

To Get Rb We use the formula. = / 4.12

Therefore = / 4.13

Therefore we need to know the value of Rb at saturation state, then using the transistor

parameters at saturation state we have: From datasheets that;

Ib=500 mA and Ib=50mA.

And, Vs = 5V 4.14

Therefore;= 5 /50 =100Ω. 4.15

The Buzzer operates at voltages of 3V-24V dc and in this project 5V dc is used.

The buzzer code excerpt is as shown below;

digitalWrite (ledPin, HIGH); //to turn on transistor hence buzzer

The buzzer is turned on by the control program when the distance required between automobiles

is less than recommended.

4.3.5.4 Design of Hazard Lights.

Hazard lights are controlled by a body microcontroller that is supplied with signals from the

main microcontroller; body computer here is implemented as body microcontroller.

The signal supplied for control of hazard light s is PWM for the following reasons;

To allow for different rates of hazard lights flickering depending on the level of danger

imposed, this is possible by use of varying signal rates send to the body microcontroller.

CHAPTER 4 DESIGN OF THE AUTO CRASH AUTOMOBILE EVASION SYSTEM

30

To allow for control of hazard light brightness depending on the level of risk of crash.

A component of interest in design is the optocoupler for switching ON the hazard lights;

Optocoupler is also called optoisolators and provides electrical separation between devices. They

assist in switching higher voltages from low voltage values. This isolation allows devices that

operate with different voltage levels to work safely together.Optocouplers are safer in protecting

the controller as compared to the relay and transistor. The use light to perform switching of a

secondary controlled circuit. The primary circuit controlling the switching derives its signals in

form of digital pulses from a microcontroller.

Fig 4.11; Hazard lighting system.

From the diagram below, design is done for protective resistors R1 and R2 for optocoupler

4N25.

MainMicrocontroller.

BodyMicrocontroller.

PWM signal.

5V dc supply.

OptocouplerSwitching

Unit.

FowardHazardLights.

RearHazardLights.

RHfoward.

LHfoward.

RH rear.

LH rear.

5V dcsupply.

12 Vdc supply.

CHAPTER 4 DESIGN OF THE AUTO CRASH AUTOMOBILE EVASION SYSTEM

31

Fig 4.12: Interfacing for switching of hazard lamps.

In obtaining the value of R1,

We, know that, = 5 , 4.16

But, Vs drops across R1 and the IR Led, thus,= 1 + , 4.17

Therefore, 1 = − , 4.18

But we know that, = 1, 4.19

Thus; 1 = ( − )/ 4.20

This thus gives the value of R1.

In our case,

We have = 5 , 4.21for IR Led; = 1.8 . 4.22

CHAPTER 4 DESIGN OF THE AUTO CRASH AUTOMOBILE EVASION SYSTEM

31

Fig 4.12: Interfacing for switching of hazard lamps.

In obtaining the value of R1,

We, know that, = 5 , 4.16

But, Vs drops across R1 and the IR Led, thus,= 1 + , 4.17

Therefore, 1 = − , 4.18

But we know that, = 1, 4.19

Thus; 1 = ( − )/ 4.20

This thus gives the value of R1.

In our case,

We have = 5 , 4.21for IR Led; = 1.8 . 4.22

CHAPTER 4 DESIGN OF THE AUTO CRASH AUTOMOBILE EVASION SYSTEM

31

Fig 4.12: Interfacing for switching of hazard lamps.

In obtaining the value of R1,

We, know that, = 5 , 4.16

But, Vs drops across R1 and the IR Led, thus,= 1 + , 4.17

Therefore, 1 = − , 4.18

But we know that, = 1, 4.19

Thus; 1 = ( − )/ 4.20

This thus gives the value of R1.

In our case,

We have = 5 , 4.21for IR Led; = 1.8 . 4.22

CHAPTER 4 DESIGN OF THE AUTO CRASH AUTOMOBILE EVASION SYSTEM

32

1 = (5 − 1.8)/15 4.231 = 213Ω 4.24

Therefore, we select 1 = 220Ω. 4.25

The value of R2 is given as;

From datasheet, current through transistor is given as 20% current transfer ratio;R2=4.7KΩ is

preferred for supply from a 12V battery rated at 600mA.This limiting resistor to ensures 120mA

flows through the opt-couplers transistor.

4.3.6 Servo Motors.

They are also called control motors and have high torque capabilities. Unlike large industrial

motors, they are not used for continuous energy conversion but only for precise speed and

precise position control at high torques. Of course their basic principle of operation is the same

as that of other electromagnetic motors; however their construction, design and mode of

operation are different. Due to their low inertia they have high speed of response.

They generally operate at very low speeds or sometimes zero speed. The D.C servomotors are

either separately excited DC motors or permanent magnet DC motors .The speed of dc motors is

normally is normally controlled by varying the armature voltage.

In this project I use the SG-90 micro servo can be easily interfaced easily using arduino IDE.

Making it easier for various industrial and home applications. SG-90 has the pinouts as in its

image, photo 4.3 below.

The servo used has a shaft torque of 1.6Kg/cm which is sufficient to sway the 8gms SR04

ultrasonic ranger in either direction.

CHAPTER 4 DESIGN OF THE AUTO CRASH AUTOMOBILE EVASION SYSTEM

33

Photo 4.3; SG 90 Servo motor.

4.3.7 The Microcontroller Selection.

In this project Atmega 328p microcontroller is used.

The choice of the controller is because of the following reasons;

Easy to program with high level language programming using C, C++ and Java.

It has relatively 13 digital and 5 analog pins thus more inputs and outputs taken.

Has 6 PWM channels hence direct output into hazard and braking subsystems.

Has relatively high memory capacity.

Has inbuilt ADCs which makes it easy to interface with analog inputs band on board

encoders.

CHAPTER 4 DESIGN OF THE AUTO CRASH AUTOMOBILE EVASION SYSTEM

34

Fig 4.13: Atmega 328p Pin outs with Arduino Mapping.

The microcontroller is connected so as to come up with an arduino circuit, which runs on the

loaded program in Flash memory to perform the desired functions.

4.3.8 The Control subsystem.

The control subsystem consists of the arduino circuitry controlled by a program loaded in its

memory. The arduino circuitry consists of an Atmega 328p microcontroller chip, a 16Mhz

crystal oscillator, two 22 pF capacitors and a reset button.

The 16 MHz crystal is used for timing, the reset button is used to reset the microcontroller to

upload a new program or to start running the existing program from the beginning.

CHAPTER 4 DESIGN OF THE AUTO CRASH AUTOMOBILE EVASION SYSTEM

34

Fig 4.13: Atmega 328p Pin outs with Arduino Mapping.

The microcontroller is connected so as to come up with an arduino circuit, which runs on the

loaded program in Flash memory to perform the desired functions.

4.3.8 The Control subsystem.

The control subsystem consists of the arduino circuitry controlled by a program loaded in its

memory. The arduino circuitry consists of an Atmega 328p microcontroller chip, a 16Mhz

crystal oscillator, two 22 pF capacitors and a reset button.

The 16 MHz crystal is used for timing, the reset button is used to reset the microcontroller to

upload a new program or to start running the existing program from the beginning.

CHAPTER 4 DESIGN OF THE AUTO CRASH AUTOMOBILE EVASION SYSTEM

34

Fig 4.13: Atmega 328p Pin outs with Arduino Mapping.

The microcontroller is connected so as to come up with an arduino circuit, which runs on the

loaded program in Flash memory to perform the desired functions.

4.3.8 The Control subsystem.

The control subsystem consists of the arduino circuitry controlled by a program loaded in its

memory. The arduino circuitry consists of an Atmega 328p microcontroller chip, a 16Mhz

crystal oscillator, two 22 pF capacitors and a reset button.

The 16 MHz crystal is used for timing, the reset button is used to reset the microcontroller to

upload a new program or to start running the existing program from the beginning.

CHAPTER 4 DESIGN OF THE AUTO CRASH AUTOMOBILE EVASION SYSTEM

35

. Fig 4.14: The Arduino control circuit.

4.4 circuit diagram

By combining the various components designed in this chapter, the circuit diagram can beobtained as drawn below.

RESET0

234VCCGND

XTAL 1

XTAL 2

5678

012345

GNDAREFAVCC

910111213

22pF

22pF

16 Mhz Crystal

Reset Button

+5V

1

CHAPTER 4 DESIGN OF THE AUTO CRASH AUTOMOBILE EVASION SYSTEM

36

Fig 4.15: Circuit diagram for the Auto crash automobile evasion system.

Optocoupler.

SR04

SERVOMOTOR

Wambasi Fred Butete

TitleNo

Name:

Circuit diagram

Drw 001 DATE MAY

RESET

1234VCCGND

XTAL 1

XTAL 2

5678

012345

GNDAREFAVCC

910111213

22pF

22pF

16 Mhz Crystal

Reset Button

IN OUT

GND

IN OUT

GND

0

SR04

SERVOMOTOR

Buzzer.

Steering control

PWM Brake Signal.

RED LED GREEN LED

BC337100Ω

220Ω

180Ω

180Ω

220Ω

220Ω

10KΩ

220Ω

HazardLamp

4.7KΩ

10KΩ

RED LED

RH-RED LED

LH-RED LED

GREEN LEDHazard Internal

Indicator

1µF 1µF 22µF22µF

10KΩPot

S2S1

GEAR S3

+12V

+5VLM 7805LM 7805

+5V

Trig

Echo

Trig

EchoVCC

VCC

CHAPTER 4 DESIGN OF THE AUTO CRASH AUTOMOBILE EVASION SYSTEM

37

4.5 Conclusion.

This chapter started with the presentation of the block diagram of the system followed by the

design of various components, namely; power subsystem, switching transistor and buzzer

warning subsystem, gear simulation, speed simulation subsystem, range detection subsystem,

design for LED indicator sub systems, servo motor selection, hazard lights and the control

circuit. Finally the various subsystems were combined into a single functional circuit diagram.

The next chapter deals with the operation of the system, test points and test results as well as

program coding.

CHAPTER 5 OPERATION, TESTING AND PROGRAM CODE.

38

CHAPTER 5

OPERATION, TESTING AND PROGRAM CODE.

5.1 Introduction.

This chapter focuses on the operation of the auto crash automobile evasion system, the test points

on the implemented circuit and the program coding.

5.2 Operation.

The system obtains its input from three input sensors;

A gear switch which determines either forward or reverse motion. By switching to either

forward or reverse, the microcontroller will assume either forward or reverse motion of

the automobile.

A speed simulator, herein implemented as a rotary potentiometer on a calibrated scale of

0-180Km/h, by rotating this switch the system reads this range of speeds as automobile

speed.

Two ultrasonic sensors, one in front and another at the back to cater for rear end

collisions. The ultrasonic sensors will measure distance and feed a pulse into the

microcontroller which will judge the distance as either safe or unsafe and engage proper

countermeasures.

The ultrasonic sensors are swayed through 180° by servo motors when the separation distance

between the automobile and obstacle is less than 30 m so as to determine which direction is safer

to cruise. The direction with fewer obstacles at a far distance is the safest to cruise to.

The system will warn and engage counter measures under the following circumstances;

When the obstacle is more than 70m away and the automobile is driving more than a

speed more than 80Km/h the a green LED which acts as an on board indicator lights to

indicate safe distance but overspeeding.However more than 70m and speed less than

80Km/h a white LED lights to indicate safe driving.

CHAPTER 5 OPERATION, TESTING AND PROGRAM CODE.

39

When the obstacle is at distance between 50m-69m from the automobile, a blue LED

lights to inform the driver of unsafe driving distance of separation. An internal buzzer is

turned on to warn the driver. If speed is more than 50Km/h brake assist is enabled.

At a distance of between 30m-49m, red LED lights indicating unsafe distance and hazard

lights are turned on. The buzzer however remains on. If speed is more than 50Km/h,

safety braking is automatically applied at a controlled rate using PWM signal by the

microcontroller. Speed is reduced to 15Km/h.

At a distance less than 30m, the ultrasonic sensors are swayed 180° in either direction by

servo motors to determine the safest direction to cruise to so as to evade collision, the

servo based steering is then steered appropriately,LH(left turn) or RH(right turn

indicators) are enabled at this stage depending on direction of safety manoeuvre. The

buzzer is stopped but hazard lights rate of flashing slightly increases. This step enables

crash evasion, thus reducing crash severity of avoiding crash completely.

Photo 5.1: Safety warning and braking action.

CHAPTER 5 OPERATION, TESTING AND PROGRAM CODE.

40

5.3 Test Points.

The various test points and results are as indicated in table 5.1 below.

STAGE PURPOSE TEST TESTING

EQUIPMEN

T

OUTPUT COMMENTS

Power supply

Implementation

Voltage output

measurement

Voltage

test

Multimeter 5.05V Within expected

range

Microcontroller Voltage and

current

input/output

measurement

Voltage

and

Current

tests

Multimeter Input.

5.04V,10.0mA

Output.

4.70V,

3.97mA.

The Voltage and

current within

expected range.

Transistor

switch

implementation.

Cut off Current,

Cut off Voltage.

Saturation

Voltage.

Current

and

voltage

tests.

Multimeter Cut off state

0.0A,0.0V,

Saturation,

0.86V

Operate perfectly as

a switch.

Warning

subsystem

implementation.

Output voltage

measurement at

digital pins

Voltage

test

Multimeter. 4.97V Within expected

range of approx,

Vs=5V.

Potentiometer

input range.

Input voltage

measurement at

analog pin.

Voltage

measure

ment.

Multimeter. 0V-5.02V Within expected

range for simulation.

Table 5.1 Test points.

CHAPTER 5 OPERATION, TESTING AND PROGRAM CODE.

41

5.4 Programming.

5.4.1 Introduction.

The coding was performed on arduino programming platform. It employs use of C+

programming, this provides for coding, debugging and uploading of the code on a

microcontroller on an arduino board. Arduino Uno board was used in uploading of code to

microcontroller and testing of components.

Photo 5.2: Arduino Uno Programming and prototype development board.

5.4.2 Program Code.

The control program runs depending on the inputs of the microcontroller chip. It is as shown

below.

/*

HC-SR04 Ping distance sensor1:

VCC to arduino 5v

GND to arduino GND

Echo to Arduino pin 7

CHAPTER 5 OPERATION, TESTING AND PROGRAM CODE.

42

Trig to Arduino pin 8

*/

/*

HC-SR04 Ping distance sensor2:

VCC to arduino 5v

GND to arduino GND

Echo to Arduino pin 9

Trig to Arduino pin 10

*/

#define echoPin1 7 // Echo Pin 1

#define trigPin1 8 // Trigger Pin 1

#define echoPin2 9 // Echo Pin 2

#define trigPin2 10 // Trigger Pin 2

#define LEDPin 13 // Onboard LED

#define LEDPin1 2 // External LED 1

#define LEDPin2 3 // External LED 2

#define LEDPin3 4 // External LED 3

#define LEDPin4 5 // External LED 4

#define ALARM 6

int maximumRange =200; // Maximum range needed

int minimumRange = 0; // Minimum range needed

long duration1, distance1; // Duration used to calculate distance

long duration2, distance2; // Duration used to calculate distance

void setup()

Serial.begin (9600);

pinMode(ALARM, OUTPUT);

pinMode(trigPin1, OUTPUT);

CHAPTER 5 OPERATION, TESTING AND PROGRAM CODE.

43

pinMode(echoPin1, INPUT);

pinMode(trigPin2, OUTPUT);

pinMode(echoPin2, INPUT);

pinMode(LEDPin, OUTPUT); // Use LED indicator (if required)

pinMode(LEDPin1, OUTPUT); // Use LED1 indicator (if required)

pinMode(LEDPin2, OUTPUT); // Use LED2 indicator (if required)

pinMode(LEDPin3, OUTPUT); // Use LED3 indicator (if required)

pinMode(LEDPin4, OUTPUT); // Use LED4 indicator (if required)

void loop()

/* The following trigPin/echoPin cycle is used to determine the

distance of the nearest object by bouncing soundwaves off of it. */

digitalWrite(trigPin1, LOW);

delayMicroseconds(2);

digitalWrite(trigPin1, HIGH);

delayMicroseconds(10);

digitalWrite(trigPin1, LOW);

duration1 = pulseIn(echoPin1, HIGH);

digitalWrite(trigPin2, LOW);

delayMicroseconds(2);

digitalWrite(trigPin2, HIGH);

delayMicroseconds(10);

digitalWrite(trigPin2, LOW);

duration2 = pulseIn(echoPin2, HIGH);

//Calculate the distance (in cm) based on the speed of sound.

CHAPTER 5 OPERATION, TESTING AND PROGRAM CODE.

44

distance1 = duration1/58.2;

distance2 = duration2/58.2;

//CASE SAFETY: safety scenario

if (distance1 >= 70 && distance1 <= 200 || distance2 >= 70 && distance2 <= 100)

/* Send a TEXT to computer and Turn LED ON to indicate "SAFE" */

Serial.print("Safe Ditance1 NO RISKS!! <ALWAYS DRIVE SAFE> ::" );

Serial.print(distance1);

Serial.println(" Metres Between!");

Serial.print("Ditance2 By Sensor 2 is ::" );

Serial.print(distance2);

Serial.println("Metres!!");

digitalWrite(LEDPin, HIGH);

digitalWrite(LEDPin4 ,LOW);

digitalWrite(LEDPin1 ,LOW);

digitalWrite(LEDPin3 ,LOW);

digitalWrite(LEDPin2 ,LOW);

digitalWrite(ALARM,LOW);

Serial.flush();

//FIRST WARNING CASE:

else if (distance1 >= 50 && distance1 < 70 || distance2 >= 50 && distance2 <= 70)

/* Send the distance to the computer using Serial protocol, and

turn LED1 OFF to indicate successful reading AND give notice. */

Serial.print("UnSafe Ditance1 <ALWAYS OBEY TRAFFIC RULES > ");

Serial.print(distance1);

Serial.println(" Metres Between!");

CHAPTER 5 OPERATION, TESTING AND PROGRAM CODE.

45

Serial.print("Ditance2 By Sensor 2 is ::");

Serial.print(distance2);

Serial.println("Metres!!");

digitalWrite(LEDPin1 ,HIGH);

digitalWrite(LEDPin2 ,LOW);

digitalWrite(LEDPin3 ,LOW);

digitalWrite(LEDPin ,LOW);

digitalWrite(LEDPin4 ,LOW);

Serial.flush();

//HAZARD AND BUZZER CASE

else if (distance1 >= 30&& distance1 < 50 || distance2 >= 30 && distance2 <= 50)

Serial.print("UnSafe Ditance1 <ALWAYS OBEY TRAFFIC RULES:BRAKE ASSISTENABLE AND BUZZER > ::");

Serial.print(distance1);

Serial.println("Metres Between!");

Serial.print("Ditance2 By Sensor 2 is ::");

Serial.print(distance2);

Serial.println("Metres!!");

digitalWrite(LEDPin2 , HIGH);

digitalWrite(LEDPin1 ,LOW);

digitalWrite(LEDPin3 ,LOW);

digitalWrite(LEDPin4 ,LOW);

digitalWrite(LEDPin ,LOW);

digitalWrite(ALARM,HIGH);

Serial.flush();

CHAPTER 5 OPERATION, TESTING AND PROGRAM CODE.

46

// COUNTERMEASURE CASE

else if (distance1 > 0 && distance1 <30 || distance2 >= 0 && distance2 <= 30 )

Serial.println("RISKY <MANEUVRES INITIATED FULLY> ::");

if (distance1 < distance2 && distance2-distance1 >= 2.5 )

Serial.println("TURN LEFT INITIATED <->");

Serial.print(distance1);

Serial.println("Metres distance 1");

Serial.print(distance2);

Serial.println("Metres distance 2");

Serial.println( );

digitalWrite(LEDPin4 ,LOW);

digitalWrite(LEDPin1 ,HIGH);

digitalWrite(LEDPin3 ,HIGH);

digitalWrite(LEDPin2 ,LOW);

digitalWrite(LEDPin ,LOW);

else if (distance2 < distance1 && distance1-distance2 >= 2.5 )

Serial.print("TURN RIGHT INITIATED <->");

Serial.print(distance1);

Serial.println("Metres distance 1");

Serial.print(distance2);

Serial.println("Metres distance 2");

Serial.println( );

CHAPTER 5 OPERATION, TESTING AND PROGRAM CODE.

47

digitalWrite(LEDPin4 ,HIGH);

digitalWrite(LEDPin1 ,LOW);

digitalWrite(LEDPin3 ,LOW);

digitalWrite(LEDPin2 ,HIGH);

digitalWrite(LEDPin ,LOW);

else

Serial.print(distance1);

Serial.println("Metres distance 1 Between!!!");

Serial.print("Ditance2 By Sensor 2 is ::");

Serial.print(distance2);

Serial.println("Metres.");

digitalWrite(LEDPin4 , HIGH);

digitalWrite(LEDPin1 ,LOW);

digitalWrite(LEDPin3 ,LOW);

digitalWrite(LEDPin2 ,LOW);

digitalWrite(LEDPin ,LOW);

Serial.flush();

//OTHERWISE:TOO MUCH SEPERATION DISTANCE

else

Serial.println("BEYOND SCOPE OF SAFETY CONCERN ::MORE THAN 100 MetresSpacing");

digitalWrite(LEDPin , HIGH);

digitalWrite(LEDPin1 ,LOW);

CHAPTER 5 OPERATION, TESTING AND PROGRAM CODE.

48

digitalWrite(LEDPin3 ,LOW);

digitalWrite(LEDPin2 ,LOW);

digitalWrite(LEDPin4 ,LOW);

//Delay 100ms before next reading.

delay(100);

CHAPTER 6 CONCLUSION AND FUTURE WORK.

48

CHAPTER 6

CONCLUSION AND FUTURE WORK.

6.1 Overview of the project objective.

The previous chapters of this report presented the objectives of the study, an overview of

previous works, related works, system design, testing and the program code. The objective was

to design and implement an auto crash automobile evasion system that will help in reducing the

severity, occurrence and possibility of automobile crash. This chapter presents the achievements,

recommendations for future work and conclusion.

6.2 Project Achievements.

This project addressed reduction of crash incidences and the related severity by use of an

intelligent microcontroller based system. An ultrasonic sensor measures distances and feeds it to

a microcontroller which in turn applies either warning signals, braking or steering control. From

the protyping results, the separation distances were separation distances were appropriately

maintained and appropriate countermeasures engaged. It could be concluded that the proposed

system yielded the expected results; it is able to determine the separation distances between

automobile and obstacle appropriately, give warning by means of a buzzer and on board LED

warning system, and engage braking and steering control if the minimum separation distance is

not provided.

6.3 Recommendations for Future Study.

This project work has opened up further possibilities of studies. Future work should consider the

following:

The system could be implemented on an automobile as opposed to a prototype.

The incorporation of fuel injection control can be used which in combination with

braking control will be able to provide more precise automobile speed control.

Stepper motor control for swinging ultrasonic sensors through 360° will ensure that side

collisions are also catered for.

CHAPTER 6 CONCLUSION AND FUTURE WORK.

49

A possible combination of ultrasonic sensors and radar based sensors will provide an

improved safety system that can be implemented in luxury cars.

6.4 Project Summary and Conclusion.

The project work considered automobile crash evasion by implementing an ultrasonic sensor

based auto crash evasion system. The objective was to reduce collisions so as to reduce death of

persons, death of wildlife, automobile damages and damages to property upon crash and thus

eliminate the related costs. For the system to perform this desired functions, it was implemented

as an intelligent system based on Atmega 328p microcontroller .The implemented system was

able to determine the separation distances between automobile and obstacle appropriately, give

warning by means of on board warning systems, and engage braking and steering control if the

minimum separation distance is not provided . The test prototype also ensured that the speed of

the automobile is automatically controlled as it started being exposed to the risk of crash. Thus

the intended objectives were met as desired.

APPENDICES

50

APPENDICES

A. Tables.

Table A1: Table of System components requirements.

Component Quantity Unit Price Cost KESATmega 328p 1 600 600PLC socket 1 50 50Reset button 1 20 20Power Switch 1 10 10Toggle switch 1 20 2016MHZ Clock crystal 1 100 10012V battery/adapter 1 1200 12005V voltage regulator 7805 1 50 50Range Ultrasonic sensor HCSR04 2 1000 20005V electric buzzer 1 300 300NPN BC 337 Transistor 1 30 30Resistors(10K*2,0.18K*6,0.1*1,0.22K*4) 13 10 13010K Potentiometer 2 50 100Capacitors(22pF*2) 2 10 20

Transistor BC 337 1 50 50

LEDS (3red,2green) 5 20 100Optocoupler 4N25 1 250 250

Total Cost KES 5030/-

Table 4.1: Ultrasonic Sensor specifications.

Parameter Value/Description

Power Supply 5V DC

Quiescent Current <2mA

Measuring Angle <15°

Ranging Distance 2cm – 500 cm/1" - 16ft(4metres)

Resolution 0.3 cm

Trigger Input Signal 10uS TTL pulse

Dimension 45*20*15mm

Wight 8gms

APPENDICES

51

Table 4.2: Typical LED Characteristics

Nominal Colour VLED

(V)

RL (Ω)= (5 − )/ Choice of RL (Ω)

RED 2.0 200.00 220

ORANGE 2.0 200.00 220

YELLOW 2.4 173.33 180

GREEN 2.8 146.67 150

BLUE 3.6 93.333 100

WHITE 3.6 93.333 100

Table 4.3: SG 90 Servo motor specifications.

Parameter Value

Stall Torque 1.6kg/cm @ 6.0V

Speed 0.12 seconds/60deg. @ 4.8V

Dimensions 21x12x22 mm

Temperature Range 0°c - 55°c

APPENDICES

52

B.Operation of system components.

B1 Operation of HCSR04 Ultrasonic range sensor.

To determine distance, a short pulse is send to the module at time zero, this is done by sending a

HIGH pulse to the trigger pin(Trig)according to [17][18],this pulse should last at least 10µS,in

this project a 10µs high pulse in used. This triggers the sensor to output a burst of 8 sonic cycles

at 40 kHz and detect the echo back. The transmitted burst once reflected by an object and

retransmitted back to the sensor module as an echo, senor receives this signal and converts it to

an electric signal, and the duration is taken as a high pulse and fed to a microcontroller for

calculation of distance. The next pulse can be transmitted when the echo is faded away. This

time period is called cycle period. The recommended cycle period should be no less than 50ms in

[17], in this project 150ms is chosen for stability of readings. If no obstacle is detected, the

output pin will give a 38ms high level signal which corresponds to 6.5 meters and this is the

maximum range of the sensor used herein for prototyping. However the sensor will return values

of upto 4 meters in this project for prototyping purposes for stable ranging.

B2 Operation of Hazard Lights.

Pre-Crash hazard lights are flashed automatically as a warning to drivers of vehicles approaching

from behind and in front of the vehicle with crash evasion system installed. It may also alert the

pedestrians on the approaching possibility of a danger. Once the microcontroller judges that there

is a high risk of crash, it transmits a signal to the body microcontroller for automatic flashing of

the hazard lights. The body microcontroller will turn ON and OFF the optocoupler switch thus

operating the hazard lamps. However, this system also gives priority to driver operation in the

same way as other driver assistant systems. This means that automatic hazard light flashing is not

activated when manual operation of the hazard lamps or turn signals is detected.

APPENDICES

53

C.Datasheets.

BC 337 Transistor datasheet.

4N25 Optocoupler datasheet.

Atmega 328/328p datasheet.

Servo motor SG90 datasheet.

Ultrasonic Range detector, HCSR04 datasheet.

LM7805 datasheet.

REFERENCES.

54

REFERENCES.

1. http://m.autorevolution.com/braking-systems-history-6933.html

2. http://www.europa.eu/transport/cita-study.

3. http://www.volkspage .net/Self-study programme 264-Volkwagen the Brake Assist

System.

4. Ward’s Auto World: Rearview Mirror.

5. http://en.m .wikipedia.org/wiki/Rear-view_mirror.

6. http://en.wikipedia.org/wiki/automotive_lighting.

7. W. Jones, “Keeping cars from crashing,” IEEE Spectrum, vol. 38, no. 9, pp. 40–45, Sep.

2011

8. http://auto.howstuffworks.com/car-driving-safety/safety-regulatory-devices/pre-collision-

systems.htm.

9. T.Nishi, N.Yamazaki, S.Kokie, T.Kuno and T.Umezaki.”Collision Avoidance System

Using Laser Beams”. Submission for the award of a Master Degree in Techno-Business

Administration, Nagoya Institute Of Technology ,Japan.

10. http://www.thedetroitbureau.com/2013/10/new-toyota-ford-systems-can-steer-clear-of-

pedestrians

11. R.Deriche, “Fast Algorithms for Low-Level Vision”, IEEE Trans. Pattern Anal. Mach.

Intell., vol.12, No.1, pp.78-87.

12. N. Matthews, P. An, D. Charnley, and C. Harris, “Vehicle detection and recognition

using millimeter wave radar,” Control Eng. Practice, vol. 4, pp.473–479, 2009.

13. http://www.audimedia.ca/media/assets/0/110/278/a53962d1-394e-46f1-b8cf-

a9f174de5019.pdf.

14. .http://media.gm.com/media/us/en/gm/press_kits.detail.html/content/Pages/news/us/en/20

12/Sep/0918_virtualbumper.html

15. http://www.worldcarfans.com/9090326.019/toyota-launches-redesigned-crown-majesta-

in-japan

16. Mwagudza N.”Vehicle Safe Drive System” Submission for bachelors degree award, May

2012.

17. .http:// www.Elecfreaks.com-Ultrasonic sensor datasheet

18. http://www.iteadstudio.com

REFERENCES.

55

19. http://picprojects.org.uk-pdf- Using an NPN transistor to drive multiple LEDs from a

microcontroller output.

20. Jaycar Electronics Reference Data Sheet: LEDUSEJ.PDF (1) Using LEDs .