Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

Safety-Automation of Cars Using Embedded Microcontrollers

Abhinav Ray Varun Kumar


Department of Instrumentation Technology, Department of Instrumentation Technology,
R.V. College of Engineering, Bangalore, R.V. College of Engineering, Bangalore,
India. India.
E-mail- rayabhinav@yahoo.com E-mail- varunkumar99@rediffmail.com

Abstract road safety, the availability of these systems are


limited for a common man solely because of their high
The paper deals with the partial automation of cars cost and lack of awareness. Some car manufacturers do
for safety purposes. We have tried to automate the car report on their research on this aspect but they do not
to prevent the danger (obstacles around the car) in the divulge the technical intricacies of their proposed
best possible way by incorporating intelligence to it system. The main aim of this paper is to develop a low
with the help of microcontrollers and interfacing them cost, partially automated system that can be installed in
with the basic structures of the braking, steering and a manually driven car for the prevention of collision
the acceleration systems of the car. The actions which does not take away the pleasure of driving. The
required are taken only if the driver is not able to steer paper essentially consists of three parts, the sensor
the car out of danger even after he is alerted. We have system, the processing system and the mechanical
given preference to a particular direction with respect systems of the car. Circuit has been designed to
to other directions in the most practical way and in a interface all these three systems. Logic has been
particular sequence so that only one system (i.e. developed taking car limitations and other practical
braking, steering and the acceleration) works at a constraints into consideration. Transformation of logic
given instant of time. The proposed system can be into an algorithm has been done for programming
implanted in a manually driven car at a very low cost. simplification. Modifications have been proposed in
the braking, steering and the acceleration system for
easy interface with the processing unit. Detailed
1. Introduction research has been carried out on the practical
implementation of this system. Identification of error
With the advent of high speed cars and overcrowded probable sources has been done and their
roads safety has become the prime concern for the car corresponding magnitude errors have been predicted.
manufacturers. In the recent past the automobile sector The practical implementation of this system is being
has come up with effective means for increasing safety carried out at R.V. College of Engineering. Grant has
of the passengers. The prime example of this is air been provided by Infosys Technologies Ltd.,
bags. Such a system does enhance the chances of Bangalore under the Campus Connect program.
survival of the passengers in case of a car crash, but its
always better stick to the famous saying 'prevention is 2. Description of the system
better than cure'. It is therefore required to develop a
system installed in the car which actually prevents The proposed system consists of the basic blocks
collision to occur. After going through various journals like transducers, microcontrollers, multiplexers and the
and the most recent developments in the car industry, it braking, steering, acceleration systems of the car.
is concluded that not much of development have been
done to solve the root cause of road accidents i.e. the 2.1. Sensor and the processing system
avoidance of collision. Though fully automated cars
and automated highway systems have been developed Ultrasound sensors have been used in development
for increased of the system. The ultrasound transmitters on each

Proceedings of the 2005 International Conference on Computational Intelligence for Modelling, Control and Automation, and International Conference on
Intelligent Agents, Web Technologies and Internet Commerce (CIMCA-IAWTIC05)
0-7695-2504-0/05 $20.00 2005 IEEE
side of the car as shown in the circuit diagram are fired systems of the car namely, the braking, steering and
with a voltage pulse simultaneously. Internal timers of acceleration systems.
the microcontrollers (MCf, MCre, MCl, MCr) are used
and enabled at this point of time. Appropriate clock
frequency is chosen for the timer. The receiver
transducer closest to the obstacle will be the first to
generate a voltage pulse. This voltage pulse passes
through the AND gate and disables the timer and the
time span is stored in a register. The AND gates are
then disabled by their respective peripheral
microcontrollers as soon as the voltage pulse is
received by them. Depending upon the transmitter
voltage the velocity of the ultrasound is calculated.
Using the time span calculated by the timers the
instantaneous relative distance is found out using
simple kinematics equations. The AND gates were
disabled because further interruptions by the other
receiver signals while microcontroller calculation
would result in interrupt signals generated by far off
obstacles which are not of concern. As soon as the four
microcontrollers finishes off the relative distance
calculation the AND gates and the timers are enabled
again. Using the same procedure instantaneous relative
distance is calculated again. The difference of the two
relative distances is calculated and is then divided by
time span between their changes. A separate timer of
the microcontroller can be used to calculate this time
span. This gives the relative velocity of the designed
car with respect to the obstacles. The instantaneous
Figure 1. The basic circuit
relative distance at that point is divided by the
instantaneous relative velocity. This gives the collision
TT: Ultrasound transmitter
time. Identical operations are performed by the four
microcontrollers (MCf, MCre, MCl, MCr) and &: AND gate
collision times of the front (Tfront), rear (Trear), left MCf: Microcontroller for front collision time
(Tleft) and the right (Tright) are calculated and sent to (Tfront) calculation
an 8:1 multiplexer with three select lines. The MCre: Microcontroller for rear collision time
multiplexer is connected to the central microcontroller (Trear) calculation
which selects the appropriate time of collision MCl: Microcontroller for left collision time (Tleft)
according to the need of the algorithm. The calculation
microcontrollers MCbr, MClt, MCrt are fed with MCr: Microcontroller for right collision time
appropriate steps for which the stepper motors (Tright) calculation
interfaced to the braking, acceleration and the steering MCbr: Microcontroller for braking stability and
system have to rotate to ensure stability conditions at critical braking time (Ts1) calculation
various velocities of the car. The microcontroller MCa MClt: Microcontroller for left turn stability and
is fed with the time required for the car to accelerate to critical left turn time (Ts2) calculation
maximum velocity at maximum acceleration MCrt: Microcontroller for right turn stability and
maintaining the stability conditions of the car. The critical right turn time (Ts3) calculation
tachometer of the car feeds the instantaneous velocity MCa: Microcontroller to find the critical time
to the microcontrollers (MCbr, MClt, MCrt) so that (Ts4) required to accelerate to maximum velocity
appropriate steps of the stepper motor are chosen for at maximum acceleration maintaining stability
braking, accelerating and steering. The central conditions
microcontroller is then interfaced to stepper motors MUX: Multiplexer (8:1)
which control the mechanical Sl: Select lines for the multiplexer

Proceedings of the 2005 International Conference on Computational Intelligence for Modelling, Control and Automation, and International Conference on
Intelligent Agents, Web Technologies and Internet Commerce (CIMCA-IAWTIC05)
0-7695-2504-0/05 $20.00 2005 IEEE
2.2. Calculations performed by the compared with. First Trear is compared with 2Ts4. If
microcontrollers for braking, steering and Trear is less than 2Ts4 the driver is alerted by a beep
acceleration sound. If the driver does not take suitable action and
Trear becomes less than Ts4 control is taken by the
MBr Feeds the magnitude of stepper motor central microcontroller and suitable action is taken as
rotation for the braking system to the main described in the algorithm.
microcontroller depending upon the velocity ranges of
the car to maintain stability conditions. It also 3. Inferences
calculates the amount of time (Ts1) taken by the car to
avoid collision depending upon the instantaneous The collision times are updated after finite instances
velocity and the braking power of the car at that of time. This time depends upon the obstacle relative
particular velocity. Ts1 is the reference time by which distance. Lower the obstacle distance higher the
the collision time of front side (Tfront) is compared frequency of collision time calculation which in turn
with. First Tfront is compared with 2Ts1. If Tfront is makes the system more accurate. The frequency of
less than 2Ts1 the driver is alerted by a beep sound. If collision time calculation is in order of kilohertz for
the driver does not take suitable action and Tfront close proximity distances. It can be thus inferred that
becomes less than Ts1 control is taken by the central the simple kinematics equations used for the collision
microcontroller and suitable action is taken as time calculation behave like differential equations.
described in the algorithm. The calculation of relative distance, velocity and
MClt Feeds the magnitude of stepper motor acceleration needs one, two and four pulses
rotation for the steering system to rotate left according respectively to the transmitter ultrasound crystal. It is
to the instantaneous velocity of the car to maintain the thus inferred that if the error in the calculation of
stability of the car. It also calculates the amount of time relative distance is E, then the corresponding errors in
(Ts2) taken by the car to avoid collision depending the calculation of relative velocity and acceleration
upon the instantaneous velocity of the car and the will be 2E and 4E respectively. Therefore errors
length to be traveled on the left. Ts2 is the reference increase in geometric progression with every increase
time by which the collision time of left side (Tleft) is in the derivative of distance calculation. Therefore in
compared with. First Tleft is compared with 2Ts2. If this system the calculation has been carried out till the
Tleft is less than 2Ts2 the driver is alerted by a beep first derivative i.e. the relative velocity to obtain the
sound. If the driver does not take suitable action and collision time.
Tleft becomes less than Ts2 control is taken by the
central microcontroller and suitable action is taken as 4. Error Sources and their compensation
described in the algorithm.
MCrt Feeds the magnitude of the stepper motor The speed of the ultrasound in air varies with
for the steering system to rotate right according to the temperature and humidity. Therefore at varying
instantaneous velocity of the car to maintain the temperatures and humidity the collision times of
stability of the car. It calculates the amount of time different magnitudes will be obtained for a particular
(Ts3) taken by the car to avoid collision depending condition. To eliminate this error a suitable standard
upon the instantaneous velocity of the car and the reference temperature and humidity can be chosen for
length to be traveled on the right. Ts3 is the reference which the ultrasound velocity is known. A
time by which the collision time of right side (Tright) compensation table for the ultrasound velocity can then
is compared with. First Tright is compared with 2Ts3. be prepared for various temperatures and humidity.
If Tright is less than 2Ts3 the driver is alerted by a
beep sound. If the driver does not take suitable action The inherent voltage-sound conversion times for the
and Tright becomes less than Ts3 control is taken by ultrasound crystals might cause negligible errors. This
the central microcontroller and suitable action is taken is usually in order of microseconds. This error can be
as described in the algorithm. removed by feeding the conversion time to the
MCa -- Microcontroller to find the critical time microcontroller and subtracting it from the obtained
(Ts4) required for accelerating to the maximum collision time.
velocity at maximum acceleration maintaining the Propagation times of AND gates and the
stability conditions of the car. Ts4 is the reference time multiplexers are generally in order of nanoseconds
by which the collision time of rear side (Trear) is which cause infinitesimally small errors. Removal of

Proceedings of the 2005 International Conference on Computational Intelligence for Modelling, Control and Automation, and International Conference on
Intelligent Agents, Web Technologies and Internet Commerce (CIMCA-IAWTIC05)
0-7695-2504-0/05 $20.00 2005 IEEE
this error is not required for practical conditions. Step 3:
Calculation time of the microcontrollers will be in a) Take in the time of collision Tleft from the
order of microseconds. Use of fast microcontrollers microcontroller MCl
and subtraction of the calculation time from the b) Take in the variable maximum stable angle theta
collision time will eliminate this error. Use of for right turn from MCrt
microcontrollers with more than 10 MHz clock c) Take in the time (Ts3) required to travel (at most)
frequency will result in error in order of 10^-4 sec. For the length of the car at that velocity and at the
practical situations this error would be insignificant. maximum angle theta from MCrt
d) Compare the time of collision (Tleft) with 2*Ts3
5. Algorithm fed to the e) If collision time (Tleft) is greater than or equal to
central microcontroller 2*Ts3, go to step 1
f) Else compare the time of collision (Tleft) with Ts3
Step 1: Call check front subroutine g) If time of collision (Tleft) is greater than Ts3, beep
a) Take in the time of collision (Trear) of the rear side and go to Step 3(a)
from MCre h) Else call turn right routine to take a right turn so
b) Take in the minimum time (Ts4) taken to that the time of collision (Tleft) increases to at least
accelerate at the front from MCa, minimum time (Ts3) 2*Ts3 or till the angle of rotation of the car becomes
to take a stable left turn from MClt and minimum time equal to theta, which ever comes first
(Ts2) to take a stable right turn from MCrt i) Go to step 1

c) Compare the three time quantities and choose the 5.1. Algorithms for the subroutines
smallest (Ts)
d) Compare collision time (Trear) with 2*Ts 1. CHECK FRONT:
e) If collision time (Trear) is more than or equal to a) Take the time of collision Tfront for the front side
2*Ts, go to Step 2 from the microcontroller Mf
f) Else compare collision time (Trear) with Ts b) Take in the time for stable braking Ts1 at that
g) If collision time (Trear) is Greater than or equal to velocity of the car from the microcontroller Mbr
Ts, beep and go to step 1(a) c) Compare Tfront with 2Ts1, If Tfront >2Ts1,
h) Else call turn left routine or turn right routine or Return
accelerate routine, which ever fits according to step d) Else beep once and compare Tfront with Ts1, if
1(b). Tfront>Ts1, Go to Step b
i) Go to step 2 e) Else call brake subroutine
f) Return
Step 2:
a) Take in the time of collision Tright from the 2. BRAKE:
microcontroller MCr a) Take in the amount of rotation of the stepper motor
b) Take in the variable maximum stable angle theta from MCbr so that the car is stable at that speed while
for left turn from MClt braking
c) Take in the time (Ts2) required to travel (at most) b) Take in the minimum time (Ts1) required to brake
the length of the car at that velocity and at the the car at that velocity from MCbr
maximum angle theta obtained from MClt c) Take in the time of collision of the front (Tfront)
d) Compare the time of collision (Tright) with 2*Ts2 from MCf
e) If collision time (Tright) is greater than or equal to d) Rotate stepper motor till the collision time Tfront
2*Ts2, go to step 3 becomes equal to 2*Ts1 or till the motor is rotated to
f) Else compare the time of collision (Tright) with Ts2 that angle, which ever comes first
g) If time of collision (Tright) is greater than Ts2, e) Return
beep and go to Step 2(a)
h) Else call turn left routine to take a left turn so that 3. TURN LEFT:
the time of collision (Tright) increases to at least 2*Ts2 a) Take in the maximum angle theta at which the car
or till the angle of rotation of the car becomes equal to can take a stable left turn from MClt
theta, which ever comes first b) Take in the time of collision (Tright) of the right
i) Go to step 3 side from MCr

Proceedings of the 2005 International Conference on Computational Intelligence for Modelling, Control and Automation, and International Conference on
Intelligent Agents, Web Technologies and Internet Commerce (CIMCA-IAWTIC05)
0-7695-2504-0/05 $20.00 2005 IEEE
c) Take in the minimum time (Ts2) required for the car 6. The outline of the program fed to the
to travel the at most the length of the car to the left at
that angle from MClt
central microcontroller
d) Rotate the motor to the right one step, call check
front routine (we cant continue to turn left if there are
cars at the front during the left turn)
e) Rotate stepper motor till right collision time Tright STEP 1
becomes equal to 2*Ts2 or till the motor is rotated to CHECK
that angle, which ever comes first CHECK FRONT
f) Return REAR

4. TURN RIGHT:
a) Take in the maximum angle theta at which the car BRAKE
can take a stable right turn from MCrt
b) Take in the time of collision (Tleft) of the left side
from MCl. STEP 2
c) Take in the minimum time (Ts3) required for the car ACCELE-
to travel the at most the length of the car to the right at CHECK RATE
that angle from MCrt RIGHT
d) Rotate the motor to the left one step, call check FRONT
front routine (we cant continue to turn right if there
are cars at the front during the right turn)
e) Rotate stepper motor till left collision time Tleft TURN
becomes equal to 2*Ts3 or till the motor is rotated to LEFT
that angle, which ever comes first
f) Return STEP 3

5. ACCELERATE: CHECK TURN


a) Take in the minimum time Ts4 to accelerate to LEFT RIGHT
maximum speed from that velocity at maximum
acceleration with regard to that velocity from MCa
b) Take in the time of collision Trear from MCre
c) Rotate stepper motor to press the accelerator pedal
d) Call check front routine (we cant continue to Figure 3. The flow of program
accelerate forward if there are cars at the front during
the acceleration) 1. The figure 2 shows the layout of the program
e) Rotate stepper motor till rear collision time Trear (Algorithm) that is fed to the central microcontroller.
becomes equal to 2*Ts4 or till the motor is rotated to 2. The blocks of code on the left hand side (namely
that angle, which ever comes first Step1, Step 2, Step3) form the main body of the
f) Return program while the blocks of code on the right hand
side (namely check front, brake, accelerate front,
turn left and turn right) is written as subroutines that
PRIORITY LEVELS FOR THE SIDES will be called by different segments of the main
program, whenever necessary.
PRIORITY LEVEL 1 FRONT SIDE
3. The first few codes of Step1 calls check front
PRIORITY LEVEL 2 REAR SIDE
subroutine to check the front side of the car (i.e. to
PRIORITY LEVEL 3 RIGHT SIDE
check if the front side is safe), accordingly depending
PRIORITY LEVEL 4 LEFT SIDE
on the requirement, the check front routine might also
call the brake routine.
Figure 2. Priority levels assigned to the sides 4. The rest of the codes of Step 1 checks if the rear of
the car is safe and might call accelerate front or

Proceedings of the 2005 International Conference on Computational Intelligence for Modelling, Control and Automation, and International Conference on
Intelligent Agents, Web Technologies and Internet Commerce (CIMCA-IAWTIC05)
0-7695-2504-0/05 $20.00 2005 IEEE
turn left or turn right subroutines, depending on the
required action to be taken.
5. Step 2 basically checks the right side of the car and
might call the turn left routine (responsible for rotation
of the motor in turn controlling the braking,
acceleration and steering systems) and/or the check
front routine, if a need arises
6. Step 3 checks the left side of the car and calls the
check front and/or turn right routine if required.

7. Mechanical systems of the car


Figure 5. The modified steering system
7.1. Braking system

In normal hydraulic braking systems, the brake In the modified steering system, a stepper motor
pedal is pushed by the driver, in turn pulling the (within a gear system) is rotated by the central
pistons (inside the master cylinder) to the right, away microcontroller to turn the steering shaft left or right
from the openings, thereby releasing hydraulic fluid artificially as per the algorithm. The rotation of the
into the brake shoes causing the brakes to be applied. stepper motor depends upon the velocity of the car,
taking stability conditions under consideration.

7.3. Acceleration system

The pedal of the accelerator can be pressed with the


help of a small gear system and a stepper motor (easily
programmable) in order to increase the speed of the car
to any desired speed.

8. Conclusion

The proposed system is a cheap/low cost system that


can be implanted in manually driven cars for safety
purpose without taking away the pleasure of driving
unlike fully automated cars. The system developed can
be used in normal city traffic conditions as well as in
highways. The system will be more effective in smaller
Figure 4. The modified braking system cars as braking, steering and acceleration are easy to
control. Features like alerting the driver with the
However in the proposed modified system, a stepper
collision times on all four sides with the help of a LCD
motor is rotated to the right by the central display can be easily achieved. Once implemented it
microcontroller. With the help of a chain/belt, a will significantly reduce the accidents caused due to
crankshaft in turn is rotated to the right, pushing the collisions, thus saving the passengers as well as the
pistons to the right and away from the openings, vehicle.
thereby artificially applying the brakes. The motor can
be rotated to the left to release the brake according to
9. References
the demand of the algorithm stated.
[1] Ernest O. Doeblin, Measurement systems, applications
7.2. Steering system and design, IV edition Pearson education.
[2] J.B. Peatman, Design with PIC microcontrollers, PH
In a normal rack and pinion steering system the Engineering 1998.
rotary action of the steering shaft is converted into [3] Crouse and Anglin, Automotive Mechanics, Mc Graw
linear motion and thus rotating the wheels. Hill 2002.

Proceedings of the 2005 International Conference on Computational Intelligence for Modelling, Control and Automation, and International Conference on
Intelligent Agents, Web Technologies and Internet Commerce (CIMCA-IAWTIC05)
0-7695-2504-0/05 $20.00 2005 IEEE

You might also like