You are on page 1of 40

MICROCONTROLLER BASED CAR PRE ACCIDENT NOTIFIER 2017

JIMMA UNIVERSITY

JIMMA INSTITUTE OF TECHNOLOGY (JIT)


SCHOOL OF ELECTRICAL AND COMPUTER ENGINEERING
A PROJECT ON
“MICROCONTROLLER BASED CAR PRE-ACCIDENT NOTIFIER”
Submitted to Jimma University, School of Electrical and Computer
Engineering in partial fulfillment for the requirements of the Degree of
Bachelor of Science in Industrial Control Stream in Electrical and Computer
Engineering for the Academic Year – JUNE 2017
Submitted by
Sl.No Name of the students ID. Number
.

1. GADISSA FIKRU 04472/06

2. TADESSE ALEMAYEHU 05128/06

3. TADESSE TENAW 05131/06

4. ROBEL H/MICHAEL 04989/06

5. SIYUM MOTI 05057/06

i|Page
MICROCONTROLLER BASED CAR PRE ACCIDENT NOTIFIER 2017

DECLARATION
We undersigned, declare that this project is our original work and has not been presented for a
degree in any form and in any other university and that to the best of our knowledge and belief
all source of material used for the project have been duly acknowledged.

Declared by

Name
Signature
1. TADESSE ALEMAYEHU

2. GADISSA FIKRU __________________

3. TADESSE TENAWU __________________

4. ROBEL H/MICHAEL __________________

5. SIYUM MOTI _______________

Date________________

Confirmed by Advisor:

Name: Dr.R.Ganesan

Signature _________________________________

Date _____________________________________

Place: Jimma.

ii | P a g e
MICROCONTROLLER BASED CAR PRE ACCIDENT NOTIFIER 2017

ACKNOWLEDGMENT
First and foremost, we would like to express our utmost gratitude to Jimma Institute of
Technology, Faculty of Electrical and Computer engineering department for providing
opportunity to us to pursue the mini project as a partial fulfillment of the requirement for the
degree of Bachelor of Engineering. This has been the greatest opportunity for us to gain
experiences, knowledge and expertise while pursuing on mini project.
Throughout this project, we are very fortunate to be blessed with the guidance and
encouragement from our advisor Dr.R.Ganesan for giving his personal guidance and supervision.

iii | P a g e
MICROCONTROLLER BASED CAR PRE ACCIDENT NOTIFIER 2017

ABSTRACT
The car pre-accident notifier system is simulated for collision avoidance system to assist drivers
for avoiding crashes by warning the driver. This system will not take control of the vehicle; it
will only inform the driver to know that he/she needs to steer back into the lane. This project has
ability to alarm and showing the result to the driver by six sides to indicating side front on
screen. It doesn’t have potential to stop the car or to decelerate the speed. Infrared sensors used
in this project have a capable measuring distance range to an object. A distance sensor is a sensor
that able to detect the presence of nearby objects without any physical contact. A distance sensor
often emits an electromagnetic field or a beam of electromagnetic radiation (infrared, for
instance), and looks for changes in the field or return signal. The sensors made by “Sharp” have
IR LED equipped with lens (D1), which transmits narrow light beam. After reflecting from the
object, the beam will be received through the second lens (D2) on a position-sensible photo
detector (PSD). The conductivity of this PSD depends on the position where the beam falls. The
conductivity is converted to voltage and then the voltage is digitalized by using analogue-digital
converter, then distance can be calculated. This consists one microcontroller, six identical
infrared distance measure sensors, one liquid crystal displayer (LCD), six different color light
emitting diodes (LED), one speaker and one potentiometer. Sensors are located on the car, two
at front side (right, left), two at back side (right, left), and the other two are at the left and right
side of the car. The two front side sensors are used to protect the car from obstacle by giving the
voltage signal for the microcontroller. It displays the written warning, “from right front” or
”from left front” on the LCD displayer as well as giving a sound by the speaker to the driver and
in addition the LED (red LED for right front) and (yellow LED for left front) will blink .Other
two back side sensors are used to protect the car from another car which approaches it from the
back side. It displays on LCD the warning “from right back” or “from left back” and the
speaker shouts by a delay of 2000ms, alternatively the LED is brighten as (BIGY LED for right
back) and (blue LED for left back). Another two side sensors also used to protect the car from
side obstacles at the time of crowding or when the driver wants to turn its direction. These two
sensors are located, one on the left side, the other on the right side. When this phenomenon is
occurred, for example if the obstacle is approaches the car from right side the LCD displays

iv | P a g e
MICROCONTROLLER BASED CAR PRE ACCIDENT NOTIFIER 2017

“from right side” LED bright out green LED. And if it is from left side the LCD display “from
left side” the LED bright out green color.

TABLE OF CONTENTS

Contents
DECLARATION..............................................................................................................................................ii
ACKNOWLEDGMENT...................................................................................................................................iii
ABSTRACT...................................................................................................................................................iv
TABLE OF CONTENTS...................................................................................................................................v
LIST OF TABLES............................................................................................................................................vi
LIST OF FIGURES.........................................................................................................................................vii
ACRONYMS...............................................................................................................................................viii
CHAPTER ONE..............................................................................................................................................1
1. INTRODUCTION.......................................................................................................................................1
1.1. Statement of problem......................................................................................................................2
1.2. Objective of the project....................................................................................................................2
1.2.1. General objective.......................................................................................................................2
1.2.2. Specific objective.......................................................................................................................2
1.3. Scope of the project.........................................................................................................................2
1.4. Limitation of the project...................................................................................................................2
1.5. Significance of the project................................................................................................................3
1.6. Outline of the project.......................................................................................................................3
CHAPTER TWO.............................................................................................................................................4
2. LITERATURE REVIEW................................................................................................................................4
CHAPTER THREE..........................................................................................................................................6
3. METHDOLOGY.........................................................................................................................................6
3.1. System block diagram.......................................................................................................................6
3.2. System Components and description...............................................................................................7
3.3. Purpose of distance sensors:..........................................................................................................11
3.4 Flowchart diagram of car pre-accident notifier:..............................................................................14

v|Page
MICROCONTROLLER BASED CAR PRE ACCIDENT NOTIFIER 2017

3.4.1 Algorithm of the flow chart......................................................................................................15


3.5 The Overall Control Circuit of the System........................................................................................15
CHAPTER FOUR..........................................................................................................................................18
4. SIMULATION RESULTS AND DISCUSSION...............................................................................................18
4.1 Software Simulation Results............................................................................................................18
4.2 Discussion........................................................................................................................................19
CHAPTER FIVE............................................................................................................................................20
5. CONCLUSION AND RECOMMENDATION................................................................................................20
5.1. Conclusion......................................................................................................................................20
5.2. Recommendation...........................................................................................................................20
REFERENCES..............................................................................................................................................22
APPENDIX..................................................................................................................................................23

vi | P a g e
MICROCONTROLLER BASED CAR PRE ACCIDENT NOTIFIER 2017

LIST OF TABLES

vii | P a g e
MICROCONTROLLER BASED CAR PRE ACCIDENT NOTIFIER 2017

LIST OF FIGURE

Figure 1.Block diagram of the project model..............................................................................................6


Figure 2.Power supply block diagram..........................................................................................................7
Figure 3Power supply circuit diagram.........................................................................................................8
Figure 4PIC16F877A microcontroller...........................................................................................................9
Figure 5Distance measuring sensor...........................................................................................................10
Figure 6 .The route of the light distance sensor........................................................................................11
Figure 7Output of infrared distance measuring sensor (GP2YOA7OOKOF)...............................................12
Figure 8. Liquid Crystal Displayer...............................................................................................................13
Figure 9.Flowchart diagram of car pre-accident notifier...........................................................................15
Figure 10.Overall Circuit diagram of the project.......................................................................................17
Figure 11.Result of when an object is approached from the right front....................................................19
Figure 12. Overall Circuit diagram of the project.......................................................................................20

viii | P a g e
MICROCONTROLLER BASED CAR PRE ACCIDENT NOTIFIER 2017

ACRONYMS

ADC- Analog to digital converter


IR- Infrared
LCD- Liquid crystal display
LED- Light emitting diode
PSD – Position sensible photo detector

ix | P a g e
MICROCONTROLLER BASED CAR PRE ACCIDENT NOTIFIER 2017

x|Page
i|Page
ii | P a g e
CHAPTER ONE

1. INTRODUCTION
The vehicle collision avoiding system project originally conceived as a semester project to
develop collision avoidance system to assist drivers in avoiding crashes by warning the driver.
Collision avoidance technologies are becoming popular in U.S. motor vehicles, and more
automakers are touting the potential safety benefits. However, the actual benefits in terms of
crash reductions still are being measured. In the world the numbers of vehicles are coming high
and increase rapidly. These high numbers of vehicles are being played the great role in our daily
life and it makes the distance between two cars moving in one road to short. The Road/Lane
Departure Warning System is a crash-avoidance technology which warns drivers if they are
drifting (or have drifted) out of their lane or from the road. This warning system is designed to
help prevent the possibility of a run-off-road crash. This system will not take control of the
vehicle; it will only let the driver know that he/she needs to steer back into the lane. This
warning system is not designed as a lane-change monitor, or a merging system which warns of
other vehicles. This informational report applies to original equipment manufacturer and after-
market Road/Lane Departure warning systems for light-duty vehicles on relatively straight roads
with a radius of curvature of 500m or more, and under good weather conditions. Future revisions
should consider the implications of newer variations on the user experience. We came up with
the idea for the vehicle collision avoidance system because of a personal experience. We think
that having this system on all cars would help people avoid collisions and be safer drivers.
Here we are using embedded controller built around the 8051 family (PIC16F877A) to produce
the appropriate decision action will be taken. The logic is produced by the program written in
Embedded C language. The software program is written, by using the MICROC environment.
The program written is then converted into hex code after simulation and burned on to
microcontroller using flash micro vision c.

1|Page
1.1. Statement of problem
 Nowadays the mortality rate is increased from day to day because of the driver may
drive fast beyond the specified speed and due to unwanted parking in the town.

1.2. Objective of the project

1.2.1. General objective


 The overall objective of the project is to provide a device that will notify the driver if
there is an object on the vehicle’s travelling path.
1.2.2. Specific objective
The Specific objectives of this project are to:-
 Improve safety
 To reduce insurance cost
 Reduce litigation
 Minimize accident rate

1.3. Scope of the project


In this project, it is trying to simulate the model by using Proteus program in the computer
application. Due to lack of materials implementation is not installed even in model size. The
simulation of this project is depends on Proteus software and micro C programming because the
microcontroller and other materials consisted in this project are needs to commanded by
programming language.

1.4. Limitation of the project


Maximum distance measured is restricted by two aspects: the amount of reflected light is
decreasing and inability of the Position Sensible photo Detector (PSD). When measuring objects
which are too far, the output remains approximately the same as it.
Minimum distance is restricted due to peculiarity of Sharp sensors, meaning the output starts to
decrease (again) sharply as the distance is at certain point. This means that to one value of the
output corresponds two values of distance. This problem can be avoided by noticing that the
object is not too close to the sensor.

2|Page
1.5. Significance of the project
This project has significant to the following different sectors:-
Community: In our country the traffic accident is high, because of the population density and
road problem. For this problem this project can minimize the mortality rate and other accidents.
Worrying of people (passengers) can be reduced where ever they go.
Government: To support the governmental workers to do their work properly and save their
time, i.e. no opposition from people and political stability is comfort. The government can save
its finance from the importing cars. It also reduced frequent road reconstruction and maintains
the road safety for long times which support transportation service.
Insurance company: when the traffic accident is occurred, the insurance company has a good
role to help the harmed parts. Therefore this project is used to reduce the expense of this best
company in one state.
Traffic: So as to minimize the overcrowding of the car, the traffic police will be benefited to do
their work without tension and stressing.

1.6. Outline of the project


The organization of this project report is well detailed and vast in its coverage; it covers all the
activities encountered during the project work. The first chapter of this work includes
introduction, objective and scope. Chapter two highlight on literature review, chapter three
highlight on description of system and some of the component used were emphasized, chapter
four highlight on result and discussion, testing and simulation. Finally, chapter five discussed all
about the conclusion and recommendation.

3|Page
CHAPTER TWO

2. LITERATURE REVIEW
A major challenge in designing intelligent vehicles capable of autonomous motion whether in
air, water or land is a reliable collision avoidance system. Any mobile robot or vehicle needs an
ability to perform reliable obstacle detection as well as have efficient and effective collision
avoidance actuation ability when performing in an unknown or dynamic environment. Mobile
robots and intelligent vehicles have recently been of great interest to commercial industries such
as automotive and aircrafts industries as well as to the military. There has been a great amount of
research devoted to the development of a reliable collision avoidance system.
In his work on Laser Intensity-Based Obstacle Detection and Tracking, John A. Hancock used a
laser scanner for obstacle detection and tracking for vehicles traveling on highways. Kalman
filtering was used to estimate the position and variance of each obstacle’s position. The focus of
the paper was only on static obstacles detection and tracking. Collision avoidance algorithm is
not attempted [1].
Although both detection aspect and avoidance algorithm aspect are involved in this project, the
system may need more alteration and adaptation to work in a dynamic and unknown
environment where there may be many non-cooperative obstacles.
Parker et al. used a pan-tilt-zoom (PTZ) camera for visual perception and a SICK scanning laser
range finder for their outdoors autonomous mobile robots to operate in unfamiliar outdoors
environments. For nearly all applications, the robots succeeded in avoiding navigation hazards
[1].
The work was thus focused on the development of the most efficient navigation path with
collision avoidance in mind. Paths are preplanned and collision checks are then executed. If the
scenario involves a time-space collision where the robots reach the same point at the same time,
a dimensional coordination diagram (CD) is constructed and a free trajectory is searched and
interpreted into a velocity profile for each robot. This velocity profile is actually the collision
avoidance actions to be executed.
In dynamic environments, for example in air, sea and land traffic, vehicular units need to avoid
one another as well as static non-vehicular obstacles while moving towards their destination [3].
Fiorini and Shiller addressed the problem of motion planning in dynamic environments by
presenting a method for computing the motions of a robot in dynamic environments, subjected to
the robot dynamics and its actuator constraints. Their concept is based on the Velocity Obstacle
4|Page
concept where a set of feasible robot velocities that would result in a collision between the robot
and obstacle is defined. This set of velocity is crucial because it will be from this set where the
avoidance maneuver at a specific time is computed.
Klee man et al did a research investigating the optimal deployment of ultrasonic transducers and
associated signal processing for indoor robotics applications, with environments composed of
surfaces that can reflect acoustic energy similar to a mirror reflecting light. Their research
established that two transmitters and receivers are necessary and sufficient to distinguish planes,
[3].
corners and edges of obstacles They provided an optimal sensor array with the minimum
number of transmitter and receivers, with the receivers closely spaced to minimize the
corresponding problem of associating different receiver echoes from multiple targets. The array
harnessed the ultrasonic sensors to be applied in a robust and accurate manner for obstacle
detection. However, their investigation involved a static sensor array, not implemented unto a
mobile platform. Also, the performance is limited by physical properties of air, reflectors and
noise [2].

5|Page
CHAPTER THREE

3. METHDOLOGY

3.1. System block diagram


The block diagram is an outline description of how we have implemented our project and the
various steps involved in it. As indicated in figure below the microcontroller takes its input from
the output voltage of sensor and displays the condition by the output materials which are LCD,
speaker and LEDs. Those output materials are called user interface materials. The block diagram
of the project is given below in figure 3.1.

Potentiometer
resistor
Power supply LCD

Speaker
Infrared sensor
GP2YOA700K0F Microcontroller
Microcontroller
PIC16F877A
PIC16F877
LED

Figure 1.Block diagram of the project model

6|Page
3.2. System Components and description
A. Power supply:
The power supply is given below in figure 3.2.

220V AC DC
output
50HZ

Step down Bridge Filter Regulator


Transformer Rectifier

Figure 2.Power supply block diagram

Basically any electronic circuit runs with a power supply. Here we are giving a 5v supply to the
various IC’s used in the design presented here. We get a 220V supply in our house at any instant.
So in order to provide our circuit appropriate supply voltage a different power circuit is to be
made based on our requirement. The various steps included in the circuit are explained below
stepwise. And also various precautions are to be taken for the safety of the electronic circuit
designed. The different stages of the design of the circuit are given below.
Transformer:
We need a step down transformer of 220/9v output to supply all the electronics involved. Here in
this device all the equipment require a DC input of 5v and since the regular input to the houses is
220v we need a transformer to step down voltages.
Bridge rectifier:
The equipment needs a DC supply, so the output from the transformer is connected to a bridge
rectifier to make it DC. A bridge rectifier basically has four diodes which provide rectification.
Filter circuit:
The output after the Rectification is not a proper DC, it has oscillation output and has a very high
ripple factor. We don’t need that pulsating output, for this we use Capacitor. Capacitor charge till
the waveform goes to its peak and discharge into Load circuit when waveform goes low. So
when output is going low, capacitor maintains the proper voltage supply into the Load circuit,
hence creating the DC. The value of this filter capacitor should be calculated as follow.

7|Page
C=I*t/V
C= capacitance
I= Max output current (let’s say 500mA)
t= 10ms
We will get wave of 100Hz frequency after converting 50Hz AC into DC, through full wave
bridge rectifier. So the Time period will be 1/100= .01 Second= 10ms. 9v is the RMS value of
transforms. So Peak voltage = Vrms of transformer * 1.414= 9* 1.414= 12.73v
Now 1.4v will be dropped on 2 diodes (0.7 per diode) as 2 will be forward biased for half wave.
So, V= 12.73 – 1.4 = 11.33v

Now C = I * t / V
C = 500mA * 10ms / 4.33 = .5 * .01 / 4.33 = 1154uF ~ 1000uF
Voltage regulator:
A voltage regulator IC 7805 is used to provide a regulated 5v DC. Input voltage should be
2volts more than the rated output voltage for proper working of IC, means at least 7v is
needed, although it can operate in input voltage range of 7-20V. Voltage regulators have all the
circuitry inside it to provide a proper regulated DC. Capacitor of 0.01uF should be connected
to the output of the 7805 to eliminate the noise, produced by transient changes in voltage.

TR1
1 3
VI VO
BR1
GND

U1 7805
C3
2

0.1uF
C4 +88.8
1000uF Volts

TRAN-2P3S
BRIDGE

Figure 3.Power supply circuit diagram

B. PIC16F877A Microcontroller
Microcontroller PIC16F877A is one of the PIC Micro Family microcontroller which is popular
at this moment, start from beginner until all professionals, because very easy using PIC16F877A
and use FLASH memory technology so that can be write-erase until thousand times. The

8|Page
superiority this Risk Microcontroller compared to with other microcontroller 8-bit especially at a
speed of and his code compression. PIC16F877A have 40 pin by 33 path of I/O.
PIC16F877A perfectly fits many uses, from automotive industries and controlling home
appliances to industrial instruments, remote sensors, electrical door locks and safety devices. It is
also ideal for smart cards as well as for battery supplied devices because of its low consumption.
EEPROM memory makes it easier to apply microcontrollers to devices where permanent storage
of various parameters is needed (codes for transmitters, motor speed, receiver frequencies, etc.).

Figure 4.PIC16F877A microcontroller

Low cost, low consumption, easy handling and flexibility make PIC16F877A applicable even in
areas where microcontrollers had not previously been considered (example: timer functions,
interface replacement in larger systems, coprocessor applications, etc.). In System
Programmability of this chip (along with using only two pins in data transfer) makes possible the
flexibility of a product, after assembling and testing have been completed. This capability can be
used to create assembly-line production, to store calibration data available only after final
testing, or it can be used to improve programs on finished products.

9|Page
C. Sensors
Sensor is a device which is sensitive to light, temperature, radiation level, or the like, that
transmits a signal to a measure or control instrument.

Figure 5.Distance measuring sensor

It is equipment which detects, and may indicate, and record objects and activities by means of
energy or particles emitted, reflected, or modified by objects. Any device that receives a signal or
stimulus (as heat or pressure or light or motion etc.) and responds to it in a distinctive manner
detector, sensing element device an instrumentality invented for a particular purpose; "the device
is small enough to wear on your wrist".

D. Infrared distance sensor (Sharp GP2Y0A700KOF)


For measuring the distance to an object there are optical sensors using triangulation measuring
method. Company “Sharp” produces most common infra-red (IR) wavelength using distance
sensors which have analogue voltage output. The sensors made by “Sharp “have IR LED
equipped with lens (D1), which transmits narrow light beam. After reflecting from the object, the
beam will be received through the second lens (D2) on a position-sensible photo detector (PSD).
The conductivity of this PSD depends on the position where the beam falls. The conductivity is
converted to voltage and then the voltage is digitalized by using analogue-digital converter, the
distance can be calculated.
The route of beams reflecting from different distance is presented on the following figure 3.6.

10 | P a g e
Figure 6 .The route of the light distance sensor

The voltage output of distance sensors by “Sharp” is inversely proportional to the distance
measured, this means that when the distance is going far from the sensor the voltage output is
decrease (decreasing is gradually slowing). All sensors have their specific measuring range
where the measured results are creditable and this range depends on the type of the sensor.
Maximum distance measured is restricted by two aspects: the amount of reflected light is
decreasing and inability of the PSD registering the small changes of the location of the reflected
ray. When measuring objects which are too far, the output remains approximately the same as it
is when measuring the objects at the maximum distance. Minimum distance is restricted due to
peculiarity of Sharp sensors, meaning the output starts to decrease (again) sharply as the distance
is at certain point (depending on the model 100-550cm). This means that to one value of the
output corresponds two values of distance. This problem can be avoided by noticing that the
object is not too close to the sensor. The Home Lab set of sensors includes IR distance sensor
SHARP GP2Y0A700KOF. Measuring range of the sensor is 100 cm – 550c m. The output
voltage of this sensor is, depending on the distance measured, up to 5 V. The distance sensor is
connected to the Sensor module. Its output voltage is sent to the channel 0 of the analogue-digital
converter of the AVR. On the basis of previous exercises of sensors, it is easy to write a program
which measures the output voltage of the distance sensors, but in addition, this exercise includes
converting this output voltage to distance [4].

3.3. Purpose of distance sensors:


A distance sensor is a sensor able to detect the presence of nearby objects without any physical
contact. A distance sensor often emits an electromagnetic field or a beam of electromagnetic
radiation (infrared, for instance), and looks for changes in the field or return signal. The object
being sensed is often referred to as the distance sensor's target. Different distance sensor targets

11 | P a g e
demand different sensors. For example, a capacitive or photoelectric sensor might be suitable for
a plastic target; an inductive distance sensor always requires a metal target. The maximum
distance that this sensor can detect is defined "nominal range". Some sensors have adjustments of
the nominal range or means to report a graduated detection distance. Distance sensors can have a
high reliability and long functional life because of the absence of mechanical parts and lack of
physical contact between sensor and the sensed object. By coming to our specification this
project accomplished with aid of distance sensor which have the brand code of GP2Y0A700K0F.
The GP2Y0A700K0F infrared sensor is a new version which takes a continuous distance reading
and reports the distance as an analog voltage with a distance range of 1m (39.3") to 5.5m
(216.5").

Figure 7.Output of infrared distance measuring sensor (GP2YOA7OOKOF)

The output of infrared distance measuring sensor is voltage as shown in figure. At different
distance from the object, the output voltage of sensor also is different. As distance between the
car and the object is increase the voltage output is decrease.

Distance(cm) Vout(v) Adc(bit)


100 2.77 566.742
200 1.44 294.624
500 0.62 126.855
550 0.57 116.622

Table 3.1.Output of distance measuring sensor

12 | P a g e
ADC=Vout/Vref*1023bit, where Vref is reference voltage which is +5v
E. Liquid Crystal Displayer (LCD)
The term liquid crystal is used to describe a substance in a state between liquid and solid but
which exhibits the properties of both. Molecules in liquid crystals tend to arrange themselves
until they all point in the same specific direction. This arrangement of molecules enables the
medium to flow as a liquid. Depending on the temperature and particular nature of a substance,
liquid crystals can exist in one of several distinct phases. Liquid crystals in a pneumatic phase, in
which there is no spatial ordering of the molecules, for example, are used in LCD technology.
One important feature of liquid crystals is the fact that an electrical current affects them. A
particular sort of nematic liquid crystal, called twisted nematics (TN), is naturally twisted.
Applying an electric current to these liquid crystals will untwist them to varying degrees,
depending on the current's voltage. LCDs use these liquid crystals because they react predictably
to electric current in such a way as to control the passage of light [4].

Figure 8. Liquid Crystal Displayer

F. Light emitting diode (LED)


A light-emitting diode (LED) is a two-lead semiconductor light source that resembles a basic p
n-junction diode, except that an LED also emits light, when an LED's anode lead has a voltage

13 | P a g e
that is more positive than its cathode lead by at least the LED's forward voltage drop, current
flows. Electrons are able to recombine with holes within the device, releasing energy in the form
of photons. This effect is called electroluminescence, and the color of the light (corresponding to
the energy of the photon) is determined by the energy band gap of the semiconductor [4].

3.4 Flowchart diagram of car pre-accident notifier:


The flowchart of pre-accident notifier is given below in Fig. 3.9.

14 | P a g e
Figure 9.Flowchart diagram of car pre-accident notifier

3.4.1 Algorithm of the flow chart


Step 1. Start
Step 2. The sensor have IR LED equipped with lens (d1) which transmit narrow light beam to
objects.
Step 3. After reflecting from the object, the beam will be received through the second lens (D2)

15 | P a g e
on a position-sensible photo detector (PSD).
Step4. The conductivity of PSD is converted to voltage and then the voltage is digitalized by
using analogue-digital converter.
ADC = Vout/Vref* 1023bit where Vref is reference voltage which is +5V.
Step 5. Is the detected obstacle distance within the range specified? If the condition is No go
back and continue the whole process again but if the condition is yes the direction is displayed
on LCD, sound and LED bright.

3.5 The Overall Control Circuit of the System


The microcontroller pic16F877A has five I/O ports namely PORTA, PORTB, PORTC, PORTD
and PORTE. Each port has its own pins. PORTA has six pins; PORTB, PORTC and PORTD
have eight pins whereas PORTE has three pins. Port A and port E are programmed to operate as
input pins for sensors.RB0, RB1, RB2, RB4 and RD5 are programmed to operate as output pin
for LCD module. RD0, RD1, RD2, RD3, RD4 and RD5 are programmed to operate as output pin
for LED module. RC3 is an output pin to operate the speaker.

The overall Circuit diagram of the project is given below in figure 3.10.

16 | P a g e
Figure 10.Overall Circuit diagram of the project

Working Principles:
The above figure is used to show the result and simulation model. This model consists of one
microcontroller, six identical infrared distance measuring sensors, one liquid crystal displayer
(LCD), six different color light emitting diodes (LED), one speaker and one potentiometer. The
sensors are used to measure the distance between the car and the object using infrared rays, gives
an output of voltage and provides this voltage to microcontroller. As it is indicated in the above
chapter under calculation methodology, the microcontroller converts this voltage to digital value
(ADC) to interpret the output. Sensors are located on the car, two at front side (right, left), two
at back side (right, left), and the other two are at the left right side of the car.

17 | P a g e
The two front side sensors are used to protect the car from obstacle by giving the voltage signal
for the microcontroller. Other two back side sensors are used to protect the car from another car
which approaches it from the back side. Another two side sensors also used to protect the car
from side obstacles at the time of crowding or when the driver wants to turn its direction. These
two sensors are located, one on the left side, the other on the right side. When this phenomenon
is occurred, for example if the obstacle is approaches the car from right side, the LCD displays
“from right side”, the speaker is sound and the LED bright out green LED. And if it is from left
side the LCD display “from left side” the LED bright out green color. The driver can dictate an
object near the car, by using three possible alternatives output interfaces One is from LCD, the
other is from speaker and then from LEDs.

18 | P a g e
CHAPTER FOUR

4. SIMULATION RESULTS AND DISCUSSION

4.1 Software Simulation Results


Result of when an object is approached from the right front is given below in figure 4.1.

Figure 11.Result of when an object is approached from the right front

As shown in figure above LCD displays the letter “from right front” or “from right back” and
the speaker shouts by a delay of 5000ms, alternatively the LED is brighten as (Red LED for
right front ) and (BIGY LED for right back). .simulation results is given below in tale 4.1.
object approaches LCD out put LED output (color)
from
Right front “from right front” Red
Right back “from right back” BIGY
Left front “from left front” Yellow

Left back “from left back” Blue


Right side “from left back” Green

Left side “from left side” BIRY

Table 4.1.simulation results

19 | P a g e
4.2 Discussion
The system is designed and simulated using Proteus simulation software .As indicated in figure
below the microcontroller takes its input from the output voltage of sensor and displays the
condition by the output materials which are LCD, speaker and LEDs. Those output materials are
called user interface materials. The overall circuit diagram is shown in Figure 4.2.

Figure 12. Overall Circuit diagram of the project

20 | P a g e
CHAPTER FIVE

5. CONCLUSION AND RECOMMENDATION

5.1. Conclusion
The objective of this project to design, integrate and test a car- pre accident notifier by 6 infrared
distance measuring sensors. The advancement of car pre- accident notifier can be implemented
using several ways of distance measurement detection. For stationary or moving obstacle(s)
detected, the system was able to execute appropriate collision avoidance actions. The project was
worked upon the assumptions that obstacles are either stationary or moving up to the same speed
as the platform and that moving obstacles will endanger the platform only in its front field of
view. The project was completed by tackling the two major aspects – the obstacle detection
aspect and the collision avoidance actuation aspect. There were attempts to try translating the
algorithm into program codes on micro C program code. For the obstacle detection aspects, it is
very important to find out the characteristics of the infrared distance measuring sensors.
Although working specifications arrived together with the sensors, it is vital that the actual
performance of the sensors to be determined. This is so that the actual performance of the
integrated detection aspect of the system may be known. In conclusion, the project is
successfully done and the objectives of the project are achieved.

5.2. Recommendation
Some improvements are required for enhancement of the car pre-accident notifier using infrared
sensor, for sensing the presence of obstacles and led blinking and buzzer for indication purpose.
There are areas that the groups will recommend improvements in the existing projects on Car
pre-accident notifier System.
Firstly, the project had an ability to only alarm the driver not to stop the motor. The group
strongly recommends more research be done on the algorithm for the Car pre-accident notifier
system to be able to stop the motor as soon as the obstacle is arriving.
Another improvement can be done on the system to cope with moving obstacles on the right and
left field of view of the car. This will represent a dynamic environment more accurately for the
Collision Avoidance system to work in.

21 | P a g e
Lastly, there may be a possibility of an obstacle being ‘invisible’ because of its angular tilt or
obstacle size. More research can be done similar to that mentioned in Klee man et al to find the
optimal sensor array design to overcome such problems.

22 | P a g e
REFERENCES
[1]. Wang, L.-j., J.-k. Wang, et al. (2008). Location estimation of mobile user in wireless sensor
network based on Unscented Kalman Filter. Microwave and Millimeter Wave Technology, 2008.
ICMMT 2008. International Conference on.
[2]. Jihua, H. and T. Han-Shue (2006). Design and implementation of a cooperative collision
warning system. Intelligent Transportation Systems Conference, 2006.
ITSC '06. IEEE
[3]. W. Jones, “Building Safer Cars,” IEEE Spectrum, vol. 39, no. 1, pp. 82- 85, 2002
[4]. J.P Introduction to Sensors, LCD and LED. http://wwwfars.nhtsa.dot.gov/Main/index.aspx.
[5].Ted Van Sickle, Programming Microcontrollers in C, Second Edition, Eagle Rock,
Virginia, 2005.
[6]. Virginia Tech Transportation Institute: http://www.vtti.vt.edu/research.html.

23 | P a g e
APPENDIX
Long ;x;y;v;t;m;k;
sbit LCD_RS at RB4_bit;
sbit LCD_EN at RB6_bit;
sbit LCD_D4 at RB0_bit;
sbit LCD_D5 at RB1_bit;
sbit LCD_D6 at RB2_bit;
sbit LCD_D7 at RB3_bit;
sbit LCD_RS_Direction at TRISB4_bit;
sbit LCD_EN_Direction at TRISB6_bit;
sbit LCD_D4_Direction at TRISB0_bit;
sbit LCD_D5_Direction at TRISB1_bit;
sbit LCD_D6_Direction at TRISB2_bit;
sbit LCD_D7_Direction at TRISB3_bit;
char txt1[] = "from right front";
char txt2[] = "from right back";
char txt3[] = "from left front";
char txt4[] = "from left back";
char txt5[] = "from right side";
char txt6[] = "from left side";
char txt7[] = "you are safe";
charrf[25];
void Tone3() {
Sound_Play(659, 250);
}
void main() {
trisb=0; //output
portb=0;

24 | P a g e
trisa=0; //input
porta=0;
trisc=0;
portc=0;
trise=0; //input
porte=0;
trisd=0;
portd=0;
Lcd_Init();
ADC_Init();
Sound_Init(&PORTC, 3);
while(1)
{x = ADC_Read(0);
y = ADC_Read(1);
v = ADC_Read(2);
t = ADC_Read(3);
m = ADC_Read(4);
k = ADC_Read(5);
if(100>=x<=550){
Lcd_Cmd(_LCD_CLEAR);
Lcd_Cmd(_LCD_CURSOR_OFF);
Lcd_Out(1,2,txt1);
portd = 1;
Tone3();
delay_ms(5000);
}
if(100>=y<=550){
Lcd_Cmd(_LCD_CLEAR);

25 | P a g e
Lcd_Cmd(_LCD_CURSOR_OFF);
Lcd_Out(1,2,txt2);
portd = 2;
Tone3();
Delay_ms(5000);
}
if(100>=v<=550){
Lcd_Cmd(_LCD_CLEAR);
Lcd_Cmd(_LCD_CURSOR_OFF);
Lcd_Out (1,2,txt3);
portd = 4;
Tone3();
Delay_ms(5000);
}
if(100>=t<=550){
Lcd_Cmd(_LCD_CLEAR);
Lcd_Cmd(_LCD_CURSOR_OFF);
Lcd_Out(1,2,txt4);
portd = 8;
Tone3();
Delay_ms(5000);
}
if(100>=m<=550)
{Lcd_Cmd(_LCD_CLEAR);
Lcd_Cmd(_LCD_CURSOR_OFF);
Lcd_Out(1,2,txt5);
portd = 16;
Tone3();
Delay_ms(5000);
}
if(100>=k<=550)

26 | P a g e
{Lcd_Cmd(_LCD_CLEAR);
Lcd_Cmd(_LCD_CURSOR_OFF);
Lcd_Out(1,2,txt6);
portd = 32;
Tone3();
Delay_ms(5000);
}
else{
Lcd_Cmd(_LCD_CLEAR);
Lcd_Cmd(_LCD_CURSOR_OFF);
Lcd_Out(1,2,txt7);
portc=0;
portd=0;
portb=0;
Tone3();
Delay_ms(5000);
}

}}

27 | P a g e
28 | P a g e

You might also like