Car Pre-Accident Notifier System
Car Pre-Accident Notifier System
JIMMA UNIVERSITY
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. GADISSA FIKRU _________________
Date _______________
Confirmed by Advisor:
Name: Dr.R.Ganesan
Signature _________________________________
Date _____________________________________
Place: Jimma.
ACKNOWLEDGMENT
First and foremost, we would like to express our utmost gratitude to Jimma Institute of
Technology, Faculty of Electrical and Computer engineering 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.
.
FACULTY OF ECE; INDUSTRIAL CONTROL STREAM Page iii
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,
rather 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 feature 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. 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. 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.
TABLE OF CONTENTS
DECLARATION ............................................................................................................................ ii
ACKNOWLEDGMENT................................................................................................................ iii
ABSTRACT ................................................................................................................................... iv
TABLE OF CONTENTS ................................................................................................................ v
LIST OF TABLES ........................................................................................................................ vii
LIST OF FIGURES ..................................................................................................................... viii
ACRONYMS ................................................................................................................................. ix
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 this project ...................................................................................................... 2
1.5. Significance of this project ................................................................................................... 3
CHAPTER TWO ............................................................................................................................ 4
2. LITERATURE REVIEW ........................................................................................................... 4
CHAPTER THREE ........................................................................................................................ 6
3. METHODOLOGY ..................................................................................................................... 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
3.4.1. Algorithm of the flow chart ......................................................................................... 15
3.5. The Overall Control Circuit of the System ........................................................................ 15
LIST OF TABLES
LIST OF FIGURES
ACRONYMS
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 micro c.
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 actator constraints. Their concept is based on the Velocity Obstacle
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,
corners and edges of obstacles [3].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].
CHAPTER THREE
3. METHODOLOGY
3.1. System block diagram
The block diagram is an outline description of how the project have been developed 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.
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. The
power supply circuit diagram is given below in Figure 3.3.
TR1
1 3
VI VO
GND
BR1
U1 C3
2
7805
0.1uF
C4 +88.8
1000uF Volts
TRAN-2P3S
BRIDGE
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.).The pin
diagram of PIC16F877A is given below in Figure 3.4.
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. The schematic of distance measuring
sensor is given below in Figure 3.5.
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 – 550cm. 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].
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").The output of distance measuring sensor is given in Figure 3.7.
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].
The schematic of LCD is given below in Figure 3.8.
No
The overall Circuit diagram of the project is given below in Figure 3.10.
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.
CHAPTER FOUR
4. SIMULATION RESULTS AND DISCUSSION
4.1. Simulation Results
Result of when an object is approached from the right front is given below in Figure 4.1.
Figure 4.1 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). The simulation results is given below in Table 4.1.
Table 4.1 Simulation results
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
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.
CHAPTER FIVE
5. CONCLUSION AND RECOMMENDATION
5.1. Conclusion
Generally this project is 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.
Secondly, the system have not ability to show at what distance object is there or will coming, it
shows whether the object is there or not.
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.
Lastly, there may be a possibility of an obstacle being ‘invisible’ because of its angular tilt or
obstacle size.
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.
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;
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);
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)
{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);
}
}}