SlideShare a Scribd company logo
[1]
Eye Tracking based Driver Fatigue Monitoring
and Warning System”
A DISSERTATION
SUBMITTED TO PUNJAB ENGINNERING COLLEGE UNIVERSITY OF
TECHNOLOGY CHANDIGARH & CDAC MOHALI
IN PARTIAL FULFILLMENT OF THE REQUIREMENT FOR THE
AWARD OF THE MASTER DEGREE
MASTER OF ENGINEERING
(Electronic Product Design &Technology)
SUBMITTED BY
HARDEEP SINGH
(Roll No. 0820808)
hardeepsingh.ec08@pec.edu.in
DEPARTMENT OF ELECTRONICS & ELECTRICAL COMMUNICATION
PUNJAB ENGINNERING COLLEGE UNIVERSITY OF
TECHNOLOGY
CHANDIGARH-160012
INDIA
2010
[2]
CERTIFICATE
This is to certify that the dissertation entitled “EYE TRACKING BASED DRIVER
FATIGUE MONITORING AND WARNING SYSTEM” submitted by Hardeep Singh
(Student ID-0820808) in partial fulfilment of the requirement for the award of the Degree of
Masters of Engineering in Electronics Product Design & Technology, P.E.C University of
Technology, Chandigarh is a record of Student‟s own work carried out by him under my
supervision and guidance.
Co-guide Guide
(Mrs. Jasbir Kaur) (Mr. J.S Bhatia)
Assistant Professor Director
Dept. of E&EC C-DAC, Mohali
P.E.C University of Tech, Chd Punjab
DECLARATION
I hereby declare that the work carried out in this dissertation is my original work and has not
been submitted for the award of any other degree course.
Date: (Hardeep Singh)
Place: Student ID-0820808
Department of E&EC
P.E.C University of Tech
Chandigarh-160012
Mobile : 9878832094
[3]
ACKNOWLEDGEMENT
The creation of this Thesis requires the combined sincere efforts, hard work talent and
blessings of many near and dear, who directly or indirectly helped me in completing my
research work.
I sincerely express my deep gratitude to Mr. J.S Bhatia (Director, CDAC Mohali) and Mrs
Jasbir Kaur (Asst. Professor, P.E.C University of Tech Chandigarh) for their value able
guidance, constructive suggestions, constant encouragement, motivation and supervision
throughout my thesis work. Their endless support helped me in channelling my efforts and
ideas in proper direction.
I wish to express my special thanks to Er. Dilip Kumar (Sr. Design Engineer, CDAC
Mohali) for his constructive criticism and constant encouragement and allowing me to use the
lab facilities for carrying out thesis work. I wish to express my sincere thanks to the whole
teaching and non teaching faculty of CDAC Mohali and P.E.C University of Technology,
Chandigarh for their constant encouragement and sincere suggestions.
In last but not least I offer heartiest appreciation to all my friends for ever willing cooperation,
moral support and best wishes for successfully taking this study.
(HARDEEP SINGH)
ID- 0820808
M.E (E.P.D.T)
[4]
ABSTRACT
The Project entitled “Eye Tracking based Driver Fatigue Monitoring and Warning System”
consists of the hardware and the software modules. The main idea behind this project is to
develope a non-intrusive system which can detect fatigue of driver and issue a timely warning.
Since large number of road accidents are caused by driver drowsiness. Hence this system will
be helpful in preventing many accidents, and consequently save money and reduce personal
suffering.
This system will detect eye movement to detect the fatigue state of driver. By monitoring the
eyes using camera and developing an algorithm we can detect symptoms of driver fatigue early
enough to avoid an accident. So this project will be helpful in detecting driver fatigue in
advance and will gave a warning output in form of sound and vibration. For indication of
warning we will use two approaches i.e one by blowing alarm and second by seat belt vibration
whose frequency will vary between 100 to 300 Hzs. Moreover the warning will be deactivated
manually rather than automatically. So for this purpose a deactivation switch will be used to
deactivate warning.
Moreover if driver felt drowsy there is possibility of sudden acceleration or de-acceleration
hence we can judge this by plotting a graph in time domain and when all three input variables
shows a possibility of fatigue at one moment then a warning signal is shown in form of text or
red colour circle. This will directly give an indication of drowsiness/fatigue which can be
further used as record of driver performance or can be used by traffic police which can take
further action accordingly.
[5]
LIST OF FIGURES
Figure Description Page No.
Fig-1.1 Progression of drowsiness and concordance of predicted- 6
and observed PERCLOS Values.
Fig-1.2 Drowsiness judgment example - 8
Fig-1.3 Block Diagram of Eye tracking based Driver Fatigue - 9
Monitoring and Warning system.
Fig-1.4 Flow chart of Eye Tracking System - 10
Fig-1.5 Steering wheel gripping pressure Variability Detection - 11
Fig-1.6 Relay Circuit Diagram - 13
Fig-2.1 Pin Diagram of 89C52 - 15
Fig-2.2 Diagram for oscillator connections - 18
Fig-2.3 Oscillator connections - 19
Fig-2.4 USB Camera - 21
Fig-2.5 Pin diagram of ADC 0808 - 23
Fig-2.6 Resistor Ladder and switch tree - 25
Fig-2.7 3 Bit A/D Transfer Curve - 26
Fig-2.8 Opto coupler - 27
Fig-2.9 Relay Contact Sets - 29
Fig-2.10 Electromagnetic relay - 29
Fig-2.11 Opto coupler relay connections - 30
Fig-2.12 Asynchronous data format - 32
Fig-2.13 25 pin connector on a DTE device - 34
Fig-2.14 9 pin connector on a DTE device, RS 232 DB9 - 35
[6]
Fig-2.15 Pin Detail of D25 Pin Connector - 38
Fig-2.16 D25 Pin Connection with Microcontroller - 39
Fig-3.1 Block Diagram of Power Supply - 40
Fig-3.2 Power Supply Circuit - 42
Fig-3.3 Steering wheel gripping pressure Variability Detection - 42
Fig-3.4 ADC Interfacing with Microcontroller - 43
Fig-4.1 A simple blank GUI - 46
Fig-4.2 GUI developed for the project - 47
Fig. 5.1 Data Acquisition System - 50
Fig-5.2 1 Hz sine wave quantized by a 3 bit A/D converter - 55
Fig-5.3 Quantization Error - 55
Fig-5.4 Signal Polarity - 56
Fig-6.1 Design Space of Product - 59
Fig-6.2 Levels of creativity - 64
Fig-6.3 Complete Circuit Diagram - 69
Fig-6.4 PCB Layout - 70
Fig-6.5 Complete Hardware of System - 71
Fig-7.1 Driver Original Image - 72
Fig-7.2 Driver Eyes open - 73
Fig-7.3 Driver Eyes closed - 73
Fig-7.4 Steering Wheel Gripping pressure - 73
Fig-7.5 Vehicle Speed variation - 74
Fig-7.6 Sample Result of working system - 74
[7]
LIST OF TABLES
Figure Description Page No.
Table 2.1 Pin description of RS232 DB9 - 36
Table 2.2 Port Addresses and IRQ’s in the PC - 38
Table 5.1 Components of Data Acquisition System - 49
Table 5.2 Types of Sensors - 52
[8]
LIST OF ABBREVIATIONS
1) AC Alternating Circuit
2) ASIC Application Specific Integrated Circuits
3) BER Bit-Error Rate
4) BPS Bits per second
5) CCD Charge coupled device
6) CIL Common Intermediate Language
7) CPU Central processing unit
8) CLI Common Language Infrastructure
9) CLR Common Language Runtime
10) CLS Common Language Specification
11) CS Chip Select
12) C# C Sharp
13) DC Direct Circuit
14) DCE Data Communications Equipment
15) DIN Data In
16) DIP Dual inline package
17) DRC Design Rule Check
18) DTE Data Terminal Equipment
19) EA Enable
20) EMI Electromagnetic Interference
21) EPC Electronic Product Code
22) Ft Feet
23) FM Frequency Modulation
[9]
24) FLIR Face lift Image replacement
25) Fps Frames per second
26) GND Ground
27) GHz Giga hertz
28) GUI Graphical User Interface
29) ID Identification
30) IDE Integrated Development Environment
31) INTR Interrupt
32) IC Integrated Circuit
33) I/O Input/Output
34) Kb Kilo Byte
35) KΏ Kilo ohm
36) KN Kilo Newton
37) LCD Liquid Crystal Display
38) LED Light Emitting Diode
39) MCU Micro control Unit
40) MHz Mega hertz
41) MOS Metal Oxide Semi Conductor
42) MM Mili Meters
43) OS Operating System
44) OSC Oscillator
45) PC Personal Computer
46) PCB Printed Circuit Board
47) PERCLOS Percent Eye Closure
48) PTH Plated Through Hole
49) PROM Programmable Read Only Memory
[10]
50) RAM Random Access Memory
51) RAD Rapid Application Development
52) RD Read
53) ROM Read Only Memory
54) RST Reset
55) SQL Structured Query Language
56) SFR Special Function Register
57) TE Transmit Enable
58) TTL Transistor-Transistor Logic
59) TV Television
60) USB Universal serial bus
61) VLSI Very Large Scale Integration
62) W Watt
63) WR Write
64) XTAL Crystal
65) 3D Three Dimensional
66) µF Micro farad
67) pF Pico farad
[11]
CONTENTS
Certificate i
Acknowledgement ii
Abstract iii
List of Figures iv
List of Tables vi
List of Abbreviations vii
CHAPTER 1: INTRODUCTION 1-13
1.1 Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Definitions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2.1 Sleepiness and Drowsiness. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2.2 Distraction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2.3 Inattention. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.3 Inattentive Driving . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3.1 Drowsy Driving. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3.2 Distracted Driving. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.4 Literature Survey. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.4.1 Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.4.2 PERCLOS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.4.3 Steering Wheel Variability Detection. . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.5 Objective of the work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.6 System Theory and Detail. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.6.1 Input Units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
(i) Eye Tracking Unit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
(ii) Steering Wheel gripping pressure Variability Detection Unit . . . . . . . . . . . 11
(iii)Speed Variation Detection Unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.6.2 Image Processing Unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.6.3 Output and Warning Unit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
CHAPTER 2: HARDWARE DESCRIPTION 14-39
2.1. Microcontroller. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
[12]
2.1.1 Features. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.1.2 Pin Configuration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.1.3 I/O Port pins and their functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
(i) Port 0. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
(ii) Port 1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
(iii) Port 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
(iv) Port 3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
(v) RST. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
(vi) ALE/PROG. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
(vii) PSEN. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
(viii) EA/VPP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.1.4 Oscillators and clock circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.2 Programming the microcontroller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2.2.1 Steps involved in writing a program. . . . . . . . . . . . . . . . . . . . . . . . . . 20
(i) UNIPROG. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
(ii) ASEM 51. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.2.2 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.3 USB Camera. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.3.1 Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.3.2 How it works. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.3.3 Outside Factors. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.3.4 Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.4 ADC(Analog to Digital Convertor-ADC0808). . . . . . . . . . . . . . . . . . . . . . . . 23
2.4.1 General Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
2.4.2 Pin Diagram. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
2.4.3 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
2.4.4 Key Specifications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
2.4.5 Functional Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
(i) Multiplexer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
(ii) The Converter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
2.5 Opto coupler 4N35. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
2.5.1 General Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
2.5.2 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
2.6 Relay. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
2.6.1 Opto coupler Relay Connection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
2.7 Serial Port Communication. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
2.7.1 Serial Interface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
[13]
(i) Interfacing Requirements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
(ii) Transmission Format. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
a) Synchronous. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .31
b) Asynchronous. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
(iii)Error Check in Data Communication . . . . . . . . . . . . . . . . . . . . . . 33
(iv)Standard in Serial I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
2.7.2 Communicating by bits. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
2.7.3 The Parity bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
2.8 DCE DTE Devices. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
2.8.1 Baud vs Bit per Second. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
2.8.2 Null Modem Cables and Null Modem Adapters. . . . . . . . . . . . . . . . . 37
2.8.3 D pin Connector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
2.8.4 Interfacing of Microcontroller parallel port. . . . . . . . . . . . . . . . . . . . 39
CHAPTER 3: CIRCUIT DESCRIPTION 40-43
3.1 Power Supply.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
3.1.1 Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
(i) Transformer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
(ii) Bridge Rectifier . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
(iii)Filter Capacitor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
(iv)Voltage Regulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
3.1.2 Circuit Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
3.2 Interfacing of Microcontroller with ADC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
3.2.1 Circuit Diagram.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
CHAPTER 4: MATLAB SOFTWARE BASICS 44-48
4.1 Software Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
4.2 Introduction to MATLAB. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
4.3 Keil Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
4.3.1 Linker control file. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
4.3.2 Map file. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
4.3.3 Project Target. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
4.3.4 Source file group. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
4.3.5 Toolset. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
CHAPTER 5: DATA ACQUISITION 49-59
[14]
5.1. Data Acquisition System. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
5.1.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
5.1.2 Data Acquisition Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
(i) Analog input subsystem. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
(ii) Analog output subsystem. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
(iii) Digital input output subsystem. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
(iv) Counter timer subsystem. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
5.1.3 Sensors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
5.1.4 Signal Conditioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
(i) Amplification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
(ii) Filtering. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
(iii)Electric Isolation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
(iv)Multiplexing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
(v) Excitation Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
5.2 Analog Input Systems. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
5.2.1 Sampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
5.2.2 Quantization. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
(i) Quantisation error. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
5.2.3 Input Range and Polarity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
5.2.4 How Are Acquired Samples Clocked?. . . . . . . . . . . . . . . . . . . . . . . . . 57
(i) Onboard Clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
(ii) Computer Clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
(iii)External Clock. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
5.2.5 Channel Configuration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
5.2.6 Transferring Data from Hardware to System Memory. . . . . . . . . . . . . . 58
(i) FIFO Buffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
(ii) Interrupts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
(iii)DMA. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
CHAPTER 6: DESIGN PHASES OF ELECTRONIC PRODUCT 60-70
6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
6.1.1 Product . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
6.1.2 Product Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
6.1.3 Design Space of Product. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
(i) Product Physiognomy. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
(ii) Product Physiography. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
(iii) Product Anatomy. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
6.2 Design phase of Electronic Product. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
6.2.1 Aesthetic Design Phase. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
[15]
6.2.2 Engineering Design Phase. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
6.2.3 Ergonomic Design Phase. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
6.3 Creativity in Design. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
6.3.1 Creativity in Product Design. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
(i) Conceptual. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
(ii) Physical . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
6.3.2 Creativity Techniques. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
(i) Analytic . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
(ii) Non Analytic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
6.4 General Rules for PCB Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .65
6.4.1 Conductor Routing Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
6.4.2 Hole Diameter Rules. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
6.4.3 Solder Pad Diameter Rules. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .66
6.5 Design Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
6.5.1 Electrical Design. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
6.5.2 Mechanical Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
6.6 EMI consideration for Designing a Product . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
6.6.1 Factors in Material Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
6.6.2 Maintaining continuity: Gaskets. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
6.6.3 Other considerations for chassis. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
6.6.4 Capabilities of PCB Manufacturer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
6.7 Complete Circuit Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
6.8 PCB Layout. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
6.9 Complete Hardware of the System. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
CHAPTER 7: RESULTS AND DISCUSSION 72-74
7.1 Hardware Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
7.2 Software Results. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
7.2.1 The first window shows Original Image of Driver. . . . . . . . . . . . . . . . . 72
7.2.2 The Second window shows Driver iris and eye brows when Eyes open. 73
7.2.3 The Third window shows image of eye brows when Eyes closed. . . . . 73
7.2.4 The Fourth window shows Steering wheel gripping pressure variation. 73
7.2.5 The Fifth window shows Vehicle speed variation. . . . . . . . . . . . . . . . . . 74
7.2.6 The Sixth window shows complete algorithm results. . . . . . . . . . . . . . . 74
[16]
CHAPTER 8: CONCLUSION AND FUTURE SCOPE 75
8.1 Conclusion. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
8.2 Futute Scope. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
REFERENCES 76-78
APPENDIX A: COMPONENTS USED 79
APEENDIX B: MATLAB PROGRAM 80-85
APPENDIX C: DATA SHEETS 86-102
[17]
CHAPTER 1
INTRODUCTION
1.1 Overview
Driver fatigue is one of the three commonest causes of motor vehicle accidents and the effect of
driver fatigue has been underestimated in the past due to difficulties in identifying fatigue as
the cause of a crash. The problem of driver fatigue of course moves far beyond just road
vehicles to all modes of transportation, being an important factor in rail, sea and air accidents as
well.
Driver fatigue commonly causes “fall asleep” motor vehicle accidents. These tend to be more
severe or fatal compared with other road accidents. This is because they often involve a single
vehicle running off the road at high speed, they tend to occur on higher speed roadways, and
braking or other preventative measures may be absent. If truck drivers are involved, the
potential to cause death or serious injury to other road users is greatly increased.
It is commonly known that drowsiness and driving is not a good combination. To be a good
driver it is necessary to be perceptive, alert and focused on the task and it is difficult to
combine these qualities with drowsiness. Another characteristic that is a bad combination with
driving is distraction. Both these disturbances have the same effect on the driver in the sense
that they have a negative effect on the perception, reaction time and focus, to name a few
things.
Drowsiness and distraction are parts of the human behaviour, which makes the problem with
drowsiness and inattentive driving difficult to completely eliminate. A similar case is alcohol
which also has a negative effect on the driving abilities, but can (theoretically) be removed
from the roads.
1.2 Definitions:
To be able to examine the effects of drowsiness, distraction and inattention it is necessary to
start with the definitions of these words.
1.2.1 Sleepiness and Drowsiness
Sleepiness, also referred to as drowsiness, is a basic physiological state that affects humans
among others and it originates from changes of the alertness during each 24-hour sleep-wake
cycle. This is caused by the internal body clocks, which programs us to be asleep twice a day:
[18]
in the middle of the night and between 14:00-16:00 in the afternoon [1]. Sleepiness is a stage
when the body needs to sleep and is defined as “the inclination to sleep” [1]. Sleepiness should
not be confused with fatigue, which is the consequence of physical labour or a long experience,
and is defined as “disinclination to continue the task at hand” [2].
1.2.2 Distraction
Distraction is a shift in attention from the primary task to another task (secondary task). In
behavioural models, human is modelled as information processing resource who has a maximal
limit of information that can be processed [4]. In these models distraction is modelled as
surrounding disturbances taking processing resources from the main task. Distraction can result
in reduced performance of the primary task. There are several degrees of distraction, but no
fixed scale. This is a problem when detecting a degree of distraction, because it is difficult to
say that one thing “steals” more attention than another. Usually distraction is measured as the
reduction of performance of the primary task.
Another important part in the distraction is the drivers “willingness to engage” in the secondary
task. How much the person engages in the task affects how distracted the person is. Distraction
happens all the time in the daily life but the usual effect of the everyday distraction is very
harmless. It results in a shift in attention from one thing to another for a brief or longer
moment. This usually has little effect on the primary task other than a delay. An example of
this is a person reading the newspaper when he hears a car alarm go off. The result of this is
that he stops reading for a while, but soon he continues reading with only a slight delay.
Sometimes this delay in the primary task may have a serious impact on a person, when he is
driving for example. Distraction in a car is different from the everyday drowsiness because
during the time you are not paying attention to the road, something may happen, which may
cause the vehicle to crash in the worst case.
1.2.3 Inattention
Inattention is when a person is not paying attention to, or focusing on a task. It could be caused
by drowsiness, distraction, fatigue, boredom or other things. If the drowsiness and distraction is
compared with inattention, it is like cause and effect.
[19]
Drowsiness and distraction can be the cause of inattention. In the word inattention it is not so
important what caused it, just that the result is inattention. With drowsiness and distraction the
effect is usually inattention, but here it is also important what caused it.
1.3 Inattentive Driving
Inattention has a negative effect on a number of characteristics that are important while driving.
It has a decreasing effect in vigilance, reaction time, memory, coordination, memory processing
and decision making, to name a few [1].
Recent research has shown that sleep deprivation and late stages of inattention has the same
effect as alcohol intoxication. In a research study, people were deprived of sleep and asked to
do different tests. The results were that persons who were awake for 17 hours had the same
results as a rested person with blood alcohol concentration (BAC) of 0.05% (0.5‰). A group of
people that had been kept awake for 24 hours performed the same as people who had a BAC of
0.1% (1%) [1].
1.3.1 Drowsy Driving
Drowsy driving causes a lot of accidents on the roads all over the world. Cars are involved in
96% of the drowsy driving accidents and trucks are involved in 3%. However for trucks the
expected number of involvement per lifecycle in drowsy driving accidents is about four times
greater than for a car, because of the long vehicle lives and high usage [10].
Trucks are especially affected by the problem with drowsy driving because of the long
transport distances and the workload management with tight deliverance schedules. In 1998
there were approximately 1.6 million truck tractors and 3.6 million trailers used in the
transportation industry in the world. Drowsiness of truck drivers causes 1 200 deaths and 76
000 injuries annually, world-wide [9].
In the truck industry 57% of all crashes are caused by drowsiness1, which makes it the number
one cause for heavy vehicle crashes [26]. With the constantly growing traffic conditions, this
problem will further grow. The physical and psychological effects that drowsiness has on
humans are impossible to combine with the qualities that are expected from a good driver.
Drowsiness changes the abilities of the driver in the following areas:
[20]
1) Slow reaction time
2) Reduced vigilance
3) Slow information processing
4) Reduced memory capacity
5) Worse coordination
6) Slow decision making
1.3.2 Distracted Driving
During the last few years the number of distracting equipment in the vehicle has increased
dramatically. Nowadays there are mobile phones, car audio equipment, navigation systems,
TV-screens, DVD-players and cruise controls only to name a few. All these things “steal”
attention from the primary task (driving) which can expose the driver to a dangerous situation.
The trend is that the amount of distracting equipment in the vehicles is increasing as they get
more available and easier to use at the same time as the complexity of these equipment
increases. The result of this is that the drivers are more and more exposed to inattentive driving.
In research of distraction it is usually helpful to examine distraction in terms of four different
categories:
 Visual distraction – looking away from the roadway
 Auditory distraction – music or mobile phone
 Biomechanical distraction – adjusting the radio volume or changing channel
 Cognitive distraction – using navigation system
These are the main kinds of distraction that the driver can be exposed to while driving. How
much distraction a certain device causes is determined by the workload combined with the
willingness of the driver to engage in that task. This means that the worst kinds of equipment
are interesting and demanding, which could be a description of a mobile phone, a radio or a
navigation system, for example. Distraction causes many accidents annually and in some
countries it is actually illegal to drive a car while speaking in a mobile phone without a hands-
free system. Approximately 0.1% of all the car drivers have been involved in an accident
caused by someone using a mobile phone. This may not seem much, but it is estimated (based
on these numbers) that 292 000 people have experienced a vehicle crash caused by a person
using a mobile phone [14].
[21]
1.4 Literature Survey
1.4.1 Overview
One system that today is considered the most effective in the detection of inattentive driving is
the system based on eye detection. An enhanced percentage of eyelid closure is one of the most
reliable predictors of drowsiness or inattention [23].
The best detection of primarily drowsiness, but also of inattention is the measurement of brain-
waves, heart rate and pulse [26]. To measure this while driving causes annoyance to the driver,
because multiple sensors have to be attached to the driver. This can affect the driver so much
that it changes the driving behaviour, which is not good at all in traffic safety research. Eye
detection on the other hand gives an accurate detection with minimal impact on the driver.
Eye closures occur with a high frequency just before the off-road accidents caused by
drowsiness that has been recorded. In the minute preceding the accident an increase of the
eyelid closure can be detected and 20-30 seconds before the accident a dramatic increase can be
seen [10].
The eye detection system consists of a camera and demanding eye-tracking software. The
camera, usually mounted on the dashboard in front of the driver, records the eyes of the driver.
This signal is then processed in an advanced system to detect how many percents the eyes are
open, the frequency of eye blinking and in which direction the driver is looking. With this
signal it is then possible to detect the status of the driver with the accuracy of about 1 mm in the
recorded images [27].
The eye detection systems are good but not perfect, when the driver is wearing glasses there
might be errors in the detection, which in some systems leads to false warnings. Sunglasses
cause problems that almost none of the systems can deal with, which makes the inattention
detection almost impossible when the driver is wearing sunglasses. Different ethnical people
are another problem, the eyes of Asian people differ from European people, but most
manufacturers claim that it shouldn‟t be a problem.
[22]
1.4.2 PERCLOS
PERCLOS (PERcent eyelid CLOSure) is a measure of driver alertness, which was identified
as the most reliable and valid in a study by the US Federal Highway Administration; various
authors refer PERCLOS as a standard for drowsiness detection. The measure is the percentage
of eyelid closure over the pupil over time and reflects slow eyelid closures rather than blinks.
The PERCLOS drowsiness metric was established in a 1994 driving simulator study as the
proportion of time (%) in a minute when the eyelids are at least 80 percent closed.
PERCLOS system is defined as proportion of time that the eyes of the driver are closed (more
that 80%) over a specified period that can be changed to suite the driver or the situation. This
system is created to measure slow eyelid closures rather than blinks. PERCLOS originates from
a drowsiness detection system that was created in a driving simulator in 1994, and has been
developed ever since [25].
Based on research by Wierwille[11], the US Federal Highway Administration (FHWA) and the US
National Highway Traffic Safety Administration (NHTSA) considers PERCLOS to be among the
most promising known real-time measures of alertness for in-vehicle drowsiness-detection
systems[10].
Figure 1.1 Progression of drowsiness and concordance of predicted and observed
PERCLOS value.
[23]
P70: the proportion of time when the eyes were closed at least 70 percent.
P80: the proportion of time when the eyes were closed at least 80 percent (the P80 metrics is
usually referred as “PERCLOS”)
EYEMEAS (EM): the mean square percentage of the eyelid closure rating.
PERCLOS has been validated in two separate laboratories as an accurate predictor of
performance degradation caused by drowsiness [24]. It is now used as a standard for
drowsiness detection in many research projects [11] and some in-vehicle detection systems try
to estimate the PERCLOS value from in-vehicle signals, this is called estimated PERCLOS
(ePERCLOS).
The eye detection system provides information of how much the eyes are closed at every
moment and with this information the PERCLOS value can be computed. This is done by
simply calculating the percent of the time that the eyes are closed more then 80% for every
three minutes. This value is then compared to a limit value to see if the driver is considered
drowsy or not.
PERCLOS is the result of a simple mathematical algorithm which is included in the majority of
the commercial eye detection systems. The problem is to detect the eyelid opening in the
camera systems, which is done with image processing. The ordinary PERCLOS system is a
measurement of the time when the eyes of the driver are between 80% and 100% closed. If the
time exceeds a boundary value a warning is given. Usually this detection is calculated over 3-
minute periods. The warning limit can be changed to suit the situation but a limit value that is
commonly used is 0.12%, so when PERCLOS is above 0.12% the driver is considered drowsy.
1.4.3 Steering Wheel Variability Detection
As reported by Wylie et al [11], steering wheel variability is related to the amount of
drowsiness in drivers (variability greater as driver become more drowsy) after being adjusted
for road dependent effects.
Steering wheel variability is related to the amount of drowsiness in drivers (variability greater
as drivers become more drowsy) after being adjusted for road dependent effects. Steering wheel
variability is also strongly and reliably affected by location on the route. Therefore this measure
[24]
must be corrected for route dependent effects if it is to achieve its full potential as an indicator
of driver fatigue. The adjustment for route dependent effects can be performed for example by
subtracting the all-driver average steering wheel variability associated with each mile of road,
thus reducing the variation associated with road curvature. The authors of the article also
suggest considering the power spectral density of the steering wheel angle in relation to fatigue.
Clearly this approach is arduous for real-time measurements.
Figure 1.2 Drowsiness judgment example “General judgment (actua-tion)” is the system
output (detection of drowsiness), “self declaration” is the driver’s subjective drowsiness
experience, the “fluctuation” (pulse of the driver) and the “steering adjustments interval“are
the recorded input variables for the drowsiness detection.
1.5 Objective of Work
The main idea behind the Project entitled “Eye Tracking based Driver Fatigue Monitoring
and Warning System” is to develope a non-intrusive system [12] which can detect fatigue of
driver and issue a timely warning. It will have both hardware and the software modules.
This project will have three input units, one Image processing unit and two Output units/
Warning units.
[25]
1.6 System Theory and Detail
The system consists of three input variables and one Image processing unit i.e computer and
two output units i.e warning components and a microcontroller.
Input Variables Warning/Output Variables
1. Eye tracking unit 1. Sound alarm
2. Speed variation detection unit 2. Seat belt vibration
3. Steering wheel gripping pressure detection unit
Fig.1.3 Block Diagram of Eye tracking based Driver Fatigue Monitoring
and Warning system
Driver
Seat belt
vibration
Microcontroller
Sensors on Car
steering
Buffer IC Buffer IC
PC
(computer)
Camera for
tracking eye
movement so
that driver
cannot go for
sleep.
Speedometer
Image processing of eye
movement i.e if driver try
to go for a sleep by closing
his eyes for half second
Microcontroller will turn on
buzzer and Seat belt
vibration and data get
recorded as track record of
driver for future reference.
ADC Circuit ADC Circuit
[26]
1.6.1 Input Units
This system will consists three input units to study the drowsy behaviour of driver namely Eye
Tracking unit, Steering wheel gripping pressure variability detection unit and Speed variation
detection unit.
(i) Eye Tracking Unit
This is the most crucial unit as the accuracy of warning issued will largely depends on this unit.
Hence it can also be called the heart of this system.
Driver face monitoring system [6] is a real-time system that can detect driver fatigue and driver
distraction using machine vision approaches. An algorithm is used for driver hypo-vigilance
detection based on eye-region processing and without explicit eye detection stage. In this
method, horizontal projection of top half-segment of facial image is used to extract symptoms
of fatigue and distraction.
Fig. 1.4 Flow chart of Eye Tracking based System
Calculation of criteria for judging
drowsiness/ fatigue
Face detection
Driver’s Image
Recognition of eyes
whether open or closed
Is driver
drowsy
WARNING
Eye detection
[27]
The Algorithm used here is very much fast as compared to PERCLOS [5] earlier used by other
hence the Processing time of this system is less than half second hence it is quite fast and issues
timely warning to the driver.
This system will detect a driver fatigue by processing of eye-region. As shown in flow chart in
Figure 1.4. After image acquisition, face detection is the first stage of processing. Then
symptoms of hypo-vigilance are extracted from the eyes. If eyes are blinking normally no
warning is issued but when the eyes are closed for more than half second this system issues
warning to the driver in form of alarm and vibration.
(ii) Steering wheel gripping pressure variability detection unit
The technique used here is that human body conducts current. Hence by using a conducting
wire on non conducting steering wheel of Vehicle and an Analog to Digital Convertor (ADC)
connected through a Transistor which acts as a switch. Whenever driver hold the steering
tightly more current flows through base of Transistor as parallel resistances made by our
fingers add up in parallel and as a result net resistance decreases and base current increases.
Fig. 1.5 Steering wheel gripping pressure Variability Detection
[28]
Hence this variation is converted by ADC into some threshold and whenever output is less than
threshold it indicates Driver Drowsiness or Fatigue state.
(iii) Speed Variation Detection Unit
Speed variation detection unit consists of a speedometer and whenever driver felt drowsy there
is possibility of sudden acceleration or de-acceleration hence we can judge this by plotting a
graph in time domain and when all three input variables shows a possibility of fatigue at one
moment then a warning signal is shown in form of text or red colour circle. This will directly
give an indication of drowsiness/fatigue which can be further used as record of driver
performance or can be used by traffic police which can take further action accordingly.
1.6.2 Image Processing Unit
This approach analyzes the images captured by cameras to detect physical changes of drivers,
such as eyelid movement, eye gaze, yawn, and head nodding. For example, the PERCLOS
system developed by W. W. Wierwile[12] used camera and imaging processing techniques to
measure the percentage of eyelid closure over the pupil over time. The three-in-one vehicle
operator sensor developed by Northrop Grumman Co. also used the similar techniques[30].
Although this vision based method is not intrusive and will not cause annoyance to drivers. In
addition, this approach requires the camera to focus on a relative small area (around the driver‟s
eyes). It thus requires relative precise camera focus adjustment for every driver.
1.6.3 Output Units/Warning Units
For indication of warning this system will use two approaches i.e one by blowing alarm and
second by seat belt vibration whose frequency will vary between 100 to 300 Hzs. Moreover the
warning will be deactivated manually rather than automatically. So for this purpose a
deactivation switch will be used to deactivate warning. Microcontroller will switch on the
vibration sensor using the relay circuit shown in Figure 1.6.
[29]
Fig.1.6 Relay Circuit Diagram
[30]
CHAPTER 2
HARDWARE DESCRIPTION
2.1 Microcontroller
The main difference between a Microprocessor and a Microcontroller is that a Microcontroller
has inbuilt peripherals like timers, USART, Interrupt Controller etc. whereas in a
Microprocessor these have to be interfaced as separate IC‟s. In this project the Microcontroller
AT89C51 from the ATMEL Corp is used. The AT89C51 is a low- power, high-performance
CMOS 8-bit microcomputer with 4Kbytes of Flash programmable and erasable read only
memory (PEROM). The device is manufactured using Atmel‟s high-density non volatile
memory technology and is compatible with the industry-standard MCS-51 instruction set and
pin out. The on-chip Flash allows the program memory to be reprogrammed in-system or by a
conventional non volatile memory programmer. By combining a versatile 8-bit CPU with Flash
on a monolithic chip, the Atmel AT89C51 is a powerful microcomputer which provides a
highly-flexible and cost-effective solution to many embedded control applications. Some of the
features of the AT89C51 Microcontroller are listed below.
2.1.1 Features
 Compatible with MCS-51™ Products
 4K Bytes of In-System Reprogrammable Flash Memory
 Endurance: 1,000 Write/Erase Cycles
 Fully Static Operation: 0 Hz to 24 MHz
 Three-level Program Memory Lock
 128 x 8-bit Internal RAM
 32 Programmable I/O Lines
 Two 16-bit Timer/Counters
 Six Interrupt Sources
 Programmable Serial Channel
 Low-power Idle and Power-down Modes
[31]
2.1.2 Pin Configuration The 89C52 have a total of 40 pins that are dedicated for various
functions such as I/O, RD, WR, address and interrupts. Out of 40 pins, a total of 32 pins are set
aside for the four ports P0, P1, P2, and P3, where each port takes 8 pins. The rest of the pins are
designated as Vcc, GND, XTAL1, XTAL, RST, EA, and PSEN.
Fig 2.1 Pin diagram of 89C52
All these pins except PSEN and ALE are used by all members of the 8051 and 8031 families.
In other words, they must be connected in order for the system to work, regardless of whether
the microcontroller is of the 8051 or the 8031 family. The other two pins, PSEN and ALE are
used mainly in 8031 based systems. The diagram of the 8052 packaged in a 40-pin DIP is
shown in figure 2.7 with the full-abbreviated names for the signals of each pin. Many of the
pins are used for more than one function.
2.1.3 I/O port pins and their functions
The four ports P0, P1, P2, and P3 each use 8 pins, making them 8-bits ports. All the ports upon
RESET are configured as output, ready to be used as output ports. To use any of these as input
port, it must be programmed.
[32]
(i) Port 0
Port 0 occupies a total of 8 pins (pins 32 to 39). It can be used for input or output. To use the
pins of port 0 as both input and output ports, each pin must be connected extremely to a 10K –
ohm pull-up resistor. This is due to fact that port 0 is an open drain, unlike P1, P2, and P3. With
external pull-up resistors connected upon rest, port 0 is configured as output port. In order to
make port 0 an input, the poet must be programmed by writing 1 to all the bits of it. Port is also
designated as AD0-AD7, allowing it to be used for both data and address. When connecting a
microcontroller to an external memory, port 0 provides both address and data. The
microcontroller multiplexes address and data through port 0 to save pins. ALE indicates if P 0
has address or data. When ALE=0, it provides data D0-D7, but when ALE=1 it has address A0-
A7. Therefore, ALE is used for de-multiplexing address and data with the help of latch
74LS373.
(ii) Port 1
Port 1 occupies a total of 8 pins (pins 1 to 8). It can be used as input or output. In contrast to
port 0, this port does not require pull-up resistor since it has already pull-up resistor internally.
Upon reset, port 1 is configures as an output port. Similar to port 0, port 1 can be used as an input
port by writing 1 to all its bits.
(iii)Port 2
Port 2 occupies a total of 8 pins (pin 21 to 28). It can be used as input or output. Just like P1,
port 2 does not need any pull-up resistors since it has pull-up resistors internally. Upon reset
port 2 is configured as output port. To make port 2 input, it must be programmed as such by
writing 1s to it.
(iv)Port 3
Port 3 occupies a total of 8 pins (pins10 to 17). It can be used as input or output, P3 does not
need any pull-up resistors, the same as P1 and P2 did not. Although port 3 is configured as
output port upon reset, this is not the way it is most commonly used. Port 3 has an additional
function of providing some extremely important signals such as interrupts.
Some of the alternate functions of P3 are listed below:
P3.0 RXD (Serial Input)
[33]
P3.1 TXD (Serial Output)
P3.2 INT0 (External interrupt 0)
P3.3 INT1 (External Interrupt 1)
P3.4 T0 (Timer 0 External Input)
P3.5 T1 (Timer 1 External Input)
P3.6 WR (External Memory Write Strobe)
P3.7 RD (External Memory Read Strobe)
(v) RST
Reset input. A high on this pin for two machine cycles while the oscillator is running resets the
device.
(vi) ALE/PROG
Address Latch Enable output pulse for latching the low byte of the address during accesses to
external memory. This pin is also the program pulse input (PROG) during Flash programming.
In normal operation ALE is emitted at a constant rate of 1/6 the oscillator frequency, and may
be used for external timing or clocking purposes. Note, however, that one ALE pulse is skipped
during each access to external Data Memory. If desired, ALE operation can be disabled by
setting bit 0 of SFR location 8EH. With the bit set, ALE is active only during a MOVX or
MOVC instruction. Otherwise, the pin is weakly pulled high. Setting the ALE-disable bit has
no effect if the microcontroller is in external execution mode.
(vii) PSEN
Program Store Enable is the read strobe to external program memory. When the AT89C52 is
executing code from external program memory, PSEN is activated twice each machine cycle,
except that two PSEN activations are skipped during each access to external data memory.
(viii) EA/VPP
EA (External Access Enable) must be strapped to GND in order to enable the device to fetch
code from external program memory locations starting at 0000H up to FFFFH. Note, however,
[34]
that if lock bit 1 is programmed, EA will be internally latched on reset. EA should be strapped to
VCC for internal program executions. This pin also receives the 12-volt programming enable
voltage (VPP) during Flash programming, for parts that require 12-volt VPP.
2.1.4 Oscillators and clock circuit
It is the heart of the microcontroller that generates the clock pulses by which all the internal
operations are synchronized. Pins XTAL1 and XTAL2 are provided for the connection of a
resonant network to form an oscillator. Typically, a quartz crystal and capacitor are employed
and thus crystal frequency will become the clock frequency of microcontroller. The figure 2.2
below shows oscillator connections with the microcontroller.
Fig: 2.2 Diagram for oscillator connections
The 8052 maximum and minimum frequency range between 1 MHz to 16 MHz and 20 MHz in
case of AT89C52. Thus, the 8052 operates on an external crystal. This is an electrical device
which, when energy is applied, emits pulses at a fixed frequency.
One can find crystals of virtually any frequency depending on the application requirements.
When using on 8051, the most common crystal frequencies are 12 MHz and 11.0592 MHz with
11.0592 being much more common.
Why would anyone pick such an oddball frequency? There‟s a real reason for it has to do with
generating baud rates in the Serial communication. A cycle is, in reality, 12 pulses of the
crystal. That is to say, if an instruction takes on machine cycle to execute, it will take 12 pulses
of the crystal to execute. Since the crystal is pulsing 11,059,000 times per second and that one
[35]
machine cycle is 12 pulses, we can calculate how many instruction cycles the 8051 can execute
per second:
11,059,000/12 = 921,583
This means that the 8052 can execute 921,583 single-cycle instructions per second. Since a
large number of 8052 instructions are single – cycle instructions it is often considered that the
8052 can execute roughly 1 million instructions per second, although in reality it is less and
depending on the instructions being used, an estimate of about 600,000 instructions per second
is more realistic.
The 8052 equipped with two timers, both of which may be controlled, set, read, and configured
individually. Keeping time and/or calculating the amount of time between events. Counting the
events themselves and generating baud rates for the serial port
If in some cases, it is essential to use frequency source other than a crystal oscillator, such as a
TTL oscillator, it will be connected to XTAL1; XTAL2 is left unconnected as shown in figure
2.3 below for oscillator connections
Fig: 2.3 Oscillator connections
2.2 Programming the Microcontroller
To program a microcontroller one must have two basic tools. One is the hardware-programmer
board and the second is the software-for downloading the program. The hardware programmer
board is used to hold the chip and enable the computer to download the program into the
microcontroller. The programmer board is serially connected to the computer.
[36]
The software you needed to program the microcontroller will be two fold. One is the compiler
and the other to download the program written. The compiler program automatically checks for
errors in the program and then compiles it into a hex file. This hex file is stored in the same
directory in which original program file is earlier stored. The compiler software used be us is
ASEM software. The downloading software used here is the UNIPROG. The uniprog can be
run in only the DOS mode. This is very user friendly software and can be operated easily. This
helps in erasing previous files and downloading new programs into the Microcontroller. It helps
out how to program the micro with step by step descriptions as follows.
2.2.1 Steps involved in writing a program to the Microcontroller:
1. Write the required program in the Notepad of windows with the syntaxes being followed as
per the rules of programming.
2. Save the written file in .asm extension. Now the assembly file has been created.
3. Next run this file in ASEM software by specifying the path of the file.
4. After this the ASEM software will check for errors and then convert this into .hex file.
5. Now run the system in the Dos Mode.
6. Next run the UNIPROG software
7. It automatically checks the IC placed in the board.
8. Then specify the hex file to be downloaded.
9. If any program is in the IC, you can erase it.
10. Now download the program and hence you are ready to work with the IC.
(i) UNIPROG is an open engine for support any hardware chip programmer. It‟s implement
an open architecture based in hardware-abstract algorithms and chip definitions, that can work
in any hardware. With UNIPROG the development of new and powerful programmers is not
limited by lack of software or the need of test chips.
(ii) ASEM-51 is a two-pass macro assembler for the Intel MCS-51 family of microcontrollers.
It is running on the PC under MS-DOS, Windows and Linux. The DOS real-mode assembler
ASEM.EXE requires only 256 kB of free DOS memory and MS- DOS 3.0 (or higher). The new
protected-mode assembler ASEMX.EXE requires a 286 CPU (or better), and at least 512 kB of
free XMS memory. The new Win32 console-mode assembler ASEMW.EXE requires a 386
CPU (or better) and Windows 9x, NT, 2000 or XP. The new Linux assembler ASEM requires a
[37]
386-based Linux system. The new HTML documentation set requires a 90 MHz Pentium (or
better) and a web browser. The ASEM-51 assembly language is a rich subset of the Intel
standard that guarantees maximum compatibility with existing 8051 assembler sources.
ASEM-51 can generate two sorts of object files: Intel-HEX format, which is directly accepted
by most EPROM programmers, and absolute OMF-51 format, which is required for many
simulators, emulators and target debuggers. Thus ASEM-51 is suitable for small and medium
MCS-51-based microcontroller projects in hobby, education and business. However, ASEM-
51has been designed to process also very large programs!
2.2.2 Features:
 Fast, compact, reliable, easy to use, and well-documented
 Easy installation, almost no configuration required
 Command line operation, batch and networking capability
 DOS (RM and PM), Win32 and Linux binaries available
 Intel-compatible syntax
 Five location counters, one for each of the MCS-51 address spaces
 Assembly-time evaluation of arithmetic and logical expressions
2.3 Camera
Fig: 2.4 USB Camera
[38]
2.3.1 Introduction
Simply, the frame rate is the number of pictures a webcam can take and how quickly it can then
transfer them to the computer's screen. Frames are measured in "frames per second" (or fps). So
if the webcam says it has a 30 fps, that means it can take 30 pictures every second and then
transfer them to the computer screen.
2.3.2 How It Works
Once a picture (or frame) is captured by the webcam, it creates a JPEG file of the still image.
When the webcam has a low frame rate (15 fps or below), the webcam can only transmit a
series of these JPEG still images. When the frame rate is higher than 15 fps, the webcam can
actually stream video using the computer's Internet connection.
Frame rates generally range from 10 fps to 60 fps. For avoiding the chopping of video, stay
closer to 30 and higher want very
2.3.3 Outside Factors
Although the number on the box may say one thing, what your webcam actually captures may
be different. Certain things can affect a webcam's frame rate, such as the capabilities of
webcam's software program, exactly what you are trying to record, the resolution of the
webcam, and even the amount of light in the room. Likewise, running multiple devices via your
computer's USB ports can also slow down the frame rate.
2.3.4 Specifications:
USB 2.0 Compatible
LED brightness controller
CMOS chip type: Color CMOS image sensor
Built-in Microphone
High Definition: 480k pixels (640x480)
Sensor size: 4.86 x 3.64mm
Frame Rate: 320x240 up to 30 frame/sec(CIF), 24-bit True Color
Video Format: 24-bit RGB
Focus range: 5cm-Infinity
Manual Focus, automatic color compensated
Support OS: Win 98/98SE/ME/2000/XP
Works perfectly with ICQ, MSN, Yahoo, AOL messenger
Easily mounts to a PC monitor or a notebook
 PC Camera software comes with this camera for viewing images
[39]
Weight: 99g
Cable length: 150cm
2.4 ADC 0808 (Analog to Digital Convertor)
2.4.1 General Description
The ADC0808, ADC0809 data acquisition component is a monolithic CMOS device with an 8-
bit analog-to-digital converter, 8-channel multiplexer and microprocessor compatible control
logic. The 8-bit A/D converter uses successive approximation as the conversion technique. The
converter features a high impedance chopper stabilized comparator, a 256R voltage divider
with analog switch tree and a successive approximation register. The 8 channel multiplexer can
directly access any of 8-single-ended analog signals.
The device eliminates the need for external zero and full scale adjustments. Easy interfacing to
microprocessors is provided by the latched and decoded multiplexer address inputs and latched
TTL TRI-STATEÉ outputs. The design of the ADC0808, ADC0809 has been optimized by
incorporating the most desirable aspects of several A/D conversion techniques. The ADC0808,
ADC0809 offers high speed, high accuracy, minimal temperature dependence, excellent long-
term accuracy and repeatability, and consumes minimal power. These features make this device
ideally suited to applications from process and machine control to consumer and automotive
applications.
2.4.2 Pin Diagram
Fig 2.5 Pin diagram of ADC 0808
[40]
2.4.3 Features
 Easy interface to all microprocessors
 Y Operates ratio metrically or with 5 VDC or analog span
 adjusted voltage reference
 No zero or full-scale adjust required
 8-channel multiplexer with address logic
 0V to 5V input range with single 5V power supply
 Outputs meet TTL voltage level specifications
 Standard hermetic or molded 28-pin DIP package
 28-pin molded chip carrier package
 ADC0808 equivalent to MM74C949
 ADC0809 equivalent to MM74C949-1
2.4.4 Key Specifications
 Resolution 8 Bits
 Total Unadjusted Error g(/2 LSB and g1 LSB
 Single Supply 5 VDC
 Low Power 15 mW
 Conversion Time 100 ms
2.4.5 Functional Description
(i) Multiplexer
The device contains 8-channel single-ended analog signals inputs. A particular input channel is
selected by using the address decoder. The input states for the address lines to select any
channel. The address is latched into the decoder on the low-to-high transition of the address
latch enable signal.
(ii) The Converter
The 8 bit converter is designed to give fast, accurate, and repeatable conversions over a wide
range of temperatures. The converter is partitioned into 3 major sections: the 256R ladder
network, the successive approximation register, and the comparator. The converter's digital
outputs are positive true. The 256R ladder network approach (Figure 2.6) was chosen over the
[41]
conventional R/2R ladder because of its inherent monotonicity, which guarantees no missing
digital codes. Monotonicity is particularly important in closed loop feedback control systems. A
non-monotonic relationship can cause oscillations that will be catastrophic for the system.
Additionally, the 256R network does not cause load variations on the reference voltage. The
bottom resistor and the top resistor of the ladder network in Figure 2.6 are not the same value
as the remainder of the network. The difference in these resistors causes the output
characteristic to be symmetrical with the zero and full-scale points of the transfer curve. The
first output transition occurs when the analog signal has reached a(/2 LSB and succeeding
output transitions occur every 1 LSB later up to full-scale.
The successive approximation register (SAR) performs 8 iterations to approximate the input
voltage. For any SAR type converter, n-iterations are required for an n-bit converter. Figure 2.7
shows a typical example of a 3-bit converter. In the ADC0808, ADC0809, the approximation
technique is extended to 8 bits using the 256R network.
Fig.2.6 Resistor Ladder and switch tree.
[42]
The A/D converter's successive approximation register (SAR) is reset on the positive edge of
the start conversion (SC) pulse. The conversion is begun on the falling edge of the start
conversion pulse. A conversion in process will be interrupted by receipt of a new start
conversion pulse. Continuous conversion may be accomplished by tying the end of- conversion
(EOC) output to the SC input. If used in this mode, an external start conversion pulse should be
applied after power up. End-of-conversion will go low between 0 and 8 clock pulses after the
rising edge of start conversion. The most important section of the A/D converter is the
comparator. It is this section which is responsible for the ultimate accuracy of the entire
converter. It is also the comparator drift which has the greatest influence on the repeatability of
the device. A chopper-stabilized comparator provides the most effective method of satisfying
all the converter requirements.
The chopper-stabilized comparator converts the DC input signal into an AC signal. This signal
is then fed through a high gain AC amplifier and has the DC level restored. This technique
limits the drift component of the amplifier since the drift is a DC component which is not
passed by the AC amplifier. This makes the entire A/D converter extremely insensitive to
temperature, long term drift and input offset errors.
Fig.2.7 3 Bit A/D Transfer Curve
[43]
2.5 Opto coupler 4N35
2.5.1 General Description
In electronics, an opto-isolator (or optical isolator, opto coupler, photocoupler, or photo MOS)
is a device that uses a short optical transmission path to transfer a signal between elements of a
circuit, typically a transmitter and a receiver, while keeping them electrically isolated since the
signal goes from an electrical signal to an optical signal back to an electrical signal, electrical
contact along the path is broken. Different sections of a circuit of a circuit operate at their own
voltage levels. Opto couplers are used to isolate these lines. If there is any transient voltage or
noise in one of the lines, the opto coupler stops it from with the other lines. It is mainly used for
signal and electrical isolation.
Relays can of course provide this kind of isolation, but even small relays tend to be fairly bulky
compared with ICs and many of today‟s other miniature circuit components. Because they are
electro-mechanical, relays are also not as reliable and only capable of relatively low speed
operation. Where small size, higher speed and greater reliability are important, a much better
alternative is to use an opto coupler. The figure 2.8 below shows the 6 pin opto coupler IC and
internal structure of an opto coupler.
Fig: 2.8 Opto coupler
The input part has an infrared LED chip and the output has a silicon diode chip. A thin,
transparent, Mylar plate embedded in clear silicone separates these. Resistors are also placed in
the circuit. The assembly is sealed in plastic. From this diagram the anode of the LED is pin 1
and the cathode is pin 2. The emitter of the phototransistor is pin 4, the collector is pin 5, and
the base is pin 6. When a forward bias voltage is applied to the input terminals of the LED an
input current flows in the LED circuit. When an electrical signal is applied to the input of the
opto-isolator, its LED lights, its light sensor then activates, and a corresponding electrical
signal is generated at the output. With a photodiode as the detector, the output current is
[44]
proportional to the amount of incident light supplied by the emitter. This current produces an
infrared light that hits the silicon chip. The input signal is connected to the LED and the output
signal is connected to the transistor. The infrared light varies with the input voltage. There are
many situations where signals and data need to be transferred from one subsystem to another
within a piece of electronics equipment, or from one piece of equipment to another, without
making a direct-ohmic electrical. Often this is because the source and destination are (or may
be at times) at very different voltage levels, like a microcontroller which is operating from 5V
DC but being used to control a triac which is switching 240V AC. In such situations the link
between the two must be an isolated one, to protect the microcontroller from over voltage
damage. These use a beam of light to transmit the signals or data across an electrical barrier,
and achieve excellent isolation.
Opto couplers typically come in a small 6 pin or 8-pin IC package, but are essentially a
combination of two distinct devices, an optical transmitter, typically a gallium arsenide LED
(light emitting diode) and an optical receiver such as a phototransistor or light triggered diac.
The two are separated by a transparent barrier which blocks any electrical current flow between
the two, but does allow the passage of light.
2.5.2 Features
o Also available in white package by specifying -M suffix, eg. 4N25-M
o UL recognized (File # E90700)
o VDE recognized (File # 94766)
o Add option V for white package (e.g., 4N25V-M)
o Add option 300 for black package (e.g., 4N25.300)
2.6 Relay
The electromagnetic relay consists of a multi-turn coil, wound on an iron core, to form an
electromagnet as shown in figure 2.9. When the coil is energized, by passing current through it,
the core becomes temporarily magnetized. The magnetized core attacks the iron armature. The
armature is pivoted which causes it to operate one or more sets of contacts. When the coil is de-
energized the armature and contacts are released. The coil can be energized from a low power
source such as a transistor while the contacts can switch high powers such as the mains supply.
The relay can also be situated remotely from the control source. Relays can generate a very
[45]
high voltage across the coil when switched of. This can damage other components in the
circuit. To prevent this, a diode is connected across the coil.
Fig: 2.9 Relay contact sets
The cathode of the diode is connected to the most positive end of the coil. The spring sets
(contacts) can be a mixture of n.o (normally open), n.c (normally closed) and c.o (common) as
shown in figure 2.10.
Fig: 2.10 Electromagnetic relay
2.6.1 Opto coupler Relay Connection:
The figure 2.11 shows the connection of opto coupler with relay. The Normally open pin is
connected to AC mains; the pin normally closed is connected to ground. The common pin is
connected to the robo car. One end of the coil is connected to the emitter of the transistor and
the other end is connected to 5V supply.
[46]
Fig:2.11 Opto coupler relay connections
2.7 Serial Port Communication
All IBM PC and compatible computers are typically equipped with two serial ports and one
parallel port. Although these two types of ports are used for communicating with external
devices, they work in different way. A parallel port sends and receives data eight bits at a time
over 8 separate wires. This allows data to be transferred very quickly; however, the cable
required is more bulky because of the number of individual wires it must contain. Parallel ports
are typically used to connect a PC to a printer and are rarely used for much else. A serial port
sends and receives data one bit at a time over one wire. While it takes eight times as long to
transfer each byte of data this way, only a few wires are required. In fact, two – way (full
duplex) communications is possible with only three separate wires – one to send, one to
receive, and a common signal ground wire.
Serial data communication uses two methods, asynchronous and synchronous. The
synchronous transfers a single byte at a time. The data coming in at the receiving end of the
data line in a serial data transfer is all 0s and 1s: it is difficult to make sense of the data unless
the sender and receiver agree on as set of rules, a protocol, on how the data is packed, how
many bits constitute a character, and when the data begins and ends.
Serial communication requires that you specify the following four parameters:
[47]
 The baud rate of the transmission
 The number of data bits encoding a character
 The sense of the optional parity bit
 The number of stop bits
Each transmitted character is packaged in a character frame that consists of a single start
bit followed by the data bits, the optional parity bit, and the stop bit or bits.
2.7.1 Serial Interface
Basic concepts concerning the serial communication can be classified into categories below:
 Interfacing requirements
 Transmission format
 Error check in data communication
 Standards in serial I/O
(i) Interfacing Requirements
The serial interface requirement is very much similar to parallel interface requirement.
Computer identifies the peripheral through port address and enable if using the read and write
signals. The primary difference between the parallel I/O and serial I/O is the number of lines
used for data transfer. Parallel I/O requires the entire bus while the serial I/O requires only one
or pair of data lines for communication
(ii) Transmission Format
Transmission format for communication is concerned with the issues such as synchronization,
direction of data flow, speed, errors and medium of transmission. Serial data can be sent
synchronously or asynchronously.
a) Synchronous Data Transmission For synchronous data transmission data is sent in blocks
at a constant rate. The start and end of the block are identified with specific bytes or bits
patterns.
b) Asynchronous Data Transmission For asynchronous transmission each data character has
[48]
a bit which identifies its start and 1or 2 bits, which identifies its end. Since each character is
individually identified, characters can be sent at any time (asynchronously), in the same way
that a person types on a keyboard.
The asynchronous format is character oriented. Each character carries the information of the
start and stop bits. When no data is being transferred, a receiver stage high at the logic 1 called
mark; logic 0 is called space. The transmission of data begins with one start bit (low)
followed by a character and one or two stop bits (high). This is known as framing. The
asynchronous format is generally used in low speed transmission (less than 20k bits/sec) in
serial I/O one bit is sent out at a time. Therefore how long the bit stays on or off is determined
by the speed at which bits are transmitted. The receiver should be set up to receive the bits at
the same rate of transmission; otherwise the receiver may not be able to differentiate between
the two consecutive 0s and 1s.
The rate at which the bits are transmitted (bits/sec) is called baud. Each equipment has its own
baud rate requirements. Baud rate is a measure of how fast data are moving between
instruments that use serial communication. If the instrument is transmitting at 9,600 baud, the
duration of the start bit and each subsequent bit is about 0.104ms. The entire character frame of
eleven bits would be transmitted in about 1.146 ms.
Knowing the structure of a character frame and the meaning of baud rate as it apply to serial
communication, maximum transmission rate in characters per second can be calculated for a
given communication setting. This rate is just the baud rate divided by the bits per frame. If the
transmission rate is set at 9,600 baud, you get 9,600/11=872 characters per second. The figure
2.12 below shows the format of the frame transmitted using asynchronous transmission.
Fig: 2.12 Asynchronous data format
[49]
(iii) Error check in data communication
During transmission, various types of errors can occur. These errors need to be checked,
therefore, additional information for error checking is sent during transmission the receiver can
check the received data against the error check information, and if the error is detected, the
receiver can request there retransmission of that data segment. Three methods generally used
for this purpose are parity check, checksum and redundancy check.
(iv) Standard in Serial I/O
The serial I/O technique is commonly used to interface terminals, printers etc. a standard is
normally defined by a professional organization (such as IEEE). A standard may include such
items as assignment of pin positions for signals, voltage levels, speed of data transfer, length of
cable and mechanical specifications. When data are transmitted as voltage, the commonly used
standard is known as RS232C. It is defined as reference to data terminal equipment (DTE) and
data communication equipment (DCE). The rate of transmission is RS232 is restricted to a
maximum of 20k baud and a distance of 50 feet.
2.7.2 Communicating by bits
In data framing for asynchronous communication, the data, such as ASCII characters, are
packed in between start bit and stop bit. The start bit is always one bit but the stop bit can be
one or two bits. The start bit is always a 0 (low) and the stop bit is 1 (high). Once the start bit
has been sent, the transmitter sends the actual data bits. There may either be 5, 6, 7 or 8 data
bits, depending on the number you have selected. Both receiver and the transmitter must agree
on the number of data bits, as well as the baud rate. Almost all devices transmit data using
either 7 or 8 data bits. Notice that when only 7 data bits are employed, you cannot send ASCII
values greater than 127. Likewise, using 5 bits limits the highest possible value to 31. After the
data has been transmitted, a stop bit is sent. A stop bit has a value of 1- or a mark state- and it
can be detected correctly even if the previous data bit also had a value of 1. This is
accomplished by the stop bits duration.
2.7.3 The Parity Bit
Besides the synchronization provided by the use of start and stop bits, an additional bit called a
parity bit may optionally is transmitted along with the data. A parity bit affords a small amount
of error checking, to help detect data corruption that might occur during transmission. When
[50]
even or odd parity is being used, the number of marks (logical 1 bit) in each byte is counted,
and a single bit is transmitted following the data bits to indicate whether the number of 1 bit
just sent is even or odd. For example, when even parity is chosen, the parity bit is transmitted
with a value of 0 if the number of preceding marks is an even number. For the binary value of
01100011 the parity bit would be 0. If even parity was in effect and the binary number
11010110 was sent, then the parity bit would be 1. Odd parity is just the opposite, and the
parity bit is 0 when the number of mark bits in the preceding word is an odd number. Parity
error checking is very rudimentary. While it will tell you if there is a single bit error then the
parity bit was received in errors. Also, if an even number of bits is in error then the parity bit
would not reflect any error at all. Mark parity means that the parity bit is always set to the mark
signal condition and likewise space parity always sends the parity bit in the space signal
condition. Since these two parity options serve no useful purpose whatsoever, they are almost
never used.
2.8 DCE and DTE devices
DTE stands for Date Terminal Equipment, and DCE stands for Data communications
Equipment. These terms are used to indicate the pin-out for the connectors on a device and the
direction of the signals on the pins. Computer is a DTE device, while most other devices are
usually DCE devices.
The RS-232 standard states the DTE devices use a 25 pin male connector, and DCE devices use
a 25-pin female connector. You can therefore connect a DTE device to a DCE using a straight
pin-for-pin connection. However, to connect two like devices, you must instead use a null
modem cable. Null modem cables cross the transmit and receive lines in the cable, and are
discussed later in this chapter. The figure 2.13 and 2.14 shows the connections and signal
directions for both 25 and 9 pin connectors.
Fig 2.13: 25 pin connector on a DTE device
[51]
Fig: 2.14: 9 pin connector on a DTE device, RS 232 DB9
The TD (transmit data) wire is the one through which data from a DTE device is transmitted to
a DCE device. This wire is used by a DCE device to receive its data. The DTE device puts this
line in a mark condition to tell the remote device that it is ready and able to receive data. If the
DTE device is not able to receive data (typically because it receive buffer is almost full), it will
put this line in the space condition as a signal to the DCE to stop is almost full), it will put this
line in the space condition as a signal to the DCE to stop sending data. When the DTE device is
ready to receive more data (i.e after data has been removed from it‟s receive buffer), it will
place this line back in the mark condition. The complement of the RTS wire is CTS, which
stands for clear to send. The DCE device puts this line in a mark condition to tell the DTE
device that it is ready to receive the data.
Likewise, if the DCE device is unable to receive data, it will place this line in the space
condition. Together, these two lines make up what is called RTS/CTS or “hardware” flow
control. The software Wedge supports this type of flow control, as well as Xon/Xoff or
“software” flow control. Software flow control uses special control characters transmitted from
one device to another to tell the other device to stop or start sending data. With software flow
control the RTS and CTS lines are not used.
DTR stands for Data Terminal Ready. Its intended function is very similar to the RTS line.
DSR (Data Set Ready) is the companion to DTR in the same way that CTS is to RTS. Some
serial devices use DTR and DSR as signals to simply confirm that a device is connected and is
turned on. The software Wedge sets DTR to the mark state when the serial port is opened and
leaves it in that state until the port is closed. The DTR and DSR lines were originally designed
to provide an alternate method of hardware handshaking. It would be pointless to use both
RTS/CTS and DTR/DSR for flow control signals at the same time. Because of this, DTR and
DSR are rarely used for flow control.
[52]
Pin Number Direction of Signal
1 Carrier Detect (CD) (from DCE) incoming signal from a modem
2 Received Data (RD) Incoming Data from a DCE
3 Transmitted data (TD) outgoing data to a DCE
4 Data Terminal Ready (DTR) Outgoing handshaking signal
5 Signal ground common reference voltage
6 Data set ready (DSR) incoming handshaking signals
7 Request to sent (RTS) outgoing flow control signal
8 Clear to send (CTS) incoming flow control signal
9 Ring Indicator (RI) (from DCE) incoming signal from a modem
Table 2.1 Pin description of RS232 DB9
CD stands for Carrier Detect. Carrier Detect is used by modem to signal that it has a made a
connection with another modem, or has detected a carrier tone. The last remaining line is RI or
Ring Indicator. A modem toggles the state of this line when an incoming call rings your phone.
The Carrier Detect (CD) and the Ring Indicator (RI) lines are only available in connections to a
modem. Because most modems transmit status information to a PC when either a carrier signal
is detected (i.e. when a connection is made to another modem) or when the line is ringing, these
two lines are rarely used.
2.8.1 Baud vs. Bits per Second
The baud unit is named after Jean Maurice Emile Baudot, who was an officer in the French
Telegraph Service. He is credited with devising the first uniform-length 5-bit code for character
of the alphabet in the late 19th
century. What baud really refers to is modulation rate or the
number of times per second that a line changes state? This is not always the same as bits per
second (BPS). If you connect two serial devices together using direct cables then baud and BPS
are in fact the same.
[53]
If you connect two serial devices together using direct cables then baud and BPS are in fact the
same. Thus, if you are running at 19200 BPS, then the line is also changing states 19200 times
per second. But when considering modems, this isn‟t the case. Because modems transfer
signals over a telephone line, the baud rate is actually limited to a maximum of 2400 baud. This
is a physical restriction of the lines provided by the phone company. The increased data
throughput achieved with 9600 or higher baud modems is accomplished by using sophisticated
phase modulation and data compression technique.
2.8.2 Null Modem Cables and Null Modem Adapters
If you connect two DTE devices (or two DCE devices) using a straight RS232 cable, then the
transmit line on each device will be connected to the transmit line on the other device and the
receive lines will likewise be connected to each other. A null modem cable or null modem
adapter simply cross the receiver and transmit lines so that transmit on one end is connected to
receive on the other end and vice versa. In addition to transmit and receive, DTRs and
asynchronous communication, the two devices initially synchronize themselves to each other,
and then continually send characters to stay in sync. Even when data is not really being sent, a
constant flow of bits allows faster data transfer rates than asynchronous methods, because
additional bits to mark the beginning and end of each data byte are not required. The serial
ports on IBM style PCs are asynchronous devices and therefore only support asynchronous
serial communications. Asynchronous means “no synchronization”, and thus does not require
sending and receiving idle characters. However, the beginning and end of each byte of data
must be identified by start and stop bits. The start bit indicates when the data byte is about to
being and the stop bit signals when it ends. The requirement to send these additional to bits
causes asynchronous communication to be slightly slower than synchronous however it has the
advantage that the processor does not have to deal with the additional idle characters. An
asynchronous line that is idle is identified with a value of 1 (also called a mark state). By using
this value to indicate that no data is currently being sent, the devices are able to distinguish
between an idle state and a disconnected line. When a character is about to be transmitted, a
start bit is sent. A start bit has a value of 0 (also called a space state). Thus, when the line
switches from a value of 1 to a value of 0, the receiver is alerted that a data character is about to
be sent RS232 communication is asynchronous. That is a clock signal is not sent with the data.
Each word is synchronized using it‟s start bit, and an internal clock on each side, keeps tabs on
the timing.
[54]
Port addresses and IRQ‟s in the PC are as given below:
Name Addresses IRQ
COM1 3F8 4
COM2 2F8 3
COM3 3E8 4
COM4 2E8 3
Table 2.2 Port Addresses and IRQ’s in the PC
2.8.3 D 25 Pin Connector
Fig: 2.15 Pin Detail of D25 Pin Connector
Because the parallel port on a computer was mainly designed to connect printers with one-way
communication, a trick is used to achieve full two way data transfer between both sides. Five
error and status message inputs are redefined as data inputs. Instead of reading full bytes, the
communication software reads these five bits and combines multiple groups of data back to
bytes. The sender and receiver have to use the same protocol to convert bytes to groups of 5
bits and vice versa.
[55]
2.8.4 Interfacing of Microcontroller parallel port
Fig: 2.16 Circuit of D25 Pin Connection with Microcontroller
[56]
CHAPTER 3
CIRCUIT DESCRIPTION
3.1 Power Supply
Fig.3.1 Block Diagram of Power Supply
3.1.1 Description
The power supply circuit comprises of four basic parts:
(i) Transformer steps down the 220 V a/c. into 12 V a/c. The transformer work on the
principle of magnetic induction, where two coils: primary and secondary are wound around
an iron core. The two coils are physically insulated from each other in such a way that
passing an a/c. current through the primary coil creates a changing voltage in the primary
coil and a changing magnetic field in the core. This in turn induces a varying a/c. voltage in
the secondary coil.
(ii) Bridge Rectifier is used in most electronic power supplies is the single-phase bridge
rectifier with capacitor filtering, usually followed by a linear voltage regulator. A rectifier
circuit is necessary to convert a signal having zero average value into a non-zero average
value. A rectifier transforms alternating current into direct current by limiting or regulating
the direction of flow of current. The output resulting from a rectifier is a pulsating D.C.
voltage. This voltage is not appropriate for the components that are going to work through
it.
(iii) Filter Capacitor is used to smooth the ripple of the D.C. voltage. The filter capacitor of
1000 µF 25V is used to stores electrical charge. If it is large enough the capacitor will store
charge as the voltage rises and give up the charge as the voltage falls. This has the effect of
smoothing out the waveform and provides steadier voltage output. A filter capacitor is
connected at the rectifier output and the d.c voltage is obtained across the capacitor.
When this capacitor is used in this project, it should be twice the supply voltage. When the
filter is used, the RC charge time of the filter capacitor must be short and the RC discharge
time must be long to eliminate ripple action. In other words the capacitor must charge up
TRANSFORMER
SHUNT
CAPACITOR
BRIDGE
RECTIFIER
VOLTAGE
REGULATOR
[57]
fast, preferably with no discharge. When the rectifier output voltage is increasing, the
capacitor charges to the peak voltage Vm. Just past the positive peak, the rectifier output
voltage starts to fall but at this point the capacitor has +Vm voltage across it. Since the
source voltage becomes slightly less than Vm, the capacitor will try to send current back
through the diode of rectifier. This reverse biases the diode. The diode disconnects or
separates the source the source form load. The capacitor starts to discharge through load.
This prevents the load voltage from falling to zero. The capacitor continues to discharge
until source voltage becomes more than capacitor voltage. The diode again starts
conducting and the capacitor is again charged to peak value Vm.
When capacitor is charging the rectifier supplies the charging through capacitor branch as
well as load current, the capacitor sends currents through the load. The rate at which
capacitor discharge depends upon time constant RC. The longer the time constant, the
steadier is the output voltage. An increase in load current i.e. decrease in resistance makes
time constant of discharge path smaller. The ripple increase and d.c output voltage V dc
decreases. Maximum capacity cannot exceed a certain limit because the larger the
capacitance the greater is the current required to charge the capacitor.
(iv) Voltage Regulator regulates the supply if the supply if the line voltage increases or
decreases. The series 78xx regulators provide fixed regulated voltages from 5 to 24 volts.
An unregulated input voltage is applied at the IC Input pin i.e. pin 1 which is filtered by
capacitor. The out terminal of the IC i.e. pin 3 provides a regular output. The third terminal
is connected to ground. While the input voltage may vary over some permissible voltage
range, and the output voltage remains constant within specified voltage variation limit. The
78xx IC‟s are positive voltage regulators whereas 79xx IC‟s are negative voltage regulators.
These voltage regulators are integrated circuits designed as fixed voltage regulators for a
wide variety of applications.
These regulators employ current limiting, thermal shutdown and safe area compensation.
With adequate heat sinking they can deliver output currents in excess of 1 A. These
regulators have internal thermal overload protection. It uses output transistor safe area
compensation and the output voltage offered is in 2% and 4% tolerance.
[58]
3.1.2 Circuit Diagram
Fig.3.2 Power Supply Circuit
3.2 Interfacing of Microcontroller with ADC 0808
Fig.3.3 Steering Wheel Gripping Pressure Variability Detection
[59]
This system works on the technique that human body conducts current. Hence by using a
conducting wire on non conducting steering wheel of vehicle and by using an Analog to Digital
Convertor (ADC) and connected through a transistor which act as a switch and when the driver
hold the steering tightly more current flows through base of Transistor as parallel resistances
made by our fingers add up in parallel and as a result net resistance decreases and base current
increases. Hence this pressure variation is converted by ADC into some threshold and
whenever output is less than threshold it indicates Driver Drowsiness or Fatigue state.
3.2.1 Circuit Diagram
Fig.3.4 ADC Interfacing with Microcontroller
[60]
CHAPTER 4
MATLAB SOFTWARE BASICS
4.1 Software Description
For the Urban search and rescue robot different types of sensors can be used and accordingly
their interfacing has to be done using some software. One of sensor used is a Webcam.
Interfacing of which with the system requires coding either in MATLAB or C#. MATLAB is a
numerical computing environment and programming language. Also a reprogrammable
microcontroller is necessary. The criterion for choosing microcontroller was its easy
availability, cost and its memory type.
The microcontroller comes with different memory types, the first being UV erasable memory
type that has a quartz window and is exposed to UV to erase the memory. Microchip provides
this option for the PIC16 series and the UV erasable devices are identified by the model
number extension JW. These devices are produced in a ceramic dual in line package and are
identical to the OTP (one time programmable) version except for the packaging and cost. The
other option considered was the FLASH based memory type AT89C51 family, which is a new
series of devices that employ electronically erasable memory. These devices are available in
DIP or surface mount packages.
The FLASH devices are more convenient to reprogram than the windowed version as they
don‟t require exposure to UV light and hence the reprogramming time is much shorter. The
microcontroller AT89C52 chosen for the development of the system is much cheaper than the
windowed PIC16C73A-JW. It has 8K of program memory and has the capability to write to its
own memory.
As a webcam is used therefore it is interfaced using MATLAB. The videos and images
captured by the Webcam are stored and processed with the help of programming in MATLAB.
4.2 Introduction to MATLAB
MATLAB is a numerical computing environment and programming language maintained by
The Math Works. MATLAB allows easy matrix manipulation, plotting of functions and data,
[61]
implementation of algorithms, creation of user interfaces, and interfacing with programs in
other languages.
MATLAB stores images using Image Processing Toolbox. The Image Processing Toolbox
extends the basic capabilities of MATLAB by providing a number of specialized I/O, display,
and processing functions for images and image processing. It stores most images as two-
dimensional arrays (i.e., matrices), in which each element of the matrix corresponds to a single
pixel in the displayed image (Pixel is derived from picture element and usually denotes a single
dot on a computer display.) Some images, such as true color images, require a three-
dimensional array, where the first plane in the third dimension represents the red pixel
intensities, the second plane represents the green pixel intensities, and the third plane represents
the blue pixel intensities. This convention makes working with images in MATLAB similar to
working with any other type of matrix data, and makes the full power of MATLAB available
for image processing applications. An image is stored as a matrix using standard MATLAB
matrix conventions. There are five basic types of images supported by MATLAB:
1. Indexed images
2. Intensity images
3. Binary images
4. RGB images
5. 8-bit images
The Image Processing Toolbox provides functions imread and imwrite that will read and write
several standard image types. A Graphical User Interface GUI uses a combination of
technologies and devices to provide a platform the user can interact with, for the tasks of
gathering and producing information.
The GUI contains
 An axes
 A pop-up menu listing three data sets that correspond to MATLAB functions: peaks,
membrane, and sinc.
 A static text component to label the pop-up menu
 Push buttons, each of which provides a different kind of plot: surface, mesh, and
contour.
[62]
Fig: 4.1 A simple blank GUI
The figure 4.1 above shows how a blank GUI is formed. It can have push buttons, radio
buttons, scroll buttons, axis, toggle button, static text, list box, check box etc.
When you save a GUI, GUIDE creates two files, a FIG-file and an M-file. The FIG-file, with
extension .fig, is a binary file that contains a description of the layout. The M-file, with
extension .m, contains the code that controls the GUI.
The figure 4.2 shows the GUI developed for the project.
[63]
Fig 4.2: GUI developed for the project
4.3 Keil Software
Keil software is used for the software implementation of the developed system. µvision 2
integrated development environments is and IDE that encapsulates a project manager, make
facility, tool configuration, editor and a powerful debugger. µvision2 is used to write and
compile the programs using the tools. It can transfer the assembly language as well as C code
into the hex file. Keil software consists of a linker control file, Map file, Project Target, Source
file group, Toolset, Linker Control File.
4.3.1 Linker control File – It is a text file µvision passes to the linker when linking. The
control file includes all directives and names of object files and library files to include in the
output file.
4.3.2 Map File – the map file is a listing file generated by the linker.
Final thesis report on eye tracking based driver fatigue hardeep singh pec university of tech chandigarh india hardeepsingh.ec08@pec.edu.in
Final thesis report on eye tracking based driver fatigue hardeep singh pec university of tech chandigarh india hardeepsingh.ec08@pec.edu.in
Final thesis report on eye tracking based driver fatigue hardeep singh pec university of tech chandigarh india hardeepsingh.ec08@pec.edu.in
Final thesis report on eye tracking based driver fatigue hardeep singh pec university of tech chandigarh india hardeepsingh.ec08@pec.edu.in
Final thesis report on eye tracking based driver fatigue hardeep singh pec university of tech chandigarh india hardeepsingh.ec08@pec.edu.in
Final thesis report on eye tracking based driver fatigue hardeep singh pec university of tech chandigarh india hardeepsingh.ec08@pec.edu.in
Final thesis report on eye tracking based driver fatigue hardeep singh pec university of tech chandigarh india hardeepsingh.ec08@pec.edu.in
Final thesis report on eye tracking based driver fatigue hardeep singh pec university of tech chandigarh india hardeepsingh.ec08@pec.edu.in
Final thesis report on eye tracking based driver fatigue hardeep singh pec university of tech chandigarh india hardeepsingh.ec08@pec.edu.in
Final thesis report on eye tracking based driver fatigue hardeep singh pec university of tech chandigarh india hardeepsingh.ec08@pec.edu.in
Final thesis report on eye tracking based driver fatigue hardeep singh pec university of tech chandigarh india hardeepsingh.ec08@pec.edu.in
Final thesis report on eye tracking based driver fatigue hardeep singh pec university of tech chandigarh india hardeepsingh.ec08@pec.edu.in
Final thesis report on eye tracking based driver fatigue hardeep singh pec university of tech chandigarh india hardeepsingh.ec08@pec.edu.in
Final thesis report on eye tracking based driver fatigue hardeep singh pec university of tech chandigarh india hardeepsingh.ec08@pec.edu.in
Final thesis report on eye tracking based driver fatigue hardeep singh pec university of tech chandigarh india hardeepsingh.ec08@pec.edu.in
Final thesis report on eye tracking based driver fatigue hardeep singh pec university of tech chandigarh india hardeepsingh.ec08@pec.edu.in
Final thesis report on eye tracking based driver fatigue hardeep singh pec university of tech chandigarh india hardeepsingh.ec08@pec.edu.in
Final thesis report on eye tracking based driver fatigue hardeep singh pec university of tech chandigarh india hardeepsingh.ec08@pec.edu.in
Final thesis report on eye tracking based driver fatigue hardeep singh pec university of tech chandigarh india hardeepsingh.ec08@pec.edu.in
Final thesis report on eye tracking based driver fatigue hardeep singh pec university of tech chandigarh india hardeepsingh.ec08@pec.edu.in
Final thesis report on eye tracking based driver fatigue hardeep singh pec university of tech chandigarh india hardeepsingh.ec08@pec.edu.in
Final thesis report on eye tracking based driver fatigue hardeep singh pec university of tech chandigarh india hardeepsingh.ec08@pec.edu.in
Final thesis report on eye tracking based driver fatigue hardeep singh pec university of tech chandigarh india hardeepsingh.ec08@pec.edu.in
Final thesis report on eye tracking based driver fatigue hardeep singh pec university of tech chandigarh india hardeepsingh.ec08@pec.edu.in
Final thesis report on eye tracking based driver fatigue hardeep singh pec university of tech chandigarh india hardeepsingh.ec08@pec.edu.in
Final thesis report on eye tracking based driver fatigue hardeep singh pec university of tech chandigarh india hardeepsingh.ec08@pec.edu.in
Final thesis report on eye tracking based driver fatigue hardeep singh pec university of tech chandigarh india hardeepsingh.ec08@pec.edu.in
Final thesis report on eye tracking based driver fatigue hardeep singh pec university of tech chandigarh india hardeepsingh.ec08@pec.edu.in
Final thesis report on eye tracking based driver fatigue hardeep singh pec university of tech chandigarh india hardeepsingh.ec08@pec.edu.in
Final thesis report on eye tracking based driver fatigue hardeep singh pec university of tech chandigarh india hardeepsingh.ec08@pec.edu.in
Final thesis report on eye tracking based driver fatigue hardeep singh pec university of tech chandigarh india hardeepsingh.ec08@pec.edu.in
Final thesis report on eye tracking based driver fatigue hardeep singh pec university of tech chandigarh india hardeepsingh.ec08@pec.edu.in
Final thesis report on eye tracking based driver fatigue hardeep singh pec university of tech chandigarh india hardeepsingh.ec08@pec.edu.in
Final thesis report on eye tracking based driver fatigue hardeep singh pec university of tech chandigarh india hardeepsingh.ec08@pec.edu.in
Final thesis report on eye tracking based driver fatigue hardeep singh pec university of tech chandigarh india hardeepsingh.ec08@pec.edu.in
Final thesis report on eye tracking based driver fatigue hardeep singh pec university of tech chandigarh india hardeepsingh.ec08@pec.edu.in
Final thesis report on eye tracking based driver fatigue hardeep singh pec university of tech chandigarh india hardeepsingh.ec08@pec.edu.in
Final thesis report on eye tracking based driver fatigue hardeep singh pec university of tech chandigarh india hardeepsingh.ec08@pec.edu.in
Final thesis report on eye tracking based driver fatigue hardeep singh pec university of tech chandigarh india hardeepsingh.ec08@pec.edu.in
Final thesis report on eye tracking based driver fatigue hardeep singh pec university of tech chandigarh india hardeepsingh.ec08@pec.edu.in
Final thesis report on eye tracking based driver fatigue hardeep singh pec university of tech chandigarh india hardeepsingh.ec08@pec.edu.in
Final thesis report on eye tracking based driver fatigue hardeep singh pec university of tech chandigarh india hardeepsingh.ec08@pec.edu.in
Final thesis report on eye tracking based driver fatigue hardeep singh pec university of tech chandigarh india hardeepsingh.ec08@pec.edu.in
Final thesis report on eye tracking based driver fatigue hardeep singh pec university of tech chandigarh india hardeepsingh.ec08@pec.edu.in
Final thesis report on eye tracking based driver fatigue hardeep singh pec university of tech chandigarh india hardeepsingh.ec08@pec.edu.in
Final thesis report on eye tracking based driver fatigue hardeep singh pec university of tech chandigarh india hardeepsingh.ec08@pec.edu.in
Final thesis report on eye tracking based driver fatigue hardeep singh pec university of tech chandigarh india hardeepsingh.ec08@pec.edu.in
Final thesis report on eye tracking based driver fatigue hardeep singh pec university of tech chandigarh india hardeepsingh.ec08@pec.edu.in
Final thesis report on eye tracking based driver fatigue hardeep singh pec university of tech chandigarh india hardeepsingh.ec08@pec.edu.in
Final thesis report on eye tracking based driver fatigue hardeep singh pec university of tech chandigarh india hardeepsingh.ec08@pec.edu.in
Final thesis report on eye tracking based driver fatigue hardeep singh pec university of tech chandigarh india hardeepsingh.ec08@pec.edu.in
Final thesis report on eye tracking based driver fatigue hardeep singh pec university of tech chandigarh india hardeepsingh.ec08@pec.edu.in
Final thesis report on eye tracking based driver fatigue hardeep singh pec university of tech chandigarh india hardeepsingh.ec08@pec.edu.in
Final thesis report on eye tracking based driver fatigue hardeep singh pec university of tech chandigarh india hardeepsingh.ec08@pec.edu.in
Final thesis report on eye tracking based driver fatigue hardeep singh pec university of tech chandigarh india hardeepsingh.ec08@pec.edu.in

More Related Content

What's hot

95960910 atoll-getting-started-umts-310-en-v1
95960910 atoll-getting-started-umts-310-en-v195960910 atoll-getting-started-umts-310-en-v1
95960910 atoll-getting-started-umts-310-en-v1
Oshin Neeh
 
Project report on Eye tracking interpretation system
Project report on Eye tracking interpretation systemProject report on Eye tracking interpretation system
Project report on Eye tracking interpretation system
kurkute1994
 
Smart classethernet user_manual_en
Smart classethernet user_manual_enSmart classethernet user_manual_en
Smart classethernet user_manual_en
Juan Milton Garduno Rubio
 
Smart classethernet user_manual_en
Smart classethernet user_manual_enSmart classethernet user_manual_en
Smart classethernet user_manual_en
Ikundu Gatambia
 
Owandy i-max-touch-2 d-pan-ceph-user-manual-rev1
Owandy i-max-touch-2 d-pan-ceph-user-manual-rev1Owandy i-max-touch-2 d-pan-ceph-user-manual-rev1
Owandy i-max-touch-2 d-pan-ceph-user-manual-rev1
superottos
 
Cube_Quest_Final_Report
Cube_Quest_Final_ReportCube_Quest_Final_Report
Cube_Quest_Final_Report
Mitchell Borchers
 
Honeywell udc 2500
Honeywell udc 2500Honeywell udc 2500
Honeywell udc 2500
Ashok Kumar Barla
 
PowerVR performance recommendations
PowerVR performance recommendationsPowerVR performance recommendations
PowerVR performance recommendations
Pedram Mazloom
 
Atv212 programming manual
Atv212 programming manualAtv212 programming manual
ESTACION DE TRABAJO ALLEN-BRADLEY
ESTACION DE TRABAJO ALLEN-BRADLEYESTACION DE TRABAJO ALLEN-BRADLEY
ESTACION DE TRABAJO ALLEN-BRADLEY
Hard Rock Cafe
 
Bn59 01127 a-08eng
Bn59 01127 a-08engBn59 01127 a-08eng
Bn59 01127 a-08eng
Hamba Tuhan
 
Uni v e r si t ei t
Uni v e r si t ei tUni v e r si t ei t
Uni v e r si t ei t
Anandhu Sp
 
Load runner controller
Load runner controllerLoad runner controller
Load runner controller
Ashwin Mane
 
NetSim Experiment Manual v11 Latest Release
NetSim Experiment Manual v11 Latest ReleaseNetSim Experiment Manual v11 Latest Release
NetSim Experiment Manual v11 Latest Release
NetSim
 
NetSim User Manual
NetSim User ManualNetSim User Manual
NetSim User Manual
Dr Praveen Jain
 
Instruction Guide _ DeviceNet and RSNetWorx Configuration and Troubleshooting...
Instruction Guide _ DeviceNet and RSNetWorx Configuration and Troubleshooting...Instruction Guide _ DeviceNet and RSNetWorx Configuration and Troubleshooting...
Instruction Guide _ DeviceNet and RSNetWorx Configuration and Troubleshooting...
Marco Enrique Ramos Castillo
 
Optimization guidelines accessibility-ericsson-rev01
Optimization guidelines accessibility-ericsson-rev01Optimization guidelines accessibility-ericsson-rev01
Optimization guidelines accessibility-ericsson-rev01
ZIZI Yahia
 
Service manual-acer-travel mate-5730-extensa-5630-series
Service manual-acer-travel mate-5730-extensa-5630-seriesService manual-acer-travel mate-5730-extensa-5630-series
Service manual-acer-travel mate-5730-extensa-5630-series
Daniel Blanco
 
VHDL book
VHDL bookVHDL book
gemes_daniel_thesis
gemes_daniel_thesisgemes_daniel_thesis
gemes_daniel_thesis
Daniel Gemes
 

What's hot (20)

95960910 atoll-getting-started-umts-310-en-v1
95960910 atoll-getting-started-umts-310-en-v195960910 atoll-getting-started-umts-310-en-v1
95960910 atoll-getting-started-umts-310-en-v1
 
Project report on Eye tracking interpretation system
Project report on Eye tracking interpretation systemProject report on Eye tracking interpretation system
Project report on Eye tracking interpretation system
 
Smart classethernet user_manual_en
Smart classethernet user_manual_enSmart classethernet user_manual_en
Smart classethernet user_manual_en
 
Smart classethernet user_manual_en
Smart classethernet user_manual_enSmart classethernet user_manual_en
Smart classethernet user_manual_en
 
Owandy i-max-touch-2 d-pan-ceph-user-manual-rev1
Owandy i-max-touch-2 d-pan-ceph-user-manual-rev1Owandy i-max-touch-2 d-pan-ceph-user-manual-rev1
Owandy i-max-touch-2 d-pan-ceph-user-manual-rev1
 
Cube_Quest_Final_Report
Cube_Quest_Final_ReportCube_Quest_Final_Report
Cube_Quest_Final_Report
 
Honeywell udc 2500
Honeywell udc 2500Honeywell udc 2500
Honeywell udc 2500
 
PowerVR performance recommendations
PowerVR performance recommendationsPowerVR performance recommendations
PowerVR performance recommendations
 
Atv212 programming manual
Atv212 programming manualAtv212 programming manual
Atv212 programming manual
 
ESTACION DE TRABAJO ALLEN-BRADLEY
ESTACION DE TRABAJO ALLEN-BRADLEYESTACION DE TRABAJO ALLEN-BRADLEY
ESTACION DE TRABAJO ALLEN-BRADLEY
 
Bn59 01127 a-08eng
Bn59 01127 a-08engBn59 01127 a-08eng
Bn59 01127 a-08eng
 
Uni v e r si t ei t
Uni v e r si t ei tUni v e r si t ei t
Uni v e r si t ei t
 
Load runner controller
Load runner controllerLoad runner controller
Load runner controller
 
NetSim Experiment Manual v11 Latest Release
NetSim Experiment Manual v11 Latest ReleaseNetSim Experiment Manual v11 Latest Release
NetSim Experiment Manual v11 Latest Release
 
NetSim User Manual
NetSim User ManualNetSim User Manual
NetSim User Manual
 
Instruction Guide _ DeviceNet and RSNetWorx Configuration and Troubleshooting...
Instruction Guide _ DeviceNet and RSNetWorx Configuration and Troubleshooting...Instruction Guide _ DeviceNet and RSNetWorx Configuration and Troubleshooting...
Instruction Guide _ DeviceNet and RSNetWorx Configuration and Troubleshooting...
 
Optimization guidelines accessibility-ericsson-rev01
Optimization guidelines accessibility-ericsson-rev01Optimization guidelines accessibility-ericsson-rev01
Optimization guidelines accessibility-ericsson-rev01
 
Service manual-acer-travel mate-5730-extensa-5630-series
Service manual-acer-travel mate-5730-extensa-5630-seriesService manual-acer-travel mate-5730-extensa-5630-series
Service manual-acer-travel mate-5730-extensa-5630-series
 
VHDL book
VHDL bookVHDL book
VHDL book
 
gemes_daniel_thesis
gemes_daniel_thesisgemes_daniel_thesis
gemes_daniel_thesis
 

Similar to Final thesis report on eye tracking based driver fatigue hardeep singh pec university of tech chandigarh india hardeepsingh.ec08@pec.edu.in

Project Report Distance measurement system
Project Report Distance measurement systemProject Report Distance measurement system
Project Report Distance measurement system
kurkute1994
 
VENDING_MACHINE_2023-2024
VENDING_MACHINE_2023-2024VENDING_MACHINE_2023-2024
VENDING_MACHINE_2023-2024
College of engineering roorkee
 
final report (parking project).pdf
final report (parking project).pdffinal report (parking project).pdf
final report (parking project).pdf
gamefacegamer
 
Final Report
Final ReportFinal Report
Final Report
Susmit Sircar
 
Smart Street System
Smart Street SystemSmart Street System
Smart Street System
Libin Thomas
 
Bidirectional Visitor Counter for efficient electricity usage.
Bidirectional Visitor Counter for efficient electricity usage.Bidirectional Visitor Counter for efficient electricity usage.
Bidirectional Visitor Counter for efficient electricity usage.
NandaVardhanThupalli
 
Vehicle to Vehicle Communication using Bluetooth and GPS.
Vehicle to Vehicle Communication using Bluetooth and GPS.Vehicle to Vehicle Communication using Bluetooth and GPS.
Vehicle to Vehicle Communication using Bluetooth and GPS.
Mayur Wadekar
 
Smart Traffic Management System using Internet of Things (IoT)-btech-cse-04-0...
Smart Traffic Management System using Internet of Things (IoT)-btech-cse-04-0...Smart Traffic Management System using Internet of Things (IoT)-btech-cse-04-0...
Smart Traffic Management System using Internet of Things (IoT)-btech-cse-04-0...
TanuAgrawal27
 
Plc report
Plc report Plc report
Plc report
Priya Hada
 
Aviation Control Unit
Aviation Control UnitAviation Control Unit
Aviation Control Unit
Samarth Annappa Swamy
 
Team Omni L2 Requirements Revised
Team Omni L2 Requirements RevisedTeam Omni L2 Requirements Revised
Team Omni L2 Requirements Revised
Andrew Daws
 
2D ROBOTIC PLOTTER
2D ROBOTIC PLOTTER2D ROBOTIC PLOTTER
2D ROBOTIC PLOTTER
ANANDKRISHNANVSSS
 
AAPM-2005-TG18.pdf
AAPM-2005-TG18.pdfAAPM-2005-TG18.pdf
AAPM-2005-TG18.pdf
EmadaddiAlazzani
 
Simocode dp = manual de parametrização e operação
Simocode dp = manual de parametrização e operaçãoSimocode dp = manual de parametrização e operação
Simocode dp = manual de parametrização e operação
confidencial
 
Accident reporting system using mems
Accident reporting system using memsAccident reporting system using mems
Accident reporting system using mems
Rohit Sinha
 
Ecas bus
Ecas busEcas bus
Ecas bus
florinescu61
 
LPG Booking System [ bookmylpg.com ] Report
LPG Booking System [ bookmylpg.com ] ReportLPG Booking System [ bookmylpg.com ] Report
LPG Booking System [ bookmylpg.com ] Report
Nandu B Rajan
 
KHAN_FAHAD_FL14
KHAN_FAHAD_FL14KHAN_FAHAD_FL14
KHAN_FAHAD_FL14
Fahad Naeem
 
Thesis report 16 bit RISC processor
Thesis report 16 bit RISC processorThesis report 16 bit RISC processor
Thesis report 16 bit RISC processor
anuruddhsharma1
 
TFG_Cristobal_Cuevas_Garcia_2018.pdf
TFG_Cristobal_Cuevas_Garcia_2018.pdfTFG_Cristobal_Cuevas_Garcia_2018.pdf
TFG_Cristobal_Cuevas_Garcia_2018.pdf
Gerard Labernia
 

Similar to Final thesis report on eye tracking based driver fatigue hardeep singh pec university of tech chandigarh india hardeepsingh.ec08@pec.edu.in (20)

Project Report Distance measurement system
Project Report Distance measurement systemProject Report Distance measurement system
Project Report Distance measurement system
 
VENDING_MACHINE_2023-2024
VENDING_MACHINE_2023-2024VENDING_MACHINE_2023-2024
VENDING_MACHINE_2023-2024
 
final report (parking project).pdf
final report (parking project).pdffinal report (parking project).pdf
final report (parking project).pdf
 
Final Report
Final ReportFinal Report
Final Report
 
Smart Street System
Smart Street SystemSmart Street System
Smart Street System
 
Bidirectional Visitor Counter for efficient electricity usage.
Bidirectional Visitor Counter for efficient electricity usage.Bidirectional Visitor Counter for efficient electricity usage.
Bidirectional Visitor Counter for efficient electricity usage.
 
Vehicle to Vehicle Communication using Bluetooth and GPS.
Vehicle to Vehicle Communication using Bluetooth and GPS.Vehicle to Vehicle Communication using Bluetooth and GPS.
Vehicle to Vehicle Communication using Bluetooth and GPS.
 
Smart Traffic Management System using Internet of Things (IoT)-btech-cse-04-0...
Smart Traffic Management System using Internet of Things (IoT)-btech-cse-04-0...Smart Traffic Management System using Internet of Things (IoT)-btech-cse-04-0...
Smart Traffic Management System using Internet of Things (IoT)-btech-cse-04-0...
 
Plc report
Plc report Plc report
Plc report
 
Aviation Control Unit
Aviation Control UnitAviation Control Unit
Aviation Control Unit
 
Team Omni L2 Requirements Revised
Team Omni L2 Requirements RevisedTeam Omni L2 Requirements Revised
Team Omni L2 Requirements Revised
 
2D ROBOTIC PLOTTER
2D ROBOTIC PLOTTER2D ROBOTIC PLOTTER
2D ROBOTIC PLOTTER
 
AAPM-2005-TG18.pdf
AAPM-2005-TG18.pdfAAPM-2005-TG18.pdf
AAPM-2005-TG18.pdf
 
Simocode dp = manual de parametrização e operação
Simocode dp = manual de parametrização e operaçãoSimocode dp = manual de parametrização e operação
Simocode dp = manual de parametrização e operação
 
Accident reporting system using mems
Accident reporting system using memsAccident reporting system using mems
Accident reporting system using mems
 
Ecas bus
Ecas busEcas bus
Ecas bus
 
LPG Booking System [ bookmylpg.com ] Report
LPG Booking System [ bookmylpg.com ] ReportLPG Booking System [ bookmylpg.com ] Report
LPG Booking System [ bookmylpg.com ] Report
 
KHAN_FAHAD_FL14
KHAN_FAHAD_FL14KHAN_FAHAD_FL14
KHAN_FAHAD_FL14
 
Thesis report 16 bit RISC processor
Thesis report 16 bit RISC processorThesis report 16 bit RISC processor
Thesis report 16 bit RISC processor
 
TFG_Cristobal_Cuevas_Garcia_2018.pdf
TFG_Cristobal_Cuevas_Garcia_2018.pdfTFG_Cristobal_Cuevas_Garcia_2018.pdf
TFG_Cristobal_Cuevas_Garcia_2018.pdf
 

Recently uploaded

Beckhoff Programmable Logic Control Overview Presentation
Beckhoff Programmable Logic Control Overview PresentationBeckhoff Programmable Logic Control Overview Presentation
Beckhoff Programmable Logic Control Overview Presentation
VanTuDuong1
 
Call Girls Chennai +91-8824825030 Vip Call Girls Chennai
Call Girls Chennai +91-8824825030 Vip Call Girls ChennaiCall Girls Chennai +91-8824825030 Vip Call Girls Chennai
Call Girls Chennai +91-8824825030 Vip Call Girls Chennai
paraasingh12 #V08
 
EV BMS WITH CHARGE MONITOR AND FIRE DETECTION.pptx
EV BMS WITH CHARGE MONITOR AND FIRE DETECTION.pptxEV BMS WITH CHARGE MONITOR AND FIRE DETECTION.pptx
EV BMS WITH CHARGE MONITOR AND FIRE DETECTION.pptx
nikshimanasa
 
Blood finder application project report (1).pdf
Blood finder application project report (1).pdfBlood finder application project report (1).pdf
Blood finder application project report (1).pdf
Kamal Acharya
 
SENTIMENT ANALYSIS ON PPT AND Project template_.pptx
SENTIMENT ANALYSIS ON PPT AND Project template_.pptxSENTIMENT ANALYSIS ON PPT AND Project template_.pptx
SENTIMENT ANALYSIS ON PPT AND Project template_.pptx
b0754201
 
一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理
一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理
一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理
sydezfe
 
Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...
Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...
Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...
PriyankaKilaniya
 
AI in customer support Use cases solutions development and implementation.pdf
AI in customer support Use cases solutions development and implementation.pdfAI in customer support Use cases solutions development and implementation.pdf
AI in customer support Use cases solutions development and implementation.pdf
mahaffeycheryld
 
An Introduction to the Compiler Designss
An Introduction to the Compiler DesignssAn Introduction to the Compiler Designss
An Introduction to the Compiler Designss
ElakkiaU
 
Open Channel Flow: fluid flow with a free surface
Open Channel Flow: fluid flow with a free surfaceOpen Channel Flow: fluid flow with a free surface
Open Channel Flow: fluid flow with a free surface
Indrajeet sahu
 
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICSUNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
vmspraneeth
 
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
upoux
 
Call For Paper -3rd International Conference on Artificial Intelligence Advan...
Call For Paper -3rd International Conference on Artificial Intelligence Advan...Call For Paper -3rd International Conference on Artificial Intelligence Advan...
Call For Paper -3rd International Conference on Artificial Intelligence Advan...
ijseajournal
 
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
Paris Salesforce Developer Group
 
Applications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdfApplications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdf
Atif Razi
 
一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理
uqyfuc
 
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
upoux
 
Accident detection system project report.pdf
Accident detection system project report.pdfAccident detection system project report.pdf
Accident detection system project report.pdf
Kamal Acharya
 
Determination of Equivalent Circuit parameters and performance characteristic...
Determination of Equivalent Circuit parameters and performance characteristic...Determination of Equivalent Circuit parameters and performance characteristic...
Determination of Equivalent Circuit parameters and performance characteristic...
pvpriya2
 
Introduction to Computer Networks & OSI MODEL.ppt
Introduction to Computer Networks & OSI MODEL.pptIntroduction to Computer Networks & OSI MODEL.ppt
Introduction to Computer Networks & OSI MODEL.ppt
Dwarkadas J Sanghvi College of Engineering
 

Recently uploaded (20)

Beckhoff Programmable Logic Control Overview Presentation
Beckhoff Programmable Logic Control Overview PresentationBeckhoff Programmable Logic Control Overview Presentation
Beckhoff Programmable Logic Control Overview Presentation
 
Call Girls Chennai +91-8824825030 Vip Call Girls Chennai
Call Girls Chennai +91-8824825030 Vip Call Girls ChennaiCall Girls Chennai +91-8824825030 Vip Call Girls Chennai
Call Girls Chennai +91-8824825030 Vip Call Girls Chennai
 
EV BMS WITH CHARGE MONITOR AND FIRE DETECTION.pptx
EV BMS WITH CHARGE MONITOR AND FIRE DETECTION.pptxEV BMS WITH CHARGE MONITOR AND FIRE DETECTION.pptx
EV BMS WITH CHARGE MONITOR AND FIRE DETECTION.pptx
 
Blood finder application project report (1).pdf
Blood finder application project report (1).pdfBlood finder application project report (1).pdf
Blood finder application project report (1).pdf
 
SENTIMENT ANALYSIS ON PPT AND Project template_.pptx
SENTIMENT ANALYSIS ON PPT AND Project template_.pptxSENTIMENT ANALYSIS ON PPT AND Project template_.pptx
SENTIMENT ANALYSIS ON PPT AND Project template_.pptx
 
一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理
一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理
一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理
 
Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...
Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...
Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...
 
AI in customer support Use cases solutions development and implementation.pdf
AI in customer support Use cases solutions development and implementation.pdfAI in customer support Use cases solutions development and implementation.pdf
AI in customer support Use cases solutions development and implementation.pdf
 
An Introduction to the Compiler Designss
An Introduction to the Compiler DesignssAn Introduction to the Compiler Designss
An Introduction to the Compiler Designss
 
Open Channel Flow: fluid flow with a free surface
Open Channel Flow: fluid flow with a free surfaceOpen Channel Flow: fluid flow with a free surface
Open Channel Flow: fluid flow with a free surface
 
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICSUNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
 
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
 
Call For Paper -3rd International Conference on Artificial Intelligence Advan...
Call For Paper -3rd International Conference on Artificial Intelligence Advan...Call For Paper -3rd International Conference on Artificial Intelligence Advan...
Call For Paper -3rd International Conference on Artificial Intelligence Advan...
 
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
 
Applications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdfApplications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdf
 
一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理
 
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
 
Accident detection system project report.pdf
Accident detection system project report.pdfAccident detection system project report.pdf
Accident detection system project report.pdf
 
Determination of Equivalent Circuit parameters and performance characteristic...
Determination of Equivalent Circuit parameters and performance characteristic...Determination of Equivalent Circuit parameters and performance characteristic...
Determination of Equivalent Circuit parameters and performance characteristic...
 
Introduction to Computer Networks & OSI MODEL.ppt
Introduction to Computer Networks & OSI MODEL.pptIntroduction to Computer Networks & OSI MODEL.ppt
Introduction to Computer Networks & OSI MODEL.ppt
 

Final thesis report on eye tracking based driver fatigue hardeep singh pec university of tech chandigarh india hardeepsingh.ec08@pec.edu.in

  • 1. [1] Eye Tracking based Driver Fatigue Monitoring and Warning System” A DISSERTATION SUBMITTED TO PUNJAB ENGINNERING COLLEGE UNIVERSITY OF TECHNOLOGY CHANDIGARH & CDAC MOHALI IN PARTIAL FULFILLMENT OF THE REQUIREMENT FOR THE AWARD OF THE MASTER DEGREE MASTER OF ENGINEERING (Electronic Product Design &Technology) SUBMITTED BY HARDEEP SINGH (Roll No. 0820808) hardeepsingh.ec08@pec.edu.in DEPARTMENT OF ELECTRONICS & ELECTRICAL COMMUNICATION PUNJAB ENGINNERING COLLEGE UNIVERSITY OF TECHNOLOGY CHANDIGARH-160012 INDIA 2010
  • 2. [2] CERTIFICATE This is to certify that the dissertation entitled “EYE TRACKING BASED DRIVER FATIGUE MONITORING AND WARNING SYSTEM” submitted by Hardeep Singh (Student ID-0820808) in partial fulfilment of the requirement for the award of the Degree of Masters of Engineering in Electronics Product Design & Technology, P.E.C University of Technology, Chandigarh is a record of Student‟s own work carried out by him under my supervision and guidance. Co-guide Guide (Mrs. Jasbir Kaur) (Mr. J.S Bhatia) Assistant Professor Director Dept. of E&EC C-DAC, Mohali P.E.C University of Tech, Chd Punjab DECLARATION I hereby declare that the work carried out in this dissertation is my original work and has not been submitted for the award of any other degree course. Date: (Hardeep Singh) Place: Student ID-0820808 Department of E&EC P.E.C University of Tech Chandigarh-160012 Mobile : 9878832094
  • 3. [3] ACKNOWLEDGEMENT The creation of this Thesis requires the combined sincere efforts, hard work talent and blessings of many near and dear, who directly or indirectly helped me in completing my research work. I sincerely express my deep gratitude to Mr. J.S Bhatia (Director, CDAC Mohali) and Mrs Jasbir Kaur (Asst. Professor, P.E.C University of Tech Chandigarh) for their value able guidance, constructive suggestions, constant encouragement, motivation and supervision throughout my thesis work. Their endless support helped me in channelling my efforts and ideas in proper direction. I wish to express my special thanks to Er. Dilip Kumar (Sr. Design Engineer, CDAC Mohali) for his constructive criticism and constant encouragement and allowing me to use the lab facilities for carrying out thesis work. I wish to express my sincere thanks to the whole teaching and non teaching faculty of CDAC Mohali and P.E.C University of Technology, Chandigarh for their constant encouragement and sincere suggestions. In last but not least I offer heartiest appreciation to all my friends for ever willing cooperation, moral support and best wishes for successfully taking this study. (HARDEEP SINGH) ID- 0820808 M.E (E.P.D.T)
  • 4. [4] ABSTRACT The Project entitled “Eye Tracking based Driver Fatigue Monitoring and Warning System” consists of the hardware and the software modules. The main idea behind this project is to develope a non-intrusive system which can detect fatigue of driver and issue a timely warning. Since large number of road accidents are caused by driver drowsiness. Hence this system will be helpful in preventing many accidents, and consequently save money and reduce personal suffering. This system will detect eye movement to detect the fatigue state of driver. By monitoring the eyes using camera and developing an algorithm we can detect symptoms of driver fatigue early enough to avoid an accident. So this project will be helpful in detecting driver fatigue in advance and will gave a warning output in form of sound and vibration. For indication of warning we will use two approaches i.e one by blowing alarm and second by seat belt vibration whose frequency will vary between 100 to 300 Hzs. Moreover the warning will be deactivated manually rather than automatically. So for this purpose a deactivation switch will be used to deactivate warning. Moreover if driver felt drowsy there is possibility of sudden acceleration or de-acceleration hence we can judge this by plotting a graph in time domain and when all three input variables shows a possibility of fatigue at one moment then a warning signal is shown in form of text or red colour circle. This will directly give an indication of drowsiness/fatigue which can be further used as record of driver performance or can be used by traffic police which can take further action accordingly.
  • 5. [5] LIST OF FIGURES Figure Description Page No. Fig-1.1 Progression of drowsiness and concordance of predicted- 6 and observed PERCLOS Values. Fig-1.2 Drowsiness judgment example - 8 Fig-1.3 Block Diagram of Eye tracking based Driver Fatigue - 9 Monitoring and Warning system. Fig-1.4 Flow chart of Eye Tracking System - 10 Fig-1.5 Steering wheel gripping pressure Variability Detection - 11 Fig-1.6 Relay Circuit Diagram - 13 Fig-2.1 Pin Diagram of 89C52 - 15 Fig-2.2 Diagram for oscillator connections - 18 Fig-2.3 Oscillator connections - 19 Fig-2.4 USB Camera - 21 Fig-2.5 Pin diagram of ADC 0808 - 23 Fig-2.6 Resistor Ladder and switch tree - 25 Fig-2.7 3 Bit A/D Transfer Curve - 26 Fig-2.8 Opto coupler - 27 Fig-2.9 Relay Contact Sets - 29 Fig-2.10 Electromagnetic relay - 29 Fig-2.11 Opto coupler relay connections - 30 Fig-2.12 Asynchronous data format - 32 Fig-2.13 25 pin connector on a DTE device - 34 Fig-2.14 9 pin connector on a DTE device, RS 232 DB9 - 35
  • 6. [6] Fig-2.15 Pin Detail of D25 Pin Connector - 38 Fig-2.16 D25 Pin Connection with Microcontroller - 39 Fig-3.1 Block Diagram of Power Supply - 40 Fig-3.2 Power Supply Circuit - 42 Fig-3.3 Steering wheel gripping pressure Variability Detection - 42 Fig-3.4 ADC Interfacing with Microcontroller - 43 Fig-4.1 A simple blank GUI - 46 Fig-4.2 GUI developed for the project - 47 Fig. 5.1 Data Acquisition System - 50 Fig-5.2 1 Hz sine wave quantized by a 3 bit A/D converter - 55 Fig-5.3 Quantization Error - 55 Fig-5.4 Signal Polarity - 56 Fig-6.1 Design Space of Product - 59 Fig-6.2 Levels of creativity - 64 Fig-6.3 Complete Circuit Diagram - 69 Fig-6.4 PCB Layout - 70 Fig-6.5 Complete Hardware of System - 71 Fig-7.1 Driver Original Image - 72 Fig-7.2 Driver Eyes open - 73 Fig-7.3 Driver Eyes closed - 73 Fig-7.4 Steering Wheel Gripping pressure - 73 Fig-7.5 Vehicle Speed variation - 74 Fig-7.6 Sample Result of working system - 74
  • 7. [7] LIST OF TABLES Figure Description Page No. Table 2.1 Pin description of RS232 DB9 - 36 Table 2.2 Port Addresses and IRQ’s in the PC - 38 Table 5.1 Components of Data Acquisition System - 49 Table 5.2 Types of Sensors - 52
  • 8. [8] LIST OF ABBREVIATIONS 1) AC Alternating Circuit 2) ASIC Application Specific Integrated Circuits 3) BER Bit-Error Rate 4) BPS Bits per second 5) CCD Charge coupled device 6) CIL Common Intermediate Language 7) CPU Central processing unit 8) CLI Common Language Infrastructure 9) CLR Common Language Runtime 10) CLS Common Language Specification 11) CS Chip Select 12) C# C Sharp 13) DC Direct Circuit 14) DCE Data Communications Equipment 15) DIN Data In 16) DIP Dual inline package 17) DRC Design Rule Check 18) DTE Data Terminal Equipment 19) EA Enable 20) EMI Electromagnetic Interference 21) EPC Electronic Product Code 22) Ft Feet 23) FM Frequency Modulation
  • 9. [9] 24) FLIR Face lift Image replacement 25) Fps Frames per second 26) GND Ground 27) GHz Giga hertz 28) GUI Graphical User Interface 29) ID Identification 30) IDE Integrated Development Environment 31) INTR Interrupt 32) IC Integrated Circuit 33) I/O Input/Output 34) Kb Kilo Byte 35) KΏ Kilo ohm 36) KN Kilo Newton 37) LCD Liquid Crystal Display 38) LED Light Emitting Diode 39) MCU Micro control Unit 40) MHz Mega hertz 41) MOS Metal Oxide Semi Conductor 42) MM Mili Meters 43) OS Operating System 44) OSC Oscillator 45) PC Personal Computer 46) PCB Printed Circuit Board 47) PERCLOS Percent Eye Closure 48) PTH Plated Through Hole 49) PROM Programmable Read Only Memory
  • 10. [10] 50) RAM Random Access Memory 51) RAD Rapid Application Development 52) RD Read 53) ROM Read Only Memory 54) RST Reset 55) SQL Structured Query Language 56) SFR Special Function Register 57) TE Transmit Enable 58) TTL Transistor-Transistor Logic 59) TV Television 60) USB Universal serial bus 61) VLSI Very Large Scale Integration 62) W Watt 63) WR Write 64) XTAL Crystal 65) 3D Three Dimensional 66) µF Micro farad 67) pF Pico farad
  • 11. [11] CONTENTS Certificate i Acknowledgement ii Abstract iii List of Figures iv List of Tables vi List of Abbreviations vii CHAPTER 1: INTRODUCTION 1-13 1.1 Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.2 Definitions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.2.1 Sleepiness and Drowsiness. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.2.2 Distraction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.2.3 Inattention. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.3 Inattentive Driving . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.3.1 Drowsy Driving. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.3.2 Distracted Driving. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 1.4 Literature Survey. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 1.4.1 Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 1.4.2 PERCLOS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 1.4.3 Steering Wheel Variability Detection. . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 1.5 Objective of the work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 1.6 System Theory and Detail. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 1.6.1 Input Units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 (i) Eye Tracking Unit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 (ii) Steering Wheel gripping pressure Variability Detection Unit . . . . . . . . . . . 11 (iii)Speed Variation Detection Unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 1.6.2 Image Processing Unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 1.6.3 Output and Warning Unit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 CHAPTER 2: HARDWARE DESCRIPTION 14-39 2.1. Microcontroller. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
  • 12. [12] 2.1.1 Features. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 2.1.2 Pin Configuration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 2.1.3 I/O Port pins and their functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 (i) Port 0. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 (ii) Port 1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 (iii) Port 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 (iv) Port 3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 (v) RST. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 (vi) ALE/PROG. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 (vii) PSEN. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 (viii) EA/VPP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 2.1.4 Oscillators and clock circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 2.2 Programming the microcontroller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 2.2.1 Steps involved in writing a program. . . . . . . . . . . . . . . . . . . . . . . . . . 20 (i) UNIPROG. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 (ii) ASEM 51. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 2.2.2 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 2.3 USB Camera. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 2.3.1 Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 2.3.2 How it works. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 2.3.3 Outside Factors. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 2.3.4 Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 2.4 ADC(Analog to Digital Convertor-ADC0808). . . . . . . . . . . . . . . . . . . . . . . . 23 2.4.1 General Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 2.4.2 Pin Diagram. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 2.4.3 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 2.4.4 Key Specifications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 2.4.5 Functional Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 (i) Multiplexer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 (ii) The Converter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 2.5 Opto coupler 4N35. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 2.5.1 General Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 2.5.2 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 2.6 Relay. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 2.6.1 Opto coupler Relay Connection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 2.7 Serial Port Communication. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 2.7.1 Serial Interface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
  • 13. [13] (i) Interfacing Requirements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 (ii) Transmission Format. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 a) Synchronous. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .31 b) Asynchronous. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 (iii)Error Check in Data Communication . . . . . . . . . . . . . . . . . . . . . . 33 (iv)Standard in Serial I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 2.7.2 Communicating by bits. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 2.7.3 The Parity bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 2.8 DCE DTE Devices. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 2.8.1 Baud vs Bit per Second. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 2.8.2 Null Modem Cables and Null Modem Adapters. . . . . . . . . . . . . . . . . 37 2.8.3 D pin Connector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 2.8.4 Interfacing of Microcontroller parallel port. . . . . . . . . . . . . . . . . . . . 39 CHAPTER 3: CIRCUIT DESCRIPTION 40-43 3.1 Power Supply.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 3.1.1 Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 (i) Transformer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 (ii) Bridge Rectifier . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 (iii)Filter Capacitor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 (iv)Voltage Regulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 3.1.2 Circuit Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 3.2 Interfacing of Microcontroller with ADC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 3.2.1 Circuit Diagram.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 CHAPTER 4: MATLAB SOFTWARE BASICS 44-48 4.1 Software Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 4.2 Introduction to MATLAB. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 4.3 Keil Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 4.3.1 Linker control file. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 4.3.2 Map file. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 4.3.3 Project Target. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 4.3.4 Source file group. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 4.3.5 Toolset. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 CHAPTER 5: DATA ACQUISITION 49-59
  • 14. [14] 5.1. Data Acquisition System. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 5.1.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 5.1.2 Data Acquisition Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 (i) Analog input subsystem. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 (ii) Analog output subsystem. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 (iii) Digital input output subsystem. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 (iv) Counter timer subsystem. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 5.1.3 Sensors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 5.1.4 Signal Conditioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 (i) Amplification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 (ii) Filtering. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 (iii)Electric Isolation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 (iv)Multiplexing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 (v) Excitation Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 5.2 Analog Input Systems. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 5.2.1 Sampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 5.2.2 Quantization. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 (i) Quantisation error. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 5.2.3 Input Range and Polarity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 5.2.4 How Are Acquired Samples Clocked?. . . . . . . . . . . . . . . . . . . . . . . . . 57 (i) Onboard Clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 (ii) Computer Clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 (iii)External Clock. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 5.2.5 Channel Configuration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 5.2.6 Transferring Data from Hardware to System Memory. . . . . . . . . . . . . . 58 (i) FIFO Buffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 (ii) Interrupts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 (iii)DMA. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 CHAPTER 6: DESIGN PHASES OF ELECTRONIC PRODUCT 60-70 6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 6.1.1 Product . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 6.1.2 Product Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 6.1.3 Design Space of Product. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 (i) Product Physiognomy. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 (ii) Product Physiography. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 (iii) Product Anatomy. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 6.2 Design phase of Electronic Product. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 6.2.1 Aesthetic Design Phase. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
  • 15. [15] 6.2.2 Engineering Design Phase. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 6.2.3 Ergonomic Design Phase. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 6.3 Creativity in Design. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 6.3.1 Creativity in Product Design. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 (i) Conceptual. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 (ii) Physical . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 6.3.2 Creativity Techniques. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 (i) Analytic . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 (ii) Non Analytic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 6.4 General Rules for PCB Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .65 6.4.1 Conductor Routing Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 6.4.2 Hole Diameter Rules. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 6.4.3 Solder Pad Diameter Rules. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .66 6.5 Design Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 6.5.1 Electrical Design. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 6.5.2 Mechanical Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 6.6 EMI consideration for Designing a Product . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 6.6.1 Factors in Material Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 6.6.2 Maintaining continuity: Gaskets. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 6.6.3 Other considerations for chassis. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 6.6.4 Capabilities of PCB Manufacturer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 6.7 Complete Circuit Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 6.8 PCB Layout. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 6.9 Complete Hardware of the System. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 CHAPTER 7: RESULTS AND DISCUSSION 72-74 7.1 Hardware Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 7.2 Software Results. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 7.2.1 The first window shows Original Image of Driver. . . . . . . . . . . . . . . . . 72 7.2.2 The Second window shows Driver iris and eye brows when Eyes open. 73 7.2.3 The Third window shows image of eye brows when Eyes closed. . . . . 73 7.2.4 The Fourth window shows Steering wheel gripping pressure variation. 73 7.2.5 The Fifth window shows Vehicle speed variation. . . . . . . . . . . . . . . . . . 74 7.2.6 The Sixth window shows complete algorithm results. . . . . . . . . . . . . . . 74
  • 16. [16] CHAPTER 8: CONCLUSION AND FUTURE SCOPE 75 8.1 Conclusion. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 8.2 Futute Scope. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 REFERENCES 76-78 APPENDIX A: COMPONENTS USED 79 APEENDIX B: MATLAB PROGRAM 80-85 APPENDIX C: DATA SHEETS 86-102
  • 17. [17] CHAPTER 1 INTRODUCTION 1.1 Overview Driver fatigue is one of the three commonest causes of motor vehicle accidents and the effect of driver fatigue has been underestimated in the past due to difficulties in identifying fatigue as the cause of a crash. The problem of driver fatigue of course moves far beyond just road vehicles to all modes of transportation, being an important factor in rail, sea and air accidents as well. Driver fatigue commonly causes “fall asleep” motor vehicle accidents. These tend to be more severe or fatal compared with other road accidents. This is because they often involve a single vehicle running off the road at high speed, they tend to occur on higher speed roadways, and braking or other preventative measures may be absent. If truck drivers are involved, the potential to cause death or serious injury to other road users is greatly increased. It is commonly known that drowsiness and driving is not a good combination. To be a good driver it is necessary to be perceptive, alert and focused on the task and it is difficult to combine these qualities with drowsiness. Another characteristic that is a bad combination with driving is distraction. Both these disturbances have the same effect on the driver in the sense that they have a negative effect on the perception, reaction time and focus, to name a few things. Drowsiness and distraction are parts of the human behaviour, which makes the problem with drowsiness and inattentive driving difficult to completely eliminate. A similar case is alcohol which also has a negative effect on the driving abilities, but can (theoretically) be removed from the roads. 1.2 Definitions: To be able to examine the effects of drowsiness, distraction and inattention it is necessary to start with the definitions of these words. 1.2.1 Sleepiness and Drowsiness Sleepiness, also referred to as drowsiness, is a basic physiological state that affects humans among others and it originates from changes of the alertness during each 24-hour sleep-wake cycle. This is caused by the internal body clocks, which programs us to be asleep twice a day:
  • 18. [18] in the middle of the night and between 14:00-16:00 in the afternoon [1]. Sleepiness is a stage when the body needs to sleep and is defined as “the inclination to sleep” [1]. Sleepiness should not be confused with fatigue, which is the consequence of physical labour or a long experience, and is defined as “disinclination to continue the task at hand” [2]. 1.2.2 Distraction Distraction is a shift in attention from the primary task to another task (secondary task). In behavioural models, human is modelled as information processing resource who has a maximal limit of information that can be processed [4]. In these models distraction is modelled as surrounding disturbances taking processing resources from the main task. Distraction can result in reduced performance of the primary task. There are several degrees of distraction, but no fixed scale. This is a problem when detecting a degree of distraction, because it is difficult to say that one thing “steals” more attention than another. Usually distraction is measured as the reduction of performance of the primary task. Another important part in the distraction is the drivers “willingness to engage” in the secondary task. How much the person engages in the task affects how distracted the person is. Distraction happens all the time in the daily life but the usual effect of the everyday distraction is very harmless. It results in a shift in attention from one thing to another for a brief or longer moment. This usually has little effect on the primary task other than a delay. An example of this is a person reading the newspaper when he hears a car alarm go off. The result of this is that he stops reading for a while, but soon he continues reading with only a slight delay. Sometimes this delay in the primary task may have a serious impact on a person, when he is driving for example. Distraction in a car is different from the everyday drowsiness because during the time you are not paying attention to the road, something may happen, which may cause the vehicle to crash in the worst case. 1.2.3 Inattention Inattention is when a person is not paying attention to, or focusing on a task. It could be caused by drowsiness, distraction, fatigue, boredom or other things. If the drowsiness and distraction is compared with inattention, it is like cause and effect.
  • 19. [19] Drowsiness and distraction can be the cause of inattention. In the word inattention it is not so important what caused it, just that the result is inattention. With drowsiness and distraction the effect is usually inattention, but here it is also important what caused it. 1.3 Inattentive Driving Inattention has a negative effect on a number of characteristics that are important while driving. It has a decreasing effect in vigilance, reaction time, memory, coordination, memory processing and decision making, to name a few [1]. Recent research has shown that sleep deprivation and late stages of inattention has the same effect as alcohol intoxication. In a research study, people were deprived of sleep and asked to do different tests. The results were that persons who were awake for 17 hours had the same results as a rested person with blood alcohol concentration (BAC) of 0.05% (0.5‰). A group of people that had been kept awake for 24 hours performed the same as people who had a BAC of 0.1% (1%) [1]. 1.3.1 Drowsy Driving Drowsy driving causes a lot of accidents on the roads all over the world. Cars are involved in 96% of the drowsy driving accidents and trucks are involved in 3%. However for trucks the expected number of involvement per lifecycle in drowsy driving accidents is about four times greater than for a car, because of the long vehicle lives and high usage [10]. Trucks are especially affected by the problem with drowsy driving because of the long transport distances and the workload management with tight deliverance schedules. In 1998 there were approximately 1.6 million truck tractors and 3.6 million trailers used in the transportation industry in the world. Drowsiness of truck drivers causes 1 200 deaths and 76 000 injuries annually, world-wide [9]. In the truck industry 57% of all crashes are caused by drowsiness1, which makes it the number one cause for heavy vehicle crashes [26]. With the constantly growing traffic conditions, this problem will further grow. The physical and psychological effects that drowsiness has on humans are impossible to combine with the qualities that are expected from a good driver. Drowsiness changes the abilities of the driver in the following areas:
  • 20. [20] 1) Slow reaction time 2) Reduced vigilance 3) Slow information processing 4) Reduced memory capacity 5) Worse coordination 6) Slow decision making 1.3.2 Distracted Driving During the last few years the number of distracting equipment in the vehicle has increased dramatically. Nowadays there are mobile phones, car audio equipment, navigation systems, TV-screens, DVD-players and cruise controls only to name a few. All these things “steal” attention from the primary task (driving) which can expose the driver to a dangerous situation. The trend is that the amount of distracting equipment in the vehicles is increasing as they get more available and easier to use at the same time as the complexity of these equipment increases. The result of this is that the drivers are more and more exposed to inattentive driving. In research of distraction it is usually helpful to examine distraction in terms of four different categories:  Visual distraction – looking away from the roadway  Auditory distraction – music or mobile phone  Biomechanical distraction – adjusting the radio volume or changing channel  Cognitive distraction – using navigation system These are the main kinds of distraction that the driver can be exposed to while driving. How much distraction a certain device causes is determined by the workload combined with the willingness of the driver to engage in that task. This means that the worst kinds of equipment are interesting and demanding, which could be a description of a mobile phone, a radio or a navigation system, for example. Distraction causes many accidents annually and in some countries it is actually illegal to drive a car while speaking in a mobile phone without a hands- free system. Approximately 0.1% of all the car drivers have been involved in an accident caused by someone using a mobile phone. This may not seem much, but it is estimated (based on these numbers) that 292 000 people have experienced a vehicle crash caused by a person using a mobile phone [14].
  • 21. [21] 1.4 Literature Survey 1.4.1 Overview One system that today is considered the most effective in the detection of inattentive driving is the system based on eye detection. An enhanced percentage of eyelid closure is one of the most reliable predictors of drowsiness or inattention [23]. The best detection of primarily drowsiness, but also of inattention is the measurement of brain- waves, heart rate and pulse [26]. To measure this while driving causes annoyance to the driver, because multiple sensors have to be attached to the driver. This can affect the driver so much that it changes the driving behaviour, which is not good at all in traffic safety research. Eye detection on the other hand gives an accurate detection with minimal impact on the driver. Eye closures occur with a high frequency just before the off-road accidents caused by drowsiness that has been recorded. In the minute preceding the accident an increase of the eyelid closure can be detected and 20-30 seconds before the accident a dramatic increase can be seen [10]. The eye detection system consists of a camera and demanding eye-tracking software. The camera, usually mounted on the dashboard in front of the driver, records the eyes of the driver. This signal is then processed in an advanced system to detect how many percents the eyes are open, the frequency of eye blinking and in which direction the driver is looking. With this signal it is then possible to detect the status of the driver with the accuracy of about 1 mm in the recorded images [27]. The eye detection systems are good but not perfect, when the driver is wearing glasses there might be errors in the detection, which in some systems leads to false warnings. Sunglasses cause problems that almost none of the systems can deal with, which makes the inattention detection almost impossible when the driver is wearing sunglasses. Different ethnical people are another problem, the eyes of Asian people differ from European people, but most manufacturers claim that it shouldn‟t be a problem.
  • 22. [22] 1.4.2 PERCLOS PERCLOS (PERcent eyelid CLOSure) is a measure of driver alertness, which was identified as the most reliable and valid in a study by the US Federal Highway Administration; various authors refer PERCLOS as a standard for drowsiness detection. The measure is the percentage of eyelid closure over the pupil over time and reflects slow eyelid closures rather than blinks. The PERCLOS drowsiness metric was established in a 1994 driving simulator study as the proportion of time (%) in a minute when the eyelids are at least 80 percent closed. PERCLOS system is defined as proportion of time that the eyes of the driver are closed (more that 80%) over a specified period that can be changed to suite the driver or the situation. This system is created to measure slow eyelid closures rather than blinks. PERCLOS originates from a drowsiness detection system that was created in a driving simulator in 1994, and has been developed ever since [25]. Based on research by Wierwille[11], the US Federal Highway Administration (FHWA) and the US National Highway Traffic Safety Administration (NHTSA) considers PERCLOS to be among the most promising known real-time measures of alertness for in-vehicle drowsiness-detection systems[10]. Figure 1.1 Progression of drowsiness and concordance of predicted and observed PERCLOS value.
  • 23. [23] P70: the proportion of time when the eyes were closed at least 70 percent. P80: the proportion of time when the eyes were closed at least 80 percent (the P80 metrics is usually referred as “PERCLOS”) EYEMEAS (EM): the mean square percentage of the eyelid closure rating. PERCLOS has been validated in two separate laboratories as an accurate predictor of performance degradation caused by drowsiness [24]. It is now used as a standard for drowsiness detection in many research projects [11] and some in-vehicle detection systems try to estimate the PERCLOS value from in-vehicle signals, this is called estimated PERCLOS (ePERCLOS). The eye detection system provides information of how much the eyes are closed at every moment and with this information the PERCLOS value can be computed. This is done by simply calculating the percent of the time that the eyes are closed more then 80% for every three minutes. This value is then compared to a limit value to see if the driver is considered drowsy or not. PERCLOS is the result of a simple mathematical algorithm which is included in the majority of the commercial eye detection systems. The problem is to detect the eyelid opening in the camera systems, which is done with image processing. The ordinary PERCLOS system is a measurement of the time when the eyes of the driver are between 80% and 100% closed. If the time exceeds a boundary value a warning is given. Usually this detection is calculated over 3- minute periods. The warning limit can be changed to suit the situation but a limit value that is commonly used is 0.12%, so when PERCLOS is above 0.12% the driver is considered drowsy. 1.4.3 Steering Wheel Variability Detection As reported by Wylie et al [11], steering wheel variability is related to the amount of drowsiness in drivers (variability greater as driver become more drowsy) after being adjusted for road dependent effects. Steering wheel variability is related to the amount of drowsiness in drivers (variability greater as drivers become more drowsy) after being adjusted for road dependent effects. Steering wheel variability is also strongly and reliably affected by location on the route. Therefore this measure
  • 24. [24] must be corrected for route dependent effects if it is to achieve its full potential as an indicator of driver fatigue. The adjustment for route dependent effects can be performed for example by subtracting the all-driver average steering wheel variability associated with each mile of road, thus reducing the variation associated with road curvature. The authors of the article also suggest considering the power spectral density of the steering wheel angle in relation to fatigue. Clearly this approach is arduous for real-time measurements. Figure 1.2 Drowsiness judgment example “General judgment (actua-tion)” is the system output (detection of drowsiness), “self declaration” is the driver’s subjective drowsiness experience, the “fluctuation” (pulse of the driver) and the “steering adjustments interval“are the recorded input variables for the drowsiness detection. 1.5 Objective of Work The main idea behind the Project entitled “Eye Tracking based Driver Fatigue Monitoring and Warning System” is to develope a non-intrusive system [12] which can detect fatigue of driver and issue a timely warning. It will have both hardware and the software modules. This project will have three input units, one Image processing unit and two Output units/ Warning units.
  • 25. [25] 1.6 System Theory and Detail The system consists of three input variables and one Image processing unit i.e computer and two output units i.e warning components and a microcontroller. Input Variables Warning/Output Variables 1. Eye tracking unit 1. Sound alarm 2. Speed variation detection unit 2. Seat belt vibration 3. Steering wheel gripping pressure detection unit Fig.1.3 Block Diagram of Eye tracking based Driver Fatigue Monitoring and Warning system Driver Seat belt vibration Microcontroller Sensors on Car steering Buffer IC Buffer IC PC (computer) Camera for tracking eye movement so that driver cannot go for sleep. Speedometer Image processing of eye movement i.e if driver try to go for a sleep by closing his eyes for half second Microcontroller will turn on buzzer and Seat belt vibration and data get recorded as track record of driver for future reference. ADC Circuit ADC Circuit
  • 26. [26] 1.6.1 Input Units This system will consists three input units to study the drowsy behaviour of driver namely Eye Tracking unit, Steering wheel gripping pressure variability detection unit and Speed variation detection unit. (i) Eye Tracking Unit This is the most crucial unit as the accuracy of warning issued will largely depends on this unit. Hence it can also be called the heart of this system. Driver face monitoring system [6] is a real-time system that can detect driver fatigue and driver distraction using machine vision approaches. An algorithm is used for driver hypo-vigilance detection based on eye-region processing and without explicit eye detection stage. In this method, horizontal projection of top half-segment of facial image is used to extract symptoms of fatigue and distraction. Fig. 1.4 Flow chart of Eye Tracking based System Calculation of criteria for judging drowsiness/ fatigue Face detection Driver’s Image Recognition of eyes whether open or closed Is driver drowsy WARNING Eye detection
  • 27. [27] The Algorithm used here is very much fast as compared to PERCLOS [5] earlier used by other hence the Processing time of this system is less than half second hence it is quite fast and issues timely warning to the driver. This system will detect a driver fatigue by processing of eye-region. As shown in flow chart in Figure 1.4. After image acquisition, face detection is the first stage of processing. Then symptoms of hypo-vigilance are extracted from the eyes. If eyes are blinking normally no warning is issued but when the eyes are closed for more than half second this system issues warning to the driver in form of alarm and vibration. (ii) Steering wheel gripping pressure variability detection unit The technique used here is that human body conducts current. Hence by using a conducting wire on non conducting steering wheel of Vehicle and an Analog to Digital Convertor (ADC) connected through a Transistor which acts as a switch. Whenever driver hold the steering tightly more current flows through base of Transistor as parallel resistances made by our fingers add up in parallel and as a result net resistance decreases and base current increases. Fig. 1.5 Steering wheel gripping pressure Variability Detection
  • 28. [28] Hence this variation is converted by ADC into some threshold and whenever output is less than threshold it indicates Driver Drowsiness or Fatigue state. (iii) Speed Variation Detection Unit Speed variation detection unit consists of a speedometer and whenever driver felt drowsy there is possibility of sudden acceleration or de-acceleration hence we can judge this by plotting a graph in time domain and when all three input variables shows a possibility of fatigue at one moment then a warning signal is shown in form of text or red colour circle. This will directly give an indication of drowsiness/fatigue which can be further used as record of driver performance or can be used by traffic police which can take further action accordingly. 1.6.2 Image Processing Unit This approach analyzes the images captured by cameras to detect physical changes of drivers, such as eyelid movement, eye gaze, yawn, and head nodding. For example, the PERCLOS system developed by W. W. Wierwile[12] used camera and imaging processing techniques to measure the percentage of eyelid closure over the pupil over time. The three-in-one vehicle operator sensor developed by Northrop Grumman Co. also used the similar techniques[30]. Although this vision based method is not intrusive and will not cause annoyance to drivers. In addition, this approach requires the camera to focus on a relative small area (around the driver‟s eyes). It thus requires relative precise camera focus adjustment for every driver. 1.6.3 Output Units/Warning Units For indication of warning this system will use two approaches i.e one by blowing alarm and second by seat belt vibration whose frequency will vary between 100 to 300 Hzs. Moreover the warning will be deactivated manually rather than automatically. So for this purpose a deactivation switch will be used to deactivate warning. Microcontroller will switch on the vibration sensor using the relay circuit shown in Figure 1.6.
  • 30. [30] CHAPTER 2 HARDWARE DESCRIPTION 2.1 Microcontroller The main difference between a Microprocessor and a Microcontroller is that a Microcontroller has inbuilt peripherals like timers, USART, Interrupt Controller etc. whereas in a Microprocessor these have to be interfaced as separate IC‟s. In this project the Microcontroller AT89C51 from the ATMEL Corp is used. The AT89C51 is a low- power, high-performance CMOS 8-bit microcomputer with 4Kbytes of Flash programmable and erasable read only memory (PEROM). The device is manufactured using Atmel‟s high-density non volatile memory technology and is compatible with the industry-standard MCS-51 instruction set and pin out. The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional non volatile memory programmer. By combining a versatile 8-bit CPU with Flash on a monolithic chip, the Atmel AT89C51 is a powerful microcomputer which provides a highly-flexible and cost-effective solution to many embedded control applications. Some of the features of the AT89C51 Microcontroller are listed below. 2.1.1 Features  Compatible with MCS-51™ Products  4K Bytes of In-System Reprogrammable Flash Memory  Endurance: 1,000 Write/Erase Cycles  Fully Static Operation: 0 Hz to 24 MHz  Three-level Program Memory Lock  128 x 8-bit Internal RAM  32 Programmable I/O Lines  Two 16-bit Timer/Counters  Six Interrupt Sources  Programmable Serial Channel  Low-power Idle and Power-down Modes
  • 31. [31] 2.1.2 Pin Configuration The 89C52 have a total of 40 pins that are dedicated for various functions such as I/O, RD, WR, address and interrupts. Out of 40 pins, a total of 32 pins are set aside for the four ports P0, P1, P2, and P3, where each port takes 8 pins. The rest of the pins are designated as Vcc, GND, XTAL1, XTAL, RST, EA, and PSEN. Fig 2.1 Pin diagram of 89C52 All these pins except PSEN and ALE are used by all members of the 8051 and 8031 families. In other words, they must be connected in order for the system to work, regardless of whether the microcontroller is of the 8051 or the 8031 family. The other two pins, PSEN and ALE are used mainly in 8031 based systems. The diagram of the 8052 packaged in a 40-pin DIP is shown in figure 2.7 with the full-abbreviated names for the signals of each pin. Many of the pins are used for more than one function. 2.1.3 I/O port pins and their functions The four ports P0, P1, P2, and P3 each use 8 pins, making them 8-bits ports. All the ports upon RESET are configured as output, ready to be used as output ports. To use any of these as input port, it must be programmed.
  • 32. [32] (i) Port 0 Port 0 occupies a total of 8 pins (pins 32 to 39). It can be used for input or output. To use the pins of port 0 as both input and output ports, each pin must be connected extremely to a 10K – ohm pull-up resistor. This is due to fact that port 0 is an open drain, unlike P1, P2, and P3. With external pull-up resistors connected upon rest, port 0 is configured as output port. In order to make port 0 an input, the poet must be programmed by writing 1 to all the bits of it. Port is also designated as AD0-AD7, allowing it to be used for both data and address. When connecting a microcontroller to an external memory, port 0 provides both address and data. The microcontroller multiplexes address and data through port 0 to save pins. ALE indicates if P 0 has address or data. When ALE=0, it provides data D0-D7, but when ALE=1 it has address A0- A7. Therefore, ALE is used for de-multiplexing address and data with the help of latch 74LS373. (ii) Port 1 Port 1 occupies a total of 8 pins (pins 1 to 8). It can be used as input or output. In contrast to port 0, this port does not require pull-up resistor since it has already pull-up resistor internally. Upon reset, port 1 is configures as an output port. Similar to port 0, port 1 can be used as an input port by writing 1 to all its bits. (iii)Port 2 Port 2 occupies a total of 8 pins (pin 21 to 28). It can be used as input or output. Just like P1, port 2 does not need any pull-up resistors since it has pull-up resistors internally. Upon reset port 2 is configured as output port. To make port 2 input, it must be programmed as such by writing 1s to it. (iv)Port 3 Port 3 occupies a total of 8 pins (pins10 to 17). It can be used as input or output, P3 does not need any pull-up resistors, the same as P1 and P2 did not. Although port 3 is configured as output port upon reset, this is not the way it is most commonly used. Port 3 has an additional function of providing some extremely important signals such as interrupts. Some of the alternate functions of P3 are listed below: P3.0 RXD (Serial Input)
  • 33. [33] P3.1 TXD (Serial Output) P3.2 INT0 (External interrupt 0) P3.3 INT1 (External Interrupt 1) P3.4 T0 (Timer 0 External Input) P3.5 T1 (Timer 1 External Input) P3.6 WR (External Memory Write Strobe) P3.7 RD (External Memory Read Strobe) (v) RST Reset input. A high on this pin for two machine cycles while the oscillator is running resets the device. (vi) ALE/PROG Address Latch Enable output pulse for latching the low byte of the address during accesses to external memory. This pin is also the program pulse input (PROG) during Flash programming. In normal operation ALE is emitted at a constant rate of 1/6 the oscillator frequency, and may be used for external timing or clocking purposes. Note, however, that one ALE pulse is skipped during each access to external Data Memory. If desired, ALE operation can be disabled by setting bit 0 of SFR location 8EH. With the bit set, ALE is active only during a MOVX or MOVC instruction. Otherwise, the pin is weakly pulled high. Setting the ALE-disable bit has no effect if the microcontroller is in external execution mode. (vii) PSEN Program Store Enable is the read strobe to external program memory. When the AT89C52 is executing code from external program memory, PSEN is activated twice each machine cycle, except that two PSEN activations are skipped during each access to external data memory. (viii) EA/VPP EA (External Access Enable) must be strapped to GND in order to enable the device to fetch code from external program memory locations starting at 0000H up to FFFFH. Note, however,
  • 34. [34] that if lock bit 1 is programmed, EA will be internally latched on reset. EA should be strapped to VCC for internal program executions. This pin also receives the 12-volt programming enable voltage (VPP) during Flash programming, for parts that require 12-volt VPP. 2.1.4 Oscillators and clock circuit It is the heart of the microcontroller that generates the clock pulses by which all the internal operations are synchronized. Pins XTAL1 and XTAL2 are provided for the connection of a resonant network to form an oscillator. Typically, a quartz crystal and capacitor are employed and thus crystal frequency will become the clock frequency of microcontroller. The figure 2.2 below shows oscillator connections with the microcontroller. Fig: 2.2 Diagram for oscillator connections The 8052 maximum and minimum frequency range between 1 MHz to 16 MHz and 20 MHz in case of AT89C52. Thus, the 8052 operates on an external crystal. This is an electrical device which, when energy is applied, emits pulses at a fixed frequency. One can find crystals of virtually any frequency depending on the application requirements. When using on 8051, the most common crystal frequencies are 12 MHz and 11.0592 MHz with 11.0592 being much more common. Why would anyone pick such an oddball frequency? There‟s a real reason for it has to do with generating baud rates in the Serial communication. A cycle is, in reality, 12 pulses of the crystal. That is to say, if an instruction takes on machine cycle to execute, it will take 12 pulses of the crystal to execute. Since the crystal is pulsing 11,059,000 times per second and that one
  • 35. [35] machine cycle is 12 pulses, we can calculate how many instruction cycles the 8051 can execute per second: 11,059,000/12 = 921,583 This means that the 8052 can execute 921,583 single-cycle instructions per second. Since a large number of 8052 instructions are single – cycle instructions it is often considered that the 8052 can execute roughly 1 million instructions per second, although in reality it is less and depending on the instructions being used, an estimate of about 600,000 instructions per second is more realistic. The 8052 equipped with two timers, both of which may be controlled, set, read, and configured individually. Keeping time and/or calculating the amount of time between events. Counting the events themselves and generating baud rates for the serial port If in some cases, it is essential to use frequency source other than a crystal oscillator, such as a TTL oscillator, it will be connected to XTAL1; XTAL2 is left unconnected as shown in figure 2.3 below for oscillator connections Fig: 2.3 Oscillator connections 2.2 Programming the Microcontroller To program a microcontroller one must have two basic tools. One is the hardware-programmer board and the second is the software-for downloading the program. The hardware programmer board is used to hold the chip and enable the computer to download the program into the microcontroller. The programmer board is serially connected to the computer.
  • 36. [36] The software you needed to program the microcontroller will be two fold. One is the compiler and the other to download the program written. The compiler program automatically checks for errors in the program and then compiles it into a hex file. This hex file is stored in the same directory in which original program file is earlier stored. The compiler software used be us is ASEM software. The downloading software used here is the UNIPROG. The uniprog can be run in only the DOS mode. This is very user friendly software and can be operated easily. This helps in erasing previous files and downloading new programs into the Microcontroller. It helps out how to program the micro with step by step descriptions as follows. 2.2.1 Steps involved in writing a program to the Microcontroller: 1. Write the required program in the Notepad of windows with the syntaxes being followed as per the rules of programming. 2. Save the written file in .asm extension. Now the assembly file has been created. 3. Next run this file in ASEM software by specifying the path of the file. 4. After this the ASEM software will check for errors and then convert this into .hex file. 5. Now run the system in the Dos Mode. 6. Next run the UNIPROG software 7. It automatically checks the IC placed in the board. 8. Then specify the hex file to be downloaded. 9. If any program is in the IC, you can erase it. 10. Now download the program and hence you are ready to work with the IC. (i) UNIPROG is an open engine for support any hardware chip programmer. It‟s implement an open architecture based in hardware-abstract algorithms and chip definitions, that can work in any hardware. With UNIPROG the development of new and powerful programmers is not limited by lack of software or the need of test chips. (ii) ASEM-51 is a two-pass macro assembler for the Intel MCS-51 family of microcontrollers. It is running on the PC under MS-DOS, Windows and Linux. The DOS real-mode assembler ASEM.EXE requires only 256 kB of free DOS memory and MS- DOS 3.0 (or higher). The new protected-mode assembler ASEMX.EXE requires a 286 CPU (or better), and at least 512 kB of free XMS memory. The new Win32 console-mode assembler ASEMW.EXE requires a 386 CPU (or better) and Windows 9x, NT, 2000 or XP. The new Linux assembler ASEM requires a
  • 37. [37] 386-based Linux system. The new HTML documentation set requires a 90 MHz Pentium (or better) and a web browser. The ASEM-51 assembly language is a rich subset of the Intel standard that guarantees maximum compatibility with existing 8051 assembler sources. ASEM-51 can generate two sorts of object files: Intel-HEX format, which is directly accepted by most EPROM programmers, and absolute OMF-51 format, which is required for many simulators, emulators and target debuggers. Thus ASEM-51 is suitable for small and medium MCS-51-based microcontroller projects in hobby, education and business. However, ASEM- 51has been designed to process also very large programs! 2.2.2 Features:  Fast, compact, reliable, easy to use, and well-documented  Easy installation, almost no configuration required  Command line operation, batch and networking capability  DOS (RM and PM), Win32 and Linux binaries available  Intel-compatible syntax  Five location counters, one for each of the MCS-51 address spaces  Assembly-time evaluation of arithmetic and logical expressions 2.3 Camera Fig: 2.4 USB Camera
  • 38. [38] 2.3.1 Introduction Simply, the frame rate is the number of pictures a webcam can take and how quickly it can then transfer them to the computer's screen. Frames are measured in "frames per second" (or fps). So if the webcam says it has a 30 fps, that means it can take 30 pictures every second and then transfer them to the computer screen. 2.3.2 How It Works Once a picture (or frame) is captured by the webcam, it creates a JPEG file of the still image. When the webcam has a low frame rate (15 fps or below), the webcam can only transmit a series of these JPEG still images. When the frame rate is higher than 15 fps, the webcam can actually stream video using the computer's Internet connection. Frame rates generally range from 10 fps to 60 fps. For avoiding the chopping of video, stay closer to 30 and higher want very 2.3.3 Outside Factors Although the number on the box may say one thing, what your webcam actually captures may be different. Certain things can affect a webcam's frame rate, such as the capabilities of webcam's software program, exactly what you are trying to record, the resolution of the webcam, and even the amount of light in the room. Likewise, running multiple devices via your computer's USB ports can also slow down the frame rate. 2.3.4 Specifications: USB 2.0 Compatible LED brightness controller CMOS chip type: Color CMOS image sensor Built-in Microphone High Definition: 480k pixels (640x480) Sensor size: 4.86 x 3.64mm Frame Rate: 320x240 up to 30 frame/sec(CIF), 24-bit True Color Video Format: 24-bit RGB Focus range: 5cm-Infinity Manual Focus, automatic color compensated Support OS: Win 98/98SE/ME/2000/XP Works perfectly with ICQ, MSN, Yahoo, AOL messenger Easily mounts to a PC monitor or a notebook  PC Camera software comes with this camera for viewing images
  • 39. [39] Weight: 99g Cable length: 150cm 2.4 ADC 0808 (Analog to Digital Convertor) 2.4.1 General Description The ADC0808, ADC0809 data acquisition component is a monolithic CMOS device with an 8- bit analog-to-digital converter, 8-channel multiplexer and microprocessor compatible control logic. The 8-bit A/D converter uses successive approximation as the conversion technique. The converter features a high impedance chopper stabilized comparator, a 256R voltage divider with analog switch tree and a successive approximation register. The 8 channel multiplexer can directly access any of 8-single-ended analog signals. The device eliminates the need for external zero and full scale adjustments. Easy interfacing to microprocessors is provided by the latched and decoded multiplexer address inputs and latched TTL TRI-STATEÉ outputs. The design of the ADC0808, ADC0809 has been optimized by incorporating the most desirable aspects of several A/D conversion techniques. The ADC0808, ADC0809 offers high speed, high accuracy, minimal temperature dependence, excellent long- term accuracy and repeatability, and consumes minimal power. These features make this device ideally suited to applications from process and machine control to consumer and automotive applications. 2.4.2 Pin Diagram Fig 2.5 Pin diagram of ADC 0808
  • 40. [40] 2.4.3 Features  Easy interface to all microprocessors  Y Operates ratio metrically or with 5 VDC or analog span  adjusted voltage reference  No zero or full-scale adjust required  8-channel multiplexer with address logic  0V to 5V input range with single 5V power supply  Outputs meet TTL voltage level specifications  Standard hermetic or molded 28-pin DIP package  28-pin molded chip carrier package  ADC0808 equivalent to MM74C949  ADC0809 equivalent to MM74C949-1 2.4.4 Key Specifications  Resolution 8 Bits  Total Unadjusted Error g(/2 LSB and g1 LSB  Single Supply 5 VDC  Low Power 15 mW  Conversion Time 100 ms 2.4.5 Functional Description (i) Multiplexer The device contains 8-channel single-ended analog signals inputs. A particular input channel is selected by using the address decoder. The input states for the address lines to select any channel. The address is latched into the decoder on the low-to-high transition of the address latch enable signal. (ii) The Converter The 8 bit converter is designed to give fast, accurate, and repeatable conversions over a wide range of temperatures. The converter is partitioned into 3 major sections: the 256R ladder network, the successive approximation register, and the comparator. The converter's digital outputs are positive true. The 256R ladder network approach (Figure 2.6) was chosen over the
  • 41. [41] conventional R/2R ladder because of its inherent monotonicity, which guarantees no missing digital codes. Monotonicity is particularly important in closed loop feedback control systems. A non-monotonic relationship can cause oscillations that will be catastrophic for the system. Additionally, the 256R network does not cause load variations on the reference voltage. The bottom resistor and the top resistor of the ladder network in Figure 2.6 are not the same value as the remainder of the network. The difference in these resistors causes the output characteristic to be symmetrical with the zero and full-scale points of the transfer curve. The first output transition occurs when the analog signal has reached a(/2 LSB and succeeding output transitions occur every 1 LSB later up to full-scale. The successive approximation register (SAR) performs 8 iterations to approximate the input voltage. For any SAR type converter, n-iterations are required for an n-bit converter. Figure 2.7 shows a typical example of a 3-bit converter. In the ADC0808, ADC0809, the approximation technique is extended to 8 bits using the 256R network. Fig.2.6 Resistor Ladder and switch tree.
  • 42. [42] The A/D converter's successive approximation register (SAR) is reset on the positive edge of the start conversion (SC) pulse. The conversion is begun on the falling edge of the start conversion pulse. A conversion in process will be interrupted by receipt of a new start conversion pulse. Continuous conversion may be accomplished by tying the end of- conversion (EOC) output to the SC input. If used in this mode, an external start conversion pulse should be applied after power up. End-of-conversion will go low between 0 and 8 clock pulses after the rising edge of start conversion. The most important section of the A/D converter is the comparator. It is this section which is responsible for the ultimate accuracy of the entire converter. It is also the comparator drift which has the greatest influence on the repeatability of the device. A chopper-stabilized comparator provides the most effective method of satisfying all the converter requirements. The chopper-stabilized comparator converts the DC input signal into an AC signal. This signal is then fed through a high gain AC amplifier and has the DC level restored. This technique limits the drift component of the amplifier since the drift is a DC component which is not passed by the AC amplifier. This makes the entire A/D converter extremely insensitive to temperature, long term drift and input offset errors. Fig.2.7 3 Bit A/D Transfer Curve
  • 43. [43] 2.5 Opto coupler 4N35 2.5.1 General Description In electronics, an opto-isolator (or optical isolator, opto coupler, photocoupler, or photo MOS) is a device that uses a short optical transmission path to transfer a signal between elements of a circuit, typically a transmitter and a receiver, while keeping them electrically isolated since the signal goes from an electrical signal to an optical signal back to an electrical signal, electrical contact along the path is broken. Different sections of a circuit of a circuit operate at their own voltage levels. Opto couplers are used to isolate these lines. If there is any transient voltage or noise in one of the lines, the opto coupler stops it from with the other lines. It is mainly used for signal and electrical isolation. Relays can of course provide this kind of isolation, but even small relays tend to be fairly bulky compared with ICs and many of today‟s other miniature circuit components. Because they are electro-mechanical, relays are also not as reliable and only capable of relatively low speed operation. Where small size, higher speed and greater reliability are important, a much better alternative is to use an opto coupler. The figure 2.8 below shows the 6 pin opto coupler IC and internal structure of an opto coupler. Fig: 2.8 Opto coupler The input part has an infrared LED chip and the output has a silicon diode chip. A thin, transparent, Mylar plate embedded in clear silicone separates these. Resistors are also placed in the circuit. The assembly is sealed in plastic. From this diagram the anode of the LED is pin 1 and the cathode is pin 2. The emitter of the phototransistor is pin 4, the collector is pin 5, and the base is pin 6. When a forward bias voltage is applied to the input terminals of the LED an input current flows in the LED circuit. When an electrical signal is applied to the input of the opto-isolator, its LED lights, its light sensor then activates, and a corresponding electrical signal is generated at the output. With a photodiode as the detector, the output current is
  • 44. [44] proportional to the amount of incident light supplied by the emitter. This current produces an infrared light that hits the silicon chip. The input signal is connected to the LED and the output signal is connected to the transistor. The infrared light varies with the input voltage. There are many situations where signals and data need to be transferred from one subsystem to another within a piece of electronics equipment, or from one piece of equipment to another, without making a direct-ohmic electrical. Often this is because the source and destination are (or may be at times) at very different voltage levels, like a microcontroller which is operating from 5V DC but being used to control a triac which is switching 240V AC. In such situations the link between the two must be an isolated one, to protect the microcontroller from over voltage damage. These use a beam of light to transmit the signals or data across an electrical barrier, and achieve excellent isolation. Opto couplers typically come in a small 6 pin or 8-pin IC package, but are essentially a combination of two distinct devices, an optical transmitter, typically a gallium arsenide LED (light emitting diode) and an optical receiver such as a phototransistor or light triggered diac. The two are separated by a transparent barrier which blocks any electrical current flow between the two, but does allow the passage of light. 2.5.2 Features o Also available in white package by specifying -M suffix, eg. 4N25-M o UL recognized (File # E90700) o VDE recognized (File # 94766) o Add option V for white package (e.g., 4N25V-M) o Add option 300 for black package (e.g., 4N25.300) 2.6 Relay The electromagnetic relay consists of a multi-turn coil, wound on an iron core, to form an electromagnet as shown in figure 2.9. When the coil is energized, by passing current through it, the core becomes temporarily magnetized. The magnetized core attacks the iron armature. The armature is pivoted which causes it to operate one or more sets of contacts. When the coil is de- energized the armature and contacts are released. The coil can be energized from a low power source such as a transistor while the contacts can switch high powers such as the mains supply. The relay can also be situated remotely from the control source. Relays can generate a very
  • 45. [45] high voltage across the coil when switched of. This can damage other components in the circuit. To prevent this, a diode is connected across the coil. Fig: 2.9 Relay contact sets The cathode of the diode is connected to the most positive end of the coil. The spring sets (contacts) can be a mixture of n.o (normally open), n.c (normally closed) and c.o (common) as shown in figure 2.10. Fig: 2.10 Electromagnetic relay 2.6.1 Opto coupler Relay Connection: The figure 2.11 shows the connection of opto coupler with relay. The Normally open pin is connected to AC mains; the pin normally closed is connected to ground. The common pin is connected to the robo car. One end of the coil is connected to the emitter of the transistor and the other end is connected to 5V supply.
  • 46. [46] Fig:2.11 Opto coupler relay connections 2.7 Serial Port Communication All IBM PC and compatible computers are typically equipped with two serial ports and one parallel port. Although these two types of ports are used for communicating with external devices, they work in different way. A parallel port sends and receives data eight bits at a time over 8 separate wires. This allows data to be transferred very quickly; however, the cable required is more bulky because of the number of individual wires it must contain. Parallel ports are typically used to connect a PC to a printer and are rarely used for much else. A serial port sends and receives data one bit at a time over one wire. While it takes eight times as long to transfer each byte of data this way, only a few wires are required. In fact, two – way (full duplex) communications is possible with only three separate wires – one to send, one to receive, and a common signal ground wire. Serial data communication uses two methods, asynchronous and synchronous. The synchronous transfers a single byte at a time. The data coming in at the receiving end of the data line in a serial data transfer is all 0s and 1s: it is difficult to make sense of the data unless the sender and receiver agree on as set of rules, a protocol, on how the data is packed, how many bits constitute a character, and when the data begins and ends. Serial communication requires that you specify the following four parameters:
  • 47. [47]  The baud rate of the transmission  The number of data bits encoding a character  The sense of the optional parity bit  The number of stop bits Each transmitted character is packaged in a character frame that consists of a single start bit followed by the data bits, the optional parity bit, and the stop bit or bits. 2.7.1 Serial Interface Basic concepts concerning the serial communication can be classified into categories below:  Interfacing requirements  Transmission format  Error check in data communication  Standards in serial I/O (i) Interfacing Requirements The serial interface requirement is very much similar to parallel interface requirement. Computer identifies the peripheral through port address and enable if using the read and write signals. The primary difference between the parallel I/O and serial I/O is the number of lines used for data transfer. Parallel I/O requires the entire bus while the serial I/O requires only one or pair of data lines for communication (ii) Transmission Format Transmission format for communication is concerned with the issues such as synchronization, direction of data flow, speed, errors and medium of transmission. Serial data can be sent synchronously or asynchronously. a) Synchronous Data Transmission For synchronous data transmission data is sent in blocks at a constant rate. The start and end of the block are identified with specific bytes or bits patterns. b) Asynchronous Data Transmission For asynchronous transmission each data character has
  • 48. [48] a bit which identifies its start and 1or 2 bits, which identifies its end. Since each character is individually identified, characters can be sent at any time (asynchronously), in the same way that a person types on a keyboard. The asynchronous format is character oriented. Each character carries the information of the start and stop bits. When no data is being transferred, a receiver stage high at the logic 1 called mark; logic 0 is called space. The transmission of data begins with one start bit (low) followed by a character and one or two stop bits (high). This is known as framing. The asynchronous format is generally used in low speed transmission (less than 20k bits/sec) in serial I/O one bit is sent out at a time. Therefore how long the bit stays on or off is determined by the speed at which bits are transmitted. The receiver should be set up to receive the bits at the same rate of transmission; otherwise the receiver may not be able to differentiate between the two consecutive 0s and 1s. The rate at which the bits are transmitted (bits/sec) is called baud. Each equipment has its own baud rate requirements. Baud rate is a measure of how fast data are moving between instruments that use serial communication. If the instrument is transmitting at 9,600 baud, the duration of the start bit and each subsequent bit is about 0.104ms. The entire character frame of eleven bits would be transmitted in about 1.146 ms. Knowing the structure of a character frame and the meaning of baud rate as it apply to serial communication, maximum transmission rate in characters per second can be calculated for a given communication setting. This rate is just the baud rate divided by the bits per frame. If the transmission rate is set at 9,600 baud, you get 9,600/11=872 characters per second. The figure 2.12 below shows the format of the frame transmitted using asynchronous transmission. Fig: 2.12 Asynchronous data format
  • 49. [49] (iii) Error check in data communication During transmission, various types of errors can occur. These errors need to be checked, therefore, additional information for error checking is sent during transmission the receiver can check the received data against the error check information, and if the error is detected, the receiver can request there retransmission of that data segment. Three methods generally used for this purpose are parity check, checksum and redundancy check. (iv) Standard in Serial I/O The serial I/O technique is commonly used to interface terminals, printers etc. a standard is normally defined by a professional organization (such as IEEE). A standard may include such items as assignment of pin positions for signals, voltage levels, speed of data transfer, length of cable and mechanical specifications. When data are transmitted as voltage, the commonly used standard is known as RS232C. It is defined as reference to data terminal equipment (DTE) and data communication equipment (DCE). The rate of transmission is RS232 is restricted to a maximum of 20k baud and a distance of 50 feet. 2.7.2 Communicating by bits In data framing for asynchronous communication, the data, such as ASCII characters, are packed in between start bit and stop bit. The start bit is always one bit but the stop bit can be one or two bits. The start bit is always a 0 (low) and the stop bit is 1 (high). Once the start bit has been sent, the transmitter sends the actual data bits. There may either be 5, 6, 7 or 8 data bits, depending on the number you have selected. Both receiver and the transmitter must agree on the number of data bits, as well as the baud rate. Almost all devices transmit data using either 7 or 8 data bits. Notice that when only 7 data bits are employed, you cannot send ASCII values greater than 127. Likewise, using 5 bits limits the highest possible value to 31. After the data has been transmitted, a stop bit is sent. A stop bit has a value of 1- or a mark state- and it can be detected correctly even if the previous data bit also had a value of 1. This is accomplished by the stop bits duration. 2.7.3 The Parity Bit Besides the synchronization provided by the use of start and stop bits, an additional bit called a parity bit may optionally is transmitted along with the data. A parity bit affords a small amount of error checking, to help detect data corruption that might occur during transmission. When
  • 50. [50] even or odd parity is being used, the number of marks (logical 1 bit) in each byte is counted, and a single bit is transmitted following the data bits to indicate whether the number of 1 bit just sent is even or odd. For example, when even parity is chosen, the parity bit is transmitted with a value of 0 if the number of preceding marks is an even number. For the binary value of 01100011 the parity bit would be 0. If even parity was in effect and the binary number 11010110 was sent, then the parity bit would be 1. Odd parity is just the opposite, and the parity bit is 0 when the number of mark bits in the preceding word is an odd number. Parity error checking is very rudimentary. While it will tell you if there is a single bit error then the parity bit was received in errors. Also, if an even number of bits is in error then the parity bit would not reflect any error at all. Mark parity means that the parity bit is always set to the mark signal condition and likewise space parity always sends the parity bit in the space signal condition. Since these two parity options serve no useful purpose whatsoever, they are almost never used. 2.8 DCE and DTE devices DTE stands for Date Terminal Equipment, and DCE stands for Data communications Equipment. These terms are used to indicate the pin-out for the connectors on a device and the direction of the signals on the pins. Computer is a DTE device, while most other devices are usually DCE devices. The RS-232 standard states the DTE devices use a 25 pin male connector, and DCE devices use a 25-pin female connector. You can therefore connect a DTE device to a DCE using a straight pin-for-pin connection. However, to connect two like devices, you must instead use a null modem cable. Null modem cables cross the transmit and receive lines in the cable, and are discussed later in this chapter. The figure 2.13 and 2.14 shows the connections and signal directions for both 25 and 9 pin connectors. Fig 2.13: 25 pin connector on a DTE device
  • 51. [51] Fig: 2.14: 9 pin connector on a DTE device, RS 232 DB9 The TD (transmit data) wire is the one through which data from a DTE device is transmitted to a DCE device. This wire is used by a DCE device to receive its data. The DTE device puts this line in a mark condition to tell the remote device that it is ready and able to receive data. If the DTE device is not able to receive data (typically because it receive buffer is almost full), it will put this line in the space condition as a signal to the DCE to stop is almost full), it will put this line in the space condition as a signal to the DCE to stop sending data. When the DTE device is ready to receive more data (i.e after data has been removed from it‟s receive buffer), it will place this line back in the mark condition. The complement of the RTS wire is CTS, which stands for clear to send. The DCE device puts this line in a mark condition to tell the DTE device that it is ready to receive the data. Likewise, if the DCE device is unable to receive data, it will place this line in the space condition. Together, these two lines make up what is called RTS/CTS or “hardware” flow control. The software Wedge supports this type of flow control, as well as Xon/Xoff or “software” flow control. Software flow control uses special control characters transmitted from one device to another to tell the other device to stop or start sending data. With software flow control the RTS and CTS lines are not used. DTR stands for Data Terminal Ready. Its intended function is very similar to the RTS line. DSR (Data Set Ready) is the companion to DTR in the same way that CTS is to RTS. Some serial devices use DTR and DSR as signals to simply confirm that a device is connected and is turned on. The software Wedge sets DTR to the mark state when the serial port is opened and leaves it in that state until the port is closed. The DTR and DSR lines were originally designed to provide an alternate method of hardware handshaking. It would be pointless to use both RTS/CTS and DTR/DSR for flow control signals at the same time. Because of this, DTR and DSR are rarely used for flow control.
  • 52. [52] Pin Number Direction of Signal 1 Carrier Detect (CD) (from DCE) incoming signal from a modem 2 Received Data (RD) Incoming Data from a DCE 3 Transmitted data (TD) outgoing data to a DCE 4 Data Terminal Ready (DTR) Outgoing handshaking signal 5 Signal ground common reference voltage 6 Data set ready (DSR) incoming handshaking signals 7 Request to sent (RTS) outgoing flow control signal 8 Clear to send (CTS) incoming flow control signal 9 Ring Indicator (RI) (from DCE) incoming signal from a modem Table 2.1 Pin description of RS232 DB9 CD stands for Carrier Detect. Carrier Detect is used by modem to signal that it has a made a connection with another modem, or has detected a carrier tone. The last remaining line is RI or Ring Indicator. A modem toggles the state of this line when an incoming call rings your phone. The Carrier Detect (CD) and the Ring Indicator (RI) lines are only available in connections to a modem. Because most modems transmit status information to a PC when either a carrier signal is detected (i.e. when a connection is made to another modem) or when the line is ringing, these two lines are rarely used. 2.8.1 Baud vs. Bits per Second The baud unit is named after Jean Maurice Emile Baudot, who was an officer in the French Telegraph Service. He is credited with devising the first uniform-length 5-bit code for character of the alphabet in the late 19th century. What baud really refers to is modulation rate or the number of times per second that a line changes state? This is not always the same as bits per second (BPS). If you connect two serial devices together using direct cables then baud and BPS are in fact the same.
  • 53. [53] If you connect two serial devices together using direct cables then baud and BPS are in fact the same. Thus, if you are running at 19200 BPS, then the line is also changing states 19200 times per second. But when considering modems, this isn‟t the case. Because modems transfer signals over a telephone line, the baud rate is actually limited to a maximum of 2400 baud. This is a physical restriction of the lines provided by the phone company. The increased data throughput achieved with 9600 or higher baud modems is accomplished by using sophisticated phase modulation and data compression technique. 2.8.2 Null Modem Cables and Null Modem Adapters If you connect two DTE devices (or two DCE devices) using a straight RS232 cable, then the transmit line on each device will be connected to the transmit line on the other device and the receive lines will likewise be connected to each other. A null modem cable or null modem adapter simply cross the receiver and transmit lines so that transmit on one end is connected to receive on the other end and vice versa. In addition to transmit and receive, DTRs and asynchronous communication, the two devices initially synchronize themselves to each other, and then continually send characters to stay in sync. Even when data is not really being sent, a constant flow of bits allows faster data transfer rates than asynchronous methods, because additional bits to mark the beginning and end of each data byte are not required. The serial ports on IBM style PCs are asynchronous devices and therefore only support asynchronous serial communications. Asynchronous means “no synchronization”, and thus does not require sending and receiving idle characters. However, the beginning and end of each byte of data must be identified by start and stop bits. The start bit indicates when the data byte is about to being and the stop bit signals when it ends. The requirement to send these additional to bits causes asynchronous communication to be slightly slower than synchronous however it has the advantage that the processor does not have to deal with the additional idle characters. An asynchronous line that is idle is identified with a value of 1 (also called a mark state). By using this value to indicate that no data is currently being sent, the devices are able to distinguish between an idle state and a disconnected line. When a character is about to be transmitted, a start bit is sent. A start bit has a value of 0 (also called a space state). Thus, when the line switches from a value of 1 to a value of 0, the receiver is alerted that a data character is about to be sent RS232 communication is asynchronous. That is a clock signal is not sent with the data. Each word is synchronized using it‟s start bit, and an internal clock on each side, keeps tabs on the timing.
  • 54. [54] Port addresses and IRQ‟s in the PC are as given below: Name Addresses IRQ COM1 3F8 4 COM2 2F8 3 COM3 3E8 4 COM4 2E8 3 Table 2.2 Port Addresses and IRQ’s in the PC 2.8.3 D 25 Pin Connector Fig: 2.15 Pin Detail of D25 Pin Connector Because the parallel port on a computer was mainly designed to connect printers with one-way communication, a trick is used to achieve full two way data transfer between both sides. Five error and status message inputs are redefined as data inputs. Instead of reading full bytes, the communication software reads these five bits and combines multiple groups of data back to bytes. The sender and receiver have to use the same protocol to convert bytes to groups of 5 bits and vice versa.
  • 55. [55] 2.8.4 Interfacing of Microcontroller parallel port Fig: 2.16 Circuit of D25 Pin Connection with Microcontroller
  • 56. [56] CHAPTER 3 CIRCUIT DESCRIPTION 3.1 Power Supply Fig.3.1 Block Diagram of Power Supply 3.1.1 Description The power supply circuit comprises of four basic parts: (i) Transformer steps down the 220 V a/c. into 12 V a/c. The transformer work on the principle of magnetic induction, where two coils: primary and secondary are wound around an iron core. The two coils are physically insulated from each other in such a way that passing an a/c. current through the primary coil creates a changing voltage in the primary coil and a changing magnetic field in the core. This in turn induces a varying a/c. voltage in the secondary coil. (ii) Bridge Rectifier is used in most electronic power supplies is the single-phase bridge rectifier with capacitor filtering, usually followed by a linear voltage regulator. A rectifier circuit is necessary to convert a signal having zero average value into a non-zero average value. A rectifier transforms alternating current into direct current by limiting or regulating the direction of flow of current. The output resulting from a rectifier is a pulsating D.C. voltage. This voltage is not appropriate for the components that are going to work through it. (iii) Filter Capacitor is used to smooth the ripple of the D.C. voltage. The filter capacitor of 1000 µF 25V is used to stores electrical charge. If it is large enough the capacitor will store charge as the voltage rises and give up the charge as the voltage falls. This has the effect of smoothing out the waveform and provides steadier voltage output. A filter capacitor is connected at the rectifier output and the d.c voltage is obtained across the capacitor. When this capacitor is used in this project, it should be twice the supply voltage. When the filter is used, the RC charge time of the filter capacitor must be short and the RC discharge time must be long to eliminate ripple action. In other words the capacitor must charge up TRANSFORMER SHUNT CAPACITOR BRIDGE RECTIFIER VOLTAGE REGULATOR
  • 57. [57] fast, preferably with no discharge. When the rectifier output voltage is increasing, the capacitor charges to the peak voltage Vm. Just past the positive peak, the rectifier output voltage starts to fall but at this point the capacitor has +Vm voltage across it. Since the source voltage becomes slightly less than Vm, the capacitor will try to send current back through the diode of rectifier. This reverse biases the diode. The diode disconnects or separates the source the source form load. The capacitor starts to discharge through load. This prevents the load voltage from falling to zero. The capacitor continues to discharge until source voltage becomes more than capacitor voltage. The diode again starts conducting and the capacitor is again charged to peak value Vm. When capacitor is charging the rectifier supplies the charging through capacitor branch as well as load current, the capacitor sends currents through the load. The rate at which capacitor discharge depends upon time constant RC. The longer the time constant, the steadier is the output voltage. An increase in load current i.e. decrease in resistance makes time constant of discharge path smaller. The ripple increase and d.c output voltage V dc decreases. Maximum capacity cannot exceed a certain limit because the larger the capacitance the greater is the current required to charge the capacitor. (iv) Voltage Regulator regulates the supply if the supply if the line voltage increases or decreases. The series 78xx regulators provide fixed regulated voltages from 5 to 24 volts. An unregulated input voltage is applied at the IC Input pin i.e. pin 1 which is filtered by capacitor. The out terminal of the IC i.e. pin 3 provides a regular output. The third terminal is connected to ground. While the input voltage may vary over some permissible voltage range, and the output voltage remains constant within specified voltage variation limit. The 78xx IC‟s are positive voltage regulators whereas 79xx IC‟s are negative voltage regulators. These voltage regulators are integrated circuits designed as fixed voltage regulators for a wide variety of applications. These regulators employ current limiting, thermal shutdown and safe area compensation. With adequate heat sinking they can deliver output currents in excess of 1 A. These regulators have internal thermal overload protection. It uses output transistor safe area compensation and the output voltage offered is in 2% and 4% tolerance.
  • 58. [58] 3.1.2 Circuit Diagram Fig.3.2 Power Supply Circuit 3.2 Interfacing of Microcontroller with ADC 0808 Fig.3.3 Steering Wheel Gripping Pressure Variability Detection
  • 59. [59] This system works on the technique that human body conducts current. Hence by using a conducting wire on non conducting steering wheel of vehicle and by using an Analog to Digital Convertor (ADC) and connected through a transistor which act as a switch and when the driver hold the steering tightly more current flows through base of Transistor as parallel resistances made by our fingers add up in parallel and as a result net resistance decreases and base current increases. Hence this pressure variation is converted by ADC into some threshold and whenever output is less than threshold it indicates Driver Drowsiness or Fatigue state. 3.2.1 Circuit Diagram Fig.3.4 ADC Interfacing with Microcontroller
  • 60. [60] CHAPTER 4 MATLAB SOFTWARE BASICS 4.1 Software Description For the Urban search and rescue robot different types of sensors can be used and accordingly their interfacing has to be done using some software. One of sensor used is a Webcam. Interfacing of which with the system requires coding either in MATLAB or C#. MATLAB is a numerical computing environment and programming language. Also a reprogrammable microcontroller is necessary. The criterion for choosing microcontroller was its easy availability, cost and its memory type. The microcontroller comes with different memory types, the first being UV erasable memory type that has a quartz window and is exposed to UV to erase the memory. Microchip provides this option for the PIC16 series and the UV erasable devices are identified by the model number extension JW. These devices are produced in a ceramic dual in line package and are identical to the OTP (one time programmable) version except for the packaging and cost. The other option considered was the FLASH based memory type AT89C51 family, which is a new series of devices that employ electronically erasable memory. These devices are available in DIP or surface mount packages. The FLASH devices are more convenient to reprogram than the windowed version as they don‟t require exposure to UV light and hence the reprogramming time is much shorter. The microcontroller AT89C52 chosen for the development of the system is much cheaper than the windowed PIC16C73A-JW. It has 8K of program memory and has the capability to write to its own memory. As a webcam is used therefore it is interfaced using MATLAB. The videos and images captured by the Webcam are stored and processed with the help of programming in MATLAB. 4.2 Introduction to MATLAB MATLAB is a numerical computing environment and programming language maintained by The Math Works. MATLAB allows easy matrix manipulation, plotting of functions and data,
  • 61. [61] implementation of algorithms, creation of user interfaces, and interfacing with programs in other languages. MATLAB stores images using Image Processing Toolbox. The Image Processing Toolbox extends the basic capabilities of MATLAB by providing a number of specialized I/O, display, and processing functions for images and image processing. It stores most images as two- dimensional arrays (i.e., matrices), in which each element of the matrix corresponds to a single pixel in the displayed image (Pixel is derived from picture element and usually denotes a single dot on a computer display.) Some images, such as true color images, require a three- dimensional array, where the first plane in the third dimension represents the red pixel intensities, the second plane represents the green pixel intensities, and the third plane represents the blue pixel intensities. This convention makes working with images in MATLAB similar to working with any other type of matrix data, and makes the full power of MATLAB available for image processing applications. An image is stored as a matrix using standard MATLAB matrix conventions. There are five basic types of images supported by MATLAB: 1. Indexed images 2. Intensity images 3. Binary images 4. RGB images 5. 8-bit images The Image Processing Toolbox provides functions imread and imwrite that will read and write several standard image types. A Graphical User Interface GUI uses a combination of technologies and devices to provide a platform the user can interact with, for the tasks of gathering and producing information. The GUI contains  An axes  A pop-up menu listing three data sets that correspond to MATLAB functions: peaks, membrane, and sinc.  A static text component to label the pop-up menu  Push buttons, each of which provides a different kind of plot: surface, mesh, and contour.
  • 62. [62] Fig: 4.1 A simple blank GUI The figure 4.1 above shows how a blank GUI is formed. It can have push buttons, radio buttons, scroll buttons, axis, toggle button, static text, list box, check box etc. When you save a GUI, GUIDE creates two files, a FIG-file and an M-file. The FIG-file, with extension .fig, is a binary file that contains a description of the layout. The M-file, with extension .m, contains the code that controls the GUI. The figure 4.2 shows the GUI developed for the project.
  • 63. [63] Fig 4.2: GUI developed for the project 4.3 Keil Software Keil software is used for the software implementation of the developed system. µvision 2 integrated development environments is and IDE that encapsulates a project manager, make facility, tool configuration, editor and a powerful debugger. µvision2 is used to write and compile the programs using the tools. It can transfer the assembly language as well as C code into the hex file. Keil software consists of a linker control file, Map file, Project Target, Source file group, Toolset, Linker Control File. 4.3.1 Linker control File – It is a text file µvision passes to the linker when linking. The control file includes all directives and names of object files and library files to include in the output file. 4.3.2 Map File – the map file is a listing file generated by the linker.