MINI PROJECT
VEHICLE ACCIDENT
PREVENTION USING
DROWSINESS DETECTION
ABSTRACT
Now
a days accidents are increasing at a large
pace,and various technologies are being introduced to
reduce the accidents.
The project deals with the prevention of road
accidents caused by drowsiness of the driver.
The driver is not able to control his vehicle when he is
asleep and by the time he realizes it, there is an
accident.
In this project we provide means of accident
prevention using eye blink wherein the vehicle is
stopped immediately and intimated wherever needed.
The
vehicle is at a very high speed on highways
due to which handling is tough and getting the
vehicle to halt in such a condition is difficult.
The Purpose of this a model is to advance a
system to detect fatigue symptoms in drivers
and control the speed of vehicle to avoid
accidents.
The main components of the system consists of
an eye blink sensor for driver blink acquisition
and an adaptive speed controller designed
using stepper motor to control the speed of
vehicle.
In this project we have two sections.
1. Transmitter section
2. Reciever section
. Transmitter section involves a webcam to capture
the image followed by an image processing
circuit using matlab and a zigbee module.
. Reciever section involves a Zigbee module to
receive signal from the transmitter.
. It is then used to signal the controller to initiate
necessary measures such as turning on an alarm
and stopping the vehicle.Stopping the vehicle
means to slow down the vehicle and park the
vehicle aside by showing left side indication,
checking for any obatacle at the left side
BLOCK DIAGRAM
TRANSMITTER:
RECEIVER:
CIRCUIT DIAGRAM
BLOCK DIAGRAM EXPLANATION
Microcontroller: PIC16F877A:
RISC
architecture
Operating frequency 0-20 MHZ
Precision internal oscillator
Power supply voltage 2.0 V-5.5 V
Power saving sleep mode
Brown out Reset (BOR) with software control option
35 I/O pins,3 independent timers/counters
8K ROM memory in FLASH technology
In-circuit serial programming option
256 bytes EEPROM memory,368 byte RAM memory
MOTOR DRIVER:
L293D
is a typical Motor driver or Motor Driver IC
which allows DC motor to drive on either direction.
L293D is a 16-pin IC which can control a set of two DC
motors simultaneously in any direction.
It means that you can control two DC motor with a
single L293D IC. Dual H-bridge Motor Driver integrated
circuit (IC).
It works on the concept of H-bridge. H-bridge is a
circuit which allows the voltage to be flown in either
direction.
Voltage need to change its direction for being able to
rotate the motor in clockwise or anticlockwise direction.
Hence H-bridge IC are ideal for driving a DC motor.
In
a single l293d chip there two h-Bridge circuit
inside the IC which can rotate two dc motor
independently. Due to its size, it is very much
used in robotic application for controlling DC
motors.
There are two Enable pins on l293d. Pin 1 and pin
9, for being able to drive the motor, the pin 1 and
9 need to be high.
For driving the motor with left H-bridge you need
to enable pin 1 to high. And for right H-Bridge you
need to make the pin 9 to high.
If anyone of the either pin1 or pin9 goes low then
the motor in the corresponding section will
suspend working. Its like a switch.
L293D:
There
are 4 input pins for this l293d, pin 2,7
on the left and pin 15 ,10 on the right.
Left input pins will regulate the rotation of
motor connected across left side and right
input for motor on the right hand side.
The motors are rotated on the basis of the
inputs provided across the input pins as
LOGIC 0 or LOGIC 1.
In simple you need to provide Logic 0 or 1
across the input pins for rotating the motor.
L293D Logic Table
Consider a Motor connected on left side
output pins (pin 3,6). For rotating the motor
in clockwise direction the input pins has to be
provided with Logic 1 and Logic 0.
Pin 2 = Logic 1 and Pin 7 = Logic 0 |
Clockwise Direction
Pin 2 = Logic 0 and Pin 7 = Logic 1 |
Anticlockwise Direction
Pin 2 = Logic 0 and Pin 7 = Logic 0 | Idle [No
rotation] [Hi-Impedance state]
Pin 2 = Logic 1 and Pin 7 = Logic 1 | Idle [No
rotation]
LCD DISPLAY:
16x2 LCD display is very basic module.
These modules are preferred over seven
segments and other multisegment displays.
The reasons being:LCDs are economical:easily
programmable:have no limitation of displaying
special characters & even custom characters
(unlike in seven segments),animations and so
on.
A 16x2 means it can display 16 characters per
line and there are 2 such lines.
Each character is displayed in 5x7 pixel matrix.
This LCD has 2 registers: COMMAND and DATA.
The
command register stores command
instructions given to the LCD.
A command is an instruction given to
LCD to do a predefined task.
The data register stores the data to be
displayed on the LCD.
The data is the ASCII value of the
character to be displayed on the LCD.
A 16x2 LCD display is used to display
necessary messages to the surrounding
vehicles
ZIGBEE:
Zigbee
is used for wireless communication.
The Zigbee transmitter module is located in
the image processing section.
In each stage, the Zigbee transmitter module
is used to transmit various data serially from
the camera section to the receiver section.
Data is transmitted serially during instances
such as starting the vehicle, first stage of alert,
system reset and second stage of alert.
Data which is transmitted serially determines
the response of the system.
Zigbee receiver is used to receive the
data transmitted serially from the camera
section using Zigbee transmitter module.
Zigbee receiver stimulates the controller
to initiate various functions in response to
different messages.
The different responses include controlling
the motion of the vehicle, display on the
LCD, turning on the buzzer etc.
WEBCAM:
Awebcamis
avideo camerathat feeds
orstreamsits image in real time to or
through acomputertocomputer network.
When "captured" by the computer, the
video stream may be saved, viewed or
sent on to other networks via systems
such as the internet, and email as an
attachment.
When sent to a remote location, the video
stream may be saved, viewed or on sent
there.
BUZZER:
A
buzzer or beeper is an audio signalling
device, which may be mechanical,
electromechanical, or piezoelectric.
Typical uses of buzzers and beepers
include alarm devices, timers and
confirmation of user input such as a
mouse click or keystroke.
In this project, it is used to awake the
driver if he falls asleep.
WORKING
When the vehicle is turned on, the camera starts
capture. The camera captures video, from which we
obtain the required images by taking screenshots.
From the obtained screenshots, only those at fixed
intervals are processed. Image processing is done
using Matlab.
The intensity variation in the region of the eyes is
checked. If the eyes are open, there will be large
intensity variation and if they are closed there will be
no intensity variation.
If the eyes appear closed in four continuous frames,
the system initiates the first stage of alert.
First stage of alert involves turning on the buzzer to
wake up the driver and displaying an alert message.
If the driver wakes up, he is provided an option to
reset the system. If he does not wake up after the first
alert, the second stage of alert is initiated.
The second stage involves displaying an emergency
message and beeping the buzzer. Then the system
checks for the presence of obstacles on the left side of
the road.
If there are no obstacles,the left indicator is turned on
and the vehicle will be parked safely on the left side of
the road. Once the vehicle stops, the camera stops
capturing.
10 PERCENT
This
stage included the working of PIC
microcontroller by using a power supply
circuit which provides a constant dc supply
of +5V.
Another part of the stage was an lcd display
which displayed an alert message VEHICLE
STOPPING .
LCD display LM016L was used and the
message was displayed by passing each
character by character to the data function
of the display program.
drawback of the 10 percent submission was
that the programming of lcd display did not use
string passing.So the program was too large.
The lcd display program was first simulated
using proteus and then burned to PIC.By
providing necessary hardware connections the
lcd was made to display the required message.
The display appeared as soon as the power was
switched on and was turned off only when the
power was switched off.Display on LCD did not
depend on any other condition.
30 PERCENT
In
the thirty percent output stage most of the
response system was simulated and
implemented on hardware.
It included an LCD display displaying the alert
message followed by stopping of the vehicle.The
response system was triggered by using a push
switch instead of the signal from Zigbee.
The microcontroller was programmed such that
on pressing the push switch the lcd display gave
the message and by the time the complete
message was displayed the vehicle was stopped.
Running and stopping of the vehicle were
illustrated using two dc motors. In running
state both motors were made to rotate in
the forward direction and in the stopping
state both the motors were stopped.
The motors were interfaced to the
microcontroller using L293D interfacing IC.
The IC can be used to control 2 dc
motors.The IC uses a 5V supply as well as
a 12V supply.The direction of rotation was
controlled by input to pins 2 and 7 for
motor1 and by pins 10 and 15 for motor 2.
50 PERCENT
The
entire transmitter section was simulated in
this stage.
The
transmitter section included the webcam and
PC.
The
program to get the image of the face and
analyse the frames at specified intervals was
developed using Matlab. Output was simulated.
If
drowsiness was detected measures which
symbolize the response side were adopted.
The
response system included displaying
different messages in the command window
in different stages.
During
the starting of the system a start
message was displayed.On receiving the first
stage of alert the corresponding message was
displayed in the command window,ie.the
message '1st Level Warning-Alarm.The
second stage of alert displays '2nd Level
Warning-Stops Vehicle'
80 PERCENT
As
part of 80 percent submission, we modified our
PIC as well as Matlab programs so as to support
graphical user interfacing.
By using RS232 we interfaced the Matlab program
on the PC with the response system on
breadboard. i.e. the receiver and transmitter
interfaced using wires.
Data was passed serially and the corresponding
outputs were observed.
For instance, when character s was passed serially
it was observed that the motors started running
and the starting message was displayed.
Similarly,
when the character a was passed,
the response corresponding to first stage of
alert was triggered. This included the buzzer
and display.
When the character r was passed, the system
was found to reset.
When the character f was passed, the second
stage of alert including the beeping buzzer,
LCD display and stopping of the vehicle was
triggered.
Thus the wired interfacing of transmitter and
receiver sections were performed.
100 PERCENT
Final
submission of the project includes the
completely fabricated PCB fixed on a
vehicle model with four wheels.
Transmitter and Receiver sections are
wirelessly interfaced using ZigBee in this
stage. Vehicle base is used to control the
motion of the vehicle.
A webcam is used to capture the face.
Initially when the start button is pressed,
the wheels of the vehicle begins to move
and the camera starts capture.
The status of the eyes will be continuously
displayed in the command window.
When
the eye remains closed in four
continuous frames, the character a is
serially transmitted from the transmitter to
the receiver Zigbee. This turns the buzzer on
and displays an alert message.
If the eye remains close in the next six
continuous frames, the character d is
transmitted and this causes the buzzer to
beep and the LCD to display an emergency
message.
Then the system checks for the presence of
obstacles and if the situation is found
favourable the left indicator is turned on and
the vehicle will be parked on the left side of
the road.
COMPONENTS REQUIRED
Webcam
PC
Zigbee
Microcontroller:
PIC16F877A
Buzzer
LCD
display:LM016L
DC Motor
Motor Interfacing IC:L293D
ADVANTAGES
Intelligent Transportation
Accidents due to drowsiness can
be prevented to a larger extent.
Safe parking with no damage to
nearer vehicles.
Provides sufficient alert to the
surrounding vehicles.
DRAWBACKS AND REMEDIAL MEASURES
Image
processing fails if the driver is using
spectacles, because the region of the eyes
cannot be detected.
Also, the detection of eyes depends on the
light available. Detection becomes hard in
low light conditions.
All these drawbacks of image capture can
be rectified by using IR cameras.
FUTURE SCOPES
In
future , the system can be made
smarter by detecting alcoholic driving
also.
The vehicle will not be started,if the
driver has consumed alcohol.