Anda di halaman 1dari 118

A DRIVER CONDITION MONITINRING SYSTEM WITH ENGINE LOCKING

MOSTAFA ESSAM BASSIOUNY AHMED


MECHATRONICS ENGINEERING
SUPERVIESD BY: DR. YVETTE SHAAN-LI SUSIAPAN

A project submitted in partial fulfilment of the requirement of


For the degree of
BEng (Hons) in Mechatronics Engineering

ASIA PACIFIC UNIVERSITY OF TECHNOLOGY & INNOVATION


FACULTY OF COMPUTING, ENGINEERING & TECHNOLOGY SCHOOL
OF ENGINEERING

AUGUST 2018

1
ACKNOLEDGEMENT

I would like to begin by thanking God for helping me by giving me the


strength required throughout this project at Asia Pacific University of Technology
and Innovation as part of the degree for Engineering (Hons).
I would like to express my special thanks of gratitude to my parents,
Prof. Essam Bassiouny Ahmed, for the support and motivation to me in terms of
finance and moral support throughout the whole course. This work would have
never been finished in the event that they had not been there.
I would like to thank everyone who had contributed to the success of
completion of this project. I would like to express my deep sense of gratitude to
Dr. Yvette Shaan-Li Susiapan, Mr. Lim Siong Chung and Mr. Kumaresan for
encouraging me to proceed with this project and provide guidance alongside.
In addition, I am very much thankful to Dr. Thang Ka Fei, Head of School
of Engineering in APU for his valuable guidance, keen interest and encouragement
at certain stages of my project.
Finally, I would also like to express my deep and thankful to all my friends,
and others whose suggestions and encouragement have contributed to the
successful of my project. Finally, I express to my family for their love and
encouragement as well. I have received so much personal support from family and
friends.

2
ABSTRACT

These days road transportation has transformed into an astonishing wellspring of


transportation as a result of the addition in auto vehicles. Inferable from this practical
augmentation of vehicles on boulevards, the possibility of accidents is rising rapidly as
number of fatal accidents due to drivers’ conditions has increased among truck drivers all
over the world leading to deaths of innocent people and lose of constructions. The aim of
this project is to design and develop a condition monitoring system for drivers. A real-time
image processing system approach to drivers monitoring conditions based on Viola-James
Algorithm and Circular Hough Transform (CHT) technique. It applies Haar Cascade
features to extract the features of Region Of Interest (ROI) of drivers face while driving
for the purpose of sleepy drivers the CHT technique used for Iris tracking which uses data
from camera which is mounted on the windshield to provide real-time conditions of the
driver to aid the warning system. Further for the purpose of intoxication drivers, Alcohol
sensor
(MQ-3) is used to detect driver’s intoxication level while DC Motor used for simulating
vehicle engine and engine locking and GSM&GPS Module to provide GPS information
and send SMS regarding driver’s alcohol consumption status to Drivers Emergency
Department.

3
TABLE OF CONTENTS
CHAPTER NO. TITLE PAGE NO.

DECLARATION OF ORIGINALITY i
APPROVAL FORM ii
ACKNOWLEDGEMENT iii
ABSTRACT iv
TABLE OF CONTENTS v
LIST OF TABLES x
LIST OF FIGURES xii
LIST OF APPENDICES xv

4
1. INTRODUCTION TO THE STUDY 1

1.1 Introduction 1
1.2 Research problem 4
1.3 Aim and objectives 5
1.4 Justification for the research 5
1.5 Organization of the rest of the chapters 6
1.6 Summary 7

5
CHAPTER NO. TITLE PAGE NO.

2. LITERATURE REVIEW 8
2.1 Introduction 8
2.2 Literature review
2.2.1 Alcohol detection 8
2.2.2 Drowsiness Detection 9
2.2.2.1 Drowsiness detection by measuring physiological changes 9
2.2.2.2 Drowsiness detection by measuring vehicle-based changes 10
2.2.2.3 Drowsiness detection by measuring behavioral changes 11
2.2.2.4 Detecting drowsiness by detection of pupil and iris 11
2.2.2.5 Detection of driver’s pulse 13
2.2.2.6 Detection of drowsiness by detecting of yawning
2.2.2.7 Detection of drowsiness by detecting eye closure 16
2.2.2.8 Real time face detection and recognition using Haar-Based
Cascade Classifier and principal component analysis. 17
2.2.2.9 Real time face detection and eye tracking based
On nonlinear Unscented Kalman filter 18
2.2.3 Alert System using GSM Module and send location using GPS 20
2.3 Summary 22

6
CHAPTER NO. TITLE PAGE NO.

3. CONCEPT DESIGN AND RESEARCH METHODOLOGY 24

3.1 Introduction 24

3.2 Proposed Methodology 24


3.3 Investigation on Materials/Components Selection 26
3.4 Concept Design derived from Fundamental Engineering principles 28
3.5 Sustainable Development I 32
3.6 Ethical consideration and Moral Professionalism I 33
3.7 Project Management, Finance and Entrepreneurship I 35
3.8 Summary 36
3.9 Conclusion 36

4. FINAL DESIGN AND SYSTEM IMPLEMENTATION 37

4.1 Introduction 37
4.2 System Implementation 37
4.2.1 Working Principle 41
4.2.1.1 Block Diagram 41
4.2.1.2 Flowchart 43
4.2.1.3 Drowsiness decision making 45
4.2.1.4 Alcohol detection 48
4.2.1.5 Engine Lock 49
4.2.2 Programming 50
4.2.2.1 Arduino 50
4.2.2.2 MATLAB 53
4.3 Hardware and Simulation Results 59

7
4.3.1 Simulation Results Graphical User Interface (GUI) 59
4.3.2 Hardware Simulation (Prototype) 63
4.4 Summary 69

5 DISCUSSION-PROJECT FINDINGS & TESTING 71

5.1 Introduction 71
5.2 Testing and Results
5.2.1 Engine lock elapsed time 71
5.2.2 Iris detection accuracy with head movement 74
5.2.3 Iris detection and drossiness accuracy in night time 80
5.2.4 Alcohol detection range test 83
5.3 Discrepancy between Theoretical and Experimental Results 89
5.4 Error sources and troubleshooting methods 89
5.4.1 Slow processing time of frames 89
5.4.2 Poor Iris detection 90
5.5 Sustainable development & Environmental considerations II 91
5.6 Project Management, Finance & Entrepreneurship II 91
5.6.1 Gantt Chart – Phase II 92
5.6.2 Project Cost II 93
5.7 Moral Professionalism and Ethical consideration II 94
5.8 Contribution of the project 94
5.9 Summary 95

8
CHAPTER NO. TITLE PAGE NO.

6 CONCLUSION AND RECOMMENDATIONS


97
6.1 Summary of Findings and Results 97
6.2 Limitations 98
6.3 Recommendations and suggestions for further research
98

REFERENCES 100

9
LIST OF TABLES

TABLE NO. TITLE PAGE NO.

2.1 Comparison between different method used for detecting drowsiness 17

2.2 Summary of Research in drowsiness detection measures 22

2.3 Summary of Research in Behavioural Measures 22

3.0 Arduino Uno Rev. 3 Comparison 27

3.1 Raspberry Pi 3 Comparison 27

3.2 Alcohol Sensor Types Comparison 28

3.3 Device Specification 32

3.4 Project Cost I 36

4.1 List of components used in prototype 37

4.2 Interfacing of input components to Arduino Uno 40

4.3 Interfacing of output components to Arduino Uno 40

4.4 Evaluating the frame value based on Iris and ROI detection 47

4.5 Commands in MATLAB to Arduino 58

5.1 Data Collection Engine Locking 72

10
LIST OF TABLES

TABLE NO. TITLE PAGE NO.

5.2 Data collection of iris detection accuracy with head movement 76


5.3 Data collection Iris detection and drossiness accuracy in night time 81
5.4 Data collection for Alcohol detection range 85
5.5 Final cost of project 93

11
LIST OF FIGURES

FIGURE NO. TITLE PAGE NO.

2.1 Alcohol Detection System Overview 9

2.2 Drowsiness Detection Based On Steering Movement Frequency 11

2.3 Block diagram of drowsiness detection using pulse finding

and detection of pupil and iris 13

2.4 Flowchart of drowsiness detection by detecting yawning 15

2.5 Flow Chart of face detection 18

2.6 Flow chart of Kalman filtering-based drowsiness detection system 19

2.7 Flow chart of real-time warning system for driver drowsiness 20

2.8 Alert System Overview 21

3.0 System Block Diagram 26

3.1 Placement of CMOS 5-megapixel camera on the windshield 29

3.2 Haar features 30

12
3.3 Integral Image 3
1

3
3.4 5 Strategic Pillars 4

3.5 Gantt Chart 3


5
3
4.1 Circuit diagram of the proposed system
9
4
4.2 Block Diagram of the Engine lock system
2
4
4.3 Flowchart of the Engine lock system
4
4
4.4 Block diagram of the drowsiness decision making
6
4
4.5 Frame arrays to decide on the drowsiness of driver
7
4
4.6 Gas detection of MQ3
8
5
4.7 Engine Lock in High Speed 0

4.8 First portion of initialization including Tick 1 and pre-ignition


5
alcohol check 1

4.9 Second portion of initialization including Tick 2 and ignition

5
alcohol check
1
5
4.10 Allowing communication with MATLAB
2
5
4.11 Engine lock condition
2
5
4.12 GSM/GPS code to send SMS contains location of the vehicle
3
5
4.13 Establishment of communication between MATLAB and Arduino
4
5
4.14 Extracting the eye area (ROI) from each frame 4

13
55
4.15 Considering only 1 ROI for the captured frame for iris detection

4.16 Finding the circles with respect to the minimum and maximum

radius size 55

4.17 Distance of driver to camera and iris detection attributes 56

4.18 Decision making over the frame array status 57

4.19 Activating the alarm system and decision making on drowsiness 58

4.20 Iris Detection GUI 59

4.21 Arduino Communications GUI 60

4.22 Main GUI 62

4.23 Front view of the prototype 63

4.24 Backend of the prototype 64

4.25 Engine simulation using DC motor and L298N driver 65

4.26 Tick 1 and Tick 2 switches 66

4.27 LEDs representing the initialization process 67

4.28 GSM SIM808 modem and step up DC voltage supply 68

4.29 Camera and LCD 69

5.1 The elapsed time for engine lock vs. SMS transmission time 73

5.2 Elapsed time for each 10 frames for 50 samples 79

14
5.3 Iris detection with head movement in daytime 79

5.4 Iris detection accuracy in night time chart 83

5.5 The setup for the alcohol test 84

5.6 The distance of driver and range of detection in radius of MQ3 85

5.7 Alcohol sensor (MQ3) measurement based on distance over 70 samples 88

5.8 Saving reading a frame for iris detection process 89

5.9 Project management planning for phase 2 92

15
CHAPTER 1

INTRODUCTION TO THE STUDY

1.1 Introduction

Automotive industry comprises of companies involved in design,


manufacturing and developing motor vehicles. Vehicles are designed based on the
various types of needs., for instance transportation of persons/ pets/goods,
entertainment, defense etc. The technological development in the design of vehicles
enhanced in the 20th century. Despite technological advancement various types of
accidents still occur. Traffic collisions happen, both due to mechanical faults in the
automobile as well as due to human errors say, behavior of the driver. Moreover,
decision-making ability and reaction speed also play a major role in the accidents
which may be attributed to a drunk or drowsy driver. Accidents caused by drunk or
drowsy drivers are high in number. Therefore, there is a need for having a monitor
to check the driver’s state of health coupled with locking engine in case the driver is
found to be intoxicated can prevent and reduce accidents.
Alcohol is classified as a depressant, implying that, it backs off crucial
capacities bringing about a slurred conversation, unstable development, disturbed
discernments and a failure to respond rapidly. With respect to how it influences the
psyche, it is best comprehended as a drug that diminishes a man's capacity to think
normally and misshapes his or her judgment.
Despite its name as a depressant, the measure of liquor devoured decides the
kind of impact. A great many people drink for the stimulant impact, for example, a
lager or glass of wine taken to "release up." But if a man devours more than the

1
body can deal with, they at that point encounter liquor's depressant impact. They
begin to feel "dumb" or lose coordination and control.
Home Minister Datuk Seri Dr. Ahmad Zahid Hamidi proposed that alcohol
consumption by drivers was one of the factors identified for road accidents.
"Between 2010 and April 2015, a total of 1,035 road accidents were recorded due to
the influence of alcohol which resulted in 618 deaths" (Carvalho, 2015).
The research carried by National Institute on Alcohol Abuse and Alcoholism
in United States of America proposed that “According to the 2015 National Survey
on Drug Use and Health (NSDUH), 86.4 percent of people ages 18 or older reported
that they drank alcohol at some point in their lifetime; 70.1 percent reported that
they drank in the past year; 56.0 percent reported that they drank in the past month”
(Alcoholism, 2017).
Whereas research carried by the National Highway Traffic Safety
Administration mentioning that “Approximately one-third of all traffic crash
fatalities in the United States involve drunk drivers (with Blood Alcohol
Concentrations [BACs] of .08 or higher). In 2016, there were 10,497 people killed
in these preventable crashes. In fact, on an average over 10-year period from 2006-
2016, more than 10,000 people died every year in drunk-driving crashes.”
(Adminstration, 2016).
Nowadays street transportation has turned into a surprising source of
transportation because of increment in car vehicles. Inferable from this expedient
increment of vehicles on streets, the possibility of mischances is rising quickly.
Apart from a couple of nations where liquor is banned, hindrance by liquor is a
critical factor affecting both the danger of a streetcar accident and the seriousness
and result of the wounds that outcome from it. The recurrence of drinking and
driving differ between nations; however, many years of research have demonstrated
that drunken drivers have fundamentally higher degree of danger being associated
with a street crash than drivers who have not expended liquor.
The quick impact of alcohol on the mind are either discouraging or
empowering in nature, contingent upon the amount devoured. In any case, alcohol
brings about impedance which improves the probability of a crash since it produces

2
misguided thinking expanded response time and reduces the level of being alert with
diminished visual vision.
On the other hand, accidents caused by drowsy driving has also a huge impact on
the society. Greater part of the mishaps caused nowadays is because of the driver's
drowsiness; especially of heavy vehicle drivers who drive for a long time without
taking a break. As research carried by the National Highway Traffic Safety
Administration mentioning states that “In 2014 there were 846 fatalities (2.6% of all
fatalities) recorded in NHTSA’s FARS database that was drowsy-driving-related.
These reported fatalities (and drowsy-driving crashes overall) have remained
largely consistent across the past decade. Between 2005 and 2009 there was an
estimated average of 83,000 crashes each year related to drowsy driving. This
annual average includes almost 886 fatal crashes (2.5% of all fatal crashes), an
estimated
37,000 injury crashes, and an estimated 45,000 property damage only crashes.”
(Adminstration, 2016)
To overcome the above two causes of accidents, a self-controlled system is carried
out to reduce the number of accidents caused by drinking or drowsy driving. The
system is to detect the blood alcohol concentration in a driver as well as alerting
him if he falls asleep while driving.
The system uses an alcoholic sensor which will detect the blood alcohol
concentration in the driver before he starts vehicle. If the sensor detects blood
alcohol concentration of 0.5 or higher, the engine lock will be activated and thus
preventing the driver to drive as the alcohol concentration equals to 0.5 or higher.
Suppose the driver was sober and he starts the engine normally and start driving
but later he decided to drink while driving. The alcoholic sensor will detect the
blood alcohol concentration while driving resulting in locking the engine and at the
same time buzzer will act as warning and a message sent to the family member or
consultant of the company along with the location of the vehicle which will not
allow the drunk driver to start the engine unless a sober driver will drive the vehicle.
Secondly, to overcome the second major reason of accidents, by attaching a
highquality camera (a charged coupled device) in front of the driver which is
controlled by computer vision methods and by implementing real-time image
3
processing, the system will detect the eye conditions and compare it with the stored
data. If the system detects drowsiness in the eye of the driver, a buzzer is activated
which will act as warning and a message is sent on the LCD, informing that the
driver must take a break for few hours.
By implementing this system in future, the number of accidents will be reduced and
the innocent lives of pedestrians as well as children will be saved.

1.2 Research Problem

In designing a system to detect the driver’s conditions, there are various


challenges that need to point it out. One of the major challenges is when detecting
the drowsiness of the driver.
The researchers proposed an algorithm to locate, track and utilize the driver’s
face and eyes to measure eye closure which is reliably supported measure of fatigue.
(Belal, et al., 2013).
The focus of this research is to use behavioral measures. A fatigue individual
shows various distinguishable facial movements, including quick and steady
squinting, gesturing or swinging their head, and regular yawning. Computerized,
nonmeddling, behavioral methodologies are broadly utilized for deciding the
sleepiness level of drivers by measuring their irregular behaviors. Lighting is one of
the basic elements of any noteworthy image processing for detecting and tracking
the eye closure. A proper lighting system will have a huge impact on the quality of
processing data. Therefore, an infrared illuminator can be used to help detecting the
eye closure during the night time as most of the accidents occur during midnight
when the lighting is poor depending on the road used.
On the other hand, huge number of accidents caused by drunk drivers.
Therefore, MQ3 sensor which is high in sensitivity in detection of alcohol and low
sensitivity of the other gases - for example benzene can be used to detect the blood
alcohol content as MQ3 alcohol sensor has high sensitivity in detecting low value of
blood alcohol content.

4
Finally, an alert system acclimated to alert the driver- whether the driver is
feeling sleepy or intoxicated as well as the ignition system used for starting up the
engine or switching of the engine, if the MQ3 detects level of alcohol in blood of
the driver or the computerized behavioral measures the sleepiness level of the
driver.

1.3 Aim and Objectives

Aim:
To design a system capable of monitoring the intoxication and drowsiness of
a driver to trigger engine locking.

Objectives:
1. To design and develop of vision-based system for drowsiness detection based on
Iris detection.
2. To design and develop a monitoring system for intoxication level of a driver.
3. To design an alert system using GSM Module and send location using GPS.
4. To design and simulate engine locking if the driver is unfit to drive.

1.4 Justification of this research

In the present creating world, advancements are impacting at each place to


bolster our mankind. There has been a great headway in technological
advancements of vehicles over past years and still to come. But accidents are yet
occurring around us. Because of the absence of transportation control facilities,
contravention of guidelines and inattention while driving has expanded lethal rates.
The research carried in the United Kingdom found, “In 2015, provisional figures
show that 220 people were killed, 160 were seriously injured and there were over
8,000 casualties in total in drink-drive accidents. Although the level of drinking and
driving has dropped dramatically over the last three decades, over 200 people are
still killed in drink-drive accidents every year.” (Accidents, 2017).

5
In general, many accidents occurring because of drinking and driving, the
project is developed to come up with a reliable solution for both main causes of
accidents - drinking and driving and falling asleep while driving. The development
of this project is necessary as it will save innocent lives caused whether by drunk
drivers or sleepy drivers.
As a researcher proposed, “In Brazil, the Federal Highway Police verified
168,593 accidents on Brazilian highways, amounting to 100,396 wounded and 8,227
dead persons in 2014. The lack of attention and sleepiness at the wheel caused
32.3% and 6% of the fatal accidents, respectively” (FV & MT, 2017). (FV & MT,
2017) also added, “In global terms, approximately 7% to 30% of fatal traffic deaths
are a result of sleepiness and fatigue”.

1.5 Organization of rest of the chapters

In chapter 2, a review of literature has been done with reference to the past
inquiries about drinking and driving and languid driving including the discoveries of
the investigation, strategies, developments, attributes, comparable frameworks and
the constraints experienced by the scientists.
In chapter 3 will depict the venture nature that will be experienced. It covers
the arranged plan and methodology that will be considered to build up the alcohol
and drowsiness detection system in a precise procedure. The subsections will cover
the material choice, simulate engine locking, and alert system. At last, sustainability
rule and project management will be represented.
Chapter 4 is to represents the actual implementation of the engine lock
system with respect to the drowsiness and alcohol detection with justification of
changes. The construction of the prototype will be comprehensively explained with
the aid of tables and circuit diagram. The working principle of the system will be
also explained in detail with the aid of block diagram and flowchart.
In chapter 5 the testing which the system was encountered will be explained
and data collection along with data analysis will be explained. The setup for each
test will be clarified with their various troubleshooting measures. Subsequently, the
project management with respect of second phase of the project will be explained.

6
Chapter 6 the achievement of the project will be taken into consideration
based on the aim and the objectives accomplished, limitations faced throughout the
project is summarized and further recommendations and suggestions for further
researches related to the project will be clarified before concluding the project.

1.6 Summary

To sum up, according to the problems stated, several people are dying due to
road accidents every year. So, a system is designed that can detect whether the
driver consumed alcohol or not and if so, the vehicle won’t start. Likewise, if driver
was driving and consumes alcohol in-route, the sensor will detect the blood alcohol
content and will lock the engine.
On the other hand, the system also can detect the drowsiness of the drivers
driving the vehicles in which they feel tiredness due to driving for a long time and
the system will generate a message “Take a break”. Meanwhile buzzer is activated
as a warning to the driver.

7
CHATPER 2

LITERATURE REVIEW

2.1 Introduction

Many researches have been proposed to detect physical and psychic


conditions of a driver which may be one of the causes of road accidents. This
chapter review the past researches carried out in relation to intoxication and
drowsiness of the driver causing road accidents. Although the literature covers a
wide variety of the methods of detecting the level of intoxication and drowsiness of
driver, this review will focus on 3 major themes. These themes are physiological
measures, vehiclebased measures and behavioral measures. Though the literature
presents various themes, this chapter will focus on behavioral measures.

2.2 Literature Review

2.2.1 Alcohol detection

(Bhuta, et al., 2015) proposed a system which aimed to decrease the traffic
collision caused by drunken drivers. The system recognizes the existence of alcohol
in the vehicle and directly switch of the motor of the vehicle. In the meantime, a
SMS includes the location of the vehicle is sent to three pre-selected contacts.
Figure 2.1 shows the basic hardware needed to detect the existence of
alcohol - the Arduino Uno Microcontroller, which is the heart of the system. While
the alcohol sensor is utilized to detect the alcohol, the output is analog, which is
interfaced to the Arduino Uno board. Moreover, GSM module utilized to send an
SMS to three preselected contacts using the GPS module which tracks the location
of the vehicle and included in the message sent by the GSM module. LCD displays
the message showing that “Alcohol Detected”. Meanwhile a DC motor which is

8
used as a simulator simulating the engine locking feature locks the engine, when
alcohol is detected.

Figure 2.1 Alcohol Detection System Overview

(Bhuta, et al., 2015)

2.2.2 Drowsiness Detection

2.2.2.1 Drowsiness detection by measuring physiological changes

This approach is to gauge the physiological changes of drivers from bio


signals; for example, the Electroencephalogram (EEG), Electrooculography (EOG),
and Electrocardiogram (ECG or EKG). Since the sleep cadence is emphatically
corresponded with brain and heart exercises, these physiological bio signals can
give precise drowsiness identification. Apart from this, all the researches in this
approach require electrode contacts on drivers' head, face, or chest. On other hand,
wiring is another issue for this approach. The electrodes contacts and wires will
pester the drivers and are hard to be actualized in real applications.
The researchers mentioned that the heart rate (HR) also shifts crucially
between the distinctive phases of tiredness, for example, alertness and exhaustion.
In this manner, heart rate, which can be effectively controlled by the ECG flag, can
likewise be utilized to recognize languor. Others have estimated tiredness utilizing
Heart Rate Variability (HRV), in which the low (LF) and high (HF) frequencies fall
in the scope of 0.04– 0.15 Hz and 0.14– 0.4.

9
The Electroencephalogram (EEG) is the physiological signal most normally
used to gauge tiredness. The EEG signal has different recurrence classification.
Firstly, the delta band from 0.5 Hz to 4 Hz, which means the human body is at rest.
Secondly, theta band from 4 Hz to 8 Hz, which means that the human body is
identified with tiredness. Thirdly, alpha band that identify the relief and innovation
state of human body which from 8 Hz to 13 Hz. Finally, beta band that define the
awareness state of the human body that starts from 13 Hz to 25 Hz. A reduction in
the energy of human body changes in the alpha recurrence band and an expansion in
the theta recurrence band which stipulate drowsiness of the human body (Saini &
Saini , 2014).

2.2.2.2 Drowsiness detection by measuring vehicle-based changes

The researches proposed vehicle-based mechanism, which compute the


steering wheel movement. Steering wheel movement is measured using an angle
sensor mounted on the steering column which will measure the driver’s steering
behavior. If the driver is sleepy, the number of micro corrections on the steering
wheel reduces when compared to normal driving. When the driver falls asleep while
driving, it results in swinging of steering as compared to normal driving condition.
To reduce the consequence of changing lane which may result in an accident, the
researchers took into consideration the small change in the movement of steering
wheel which lies between 0.5° to 4° which is enough to modify the lateral position
inside the lane (Saini & Saini , 2014).
Figure 2.2 shows the normal (awake) steering movement compared with the
drowsiness of steering movement. Auto organizations, for example, Nissan and
Renault, have embraced SWMs. However, it works only in extremely constrained
circumstances. This is because they can work dependably at specific situations and
are excessively subject to the geometric qualities of the street and to a lesser degree
on the active attributes of the vehicle.

10
Figure 2.2 Drowsiness Detection Based On Steering Movement Frequency

(Saini & Saini , 2014)

2.2.2.3 Drowsiness detection by measuring behavioral changes

A drowsy driver shows various trademark facial motions, including quick


and steady flickering, gesturing or swinging their head, and incessant yawning.
Behavioral measures method which is utilized by image processing of the various
known facial movements. Different parameters are detected using the image
processing process to detect the drowsiness of the driver.

2.2.2.4 Detecting drowsiness by detection of pupil and iris.

According to the Monitoring System for Drivers of Heavy Vehicles


Automated, to detect the drowsiness of the driver, the researchers (Ozakta , et al.,
2016) proposed that eye tracking is the procedure of evaluating either the point of
staring or the movement of an eye relative to the head through an image-based eye
detection by exploiting eyes’ differences in appearance and shape from the rest of
the face. The researchers (Ozakta , et al., 2016) added to identify the drowsiness of
the driver is significant to detect pupil and iris.

11
Figure 2.3 shows the block diagram of the proposed system utilizing Haar
Adaboost Classifier which uses pre-trained cascade file in OpenCV library. The
methodology used is by recognizing the eye socket. The two eye sockets are utilized
as the competitor locales to limit the computational cost and likely misrecognizing
for eye pupil detection. Eye sockets appear in two unrelated rectangles and their
mass focuses in terms of strength. Contingent upon the Euclidean separation
between the mass focus and every pixel in every socket, the pixel with the base
physical separation and most noteworthy obscurity is considered as the probable
pupil center. Keeping in mind the end goal to discover the eyeball limit, pixels are
scanned from external to internal towards the competitor pupil center in 8 routes.
Neighborhood minima and maxima regions in which pixels make high difference in
terms of strength are identifiable and their Euclidean separations with the likely
probable pupil are found the mean value of. By this technique, circular model of
eyeball is approximated with its centroid and two distances across. At last, the
enormity of the proportion x/y between the flat distance across x and vertical
diameter y decides the drowsiness state.

12
Figure 2.3 Block diagram of drowsiness detection using pulse
finding and detection of pupil and iris. (Ozakta et
al.,2016)

2.2.2.5 Detection of driver’s pulse

The researchers (Ozakta et al.,2016) added on pulse finding case which is


located to the steering of vehicle. The beat of the driver can be recorded through
hygrograph. The normal of the beat is computed in at regular intervals. A degree is
indicated by including - 20 and +20, in each time when the median is computed.
And afterward it is controlled that whether the present heartbeat is in the range
specified or not. On the off chance that present heartbeat isn't in the range specified,
the driver will see a notice at the indicator board which is Have a break! While if
there is no heartbeat, the vehicle stops, and a message is sent to the emergency
department about the drivers hear beat. This system approach has been programmed
on Arduino environment that is Java base IDE.
13
2.2.2.6 Detection of drowsiness by detecting of yawning

The researchers (Abtahi, et al.,2014) define that the drowsiness is the


significant issue behind the street mishaps. The utilization of assistive system that
monitors a driver's level of carefulness and alarm the driver in case of drowsiness
can be noteworthy in the prevention of accidents.
Figure 2.4 shows the system diagram of the proposed system which consist
of different stages to detect the changes in the mouth of the driver. Firstly, detecting
the face which is a challenging task as human faces are nonrigid and have a huge
level of variability in size, color, shape and texture. Taking all the variable into
consideration, the most practical way to detect drivers face is by recognizing the
skin color and texture. Despite, it should be known that the detection plan should be
fixed to skin type and variation in lighting conditions

14
Figure 2.4 Flowchart of drowsiness detection by detecting yawning.

(Abtahi et al.,2014)

In consequence, researches took advantages of the basic rules for various


color space for instance RGB, YCbCr and HSV as to enhance the efficiency of the
detection. RGB is utilized to detect the skin color during normal or lateral daylight
beam and under any external illumination. Furthermore, Cb-Cr color space known
as color appearance parameters addition assurance of skin color where Hue values
display the observable split between skin and non-skin regions. Results of skin
location technique is black and white image shows the face as white and the
background in black color. Moving on, after detecting the face of the driver
researchers used the detected face as a template to track down the face movements
based in Kalman filter movements tracking. After face detection and tracking its
movements, the position of the eye is detected to verify the location of the mouth in
the face is identified accurately by using the geometrical relationship between the
eyes and mouth.
In this paper researchers purposed another approach towards location of
driver’s sluggishness considering yawning estimation. This includes a few stages
such as the constant recognition and following of driver's face, discovery and
15
following of the mouth form and the location of yawning by considering and
estimating both the rate and the measure of changes in the mouth shape region. In
this paper a few strategies are utilized, that are connected to few procedures to
guarantee the detection of yawning appearance within the sight of variable lighting
conditions and facial impediments.
Test outcomes exhibit that the proposed framework can proficiently gauge
the previously mentioned parameters and recognize the yawning state as an
indication of driver's sluggishness in real-time environment.

2.2.2.7 Detection of drowsiness by detecting eye closure

The researchers depict a constant framework for breaking down video


arrangements of a driver and deciding the level of attention. For this reason,
researchers utilize the calculation of percentage of eyelid closure. The eye closure
goes about as a marker to distinguish sleepiness. Driver's fatigue and drowsiness are

the significant reasons for car crashes on street. It is extremely important to screen
the driver's cautiousness level and to issuing a ready when he/she isn't giving careful
consideration to the street is a promising method to lessen the mistakes caused by
driver factors. The weariness checking can begin with separating visual parameters.
This should be possible through a PC vision framework. The researchers purposed
reason of an ongoing robust technique for eye following under factor lighting
conditions and facial introductions.
In this paper the most recent innovations are utilized for eye identification.
The following depends on the eye appearance. Visual data is gained utilizing an
extraordinarily outlined arrangement joining a CCD camcorder with an IR
enlightenment framework. The framework is completely programmed and
recognizes eye position and eye conclusion and recuperates the look of eyes. Trial
comes about utilizing genuine pictures exhibit the exactness and strength of the
proposed arrangement. This could turn into a vital part in the improvement of the
propelled security vehicle. (Spurjeon & Bahindwar, 2012)

16
Table 2.1 Comparison between different method used for detecting drowsiness
Method Used Variables of Advantages Weakness
detection

Physiological Brain Signals Precise Interfering


Measures and Heartbeat with
driver body.
gathered from
ECG, EOG and
EEG

Vehicle based Steering Wheel No interfering Undependable


measures Movement with driver’s
body

Behavioral Yawning, Eye No interfering Condition of the


measures closure, Eye with driver body background
and easily lighting during
blink utilized. day and night
time.

2.2.2.8 Real time face detection and recognition using Haar-Based Cascade

Classifier and principal component analysis.

(Dabhade & Bewoor, 2012) proposed a real time face recognition system by
implementing Haar Cascade Classifiers to detect the face and Log-Gabor filter for
extraction feature. In this paper, sliding window algorithm was utilized which fewer
features are chosen by sliding window algorithm.
Figure 2.5 shows the flow chart of face detection. Moreover, principal
component analysis of Log-Gabor feature is used for face recognition which is
known also as Eigenspace projection. Eigenspace is calculated by identifying the
eigenvectors of the covariance matrix resulting from a set of facial vectors.

17
Figure 2.5 Flow Chart of face detection
(Dabhade & Bewoor, 2012)

2.2.2.9 Real time face detection and eye tracking based on nonlinear Unscented Kalman filter.
(Zang & Zhang, 2017) proposed driver drowsiness detection system based
on nonlinear unscented Kalman filter.
Figure 2.6 shows the flow chart of the drowsiness detection system. The
proposed system tracks down the eye which consist of two major concepts. The first
concept is a Kalman filter -based tracking the pupil followed by support vector
machine classifier for pupil verification. If the first eye tracking concept fails by the
mean shift tracking the researchers can activate the second concept. The system
detects the face location by Haar-Cascade Classifier. Driver fatigue is detected using
PERCLOS.

18
Figure 2.6 Flow chart of Kalman filtering-based drowsiness detection system.

(Zang & Zhang, 2017)

Figure 2.7 shows the flow chary of real-time warning system for driver
drowsiness. (Flores, et al., 2009) proposed drowsiness system which present six
modules. The researchers used Haar Cascade Classifier and Adaboost technique to
detect the face of the driver. Moreover, researchers used condensation algorithm
parallel with neural networks for tracking the face. Further, head-tilt based on neural
networks was implemented to know the face orientation in the up and down cases.

19
Figure 2.7 Flow chart of real-time warning system for driver drowsiness
(Flores, et al., 2009)

2.2.3 Alert System using GSM Module and send location using GPS

Alerting the driver, while driving, is required in many conditions. For


instance, for heavy truck drivers who drive for long time without taking a break are
prone to cause accidents as they fall asleep while driving. In this research, alert
system with both vehicle tracking, and accident alert features is highlighted.
Vehicle tracking features basically benefits the organizations which depend
on the vehicle framework. Since it can demonstrate the situation of all vehicles
progressively, they can provide normal information as needed. The following
framework can store the entire information where the vehicle had gone, where it
stopped with how much time it took at each stop and can make provide entire
information for examination. It is additionally utilized as a part of transports and
prepares, to assess how far are they, how much time it takes for them to arrive at a
specific stop.
Accident Alert Feature depends on innovation. The primary reason for its
existence is to recognize a mishap and alarm to the emergency room, so the casualty
can discover some assistance. It can identify mishaps and the force of the mischance
with no visual contact from the control room. If this framework is embedded into
each vehicle then it is straightforward to understand the number of vehicles

20
associated with a specific mischance and how extreme it is with the goal that the
assistance from emergency room will be according to the emergency room. (Rakesh,
2014)
Figure 2.8 shows the overview of the alert system where vehicles receive
data from Global Positioning System and send it by using GSM module to
communicate with the owner of the vehicles or the emergency department. The
location of the vehicle is found by Global Positioning System that uses either
satellite or radio signals to send the coordinates of the location to the emergency or
owner of the vehicle.

Figure 2.8 Alert System Overview

(Rakesh, 2014)

21
2.3 Summary

Table 2.2 Summary of research in drowsiness detection measures


No Year Researcher Method Used Weakness
. Name
1 2014 Saini and Saini Physiological Measures Interfering with driver body.
2 2014 Saini and Saini Vehicle based measures Undependable
3 2016 Ozakta , et al. Behavioral measures Condition of the background
lighting during day and night
time.

Table 2.3 Summary of research in behavioural measures


No Year Researcher Sensor Used Detection Filters Accuracy
. Name Techniques
1 2016 Ozakta et C170 Haar Adaboost 90%
al.,2016 Camera Classifier
2 2010 Zhang and Camera with HaarCascad Unscented 99%
Zhang IR e Kalman
illuminator Classifier Filter
3 2012 Dabhade and CCD HaarCascad Log-Gabor 76%
Bewoor Camera e Filter
Classifier

4 2009 Flores, et al. Monocular Haar- Adaboost 96%


Camera Cascade Technique
Classifier
5 2009 Flores, et al. Monocular Neural Condensation 95%
Camera Networks Algorithm

22
Table 2.2 and 2.3 shows the different ways of detecting drowsiness. The
HaarCascade classifier with Adaboost technique the most method used by researchers.
Moreover, method of detecting drowsiness measures whether it is physiological measures,
vehicle- based measures and behavioral measures most of the researchers prefer behavioral
method as it does not interfere with the driver.
In the next chapter, the methodology is explained and how to monitor the drivers
condition in real-time.

23
CHAPTER 3

CONCEPT DESIGN AND RESEARCH METHODOLOGY

3.1 Introduction

Distinctive ways to deal with decrease the number of mishaps caused by


intoxication or and drowsy driver, by different analysts, have been talked about in
the past section. In this chapter, the proposed strategy to be utilized to execute the
venture will be point by point. An avocation for the choice of material and parts will
be given, furthermore, engineering concepts, calculations and assumptions will be
provided. This chapter likewise portrays the maintainability of the undertaking in a
social, monetary and ecological viewpoint.

3.2 Proposed Methodology

The main control unit of the driver condition monitoring system and engine
locking would be Arduino Uno, an open source physical computing platform build
on a straightforward I/O board. Alcohol sensor (MQ-3) will be interfaced with
Arduino Uno to detect the existence of alcohol. As the driver starts the car engine
which is simulated by a DC-motor connected to key ignition. Once the car ignition
is switch on the MQ-3 sensor starts detecting the blood alcohol content of the driver.
In case of MQ-3 sensor detects the existence of alcohol immediately the simulated
car engine will switch off with the help of relay. Further, in case of sober condition
of the driver the simulated car engine will not switch off. Since the driver is sober
and there is no existence of alcohol the driver can drive the car. In consideration of,

24
driver changes his mind and starts to drink after the engine car is switched on while
he’s sober the MQ-3 sensor which is frequently detecting either alcohol exists or
not will recognize the presence of alcohol consequently the car ignition is switched
off meanwhile microcontroller gets the location of the vehicle from the global
positioning system GPS in order to send a message using global system mobile
communication GSM Modem is utilized an SMS is to be send referring to the
location provided from GPS to the pre-selected contact.
On the other hand, developing a computer vision system to monitor human
condition while driving in real time is a real challenging task where it requires
powerful processing power. Raspberry Pi, a credit-card sized computer with extreme
processing power. Would be utilized to detect the drowsiness condition of the
driver. Raspberry Pi supports interfacing with low and high peripherals devices
which makes it suitable for detecting the drowsiness driver condition. A CMOS
QSXGA 5megapixel camera interfaced with Raspberry Pi which monitor the facial
changes of the driver. The proposed system identify the symptoms of drowsiness.
By utilizing Haar cascade classifier technique to detect the face region, eye region
and eye blinking rate in real time environment. After detecting the face region of the
driver, Haar Cascade detects the open eye area and compare it with the stored data
in case of open eye area equals to 0 which define a closed eye and eye close count
increase. Every 5 seconds eye close count is compared with the threshold value if
eye close count exceeded the threshold value indicating the driver is in fatigue.
Raspberry Pi sends a warning message to Arduino Uno throughout I2C serial bus.
Prescribed tasks are carried after receiving the warning message by Arduino Uno
alike switching on the buzzer, displaying a message on LCD “Take a break” and
switching of the relay to stop the car engine.
Figure 3.0 shows the system block diagram; the proposed method will be
utilizing by a microcontroller and a single board computer. The microcontroller is
Arduino Uno which will be function as Master, while the single board computer is
Raspberry Pi which will function as slave. Alcohol sensor is interfaced with
Arduino Uno. MQ-3 detects the existence of alcohol once the driver starts the
engine car which will be simulated by a DC-motor and key ignition and a relay to
switch on or off the car ignition. An IC shifter MAX232 will be interfaced with both

25
GPS Modem and GSM Modem which will be connected to the microcontroller to
take the obligatory task according to the detected signals from the alcohol sensor or
CMOS QSXGA 5megapixel camera. Buzzer and Liquid-crystal display (LCD)
devices receives signals from Arduino Uno microcontroller as both devices are used
to alert the driver in case of alcohol intoxication or tiredness.
Further, CMOS QSXGA 5-megapixel camera interfaced with Raspberry Pi
to monitor the driver drowsiness condition by monitoring facial changes of the
drivers. Raspberry Pi will be connected to Arduino Uno microcontroller by I2C
serial bus as shown in Figure 3.0. If drowsiness of driver is detected Raspberry Pi
sends warning message through the transmit pin Tx to receiver pin Rx of Arduino
Uno microcontroller which will sends set of tasks to the buzzer and LCD to display
a message referring to “Take A Coffee Break”. Moreover, switching off the relay to
stop engine car.

Figure 3.0 System Block Diagram

3.3 Investigation on Material and Component Selection

A robust system design resulting from valuable material and most suitable
component selection. To design a powerful system there are many components that
needed to be selected.

26
3.3.1 Arduino Uno Rev3

The essential component of the driver condition monitoring system and


engine locking is the controller which controls the whole system. Amid the previous
years, various controllers have surfaced and all able to perform the same tasks
compared to other controller.

Table 3.0 Arduino Uno Rev. 3 Comparison


Arduino Uno Propeller Beagle Board
Rev3 PropStick Rev.C4
Operating None None Linux, Windows CE
System
Processor ATMEGA328 P8X32A-M44 TI DM3730 (ARM)
Speed 16 MHz 12MHz 720 MHz
RAM 2 KB 32 KB 256 MB
USB Ports Shield - 1 x 2.0
Audio Ports Shield - Stereo In/Out
Vide0 Shield VGA, NTSC or DVI-D, S-Video
PAL
Online Support Huge Community Medium Medium Community
Community
Price in RM 175 196 222

3.3.2 Raspberry Pi 3 Controller

Table 3.1 Raspberry Pi 3 Comparison


Banana Pi Raspberry Pi 3 Cubie Board 1
Operating Linux-Based Linux-based Linux-based
System
Processor ARM Cortex-A7 Quad Cortex A53 Cortex A8
Dual-Core
Clock speed 1 GHz 1.2 GHz 1 GHz

27
RAM 1G DDR3 1GB SDRAM 1GB
USB Ports 4 4 2
Audio Ports 3.5 mm 3.5 mm jack -
Video CVS and HDMI HDMI HDMI
Online Support Huge Community Huge Community Medium
Community

Price in RM 540 318 248

3.3.3 MQ-3

Table 3.2 Alcohol Sensor Types Comparison


Semiconductor Fuel cell Spectrophotometer
Breathalyzer Breathalyzer Breathalyzer
(MQ-3) Deerway (Lion 500
Portable Alcolmeter Breath
Professional analyzer)

Breathalyzer

Area of Usage Personal Use Police Police Stations and


authorities in Legal Courts

Sensitivity Moderate High High


Size Small Medium Large
Cost in RM 8 360 4000

3.4 Concept Design Derived from Fundamental Engineering Principles

Figure 3.1 shows the placement of alcohol sensor and CMOS 5-megapixel
camera inside the vehicle. As the MQ-3 alcohol sensor will be placed in center of
the steering wheel and the CMOS 5-megapixel camera will be placed on the
windshield.

28
Camera Placement
Alcohol Sensor Placement

Figure 3.1 Placement of CMOS 5-megapixel camera on the windshield

3.4.1 Calculation

Blood Alcohol Content (BAC) Calculation


The alcohol sensor MQ-3, that gauge alcohol content existing in the volume
of breath in milligrams per liter (mg/L) which is well-known as breath air content
(BrAC). The appropriate measure to determine whether the driver is drunk or not is
by calculating the blood alcohol content (BAC), that is the amount of alcohol
content in blood volume. Alcoholic intoxication of the driver can be tracked down
by recognized by the percentage of BAC. Since there is a direct relationship
between breath air content (BrAC) and blood alcohol content (BAC) therefore the

29
ratio between BrAC and BAC is 1:2100; that means for every milligram of alcohol
in breath, there are 2100mg of alcohol in the blood. Indicating that BrAC values
measured by MQ-3 sensor could be converted to BAC.
1% 𝐵𝐴𝐶 = 10 𝑔/𝐿 𝑜𝑟 10,000 𝑚𝑔/𝐿 (3.1)
0.1% 𝐵𝐴𝐶 = 1000 𝑚𝑔/𝐿 (3.2)
A body with 0.1% BAC has 1000 mg/L of alcohol in their blood and

𝑚𝑔 alcohol in their breath


Therefore, final formula for calculating % of BAC can be derived from
BrAC which is as follows; %𝐵𝐴𝐶 = 𝐵𝑟𝐴𝐶 𝑚𝑔 ∗ 0.21 (3.3)
𝐿

(Dwipjoy Sarkar, 2014)

Face detection using Haar Cascade Classifier

For the detection of the face, Haar features are the fundamental component
of the Haar cascade classifier. Haar features are utilized to identify the presence of
different component in given picture. Each feature result in a solitary esteem which
is determined by subtracting the sum of pixels under white rectangle from the sum
of pixels under black rectangle.
Figure 3.2 shows different rectangle features to detect the face rapidly which
are Haar features.

𝑃(𝑥) = 𝑆𝑢𝑚 𝑜𝑓 𝑝𝑖𝑥𝑒𝑙𝑠 𝐵𝐿𝐴𝐶𝐾 − 𝑆𝑢𝑚 𝑜𝑓 𝑝𝑖𝑥𝑒𝑙𝑠 𝑊𝐻𝐼𝑇𝐸 (3.4) 𝑅𝐸𝐺𝑇𝐴𝑁𝐺𝐿𝐸


𝑅𝐸𝐺𝑇𝐴𝑁𝐺𝐿𝐸

(Singh, et al., 2013)

Figure 3.2 Haar features


(Singh, et al.2013)

30
Integral Image
The image is scanned several times through the different Haar features. Haar
feature begin scanning the image from the left top corner and ends the face detection
process at right bottom corner.
Integral Image concept is utilized which grant the calculation of total pixel
inside any rectangle feature by using only 4 values at the corners of the rectangle as
shown in Figure 3.3

Figure 3.3 Integral Image


(Singh, et al.2013)

𝐺1 = 𝐴, 𝐺 2 = 𝐴 + 𝐵, 𝐺 3 = 𝐴 + 𝐶, 𝐺 4 = 𝐴 + 𝐵 + 𝐶 + � Calculating
total pixels in D rectangle

� = 𝐺1 + 𝐺 4 − 𝐺 2 − 𝐺 3
� = 𝐴 + (𝐴 + 𝐵 + 𝐶 + �) − (𝐴 + 𝐶 + 𝐴 + 𝐵) (3.5)
(Singh, et al.2013)
Adaboost Algorithm
Haar features can be more than 160,000 features values inside a base
resolution of the detector at 24x24 which need to be calculated and processed.
Adaboost algorithm is a machine learning algorithm which helps to find the best
features from the 160,000+ features. Then these features are combined to evaluate
and decide a detection of face or not. These features are known as weak classifiers.
Weak classifiers are chosen classifiers which perform better than random guessing.
Adaboost build a powerful classifier as a linear combination of the weak classifiers.

31
𝐹(𝑥) = �1𝑓 1(𝑥) + �2𝑓 2(𝑥) + �3𝑓 3(𝑥) + � (3.6)
𝐹(𝑥) 𝑤ℎ𝑒𝑟𝑒 𝑥 𝑖𝑠 𝑡ℎ𝑒 𝑠𝑡𝑟𝑜𝑛𝑔 𝑐𝑙�𝑠𝑠𝑖𝑓𝑒𝑟

𝑓 1(𝑥) 𝑤ℎ𝑒𝑟𝑒 𝑥 𝑖𝑠 𝑡ℎ𝑒 𝑤𝑒�𝑘 𝑐𝑙�𝑠𝑠𝑖𝑓𝑒𝑟

(Singh, et al.2013)

3.4.2 Device Specification

Table 3.3 Device Specification


Device Specification
MQ-3 <750mW
SIM808 GPRS, GSM and GPS 5 V to 18 V
Module
Arduino Uno Rev3 6 V to 20 V
Raspberry Pi 3 B+ 5V

3.5 Sustainable development and Environmental Consideration and Moral


Professionalism.

When outlining the driver condition monitoring system with engine locking,
mind was taken to take into consideration the 3-major sustainable pillars. The
system designed, and the selection of devices were chosen not to harm the
environment. On the other hand, in terms of economically the selection of devices
were chosen to be affordable for the consumers. Lastly, social factor its where the
designed system is designed were it ensures the safety of the consumers as it alert
the user whenever drowsiness is detected or alcohol intoxication of the driver.

32
3.6 Ethical consideration and Moral Professionalism I

Moral professionalism and ethical consideration envelop the lead as an


engineer ought to maintain in execution of his command as a specialist in both. An
engineer ought to carry on in an expert and good way in an offer to guarantee that
engineering profession is maintained with the farthest honesty
During the implementation of the project some of the applicable sections of
the BEM code of professional conduct will be adhered to such as:
1. Section 1.0, whereby the security, welfare and strength of people, in general,
will be held central all through the length of this project. Wellbeing measure
will be taken to guarantee that those straightforwardly and by implication
associated with the undertaking are not hurt.
2. The#Ministry##of##Transport#has#launched#a#Road#Safety#Plan#20142020
#in#November#2014#to#improve#road#safety#in#Malaysia#on#par#with
developed#countries.#The#plan#is#a#continuation#of#the#Road#Safety#Plan
2006 - 2010.
3. The#plan#is#also#in#line#with#global#efforts#through#the#United#Nations#
Decade#of#Action#for Road#Safety#2011 - 2020#with#a#goal#to#stabilize#
and#then#reduce#the#forecast#level#of#road#accident#fatalities#by#50%#by#
2020#worldwide#through#the#implementation#of#various#activities#and#initi
-atives#road#safety. #This#plan#was#drawn#up#by#five#Strategic#Pillars#as#
follows:

33
Figure 3.4: 5 Strategic Pillars

34
3.7 Project Management, Finance and Entrepreneurship 1

Figure 3.5: Gantt Chart

35
3.7.1 Project Cost I

Table 3.4 Project Cost I

Component Quantity Price (RM)


Arduino Uno Rev3 1 125
DC motor 1 30
12V Battery Rechargeable 1 100
SIM808 GSM/GPS module 1 165
Raspberry Pi 3 B+ 1 165
MQ3 sensor 1 15
Buzzer 1 5
LCD 1 25
Ignition Key 1 750
LED 4 5
CMOX-Camera 1 10
I2C Bus 1 20
Total RM 1415

3.8 Summary

In this section, figures and stream graphs have been utilized to clarify how
the proposed venture is planned to work. Legitimate figuring’s and examination
have been completed to legitimize which materials and segments are to be utilized
as a part of the real venture.

3.9 Conclusion

To conclude the proposed system takes the advantage of Haar Cascade


Classifier as well as Adaboost technique, A real- time image processing method is the
most suitable for monitoring drivers’ condition as there is no interfering with the
driver.
36
37
CHAPTER 4

FINAL DESIGN & SYSTEM IMPLEMENTATION

4.1 Introduction

This chapter is catered to represents the implementation of the engine lock


system with respect to the drowsiness and alcohol detection. The construction of the
prototype will be comprehensively explained with the aid of tables and circuit
diagram. The working principle of the system will be also explained with the aid of
block diagram and flowchart. Furthermore, the comprehensive explanation will be
conducted regarding drowsiness decision making, alcohol detection, and engine
lock. The programming concepts used to develop this system will be explained in
detail. The graphical user interface and the final prototype are showcased at the end
of this chapter.

4.2 System Implementation

The prototype of this project is built based on the given design. However,
minor changes are applied with respect to the changes applied on the methodology.
The list of all components used in prototype is shown in below table.

38
Table 4.1: List of components used in prototype

Component Quantity Description


Arduino 1 Microcontroller to process the received data
Uno from sensors, command to actuators, and
communicate with MATLAB

DC motor 1 To simulate the engine of vehicle

L298n 1 To drive and control the DC motor


driver

AC to DC 1 To provide the 12v DC for motor and GSM


regulator module

GSM 1 To provide the GPS information and send SMS


module regarding driver’s alcohol consumption status

MQ3 1 To detect the driver’s alcohol consumption


sensor status

Buzzer 1 To warn and awake the driver

LCD 1 To showcase the process of the system to user


(such as commands sent from microcontroller
to driver)

Switch 2 The switches are used to simulate the ignition


of the engine

LED 4 2 LEDs are representing the ignition stage


while 2 LED will be used to indicate that the
driver is consuming alcohol.

Figure 4.1 shows the construction of the components to Arduino Uno. The
communication of the Arduino Uno (prototype) with MATLAB is via serial
communication using serial cable.

39
Figure 4.1: Circuit diagram of the proposed system

The interfacing of the input and output components to Arduino Uno is


tabulated in below tables. The 5v DC and ground pin of the Arduino is shared for all
components while the signal pin is connected to either digital I/O or analog pins.
40
Table 4.2: Interfacing of input components to Arduino Uno
Component Pin Analog or Digital Arduino Pin

Switch for Tick 1 COM Analog A0

Switch for Tick 2 COM Analog A1

MQ3 A0 Analog A2

Table 4.3: Interfacing of output components to Arduino Uno


Component Pin Analog or digital Arduino Pin

LCD SDL I2C bus A4

SCL A5

Backlight 5v

L298N Int1 Digital 8

Int2 Digital 9

Enable Digital 10

Buzzer Positive Digital 11

LED (tick 1) Anode Digital 2

LED (Alcohol sign Anode Digital 3


Pre-ignition)
LED (tick 2) Anode Digital 4

LED (Alcohol sign Anode Digital 5


Ignition)
GSM module Tx Digital 7

41
Rx Digital 6

4.2.1 Working Principle

4.2.1.1 Block diagram

The block diagram of the proposed system is represented in figure 4.2. The
communication between Arduino and MATLAB is via serial communication. The
system begins receiving the command from MATLAB to Arduino to initiate the
system. The initiation contains 4 stages as:
Tick 1: Once the initiation begins, the system waits for Tick 1 which
represents the battery supply to system.
Pre-Ignition alcohol check: This is required to check driver’s drink status
before letting driver to ignite the engine.
Tick 2: Tick 2 represents the ignition button in system which is followed
with another alcohol check level called as “Ignition alcohol check”.
Ignition alcohol check: The second alcohol consumption check is applied as it
is believed that driver might take a rest and consume alcohol and ignite the car. The
time interval between the Tick 1 to Tick 2 might reach up to 30 minutes; therefore, it
is required to check alcohol presence once again.
The ignition progress will be updated to user using 4 LEDs. In absence of
alcohol, engine ignites and operate in slow speed. The result is sent to MATLAB to
turn ON the camera for driver dowdiness detection. By the same token, alcohol
detection sensor continuously monitors the driver drinking status. There are two
triggers in system as:

1. Engine lock: If driver’s drink status flags up which means that the driver is
consuming alcohol, the engine is locked, and the GSM model sends the
location of driver to Company.
2. Warning drowsy driver: If driver’s drowsiness flags up which means that
driver’s iris is no longer detected by system, the system warns drivers using
a buzzer and a message on LCD.

42
Figure 4.2: Block Diagram of the Engine lock system

43
4.2.1.2 Flowchart

Figure 4.3 shows the flowchart of the system which begins its operation with
receiving the commands from MATLAB software. This will build a serial
communication between Arduino and MATLAB; and restart the Arduino board. The
Ignition of the system begins in 4 stages and if alcohol is not detected in
initialization stage, Arduino sends “Driver OK” commands to MATLAB. This will
initiate the drowsiness detection in MATLAB.
The system continuously monitors both the drowsiness and alcohol
consumption of driver. As mentioned earlier, these two measurements trigger an
action. Drowsiness warns user using buzzer and LCD while alcohol sensor can stop
the engine and send the location of driver to company via SMS.

44
Figure 4.3: Flowchart of the Engine lock system

45
4.2.1.3 Drowsiness decision making

The Iris detection using vision system is used to determine whether driver is
sleep or awake. The proposed iris detection algorithm is a combination of two
algorithms including:
Viola-Johns algorithm: This algorithm is used to detect the face of human
in a form of cascade object detector. This function, however, is already available in
MALAB 2018 with very efficient in response time and face detection accuracy. This
function is part of Vision toolbox in MALAB 2018, known as
“Vision.CascadeObjectDetector”. This function can detect faces, noses, eyes,
mouth, or upper body.
This algorithm has four stages as:
• Haar Feature Selection
• Creating an Integral Image
• Adaboost Training
• Cascading Classifiers
The Haar features are those common features that a human face has such as
the color of upper-cheeks is brighter than eye region; or nose bridge area is much
brighter than the eyes regions. Another consideration is form of a face which refer to
the placement of the noise, eyes and mouths in certain point.
Circle Hough Transform (CHT) algorithm: This algorithm is used to
detect the circles on a Region of Interest (ROI). The ROI in case would be the eyes
area which are detect using Viola-Johns’ algorithm. The CHT algorithm can detects
the circles based on three steps:
• Accumulator Array Computation
• Center Estimation
• Radius Estimation
This algorithm is also available in MATLAB software version 2018 with a
function called “imfoundcirle”.
Figure 4.4 shows the iris detection which contains two main parts. In the first
part, the ROI of the eyes are cropped. This is because, the accuracy of detection will

46
increase as the circles inside the ROI area will be considered. In the second part, the
circle shapes in ROI regions are tracked down via imfoundcirle function.

Figure 4.4: Block diagram of the drowsiness decision making

In CHT method, the circle size is one of the important factors which can
eliminate non-iris objects (the small- and large-sized circles). This requires applying
new method which is based on the size of ROI. The distance of the driver to camera
changes the ROI size; so that, while drivers approves toward the camera, ROI size
enlarges which causes iris size to maximize as well. To solve this issue, the next test
will be conducted to rectify this issue.
By applying the test on the length of ROI and Iris radius, the rough
estimation of the iris size based on ROI length was found to be 0.053. This
coefficient will be multiplied with the length of detected ROI to result in the average
Iris size. However, the Iris size might be either larger or smaller, depending on the
accuracy of circle shape detection in CHT algorithm.
Therefore, the size of Iris radius is ranged to upper and lower limits. The
limit range was found experimentally to be:
𝑈𝑝𝑝𝑒𝑟 𝑟�𝑛𝑔𝑒 = �𝑣𝑒𝑟�𝑔𝑒 𝑟�𝑛𝑔𝑒 + 8

𝐿𝑜𝑤𝑒𝑟 𝑙𝑖𝑚𝑖𝑡 = �𝑣𝑒𝑟�𝑔𝑒 𝑟�𝑛𝑔𝑒 – 5

47
However, in case of small average of iris radius -long distance of driver to
steering wheel-, the lower limit might be negative which causes a failure in CHT
algorithm. This is clear that the radius size of a circle shape would not be negative.
Therefore, in this case, the lower limit value will be set to 1 which is the
lowest radius size supported by CHT algorithm.

The ROI area is stored as an array with 4 columns or values. The first two
values define the origin of the ROI region and the third value is the length of ROI.
Figure 4.5 shows the decision of the driver’s drowsiness or awareness will
be based on the frame array. The reason of constructing the frame arrays is to
minimize the possible errors in detection of Iris. In some cases, the environment
changes (e.g. brightness, contrast) can affect on the performance of iris detection
while the driver’s eyes are open. To minimize this error, the frames are placed in an
array. Each array will contain 10 frames.

Figure 4.5: Frame arrays to decide on the drowsiness of driver

Each frame array contains 10 frames. Each frame contains a value of either 1
or 0. Below table represents how each frame is valued.
Table 4.4: Evaluating the frame value based on Iris and ROI detection
ROI Iris Frame value Drowsiness Result
Detected Detected 1 awareness
Not Detected Detected 0 drowsiness
Not Detected Not Detected 0 drowsiness

In order to understand the driver condition (drowsiness or awareness), the


frame array is analyzed. The duration of which the driver is not aware (Frame Array
results in drowsiness) is set to 5 Frame arrays which accumulates 5 to 6 seconds
(depending on the processing time of the computer).

48
The processing time for the first frame found to be higher than other frame
arrays (around 1.2 to 1.40 seconds). This is because, the first frame arrays are both
creating the variables with 12 cells and storing the new values while the next frame
array will jot store and replace the new values.

4.2.1.4 Alcohol detection

The alcohol detection will be measured based on MQ3 sensor. This sensor
can measure alcohol and maps the readings in range of 0 to 1023. The measurement
of MQ3 is Blood alcohol level (BAC) that is based on grams per deciliter (g/dL).

Figure 4.6: Gas detection of MQ3

(Datasheet of MQ3)

The measurement of the MQ3 regarding alcohol is fluctuating. Therefore, it


is required to obtain a set of reading from MQ3 and find the average of the
measurement.

4.2.1.5 Engine Lock

The engine lock occurs in two different stages:


49
Before ignition: the engine locks if the alcohol presence is detected. This
engine locks occur in two different stages as explained earlier. The first stage is
when the Tick 1 is triggered while the second one occurs right after the Tick 2. In
presence of alcohol in either portion of prior to ignition stage, the engine locks and
the system would not communicate with MATLAB. This also triggers the message
transmission to company via SMS to acknowledge the authorities regarding driver
behavior and condition.
High Speed (car is moving): Continues driver alcohol consumption is also
part of the proposed system feature. This feature monitors the driver’s alcohol
consumption and in presence of the alcohol the following steps occur.
Figure 4.7 shows the total duration of this process from the time 0 (detection
of alcohol) until the turning the engine off will take 20 seconds. However, the time
for GSM modem to access to GPS data might varies from one location to location.
The 10 seconds is assigned for driver to pull over the car as the car is speeding
down automatically. Once the car is at Low Speed (Not moving), the system would
send SMS to company and turn off the engine which takes another 10 seconds.

50
Figure 4.7: Engine Lock in High Speed

4.2.2 Programming
The programming of this project involves in two sections including Arduino
programming and MATLAB.

4.2.2.1 Arduino

Arduino is responsible for:


• Engine lock
• Initialization
• Alcohol measurement
• Sending location via SMS
• Controlling the engine speed
• Receiving the command from MATLAB for alarm set

51
The initialization of the system comprises of 4 stages which was explained
earlier. The four stages are performed in void setup of the program. Program halts
for Tick 1 to be switched ON. Once the tick 1 is triggered, the alcohol check will be
applied. If the alcohol is detected the engine lock is activated.
As shown in Figure 4.8 and Figure 4.9 If the first check of alcohol is clears,
program halts for Tick 2 to be switched ON. Once the tick 2 is triggered, the alcohol
check will be applied again. If the alcohol is detected the engine lock is activated.

Figure 4.8: First portion of initialization including Tick 1 and pre-ignition alcohol
check

Figure 4.9: Second portion of initialization including Tick 2 and ignition alcohol
check
In case of absence of alcohol in both Tick 1 and 2, the command of “Driver
ok” is printed on serial monitor which is read by MATLAB. Therefore, the motor
speed is set to Normal which is 60 as shown in Figure 4.10. This represents the
engine is ON, but car is not moving.

52
Figure 4.10: Allowing communication with MATLAB
The engine lock is result of presence of alcohol in prior ignition stage. The
engine lock is controlled in two parallel methods. In the first method, the engine
speed is set to 0 which does not rotate the DC motor. The second method is to keep
the
“flagpullover” at 0 which does not allow program to continue; therefore, the
message of “Driver OK” would not be sent to MATLAB resulting MATLAB to
keep drowsiness deactivated.

Figure 4.11: Engine lock condition


Sending SMS is done in the 3 conditions of detecting alcohol which are after
Tick 1 and Tick 2 and while car is moving whether with high speed or low speed
and that is when the engine lock occurs. Figure 4.12 shows the utilization of
GSM/GPS module.

53
Figure 4.12: GSM/GPS code to send SMS contains location of the vehicle.
In any case GSM/GPS model is initialized in the first place. Then, the GPS is
activated, and the GPS data will be stored in “Message” variable. Once the message
is provided, the “sendSMS” function is used to transmit the message to driver’s
emergency department.
The LCD is connected to Arduino using I2C. The LCD requires to have the
I2C bus address which was found to be 27 experimentally.

4.2.2.2 MATLAB

Arduino responds to MATLAB:

The first thing in this system is the initialization which includes 4 stages as
explained earlier. The command of “Driver OK” is sent from Arduino to MATLAB
to start the process of drowsiness detection. However, it is required for MATLAB to
establish communication with Arduino in the first place. The communication begins
with creating a serial communication named as”ss” as shown in figure 4.13. The
communication port is inserted by user in GUI. The fopen function stablishes the
connection to Arduino. In the next step, it is required to scan the serial
communication for any upcoming command from Arduino. This is to ensure that
MTLAB and Arduino are synchronised.
54
Figure 4.13: Establishment of communication between MATLAB and Arduino

Iris detection:

Figure 4.14 shows the iris detection was done using “imfindcircle” function.
However, prior to using this function, the area of detection is limited for higher
accuracy. This is done using cropping the ROI section find using Viola-Johns
algorithm. The cropped area can be saved and used again which can increase the
processing time. Therefore, the pixels are stored in a matrix instead. In the first
place, a frame is captured from camera and passed to
“Vision.CasecaseObjectDetector” function with argument of “EyePairBig” which
can extract the eye area of the human.

Figure 4.14: Extracting the eye area (ROI) from each frame

The second filter is to ensure that only 1 ROI is detected. In absence of ROI
area, the iris detection would be deactivated. This is done by considering the size of
the ROI areas which should not be empty and also equal to 1.

Figure 4.15: Considering only 1 ROI for the captured frame for iris detection

55
Then the image is cropped with respect to the coordinate of the ROI in the
frame using “imcrop” function.

CroppedImage = imcrop(I,BB);

Figure 4.16 shows the next step, that circles inside the ROI would extracted
using “imfindcircle” function. This function requires to determine the minimum and
maximum radius size of the circles to be found in image.

Figure 4.16: Finding the circles with respect to the minimum and maximum radius

size

The minimum and maximum radius size of the driver would change if the
driver’s distance to camera changes. Therefore, it requires to correlate the radius
size to the size of ROI. The size of ROI is determine using the BB (3) which is the
length of the ROI regions. The coefficient was found and used to estimate the
average size of the iris’s radius with respect to the length of the ROI. The value was
experimentally found to be 0.053 which is multiplied with the length of the ROI.

56
Figure 4.17: Distance of driver to camera and iris detection attributes

As this average value might not found to be exact, the minimum and
maximum values are added to the size of the iris’s radius. The maximum iris size is
the average size of the iris’s radius plus 8 and minimum is set to 5 as it was
explained earlier in iris detection section. As the iris size cannot be negative while
the average radius might reach below 5, the negative value of the minimum iris
would be considered as
1 which is the minimum iris’s radius size in this system.
Figure 4.18 shows the next filter to increase the iris detection accuracy, is to
ensure that two circles are found in ROI area. Therefore, if the number of radius
array is 2, it can represent that two circles inside the ROI area. This case, the
drowsiness would set the frame value as 1. Otherwise, this value would be set to 0.

57
Figure 4.18: Assigning the drowsiness based on the number of circles inside ROI

However, the decision making based on 1 frame and triggering the alarm
would not be an ideal method as the system would lag and disturbs the driver. By
the same token, due to possible error in detection from image processing due to
various reason such as brightness or quick look at side mirror of driver which is
natural in driving; the system requires to take decision in sample base. This was,
however, explained in iris detection section. The frames of 10 are gathered and the
value of each frame is evaluated. The median of these frame can show whether the
driver was sleep or aware.

Figure 4.18: Decision making over the frame array status

“DrowsinessCounter” variable records the number of times which the


drowsiness was detected by system. This value is set to 0 once drowsiness is not
detected; therefore, the total number of drowsiness must be above 5 in a row
encounter.

58
These 10 frames create a frame array and the total number of 5 frame array
with drowsiness condition can trigger the alarm system to awake driver. This should
be taken into account that the drowsiness is activated only and if the driver is
driving the car; therefore, this system is deactivated once the car is off or stopped.

Figure 4.19: Activating the alarm system and decision making on drowsiness

The communication with Arduino requires to activate the alarm. This is done
by sending a command to Arduino. The list of commands in MATLAB to Arduino is
shown in table 4.5
Table 4.5: Commands in MATLAB to Arduino
Command Description
1 Activates alarm (driver seems to be sleepy)
2 Deactivate alarm (driver is awake)
3 Increase the engine speed to high speed
4 decrease the engine speed to low speed (stop)

4.3 Hardware and Simulation results

4.3.1 Graphical User Interface (GUI):


59
Here are 3 GUIs on this system including:

Main GUI: This is used for final testing the system and final GUI of the
system.
Arduino Communication: this GUI is used to showcase the communication
between Arduino and MTLAB.
Iris detection: this GUI is detecting the iris of user without connection to
Arduino. This GUI can be used to evaluate the performance of iris detection
algorithm in unit test.
Iris detection GUI:
Figure 4.20 shows the iris detection GUI has a table which can represents the
drowsiness of each 10 frames, elapsed time for processing the 10 frames, and the
decision made over the drowsiness of the 10 frames.

Figure 4.20: Iris Detection GUI

The control panel has two buttons including:


1. Start: To begin the process of iris detection.
2. Stop: to halt the system in emergency condition.
60
There are two edit boxes in control panel including:
1. Duration of frame: This can represent the length of iris detection period.
This is clear that the higher frames will results in longer period of iris
detection.
2. Drowsiness: this is the decision made over the 5 frame arrays (comprising of
50 frames in duration of 5 to 6 seconds).
A slider is used to visually represent that the driver drowsiness is being
detected. The main page button will redirect back to main GUI.

Arduino Communication GUI:


The Arduino Communication is one of the methods to understand how
MATLAB and Arduino sends and receive data with each other. The communication
between the Arduino and MATLAB is two ways. Figure 4.21 shows that is required
to write the communication port and press on the “connect to Arduino” button.

Figure 4.21: Arduino Communications GUI

61
There are two buttons for communication with Arduino on this GUI including:
Set Alarm ON: This button will send command ‘1’ to Arduino. Arduino
receives this command and send back a text which will be represented on orang
color edit box.
Set alarm OFF: This button will send command ‘2’ to Arduino. Arduino
receives this command and sends back a text which will be represented on orang
color edit box.
Once the communication is done, the communication must be terminated.
This can be done in two ways:
1. Disconnect from Arduino button
2. Clear all objects

In either case, any communication port in MATLAB is cleared and deleted.


The main page button will redirect back to main GUI.
Main GUI:

Figure 4.22 shows the main GUI does not show the details as in other GUIs
as the task assigned for the whole system does not require that. The main GUI only
showcase the driver face and decide ion the drowsiness.
The stop emergency is able to halt both the iris detection and alcohol
detection at the same time.

62
Figure 4.22: Main GUI

63
4.3.2 Prototype (Hardware simulation)

Camera

Buzzer
LCD DC Motor
(Simulate Car
Engine)
TICK 1 TICK 2
LED’s

Alcohol
Sensor (MQ3)

Figure 4.23: Front view of the prototype

64
Figure 4.24: Backend of the prototype

65
DC MOTOR

L298N

AC to DC
Converter

Figure 4.25: Engine simulation using DC motor and L298N driver

66
TICK 1 TICK 2

Figure 4.26: Tick 1 and Tick 2 switches

67
LCD

LED’s

Figure 4.27: LEDs representing the initialization process

68
Step Up Digital
Voltage Potential
Meter

GSM/GPS
Module

Figure 4.28: GSM/GPS SIM808 module and step up DC voltage supply

69
Camera

LCD

Figure 4.29: Camera and LCD

70
4.4 Summary
As summary to this chapter, the prototype was built per design and the
construction result was visualized. This system used an Arduino Uno microcontroller
to process the measurement from sensor; control the actuators and communicate with
MATLAB software. The engine lock feature was performed in two different sections
which are prior to ignition and when car is ON. This system used a DC brushless
motor to represents the engine. The DC motor is controlled with L298N driver which
is powered with a 12V voltage regulator. The GSM modem SIM808 was used to send
location of the driver via SMS while alcohol detection is fagged up. The system uses
an LCD and buzzer to warn user while drowsiness is detected. MATLAB is used for
iris detection; deciding on drowsiness; and communicating with Arduino. The iris
detection algorithm used a combination of two algorithm as Viola-john for ROI
detection (detecting the eyes area) and CHT algorithm to track iris of driver. The iris
detection works based on frame arrays which contains 10 frames. Each 10 frames are
stored in a frame array and the decision is made based on the value of each value to
be wither 1 or 0 with respect to the fact that 0 indicates that the driver iris was no
detected. The system had 3 GUIs which 1 is the final GUI and other 2 are used for
unit test. The unit test is used for iris detection and communication with Arduino.

71
CHAPTER 5

DISCUSSION- PROJECT FINDING AND TESTING

5.1 Introduction

This chapter will test the prototype to evaluate the engine lock elapsed time
and performance; iris detection with respect to moving head towards left, right, up,
and down in day time; iris detection accuracy in night time where there is less
brightness; and alcohol detection range. Each test explains the aim of test, setup
condition and procedure of test, data collection and data analysis. The data is
tabulated and visualized using charts.

5.2 Testing and results

5.2.1 Engine lock elapsed time

Aim of test:

This test determines the elapsed time from the alcohol detection time to the
complete engine stop.
Setup:

The setup for this test would be the same as the final prototype except minor
changes in code which requires to monitor the elapsed time using mills function in
Arduino IDE. In this test, the speed of motor is set to high at the beginning, and
alcohol is placed in near side of MQ3 alcohol which activates the alcohol presence
in car.

72
Test procedure:

• The mills function is used in four different stages once the alcohol is
detected in system as:
1. The moment that alcohol presence is detected (the reference time): t0
2. The moment that the engine is completely stopped: t1
3. The moment when the GPS data is received, and SMS is sent: t2
4. The moment at the engine is turned off: t3
• The system runs for 20 times and the values of t0 to t3 is recorded. The
values of t0 to t3 will be published on serial monitor.
• The total time taken for engine lock is the sum of t0 to t3.
• The average time for engine lock is also calculated. Data collection for
Engine lock:

Table 5.1: Data collection for Engine lock


Sampl t0 t1 t2 t3 Elapsed Time SMS
e transmission
time

1 345 355 368 373 28 13


2 345 355 364 369 24 9
3 345 355 366 371 26 11
4 345 355 367 372 27 12
5 345 355 365 370 25 10
6 345 355 369 374 29 14
7 345 355 369 374 29 14
8 345 355 366 371 26 11
9 345 355 369 374 29 14
10 345 355 366 371 26 11
11 345 355 365 370 25 10
12 345 355 368 373 28 13
13 345 355 370 375 30 15
14 345 355 369 374 29 14

73
15 345 355 368 373 28 13
16 345 355 369 374 29 14
17 345 355 364 369 24 9
18 345 355 368 373 28 13
19 345 355 366 371 26 11
20 345 355 370 375 30 15

27.3 12.3

Figure 5.1: The elapsed time for engine lock vs. SMS Transmission time

Data analysis Engine lock:

The time taken for DC motor to stop completely from the high speed which
is 255, will take 10 seconds without any extra execution time. Similarly, the time
delay between the SMS transmission and turning off the whole system would be
constant at 5 seconds. However, the time taken for GSM module to receive the GPS
data depends on the location of which the car exist. This time would vary from one
74
location to another as it was explained earlier in chapter 4. Therefore, the SMS
transmission time is taken into account. The result indicates that the average elapsed
time for engine lock and SMS transmission time is 27.3, and 12.3 seconds,
respectively.

5.2.2 Iris detection accuracy with head movement

Aim of test:

The aim of this test is to ensue how accurate system responds to the face of
driver while looking at side mirrors. The test will also evaluate the system responds
towards activating the wake-up alarm in case of sleepy driver.
Setup:

This is clear that driver cannot look at side mirror for long period of time
exceeding 5 or 6 seconds. This time is given to driver for quick look at side mirror.
However, looking down or towards left or right side for longer time is the indication
of sleepy driver which can trigger the wake-up alarm. There is not specific setup
condition for this test; however, the movement of the head of driver must be taken
into account. In this test, author would be the driver and head is moved to:
• Right side for duration of longer than 6 seconds.
• Left side for duration of longer than 6 seconds.
• Downward for duration of longer than 6 seconds.
• Upward for duration of longer than 6 seconds.
The test also considers the stability of iris detection by looking forwards for
duration of 20 seconds for each sample.
Test procedure:
• Driver keeps his head in forward direction for 10 frames.
• If any drowsiness indication is activated; the system response with respect to
iris detection is assumed as failure; otherwise, it would be successful iris
detection.
• The second test would be in four movement of head in duration of 10 frames
for each.
• The movement of head would be left, right, down, and up.
75
• The total sample of 20 would be taken for this test.
• The number of failures in iris detection over the total sample would result in
error percentage for iris detection.
• The data from frames are received from Iris detection GUI. The data is
exported in csv format in excel file.

76
Data Collection Iris detection accuracy with head movement:

Table 5.2: Data collection of iris detection accuracy with head movement

Sampl Head F F F F F F F F F F1 Drowsiness Elapsed time (S)


e Positio 1 2 3 4 5 6 7 8 9 0 Decision
n (1 Awake , 0 =
Sleep)
1 Forwar 1 1 1 1 1 1 1 1 1 1 1 3.2
d
2 Forwar 1 1 1 1 1 1 1 1 1 1 1 1.01
d
3 Forwar 1 1 1 1 1 1 1 1 1 0 1 1.1
d
4 Forwar 1 1 1 1 1 1 1 1 1 1 1 1.17
d
5 Forwar 1 1 1 1 0 0 1 0 1 1 1 1.34
d
6 Forwar 1 1 1 1 1 1 1 1 1 1 1 1.32
d
7 Forwar 1 1 1 1 1 1 1 1 1 1 1 1.16
d
8 Forwar 0 1 1 1 0 0 1 1 1 1 1 1.2
d
9 Forwar 0 1 1 1 0 0 1 1 1 1 1 1.16
d
10 Forwar 0 0 0 1 1 1 1 0 1 1 1 1.32

77
d
11 Left 0 1 1 0 1 0 0 1 0 0 0 1.25
12 Left 0 1 1 0 0 0 1 0 0 1 0 1.43
13 Left 0 1 1 1 0 0 0 0 0 0 0 1.09
14 Left 0 0 0 0 0 0 0 0 0 0 0 1.34
15 Left 0 0 0 0 0 0 0 0 0 0 0 1.27

16 Left 0 0 0 0 0 0 0 0 0 1 0 1.37
17 Left 0 0 0 0 0 0 0 0 0 1 0 1.36
18 Left 0 0 0 0 0 0 0 0 1 0 0 1.29
19 Left 1 1 0 0 1 0 1 0 1 1 1 1.29
20 Left 0 0 1 0 0 0 0 0 0 1 0 1.06
21 Right 0 0 0 1 1 1 1 1 1 1 1 1.33
22 Right 0 0 0 1 1 0 0 0 0 1 0 1.29
23 Right 0 0 0 1 1 1 0 0 0 1 0 1.34
24 Right 0 0 0 1 1 1 0 0 0 1 0 1.5
25 Right 0 0 0 0 0 0 0 0 0 1 0 1.48
26 Right 1 1 1 0 0 0 0 0 0 0 0 1.14
27 Right 1 1 1 0 0 0 0 0 0 0 0 1.39
28 Right 1 1 1 0 0 0 1 0 0 0 0 1.03

78
29 Right 1 1 1 0 0 0 1 0 0 0 0 1.3
30 Right 0 0 1 0 1 0 0 0 0 0 0 1.17
31 Right 1 1 0 0 0 0 0 0 1 1 0 1.28
32 Up 0 0 0 0 0 0 1 1 1 1 0 1.45
33 Up 0 0 0 1 1 1 1 1 1 1 1 1.01
34 Up 0 0 0 1 1 1 0 0 0 1 0 1.34
35 Up 0 0 0 1 1 1 0 0 0 1 0 1.05
36 Up 0 0 0 0 0 0 0 0 0 1 0 1.27
37 Up 1 1 1 0 0 0 0 0 0 0 0 1.32
38 Up 1 1 1 0 0 0 0 0 0 0 0 1.38
39 Up 1 1 1 0 0 0 1 0 0 0 0 1.43
40 Up 1 1 1 0 0 0 1 0 0 0 0 1.3
41 Down 0 1 1 0 1 1 1 1 0 0 1 1.42
42 Down 0 0 0 1 1 1 1 0 0 0 0 1.38
43 Down 0 0 0 1 1 1 1 1 1 1 1 1
44 Down 0 0 0 1 1 1 0 0 0 1 0 1.41
45 Down 0 0 0 1 1 1 0 0 0 1 0 1.4
46 Down 0 0 0 0 0 0 0 0 0 1 0 1.32
47 Down 1 1 1 0 0 0 0 0 0 0 0 1.31
48 Down 1 1 1 0 0 0 0 0 0 0 0 1.06

79
49 Down 1 1 1 0 0 0 1 0 0 0 0 1.23
50 Down 1 1 1 0 0 0 1 0 0 0 0 1.35
Average Elapsed 1.26
Time

80
Figure 5.2: Elapsed time for each 10 frames for 50 samples

Iris Detection with head movement in daytime

10%

90%

Correct Fail

Figure 5.3: Iris detection with head movement in daytime

Data analysis Iris detection accuracy with head movement:


81
The forward position of head resulted in value of 1 for each 10 frames and in
overall duration of 10 frames in a row. The light green areas in table indicates the
sleepiness of driver which triggers the alarm of system and it worked perfectly.
However, minor detection of iris was observed while the head was moved on left,
up and down. This is because, the rotation of head has smaller degree towards the
forward position resulting on detection of iris.
Despite the fact that those orange areas are not considered as the mistake of
system in iris detection but considering 5 errors in detection of iris out of 50 samples
results in accuracy of 90% for the iris detection with head movement in day time.
The average elapsed time for each frame array (excluding the first frame array) is
1.26 second which indicates of average processing time of frame in 0.126 seconds.

5.2.3 Iris detection and drossiness accuracy in night time

Aim of test:

The aim of this test is to analyze the performance of iris detection with
respect to low brightness of environment.

Setup:

The setup of this test is similar to test 2. The only difference refers to the
brightness of the environment during the test. Therefore, the test is conducted in
night time to ensure less brightness hits the driver’s face. This can result in
performance of system with contrast to day time.

Test procedure:

• Driver keeps his head in forward direction for 50 frames.


• If any drowsiness indication is activated; the system response with
respect to iris detection is assumed as failure; otherwise, it would
be successful iris detection.

• The total sample of 50 would be taken for this test.

82
• The data from frames are received from Iris detection GUI. The
data is exported in CSV format in excel file.

Data collection for iris detection and drossiness accuracy in night time:

Table 5.3: Data collection Iris detection and drossiness accuracy in night
time
Sample Head F1 F F F F5 F6 F F F9 F10 Drowsiness Elapsed
Positio 2 3 4 7 8 Decision (1 time
n Awake, 0 = (s)

Sleep)

1 Forward 1 1 0 1 1 1 0 1 1 1 1 3.18
2 Forward 1 0 0 1 1 0 1 0 1 1 1 1.07
3 Forward 1 1 1 0 1 1 1 1 1 1 1 1.07
4 Forward 1 0 1 1 0 1 0 0 1 1 1 1.38
5 Forward 1 1 0 1 1 0 1 1 0 1 1 1.46
6 Forward 1 0 1 1 0 1 0 1 1 0 1 1.12
7 Forward 1 1 1 1 0 1 1 1 1 1 1 1.03
8 Forward 1 1 1 1 0 1 1 0 1 1 1 1.26
9 Forward 1 1 0 0 1 1 0 1 1 1 1 1.05
10 Forward 1 1 1 1 1 1 0 0 1 0 1 1.05
11 Forward 1 1 0 1 1 1 1 1 1 0 1 1.2
12 Forward 1 1 0 0 1 1 1 1 1 0 1 1.11
13 Forward 1 0 0 0 1 1 1 0 0 0 0 1.29
14 Forward 1 1 1 1 1 1 1 1 1 1 1 1.2
15 Forward 1 0 0 1 1 0 1 1 1 1 1 1.26
16 Forward 1 1 0 1 0 1 1 0 1 1 1 1.08
17 Forward 1 0 1 0 1 1 1 1 1 1 1 1.57
18 Forward 1 1 1 0 1 1 0 1 1 1 1 1.52
19 Forward 1 1 1 0 1 1 1 1 1 1 1
20 Forward 1 0 1 0 0 0 0 0 1 1 0

83
21 Forward 1 1 1 1 0 1 1 1 1 1 1
22 Forward 1 0 0 0 0 0 0 1 1 1 0
23 Forward 1 0 1 1 1 1 1 1 0 1 1
24 Forward 1 1 1 0 1 1 0 0 1 1 1
25 Forward 1 1 0 1 1 1 1 1 1 1 1
26 Forward 1 1 0 0 1 0 1 0 1 1 1
27 Forward 1 1 1 0 1 0 1 1 1 0 1
28 Forward 0 1 1 1 0 0 0 1 1 1 1
29 Forward 0 1 1 0 0 1 1 0 1 1 1
30 Forward 1 1 0 1 0 0 0 0 1 0 0
31 Forward 1 1 0 0 1 0 1 1 1 1 1
32 Forward 1 1 1 1 1 1 1 0 1 1 1
33 Forward 1 1 1 0 1 0 1 1 1 1 1
34 Forward 1 1 1 1 0 0 0 0 1 1 1
35 Forward 1 0 1 0 1 1 1 1 0 1 1
36 Forward 1 1 1 1 0 1 0 0 0 1 1
37 Forward 1 0 1 0 1 1 1 1 0 0 1
38 Forward 1 0 1 1 0 1 0 1 1 1 1
39 Forward 1 0 0 1 0 1 0 1 1 1 1
40 Forward 1 1 1 1 0 1 0 0 1 1 1
41 Forward 0 1 1 1 1 1 1 1 0 0 1
42 Forward 1 1 1 1 0 1 1 0 1 1 1
43 Forward 1 0 1 1 1 0 1 1 1 1 1
44 Forward 1 1 0 0 1 1 0 1 1 1 1
45 Forward 1 0 1 0 1 1 1 1 0 0 1
46 Forward 1 1 1 1 0 0 1 1 1 1 1
47 Forward 1 0 0 1 1 0 1 1 0 1 1
48 Forward 1 1 1 0 1 1 1 0 1 0 1
49 Forward 1 0 1 1 1 1 1 1 1 1 1

84
50 Forward 1 1 1 1 1 0 1 1 1 0 1
Average Elapsed Time

Iris Detection Accuracy at night time

8%

92%

Correct Fail

Figure 5.4: Iris detection accuracy at night time chart


Data analysis iris detection and drossiness accuracy in night time:

The data indicates robust result for iris detection in night time with accuracy
of 92%. The result indicates that some frames failed in detecting the iris; however,
the final decision based on 10 frames indicates the awareness of driver due to
detection of driver’s iris. The errors in sample 13, 20, 22, and 30 occurred due to
change in brightness which was corrected in the next frame array. The total test
resulted in no alarm activation which indicates on 100% drowsiness accuracy in
night time.

5.2.4 Alcohol detection range test:

85
Aim of test:

This test will determine the range of alcohol detection by MQ3. This test is
conducted to ensure that the alcohol consumption of other passengers is not
considered as alcohol consumption of driver in car.
Setup:

This experiment requires a bottle filled with alcohol and placed in a certain
distance to MQ3 and a fan to blow the alcohol to MQ3. The distance is changed by
10 cm in each 10 sample to determine the range of detection. The total of 70
samples is conducted in this test.

Figure 5.5: The setup for the alcohol test

The area of detection is in radius around the MQ3. The radius length of
maximum detection would be 70 cm.

86
Figure 5.6: The distance of driver and range of detection in radius of MQ3

Test procedure:

• The Test will be conducted in Arduino Side only.


• The system will print the MQ3 measurement of alcohol for duration of 1
second per sample.
• The total 70 samples will be used and the distance of bottle to MQ3 is
changed in each 10 samples.
• The data printed on screen will indicate on the alcohol detection as well.
• The data will be recorded in excel file to define the maximum range of
detection.
Data collection for alcohol detection range:

Table 5.4: Data collection for Alcohol detection range:


Sample Distance of MQ3 reading (BAC in Alcohol Detection
bottle (cm) ppm)

1 10 14254 1
2 10 14835 1

3 10 14711 1
4 10 14486 1

87
5 10 14718 1
6 10 14175 1
7 10 14121 1
8 10 14952 1
9 10 14396 1
10 20 13491 1
11 20 13871 1
12 20 13020 1
13 20 13623 1
14 20 13946 1
15 20 13291 1
16 20 13648 1
17 20 13618 1
18 20 13213 1
19 20 13415 1
20 20 13723 1
21 30 199 0
22 30 123 0
23 30 175 0
24 30 11486 1
25 30 12878 1
26 30 11342 1
27 30 12292 1
28 30 11638 1
29 30 11736 1
30 30 11612 1
31 40 67 0
32 40 116 0

33 40 189 0

88
34 40 137 0
35 40 10867 1
36 40 11750 1
37 40 10187 1
38 40 10532 1
39 40 10406 1
40 40 11768 1
41 50 139 0
42 50 88 0
43 50 174 0
44 50 167 0
45 50 135 0
46 50 9084 1
47 50 9806 1
48 50 9005 1
49 50 9948 1
50 50 9634 1
51 60 74 0
52 60 184 0
53 60 153 0
54 60 149 0
55 60 101 0
56 60 184 0
57 60 183 0
58 60 196 0
59 60 7447 1
60 60 8071 1
61 70 70 0
62 70 107 0

89
63 70 105 0
64 70 76 0
65 70 89 0
66 70 188 0
67 70 118 0
68 70 68 0
69 70 103 0
70 70 91 0

Figure 5.7: Alcohol sensor (MQ3) measurement based on distance over 70

samples Data analysis for alcohol detection range:

The data indicates that the range of detection can decrease the PPM level
measured by MQ3. The result indicates that the higher the distance will result in
longer time for detection and the PPM level is reduced. The distance of 60cm is the
maximum range of detection as the alcohol measurement in distance of 70 cm was
not detected by MQ3 sensor.

90
5.3 Theoretical vs. experimental results discrepancy

The reading of MQ3 fluctuate in time which varies from the calculation.
However, there are many reasons for this discrepancy such as variant in air alcohol
due to circulating air inside the car. Nevertheless, the reason is mainly due to the
fact this sensor consumes massive amount of current which can easily hit up the
chip. The higher temperature at MQ3 can vary the readings for this sensor. This
issue can result in long run of the sensor; however, as this project is being used in
Malaysia and most of cars use Air conditioning unit, the temperature can be
stabilized.

5.4 Error sources and troubleshooting methods

5.4.1 Slow processing time of frames:

The first error was found in MATLAB side while processing the frames. The
processing time was very slow. The frames are written in MATLAB and read by
“imread” function. This led into slow processing time.

Figure 5.8: saving reading a frame for iris detection process

In order to fix this issue, the frames must be taken into process without being
saved in computer. The earlier issue was also due to “IMSHOW” function which
causes low processing time as this function calls several functions including figure
to construct a figure to showcase the frame.
The second method was to replace the “imshow” function with “imagesec”
function which led into same issue, the slow response and processing time.
The issue was resolved by considering an alternative method using “step”
function to store the process features over the frame and apply the features over the
frame.
“showFrameOnAxis” function was used to smooth the processing of frames and
showcase

91
the frames over the GUI. This function considers a figure as parent of the axis and
show the frame over the GUI.
The issue further issue raised when the system was stopped and run again.
The issue refers to disappearing the axis over the GUI; hence, the camera was
missing in GUI. The issue was investigated, and the root of issue referred to parent
of axis used for camera. The parent for the first time runs considers a figure while
this parent figure is no longer available in second and further runs. To solve this
issue, the parent name of the axis was saved and passed to axis in next run.

5.4.2 Poor Iris detection:

To detect the iris, the feature of human eye must be taken into account. This
is clear that each iris has relative distance to another. However, this distance changes
when driver changes its distance to camera. The closer driver gets to the camera, the
less this distance would be. Therefore, the detection of iris based on fix position was
early error which causes poor accuracy of system in iris detection.
In order to fix this issue, the length of ROI was taken as a variable to define
the boundary for radius of the iris and also the distance between two irises. The
method applied to overcome this issue was to use the length of ROI and multiply it
to 0.053 value which was found experimentally as the ratio of ROI to iris radius
size. The maximum and minimum radius size of iris was found also experimentally
by considering 8 and 5 as the higher and lower range for the radius size.
Despite better accuracy of system in detecting iris as circle shape, detecting
more than and less than 2 circles in ROI area, resulted into poor iris detection. To
resolve this issue, a condition was applied to the CHT algorithm to process the iris if
and only if two circles with respect to assigned size are detected in ROI. This
feature increased the accuracy of iris detection algorithm.

5.5 Sustainable development & Environmental considerations II


92
Economic

The system can decrease the possibility of accident of driver due to both
drowsiness and alcohol consumption. The accident can result in financial damage
for company; therefore, the system can reduce the possibility and reduce the
financial damage. The system is made from cheap but responsive components. The
low cost of project compared to the saving toward the financial damage is the great
effect of this project in terms of economic sustainability.

Environmental

In terms of environmental sustainability, the system used recyclable


components and all the components are detachable. This means that the components
can be used for further projects with very small rate of disposal. The system also
does not produce any chemical material or gases to harm environment.

Social

Drowsy drivers have been one of the main reasons of crash and accident on
roads and highways. According to National Highway Traffic Safety Administration,
the rate of accident due to drowsy drivers is estimated to be 72,000 crashes, 44,000
injuries, and 800 deaths in 2013. Out of these numbers, 6,000 fatal crashes have
been reported in 2013 (Centers for Disease Control and Prevention, 2013). The high
number of accidents resulted from drowsy driver could also harm other vehicles and
damage welfare of public. The engine lock and warning alarm in cases of alcohol
consumption and drowsy driver can contribute great impact on reduction of
accidents. Reduction of accident due to mentioned reasons can also increase the
welfare of public.

93
5.6 Project Management, Finance & Entrepreneurship II

5.6.1 Project plans and schedule

Figure 5.9: Project management planning for phase 2

92

94
5.6.2 Project cost II

Table 5.5: Final cost of project


Component Quantity Price (RM)

Arduino Uno 1 40

DC motor 1 30

L298n driver 1 25

AC to DC regulator 1 40

GSM module 1 165

Step up converter 1 25

MQ3 sensor 1 15

Buzzer 1 5

LCD 1 25

Switch 2 30

LED 4 5

Camera 1 90

MATLAB (Student Version) 1 350

Total RM 850

The total cost of the project was RM 850 which is considered very cheap
compare to its application in automotive industry. The system used MATLAB
software for iris detection which specify of 30% of the total cost of project.
Considering a business version and using the license for a greater number of
vehicles can reduce the total cost of project to RM 500.

95
5.7 Moral Professionalism and Ethical consideration II

Author declares that the literature plagiarism is considered at the highest


degree. All the contents used in this report including table, figure, equations, and
algorithms are cited based on Harvard referencing style. The contents are gathered
from the sources where the usage of content was allowed by authors.
Considering the copyright roles and regulation, two software were used in
development of system including: Arduino which is an open source software; and
MATLAB software. This system purchased student version of MATLAB software.
This version provides free toolbox such as vision which was used to capture the ROI
of driver using viola-johns algorithm. Any toolbox used in MATLAB software was
free of use for student version.
The project has considered the highest degree of care towards the welfare of
public by designing and developing a system that can reduce the accidents and
increase the welfare of public. The system design took into account the importance
of public welfare and followed the BEM code of professional conduct section 1.1.
With respect to the section 4.3 code of BEM, this report had not tarnished the
reputation of any company (referring to comparison of component) by giving the
advantage to one respect to another. The comparison was based on the best fitted
component for this project with respect to cost and functionality.
In the experiment part, author tested the system as driver of vehicle and there
was no third party involved in prototype testing.

5.8 Contribution in this project

The iris detection method proposed by author in this system was one of the
contributions to system where two algorithms were combined to obtain higher
accuracy for iris detection. The viola-johns’ algorithm was used to capture the ROI
(the eye area) of driver and CHT algorithm was used to detect the iris of driver.
These

96
wo methods, however, could result in poor accuracy for iris detection. Therefore,
author came up with a filtration part to decrease the response time and increase the
detection accuracy. The filtration part involved in cropping the ROI part; and
considering two circles with dynamic size with respect to distance of driver to
camera.
Another contribution of author was involved in drowsiness detection
algorithm. The algorithm used for drowsiness involves in 10 frames. Frame value
can be either 1 or 0 for iris detect condition and lack of iris detection condition,
respectively. The median of the 10 frames would result in the drowsiness of that 10
frames, known as frame array. The total 5 frame arrays in a row results in
drowsiness of driver that indicates driver’s face is not in forward direction for
duration of 5 to 6 seconds.
Another contribution of author was the engine lock mechanism followed by
sending the location via SMS to company. The proposed algorithm involved in four
stages including: 1) detection of alcohol, 2) reducing the engine speed in 10
seconds, 3) getting the GPS data and send them using SMS to company, 3) turn off
the car after 5 seconds. As the elapsed time for GSM modem to get the GPS data
and send SMS varies from one location to another, the average elapsed time for
engine lock could be obtained which was found to be 27.3 seconds. The average
time of sending location via SMS was found to be 12.3 seconds.
Another contribution of author to this project referred to the initialization of
the system in 4 stages, including: 1) Tick 1 switch, 2) Pre-Ignition alcohol check, 3)
Tick 2 switch, and 4) Ignition alcohol check. Engine lock can occur before vehicle
ignites in two different stages which can stop driver from moving the car while
consuming alcohol. In absence of alcohol I initialization stage, vehicle will ignite,
and iris detection will be activated. Arduino and MATLAB are synchronized in this
step.

97
5.9 Summary

To summarize this chapter, the system was tested with the engine lock
elapsed time and performance; iris detection with respect to moving head towards
left, right, up, and down in day time; iris detection accuracy in night time where
there is less brightness; and alcohol detection range. The result indicates that the
average elapsed time for engine lock and SMS transmission time is 27.3, and 12.3
seconds, respectively. Accuracy of 90% for the iris detection with head movement in
day time was obtained. The average elapsed time for each frame array (excluding
the first frame array) is 1.26 second which indicates of average processing time of
frame in 0.126 seconds. Iris detection in night time resulted in accuracy of 92%
while 100% drowsiness detection accuracy in night time was obtained. The result of
alcohol detection range test indicates that the higher the driver’s distance to camera
results in longer time for detection and the PPM level is reduced. The distance of
60cm is the maximum range of detection as the alcohol measurement in distance of
70 cm was not detected by MQ3 sensor.

98
CHAPTER 6

CONCLUSION AND RECOMMENDATIONS

6.1 Summary of findings and results

The prototype was built per design and the construction result was
visualized. This system used an Arduino Uno microcontroller to process the
measurement from sensor; control the actuators and communicate with MATLAB
software. The engine lock feature was performed in two different sections which are
prior to ignition and when car is ON. This system used a DC brushless motor to
represents the engine. The DC motor is controlled with L298N driver which is
powered with a 12-v voltage regulator. The GSM modem SIM808 was used to send
location of the driver via SMS while alcohol detection is fagged up. The system uses
an LCD and buzzer to warn user while drowsiness is detected. MATLAB is used for
iris detection; deciding on drowsiness; and communicating with Arduino. The iris
detection algorithm used a combination of two algorithm as Viola-john for ROI
detection (detecting the eyes area) and CHT algorithm to track iris of driver. The iris
detection works based on frame arrays which contains 10 frames. Each 10 frames
are stored in a frame array and the decision is made based on the value of each value
to be wither 1 or 0 with respect to the fact that 0 indicates that the driver iris was no
detected. The system had 3 GUIs which 1 is the final GUI and other 2 are used for
unit test. The unit test are for iris detection and communication with Arduino.
The system was tested with the engine lock elapsed time and performance;
iris detection with respect to moving head towards left, right, up, and down in day
time; iris detection accuracy in night time where there is less brightness; and alcohol

99
detection range. The result indicates that the average elapsed time for engine lock
and SMS transmission time is 27.3, and 12.3 seconds, respectively. Accuracy of
90% for the iris detection with head movement in day time was obtained. The
average elapsed time for each frame array (excluding the first frame array) is 1.26
second which indicates of average processing time of frame in 0.126 seconds. Iris
detection in night time resulted in accuracy of 92% while 100% drowsiness
detection accuracy in night time was obtained. The result of alcohol detection range
test indicates that the higher the driver’s distance to camera results in longer time for
detection and the PPM level is reduced. The distance of 60cm is the maximum
range of detection as the alcohol measurement in distance of 70 cm was not detected
by MQ3 sensor.

6.2 Limitation

The limitation of this study refers to the condition of driver while driving for
iris detection. The accuracy of iris detection reduces if the driver uses glasses while
driving. This is because of the reflection to the glass which can effect on both face
detection and iris detection.
Another limitation refers to the brightness in area of detection for image
processing. Despite the fact that the current system is responsive to different
environment condition, but intense brightness over the face of driver will reduce the
accuracy of system.
The MQ3 sensor senses the alcohol in a closed environment while the
windows are pulled up. Testing result of this sensor in an open area (while the
windows are pulled down) can reduce the detection accuracy.
The system is not able to send the location of the driver if the car is under
tunnel or closed area where access to GPS data is not possible. In this condition, the
vehicle is stopped, and the system will turn off.

100
6.3 Recommendations and suggestions for further research

In the future work, current system can be enhanced by considering wheel


control as other tributes for drowsy driver. This feature can be used by considering
the sensing elements over the steering wheel and continuous monitor over the angle
of steering wheel. The system begins to monitor the steering wheel angle once there
is no sense over the steering wheel. The system could be more enhanced to be aware
of crossing lines using ultrasonic sensor. This is because, with a small degree change
in steering wheel in high speed, the vehicle can crash in less than 10 seconds
(considering gradual move towards side of road).
The alcohol detection system can be also enhanced by considering some
sensors over the steering wheel, and on seat to measure the alcohol existence in
body of driver. This way can increase the accuracy of alcohol detection as it only
focuses on the driver itself.

101
REFRENCES
Abtahi, S., Hariri, B., Shirmoh, S. & Omidyeganeh, M., 2014. YawDD: A Yawning
detection Dataset. New York, ACM, pp. 24-28.

Accidents, T. R. S. f. t. P. o., 2017. Drinking and Driving, Birmingham: The Royal Society
for the Prevention of Accidents.

Adminstration, N. H. T. S., 2016. Drunk Driving, Washington: United States Department of


Transportation.

Alcoholism, N. I. o. A. A. a., 2017. Alcohol Facts and Statistics, s.l.: National Institute on
Alcohol Abuse and Alcoholism.

Belal, A. et al., 2013. Driver Drowsiness Detection System. International Workshop on


Systems, Signal Processing and their Applications, Volume 8, pp. 151-155.

Bhuta, P., Desai, K., Keni, A. & Badre, M. V., 2015. Alcohol Detection and Vehicle
Controlling. International Journal of Engineering Trends and Applications (IJETA), 2(2),
pp. 92-97.

Carvalho, M., 2015. The Star Online. [Online] Available at:


https://www.thestar.com.my/news/nation/2015/06/18/parliament-drunk-drivers-
500pastfive-years/
[Accessed 12 02 2018].

Centers for Disease Control and Prevention. (2013). Drowsy Driving. [online] Available at:
https://www.cdc.gov/features/dsdrowsydriving/index.html [Accessed 17 Aug. 2018].
Dabhade , S. A. & Bewoor, M. S., 2012. Real Time Face Detection and Recognition using
Haar-based Cascade Classifier and Principal Component Analysis. International Journal of
Computer Science and Management Research, 1(1), pp. 59-64.

Dwipjoy Sarkar, A. C., 2014. A Real Time Embedded System Application for Driver
Drowsiness and Alcoholic Intoxication Detection. International Journal of Engineering
Trends and Technology (IJETT), 10(9), pp. 461-465.
Flores, M. J., Armingol, J. M. & Escalera, A. . d. l., 2009. Real-TimeWarning System for
Driver Drowsiness Detection Using Visual Information. s.l., J Intell Robot Syst.
102
FV, N. & MT, M., 2017. Safety and health of professional drivers who drive on Brazilian
highways. Safety and health of professional drivers who drive on Brazilian highways,
51(March 30), p. 2.

Ozakta , S. et al., 2016. Monitoring System for Drivers of Heavy Vehicles. Social And
Applied Sciences, 6(2), pp. 23-30.

Partnership, G. R. S., 2007. Drinking and Driving: a road safety manual for decisionmakers
and practitioners, Geneva: World Health Organization.

Rakesh, K., 2014. Vechicle Tracking and Accident Alert System.. Rourkela, National
Institute Of Technology Rourkela.

Saini , V. & Saini , R., 2014. Driver Drowsiness Detection System and Techniques: A
Review. International Journal of Computer Science and Information Technologies, 5(3), pp.
4245-4249.

Singh, V., Shokeen, D. V. & B. S., 2013. FACE DETECTION BY HAAR CASCADE
CLASSIFIER WITH SIMPLE AND COMPLEX BACKGROUNDS IMAGES USING
OPENCV IMPLEMENTATION. International Journal of Advanced Technology in
Engineering and Science, 01(12), pp. 33-38.

Spurjeon , K. & Bahindwar, Y., 2012. A Dedicated System for Monitoring of Driver’s
Fatigue. International Journal of Innovative Research in Science, Engineering and
Technology, 1(2), pp. 256-262.

VURAL, E., 2009. VIDEO BASED DETECTION OF DRIVER FATIGUE. s.l., Sabanci
University.

ZHANG, Z. & ZHANG , J., 2010. A new real-time eye tracking based on nonlinear
unscented Kalman filter for monitoring driver fatigue. J Control Theory Appl, 8(2), pp.
181-188.

103

Anda mungkin juga menyukai