Microcontrollers Based Rear End Anti Col

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

G.J. E.D.T.,Vol.

2(6):14-21 (November-December, 2013) ISSN: 2319 – 7293

MICROCONTROLLERS BASED REAR-END ANTI-COLLISION WARNING SYSTEM


FOR VEHICLES
Alemayehu Wakjira1, & Ramesh Babu Nallamothu 2
1
Lecturer, Mechanical and vehicle Engineering Department, School of Engineering,
Adama Science and Technology University, Adama, Ethiopia.
2
Associate Professor, Mechanical and vehicle Engineering Department, School of Engineering,
Adama Science and Technology University, Adama, Ethiopia.

Abstract
Now a day’s vehicle accident is becoming critical issue allover the world and in Ethiopia in particular that demands
engineer’s endeavor to find ways to minimize the incidence. The application of electronic systems embedded in
automobile is expected to contribute a lot on the race to minimize vehicle accident disaster. Thus, the research focused on
developing a model of rear end anti-collision warning system that will detect the distance between two vehicles moving
on the same lane in the same direction and alert the driver whenever she or he is in danger range using microcontroller
(PIC).

Key words: mechatronics, microcontroller, rear-end collision, car accident

1. Introduction
Ethiopia, in addition to HIV AIDS, is suffering from car accidents. A large number of people have been killed in
motor vehicle accidents of various kinds. In this regard, the Ethiopian Federal Police Annual Statistical Report on road
accidents shows that in Ethiopia, during the years 2002/03-2006/07, the number of people who died of vehicle accidents
each year is 2,226 on average. The same report indicated that the yearly average number of serious and light injuries
during the aforementioned period is 3,855 and 4,826 respectively (Federal Police of Ethiopia annual statistics (2002/03-
2006/07)).
The worsening situations in the rate of car crash calls for hand to hand efforts of all concerned bodies and the
society in general. It is a well known fact that the socio economic, physical and psychological crisis caused by vehicle
accidents need to be dealt with seriously. Various research and studies should be conducted to overcome these problems
(Federal Police of Ethiopia annual statistics (2002/03-2006/07), WHO (2004). World report on road traffic injury
prevention, Geneva: World health organization, Advances in Transportation Studies an international Journal Section A
15 (2008)).
This research will be dedicated to attempt alternative solution for this known problem by developing low cost
domestic anti-collision warning system model that would be mounted on the existing car models and alert the driver in
danger zone.
Therefore, rather than putting aside inbuilt active safety system development to the car manufacturers, the user shall
find ways to solve the problem by developing domestic active safety system model that would be developed later to be
fitted to road vehicle despite their model and year of make. This initiated the writer of this manuscript to contribute his
share by constructing a model that will enable to conduct further research for finding alternative solution to minimize this
life threatening menace of vehicle accident in Ethiopia.

2. Vehicle Accidents
A vehicle or car accident is a road traffic incident which usually involves one road vehicle being in collision with,
either another vehicle, or another road user, or a stationary road side object, and this may result in death, injury and/or
property damage. According to WHO, 2004 road incidents result in death of an estimated 1.2 million people worldwide
each year, and injure about forty times this number (Federal Police of Ethiopia annual statistics (2002/03-2006/07)).
Various statistical data showed that vehicle to vehicle collisions have become one of the most serious problems
nowadays (“Statistics of motor vehicle collisions and types of collisions,” Road safety Assoc. Korea, 1997, Tech. Rep.).
In particular rear end collision accidents are said to occur more frequently, and thus, establishment of some means and
alternative solution for rear end collision avoidance is considered as a vital issue for reduction of vehicle accident.
According to the National Highway Traffic Safety Administration (NHTSA), the leading cause of death, about the
six most common are listed. If we look at six of them the greatest threats to the victims are the drivers themselves (British
medical journal April 10, 2004; 328:851 (published by WHO and World Bank)). These are: Distracted Drivers, Driver
Fatigue, Drunk Driving, Speeding, Aggressive Driving, Weather.

2.1 Vehicle Collisions Classification

 Head-on collisions,
Vehicle collisions can be classified by mechanism. Common mechanisms include:

 Run-off-road collisions,
 Rear-end collisions,

14
G.J. E.D.T.,Vol. 2(6):14-21 (November-December, 2013) ISSN: 2319 – 7293



Side collision, and
Rollovers are the most common once.

3. Microcontrollers
Microcontrollers are a type of microcomputers that consists of a single silicon chip and they are used in many house
hold goods and cars. Therefore a microcontroller is a single chip computer. Micro suggests that the device is small, and
controller suggests that the device can be used in control applications. Another term used for microcontroller is
embedded controller, since most of the microcontrollers are built in to or embedded in the devices they control. The term
microcomputer is used to describe a system that includes a minimum of microprocessor, program memory, data memory
and input-output (I/O). Some microcomputer systems include additional components such as timers, counters, analogue
to digital converters, and so on (Automotive engineering journal, March 1997, pp.86, Thomas Braunl, (2008).
Embedded Robotics, third edition, http://www.st.com, MICROCONTROLLERS MADE EASY).
Even though there are several types of microcontrollers, the most commonly used in embedded systems are the Basic
stamp and the PIC Basic microcontrollers. The BASIC Stamp is a microcontroller developed by Parallax, Inc.
(http://www.parallaxinc.com/) which is easily programmed using a form of the BASIC programming language. It is
called a “Stamp” because it is close to the size of an average postage stamp. The basic stamp is expensive and slower
compared to PIC Basic microcontrollers. Due to this the PIC Basic microcontroller is chosen for this project to develop a
low cost model. The comparison (table 1) is briefly shown as follows (http://www.pond.ie/TechInfo/Stamp and
http://www.lvr.com/files/mibch1.pdf).
Table 1 Comparison of Basic stamp and PIC microcontroller.
Basic stamp PIC microcontroller
Expensive Cheaper
Slower Faster
Easier to learn More difficult to learn to use
Free software for programming (PBASIC) can be Requires a compiler to create software
Downloaded from parallax

4. Rear end Collision and Detection Methods


Rear end collision is one of the most frequently happening vehicle accidents. According to the National Highway
Traffic Safety Administration, in the year 2000, rear end collision accounted for 29.7% of the total number of the vehicle
crash. That year, rear end collision were second to side collisions which is 30.2% of the total number of vehicle crash.
From the same report it is seen that head-on crash is about 2.2%. It is also reported that rear end collision is a head ach to
the insurers since it is frequently occurring (“Traffic Safety Facts 2000”, National Highway Traffic Safety
Administration Report).
In addition, examination of the 1992 General Estimates System (GES) electronic data base for police-reported
crashes shows that 23% were rear end,1% head-on,16% single , and 60% others. The category “others” contains crashes
for which the forward collision warning system may not be effective such as angle and sideswipe crashes, backing
crashes and some non collision class such as rollover, fires, jackknifes, and immersions. Thus approximately 40% of
these classes of crashes may be prevented or their effects lessened by using a forward collision warning system (Dogan
Ibrahim, 2006).
From this we can infer that rear end collision is the threat all over the world that needs engineers endeavor.
Numerous types of differing technologies have been employed in previous collision avoidance systems. For example, one
known type of system is based on ultrasonic sensors (L.H. Nordlund, 1961). A high frequency sound wave is emitted into
the area under surveillance and reflected sound waves having the frequency of the emitted sound are analyzed to
determine whether an object is present in the monitored area. An Ultrasonic-type system are rather slow in terms of
response time and are particularly subject to various kinds of interference due to wind buffeting and eddies as well as
other sources of interfering noise which reduces the reliability of the systems. Moreover, the ultrasonic transducer
employed in these systems must be mounted in the open air, thus subjecting it to airborne dirt and moisture which can
eventually interfere with the proper operation of the system (George Beggs et al, 1992).
Another type of known collision avoidance system uses radio frequency transmitters and receivers or radars. These
systems, while relatively effective in terms of performance, are relatively expensive and therefore have not gained
widespread use in common passenger vehicles (Masaaki Katsumata, 1978).
Optical systems are also known which measure the time of flight for light transmitted from the vehicle, to the object
and back. However, these systems also require expensive components and relatively complex circuitry (Yoshiyuki Etoh
et al, 1988).

5. Designing Rear end Anti-collision Warning System Using PIC Microcontroller


5.1 Design Specification
As it is shown on the block diagram below (figure 1), four inputs are considered to be involved in the system. These
are the vehicle speed, the brake switch, the steering position and the distance of an object or vehicle in front of the
vehicle equipped with this collision warning system.
Basically the speed of the vehicle should be sensed by speed sensor which will output either digital or analog signal
depending on the type of sensor used. But on this project, a potentiometer is used to simulate the speed sensor manually
at different positions. Similarly the steering position sensor is simulated by a push button. The brake pedal position is
sensed with the help of push button as it is on the real vehicle.

15
G.J. E.D.T.,Vol. 2(6):14-21 (November-December, 2013) ISSN: 2319 – 7293

To measure the distance of an object ahead of the vehicle, an infrared sensor (GP2D12) which require a 5v input is
used. This sensor can detect an object at a distance of 10cm to 80cm. Within this range of distance it will detect an object
and output an average analog voltage of 0.4v to 2.6v depending on the object distance from the sensor. Therefore, if
someone gets the optimized stopping distance in relation to the vehicle speed and other variables affecting the stopping
distance, it is possible to program a microcontroller so that it will out put a warning signal to inform the driver that an
object is in front.
This project is designed assuming the driver is aware of everything in front if the brake is applied or steering wheel
is being steered. The system is informed about these two things by the help of brake switch and steering position sensor.
As a result, the system will not warn the driver if either of the two is detected. i.e. if brake is applied or steering is being
steered to left or right. Taking all this things in to consideration, the system will warn the driver only when the vehicle is
not changing a direction, brake is not applied and object is in the target. Thus, this system will help the driver informing
to take care of an object in front of the vehicle either during night or day driving. Generally the system is demonstrated in
a simplified concept block diagram below so that one can easily understand (figure 1).

Figure 1 concept block diagram

5.2 Rear end Anti-collision Warning Design Using PIC Microcontroller (PIC16F876A)
The rear end collision warning system designed in this project consists of hard ware and software part. The hard
ware part consists of the 10x7.5 mm circuit board, microcontroller, the distance sensor, potentiometers, push buttons,
connecting wires, various electronic components used for power supply and timer circuits. Some of the components are
shown by the help of block diagram and the picture below taken while constructing experiment boards (figure 2).

Figure 2 block diagram


To make the dream of rear end anti-collision warning system model development true, the following steps have
been followed for designing the system. These are:
a) Selecting the input variables
b) Listing out the materials required and collecting them
c) Making an experiment circuit (hard ware)
d) Writing a code which relates all the input variables
e) Loading the code in to the microcontroller
f) Testing all the hard and software functionality
g) Finally developing the model for demonstration
Since the intention is to develop a model, the system consists of only four inputs and a single out put. This makes
the project feasible and easily understandable to others. These inputs are: Vehicle speed, Steering position, Brake switch
and object distance.
The vehicle speed is the basic input variable that will greatly affect the stopping distance of a vehicle; therefore, it is
crucial to consider it as input to decide the minimum distance required to follow the preceding vehicle or an object in
front.
The other inputs such as brake switch and steering position are used to indicate whether the driver is aware of the
situations or not. The object distance is informed by the help of the distance sensor and the microcontroller will make the
decision required based on the other input variables.

16
G.J. E.D.T.,Vol. 2(6):14-21 (November-December, 2013) ISSN: 2319 – 7293

5.2.1 Interfacing Sensors


The sensors used in this project are of analog and digital type. The brake switch and steering position sensors are
digital whereas the speed sensor and the distance sensor are analog. Since the digital sensors are simple pushbutton, there
is no need of a separate complicated interface circuit. But there is a pull up resistors which is used to interface the
buttons.
When the switch is open, 5v, logic 1 is connected to the microcontroller.
When the switch is closed, 0v, logic 0 is connected to the microcontroller.
The distance sensor with analog output is incorporated with a signal conditioning circuit in it eliminating a separate
interface circuit design. The only external circuit required is connecting a bypass capacitor of 10 microfarad or above in
parallel with the sensor power supply and ground connection as recommended by the sensor manufacturers. The speed
sensor is also simulated using a potentiometer and it doesn’t need any special interface circuit outside the
microcontroller. Inside the microcontroller, there is an analog to digital converter interface to suit the outputs of the
distance and speed sensors (analog) to the microcontroller (digital).

5.2.2 Interfacing Driver Circuits


The LED and the buzzer used as an actuator in this project are using a simple driver circuit. The LED used as a top
speed warning is derived directly by connecting an LED to the microcontroller output pin through a series resistor of 330
ohm (figure 4-10). We know that a standard LED consumes 10mA for normal brightness and the voltage drop across
LED is about 2V. But the voltage at the output of the microcontroller is about 5V when the port is at logic one level. As a
result of this it is impossible to connect an LED without a series resistor connected to it. Therefore there is a need to
determine a current limiting resistor value. So if the output voltage of the port is 5V, to have a voltage drop of 2V, we
need to drop 3V across the resistor. If we assume the current through the LED to be 10mA, the resistance value can be

5  2V
calculated as

R   0.3k The nearest resistor value is 330 


3V
10mA 10mA
Other driver circuit used in the project is the one used to drive the buzzer. Two transistors connected as Darlington
pair is used to drive the buzzer. The output from the microcontroller port is used only to trigger the transistor so that
external 6v source is supplied to the buzzer.
The complete schematic diagram of the project consists all the above sections and drawn using ISIS professional
soft ware as below (figure 3).

Figure 3 schematic diagram of the system

17
G.J. E.D.T.,Vol. 2(6):14-21 (November-December, 2013) ISSN: 2319 – 7293

5.3 Software Algorism for Rear end Anti-collision Warning Using PIC 16F876A
The software algorithm is written using assembly language and it is shown using the flow chart and a sample codes
taken from the complete program of the project. The flow chart of the complete program is as below (Figure 4).

Figure 4: Flow chart

5.4 Principle of Operation of the Complete System


The rear end anti-collision warning system model made in this project consists of hard and soft wares. The hard
ware circuit is made on the printable circuit board and mounted on a simple four wheel car model for demonstration
(figure 5).

18
G.J. E.D.T.,Vol. 2(6):14-21 (November-December, 2013) ISSN: 2319 – 7293

The power supply, timer, the microcontroller and hard wires are all in a single board. The distance sensor is
mounted on the front bumper of the car so that it can detect an object in front of the car. The car model is driven by a dc
motor using other drive circuits which is not part of this project. The potentiometer used to simulate vehicle speed is
mounted on the car so that it can be varied manually. There is also a buzzer mounted on the dash board to alert the driver
when necessary.

Figure 5: Demonstration model


When driving the car, the actual speed is not varying since it is driven by a simple dc motor. But by setting the
potentiometer on the car to different positions, it is possible to see the system detecting an object at different distances in
relation to vehicle speed.
As the car is driven, if an object is detected, the distance sensor will out put a voltage that will be received by the
microcontroller and processed according to the software loaded to it in the form of a program. Then, the microcontroller
first checks the vehicle speed at which it is moving. Then, for that particular speed, the controller checks whether the
object is in the specified range or not. If the object is not in the target, the operation will loop and continuously checks
speed and then the object distance. If the object is in the specified target, the program will check whether the driver is
aware or not by checking the brake switch and steering position. If the driver is already applied the brake, the system will
loop once again and will not alert. In case if the driver is not attentive and the vehicle is not steered, the system will
automatically tell the driver to apply a brake or any other corrective measures not to collide with the object in front by the
help of audible siren or red light.
If the driver is changing a direction, i.e. steering a vehicle, it is assumed that he/she is taking care of everything in
front. Thus, the program checks steering position before alerting the driver. Once the system alerts the driver by the
audible sound or red light, it will continue to awake until he or she apply brake or steer the vehicle. This system will help
the driver by doing so to minimize the possible rear end collision with the object a head of the car being driven.

6. Practical Implementation and Experimental Results


The practical part of the project is divided in to four main phases. Under each phase several trials has been
conducted. Some main tasks performed under each phase are discussed shortly as below.

6.1. Experiments
To conduct different experiments, all the necessary materials are collected and an experiment board is made. This
experiment board consists of the microcontroller and microcontroller support circuits such as power supply, clock signal
circuit and other related circuits. The distance sensor and the potentiometers used to simulate vehicle speed are mounted
on a separate board. On the experiment board made for trial, several experiments have been made.

6.2 Results Obtained from Sensor Output versus Distance


During day time a thorough experiment has been made to record the voltage output of the distance sensor
(GP2D12) using different objects at different distances. A straight table and long ruler are used to record the result. The
results are collected. The result refers different objects at different distance from the sensor.

6.3 Speed versus Object Distance


In this project, vehicle speed is simulated by a potentiometer. The potentiometer outputs analog voltage as per the
setting manually made. Since the output voltage represents the vehicle speed, it is programmed to detect an object at
different distances for different speed of the vehicle. Therefore, using 0v to 5v reference voltage, it is possible to have
255 different speed at which object can be detected for each speed.
For simplicity on this experiment, only five speeds are considered in the program which will enable the system to
detect an object at five different distances. Accordingly the corresponding speed and distance is recorded during the
experiment.

19
G.J. E.D.T.,Vol. 2(6):14-21 (November-December, 2013) ISSN: 2319 – 7293

Though the PIC16F876A consists of 10 bit analog channels, the higher address register of these analog channels are
used which can hold an eight bit value. So we can consider the analog reading as 8 bit number. Therefore the
microcontroller can read an analog voltage of 0V to 5V and convert it in to an 8 bit number where 0V is 0 and 5V is 255.
That is a reading of 51 per volt or a resolution of 1/51V. In another word 1 bit is a voltage reading of 19.6mV. Based on
this resolution, five speeds are represented by an analog reading of 51, 77, 102,128, and 153 which corresponds to a
voltage reading of 1V, 1.5V, 2V, 2.5V, and 3V respectively. Similarly five respective distances are sampled as 26, 51,
77, 102, and 128 which correspond to a voltage reading of 0.5V, 1V, 1.5V, 2V, and 2.5V respectively. Since the vehicle
speed is considered from 0KM/hr to 180km/hr and distance from 10cm to 80cm. Based on these resolutions, the program
has been written and loaded to the microcontroller and.
Table 2 Shows sampled vehicle speeds with a corresponding warning distance.
No. Speed Warning distance Remark
Km/hr
1 <=36km/hr 10cm
2 <=54km/hr 30cm
3 <=72km/hr 47cm
4 <=90km/hr 63cm
5 <=108km/hr 80cm
6 >108 Top speed warning LED will lit

On actual vehicle the warning distance has to be determined based up on optimized stopping distance of the vehicle
to be equipped with rear end ant-collision warning system. This needs another research by itself. Then the programmer
has to consider this optimized stopping distance when writing the code for the software development.

7. Discussions of Results
7.1 Object Distance versus Analog Voltage Output
Various objects are selected for experiment purpose just to see the distance sensor analog voltage output in relation
to the respective object distance. The objects are selected taking into consideration the materials from which most vehicle
bodies are made and objects that possibly observed on the road. Therefore, carton, glass, sheet metal, black painted
carton and human body were selected.
When the sensor output is recorded for each of the objects, slight differences were observed. Since the objects are
hold manually at different distances while conducting the experiment, my own error in holding the object exactly
perpendicular to the sensor may add to the differences observed. More or less, the output is nearly similar, so it is
possible to have a relation between an object distance and the analog voltage output of the sensor.
The other scientific reason for the variation of the sensor voltage output for different object yields due to the difference in
reflexive property of the materials. The glass material is superior to all the materials considered in this experiment. Since
its reflexivity is high, it resulted in higher voltage output of the sensor.

8. Conclusions and Achievements


8.1 Conclusions
A rear end anti-collision warning system is designed and mounted on a very simple and easily understandable
model constructed to demonstrate the system and it is found functional.
The IR distance sensor GP2D12 is utilized to demonstrate the rear end anti-collision warning system. It can detect
an object at a range of 10cm to 80cm distance from the car model. When an object is within the specified range, the
sensor outputs a voltage corresponding to the object distance telling the system how far the object is. Therefore, based on
the preprogrammed value the microcontroller can inform the driver by actuating an audible buzzer attached on the dash
board.
A distance sensor which detects an object at a longer distance is required to apply this system on a real vehicle.
The anti-collision warning system performance is encouraging. Therefore, if the right materials are collected, it is
possible to enhance its features so that it can be used in vehicles.
The model is a good witness and demonstration tool for any one wants to do research on anti-collision warning system.
The model can be used to demonstrate students the application of embedded system and mechatronics. It also initiates
learners toward the course mechatronics/embedded systems which are popular these days on every machine.

References
Advances in Transportation Studies an international Journal Section A 15 (2008).
Automotive engineering journal, March 1997, pp.86.
British medical journal April 10, 2004; 328:851 (published by WHO and World Bank).
Dogan Ibrahim, (2006). PIC BASIC Projects 30 Projects Using PIC BASIC and PIC BASIC PRO. Linacre House, Jordan Hill
Federal Police of Ethiopia annual statistics (2002/03-2006/07).
George Beggs et al, (1992). Object detection Method and Apparatus Employing Electro-optics U.S.PATENT NO. 5,122,796.
L.H. Nordlund, (1961). Close-Following Vehicle Warning System, U.S.PATENT NO. 2,974,304.
Masaaki Katsumata, (1978). Radar-operated Collision Avoidance System for Roadway Vehicles Using Stored Information for
Determination of Valid Objects, U.S.PATENT NO. 4,072,945. “Statistics of motor vehicle collisions and types of collisions,” Road
safety Assoc. Korea, 1997, Tech. Rep. “Traffic Safety Facts 2000”, National Highway Traffic Safety Administration Report.

20
G.J. E.D.T.,Vol. 2(6):14-21 (November-December, 2013) ISSN: 2319 – 7293

Thomas Braunl, (2008). Embedded Robotics, third edition


WHO (2004). World report on road traffic injury prevention, Geneva: World health organization.
Yoshiyuki Etoh et al, (1988). Method and system for automatically Detecting A preceding Vehicle, U.S.PATENT NO. 4,757,450
http://www.st.com, MICROCONTROLLERS MADE EASY
http://www.pond.ie/TechInfo/Stamp and http://www.lvr.com/files/mibch1.pdf

21

You might also like