Thesis.pdf

  • Uploaded by: abdulsemed
  • 0
  • 0
  • June 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Thesis.pdf as PDF for free.

More details

  • Words: 8,685
  • Pages: 50
Drowsiness Detection And Accident Prevention System

KATASANI VAMSIDHAR REDDY - N120863 KANCHARANA NARAYANA RAO - N120856 SEEPANA VENKATA RAMANA -N120855 ADDANKI SANKARARAO - N120564 DARAVATH HARI NAIK - N120841 Department of Electronics and Communication Engineering Rajiv Gandhi University of Knowledge Technologies, Nuzvid This report is submitted for the partial fulfillment of the degree of Bachelor of Technology March 2018

We would like to dedicate this thesis to our well wishers.

Declaration

We hereby declare that except where specific reference is made to the work of others, the contents of this report is original and have not been submitted in whole or in part for consideration for any other degree or qualification in this, or any other university. This report is our own work and contains nothing which is the outcome of work done in collaboration with others, except as specified in the text and Acknowledgements. This report contains fewer than 65,000 words including appendices, bibliography, footnotes, tables and equations and has fewer than 130 figures. Katasani Vamsidhar Reddy, Kancharana Narayana Rao, Seepana Venkata Ramana, Addanki Sankara Rao, Daravath Hari Naik. March 2018

Acknowledgements

We extend our deepest gratitude to all those who has been part of this project. Thank you very much for all those who support us from starting onwords and encourages our each individual thought. This work is the most important achievement in our lives. This much of work is not possible without the blessings of our parents. Their continuous encouragements and blessing are the basic reason for our each and every achievement. We extend our special thanks to our project guide Mr. Vinod Babu, Assistant professor in Dept. of Electrical Engineering, who is not only a excellent professor but also a more ethical person with great insight and proper pre-planning. This much of work is only possible because of his excellent guidance in every aspect of the project. Who has been providing all facilities in on time. Thank you very much sir being part of this project and giving this great opportunity to working with you.We hope the same thing will continue further also. We thank to Mr. Venu, lab assistant in Dept. of ECE who helped us directly by providing equipment required while capturing the videos. We also thank Mr. Laksman, lab assistant in Dept. of Civil for fulfilling the requirements. We also indebted our internal supporters Mr. V. Srinivasa Rao and Mr. Prasad Rao, those help us while we are facing problem with handling the bees. We thank to all our co-workers who also working in our project and we extend our gratitude to the seniors and juniors help us while doing the project.We thank to administration of the RGUKT IIIT Nuzvid for providing the suitable and peaceful working conditions. We take this opportunity to thank all the faculty of Dept. ECE & EEE, who is directly or indirectly helped us with their genius thoughts and timely suggestions. Last but not least, we thank all our friends who always help us in every aspect and their motivation in all our efforts.

Abstract

Vehicle accidents are most common if the driving is inadequate. These happen on most factors if the driver is drowsy or if he is alcoholic. Driver’s drowsiness is recognized as an important factor in the vehicle accidents. Our aim is to present an automatic drowsiness monitoring and accident prevention system that is based on monitoring the changes in the heart beat duration. It is scientifically proven that whenever a person is feeling drowsiness his heart beats faster than the normal conditions. Tracking this heart beats we can detect whether the person is in harm’s way or not.

Table of contents List of figures

xiii

List of tables

xv

1

Introduction 1.1 Drowsiness may be due to the following: . . . . . . . . . . . . . . . . . . .

2

Experimental setup 2.1 Eye Blink Sensor . . . . . . . . . . . . . . . . . . . . . . . . 2.1.1 Description of Infrared sensor . . . . . . . . . . . . . 2.2 GSM modem . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2.1 Operations that can be performed using GSM modem: 2.3 Piezo electric sensor . . . . . . . . . . . . . . . . . . . . . . 2.3.1 Piezo electric effect . . . . . . . . . . . . . . . . . . . 2.4 Buzzer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.5 vehicle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.6 Arudino . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.7 GPS Antenna . . . . . . . . . . . . . . . . . . . . . . . . . .

3

4

1 2

. . . . . . . . . .

3 3 3 5 5 6 6 8 9 9 11

. . . . . .

13 13 13 14 15 15 15

Different approaches of analysis 4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

19 19

Theoretical description 3.1 Drowsiness . . . . . . . . . . . . . . . . . . 3.1.1 Caffier’s Study For Drowsiness . . . 3.2 Drowsiness levels according to caffier’s study 3.3 Physical parameters . . . . . . . . . . . . . . 3.3.1 Sensor . . . . . . . . . . . . . . . . . 3.3.2 BPM . . . . . . . . . . . . . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . . . . . .

. . . . . .

. . . . . . . . . .

. . . . . .

. . . . . . . . . .

. . . . . .

. . . . . . . . . .

. . . . . .

. . . . . . . . . .

. . . . . .

. . . . . . . . . .

. . . . . .

xii

Table of contents 4.2

. . . . . . . . . . . . . . .

19 20 20 20 21 23 24 24 24 24 25 26 27 28 30

Conclusions and Future works 5.1 Brief summary of the work . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2 Future work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

33 33 33

4.3

4.4

5

Trail-1:Heart Beat Sensor . . . . . . . . . 4.2.1 Features: - . . . . . . . . . . . . 4.2.2 Using heart beat sensor: - . . . . 4.2.3 Working: - . . . . . . . . . . . . 4.2.4 Code for working: . . . . . . . . 4.2.5 Drawbacks Of This Approach . . Trail-2:Image Processing . . . . . . . . . 4.3.1 Intoduction . . . . . . . . . . . . 4.3.2 Use Of Image Processing . . . . . 4.3.3 Working . . . . . . . . . . . . . . 4.3.4 Drawback of Image Processing . Main project:Eye Blink Sensor Approach 4.4.1 Code for Buzzer . . . . . . . . . 4.4.2 GSM: . . . . . . . . . . . . . . . 4.4.3 Code for GSM modem . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

List of figures 1.1

Detection of Drowsiness and Accident Prevention Block diagram . . . . . .

2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 2.10

IR Sensor . . . . . . . . . . . GSM . . . . . . . . . . . . . . Piezo Electric Sensor . . . . . Piezo Electric Sensor Working Piezo electric sensor . . . . . Buzzer . . . . . . . . . . . . . Vehicle . . . . . . . . . . . . Vehicle Red Light Rurns On . Arduino UNO . . . . . . . . . GPS Antenna . . . . . . . . .

. . . . . . . . . .

4 6 7 7 8 9 9 10 10 11

3.1 3.2 3.3

when drowsiness affected . . . . . . . . . . . . . . . . . . . . . . . . . . . Wrist heart rate monitor . . . . . . . . . . . . . . . . . . . . . . . . . . . . Heart rate monitor with a wrist receiver . . . . . . . . . . . . . . . . . . .

13 16 16

4.1 4.2 4.3 4.4 4.5

Heart Beat Sensor . . . . . . . Heart beat sensor . . . . . . . Image Processing . . . . . . . GSM Module SIM900A . . . Output After Sending Message

19 20 24 29 31

. . . . . . . . . .

. . . . .

. . . . . . . . . .

. . . . .

. . . . . . . . . .

. . . . .

. . . . . . . . . .

. . . . .

. . . . . . . . . .

. . . . .

. . . . . . . . . .

. . . . .

. . . . . . . . . .

. . . . .

. . . . . . . . . .

. . . . .

. . . . . . . . . .

. . . . .

. . . . . . . . . .

. . . . .

. . . . . . . . . .

. . . . .

. . . . . . . . . .

. . . . .

. . . . . . . . . .

. . . . .

. . . . . . . . . .

. . . . .

. . . . . . . . . .

. . . . .

. . . . . . . . . .

. . . . .

. . . . . . . . . .

. . . . .

. . . . . . . . . .

. . . . .

. . . . . . . . . .

. . . . .

. . . . . . . . . .

. . . . .

. . . . . . . . . .

. . . . .

. . . . . . . . . .

. . . . .

. . . . . . . . . .

. . . . .

. . . . .

2

List of tables 3.1

Drowsiness Levels. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

14

Chapter 1 Introduction Accidents happens on most factors if the driver is drowsy or if he is alcoholic. Driver’s drowsiness is recognized as an important factor in the vehicle accidents. The effects of drowsiness are similar to alcohol- it will make your driving inputs (steering, acceleration, braking) poorer, destroy your reaction times and blur your thought processes. The AAA says that 20The study, which examined the perceptions of sleepy driving and drunk driving of 114 young drivers (under 30) and 177 drivers over 30, found young drivers were more likely to drive sleepy than drunk and more accepting of enforcement practices for drink driving than they are for sleepy driving. Research shows a blood alcohol content (BAC) of 0.05 per cent has the same effect as being awake for 17 hours, and a BAC of 0.1 percent is roughly 20 hours, but drivers don’t consider the impairment to be the same. Over the last decade, an increased amount of effort and technology have been developed to prevent and reduce the effect of human related crashes (e.g. airbags, ABS, park sensors). Advanced technology offers some hope to avoid these up to some extent that technology called “Drowsy Driver Detection System” (DDDS) has been developed by major vehicle companies including Mercedes- Benz, Volvo, Saab, Nissan and Hyundai which detect the fatigue state of the driver to prevent possible accidents. On the other hand, these studies have limitations in terms of the use of expensive hardware (e.g. infrared cameras) and the level of automaticity. In this study, we present a low cost and fully automatic solution for handling the drowsy driver detection problem. Our duration eye-lid closures. The eye blink duration is the time spent while upper and lower eye-lids are connected. This project involves measure and controls the eye blink using IR sensor. The IR transmitter is used to transmit the infrared rays in our eyes. The IR transmitter is used to transmit the infrared rays in our eyes. The IR receiver is used to receive the reflected infrared rays from our eyes. If the eyes are close it means the output of IR receiver is high

2

Introduction

Fig. 1.1 Detection of Drowsiness and Accident Prevention Block diagram otherwise the IR receiver output is low. This to know the eye is closing or opening position of the eyes. In this project we used more Arduino coding because this is very convenient to the get results accurately. An operation flow diagram of the proposed system is shown in Figure 1.1

1.1

Drowsiness may be due to the following:

1. Chronic pain 2. Diabetes 3. Having to work long hours or different shifts (nights, weekends) 4. Changes in blood sodium levels (hyponatremia /hypernatremia) 5. Medicines (tranquilizers, sleeping pills, antihistamines) 6. Not sleeping for long enough 7. Sleep disorders (such as sleep apnea syndrome and narcolepsy) 8. Too much calcium in your blood (hypercalcemia) 9. Underactive thyroid (hypothyroidism)

Chapter 2 Experimental setup For conducting real time experiments, a setup is prepared, created an external enclosed environment. For capturing videos. In next, prepared experimental setup will be discussed. Experimental setup is consist of vehicle,Eye blink sensor ,GSM ,piezo electric Sensor,Buzzer,Arduino Board

2.1

Eye Blink Sensor

Eye Blink Sensor is used in this project to detect whether the person is in drowsiness or not by counting the number of eye blinks.we have used infrared sensor as eye blink sensor

2.1.1

Description of Infrared sensor

An infrared sensor is an electronic instrument which is used to sense certain characteristics of its surroundings by either emitting or detecting infrared radiation or both. Infrared sensors are also capable of measuring the heat being emitted by an object and detecting motion. This process involves measuring and controlling the eye blink using IR sensor. The IR transmitter is used to transmit IR rays in our eye.The IR receiver is used to receive the reflected IR rays of eye.If the eye is closed,it means the output of IR receiver is high.Otherwise the output is low. For this first we have studied about using IR sensor IR techniques used to determine eye status and to detect eye blinks.for this we can use The Arduino microcontroller and its interfacing with the IR sensor and the alarmsIR LED cab be placed to the glass of the

4

Experimental setup

Fig. 2.1 IR Sensor driver so the driver should wear a glass so that glass is incorporated with LED. this LED continuously transmit or emits the IR rays on to the eyes of the drivers.so whenever the driver closes the eye then reflection of IR will be more.whenever the driver wants close the eye then rays penetrate into eyes.IR reflected back from the closed eye and there is a photo diode also placed inside the sensor which will get the amount of the reflected light. so this photo diode is take the amount of reflected light and it will send it corresponding output to the Arduino. Initiallywe will set a threshold value to Arduino. If some amount of percentage reflected ray is back, then it states that eye is closed.If reflected ray is less than that so eye is opened. Then the Arduino compares the output that was given by photo diode and it will checks whether it is less than threshold or greater than threshold . If it is less than threshold, then no problem. But if it is greater than threshold then it will determine eye is closed. Here we have 2 kinds of situations 1) Whether the eye is closed continuously or 2) Whether the eye is closed short time like a blink so we need to come up a solution to Identify whether he is blinking his eye or closed his eye. the Arduino compares the recordings. if some of that last recordings or more than threshold value then it states that the person having feeling drowsiness. means he is closing his eyes continuously then we will rings the alarms

2.2 GSM modem

2.2

5

GSM modem

GSM is a mobile communication modem; it is stands for global system for mobile communication (GSM). The idea of GSM was developed at Bell Laboratories in 1970. It is widely used mobile communication system in the world. GSM is an open and digital cellular technology used for transmitting mobile voice and data services operates at the 850MHz,900 MHz, 1800MHz and 1900MHz frequency bands. GSM system was developed as a digital system using time division multiple access (TDMA) technique for communication purpose. A GSM digitizes and reduces the data, then sends it down through a channel with two different streams of client data, each in its own particular time slot. The digital system has an ability to carry 64 kbps to 120 Mbps of data rates. A GSM modem is a device which can be either a mobile phone or a modem device which can be used to make a computer or any other processor communicate over a network. A GSM modem requires a SIM card to be operated and operates over a network range sub scribed by the network operator. It can be connected to a computer through serial, USB or Bluetooth connection. The GSM modem has wide range of applications in transaction terminals, supply chain management, security applications, weather stations and GPRS mode remote data logging.

2.2.1

Operations that can be performed using GSM modem:

1. We can read, write and delete SMS messages. 2. We can start Sending SMS messages. 3. We can reply to a SMS message. 4. We can monitor the signal strength in particular locality 5. We can monitor the charging status and also the charge level in the battery. 6. We can read, write and search phone book entries. 7. We can use it in various projects for different purposes.

6

Experimental setup

Fig. 2.2 GSM

2.3

Piezo electric sensor

This is used to detect whether the accident has been occured or not to know the working principle of this first of all we need to know about piezo electric effect

2.3.1

Piezo electric effect

Piezoelectric transducers are based on the property of accumulating charges if stressed (direct effect)and to strain in case of an electric signal is applied across their electrodes (inverse effect) Normally, piezoelectric crystals are electrically neutral. A positive charge in one place cancels out a negative charge nearby. However, if the piezoelectric crystal in squeezed, pushing some of the atoms closer together or further apart (upsetting the balance of positive and negative), this will bring to a net electrical charges. This effect carries through the whole structure so net positive and negative charges appear on opposite, outer faces of the crystal. One disadvantage of piezoelectric sensors is that they cannot be used for truly static measurements. A static force results in a fixed amount of charge on the piezoelectric material. In conventional readout electronics, imperfect insulating materials and reduction in internal sensor resistance causes a constant loss of electrons and yields a decreasing signal. Elevated temperatures cause an additional drop in internal resistance and sensitivity. The main effect on the piezoelectric effect is that with increasing pressure loads and temperature, the sensitivity reduces due to twin formation. While quartz sensors must be cooled during

7

2.3 Piezo electric sensor

Fig. 2.3 Piezo Electric Sensor

Fig. 2.4 Piezo Electric Sensor Working

8

Experimental setup

Fig. 2.5 Piezo electric sensor measurements at temperatures above 300 °C, special types of crystals like GaPO4 gallium phosphate show no twin formation up to the melting point of the material itself. However, it is not true that piezoelectric sensors can only be used for very fast processes or at ambient conditions. In fact, numerous piezoelectric applications produce quasi-static measurements, and other applications work in temperatures higher than 500 °C. Piezoelectric sensors can also be used to determine aromas in the air by simultaneously measuring resonance and capacitance. Computer controlled electronics vastly increase the range of potential applications for piezoelectric sensors. Piezoelectric sensors are also seen in nature. The collagen in bone is piezoelectric, and is thought by some to act as a biological force sensor.

2.4

Buzzer

A buzzer or beeper is an audio signalling device, which may be mechanical, electromechanical, or piezoelectric (piezo for short). Typical uses of buzzers and beepers include alarm devices, timers, and confirmation of user input such as a mouse click or keystroke. A simple alarm buzzer will be used to alert the driver during drowsiness or sleepiness. After alarming the driver, the driver will alert if the driver will alert then there the switch will be provided there, then he can press the switch after that the vehicle will move normal condition means it’s starts from as it is. At that if he doesn’t press the switch then the next step will be processed.

9

2.5 vehicle

Fig. 2.6 Buzzer

Fig. 2.7 Vehicle

2.5

vehicle

Vehicle is constructed using Aurdino programming.It is a four Wheeler vehicle .When the driver is drowsy, his vehicle can hit the nearby vehicles too. Therefore, to alert them this system will blink the headlights and rear lights of this vehicle.

2.6

Arudino

What is Arduino UNO ? The Arduino Uno is a microcontroller board based on the ATmega328 (datasheet). It has 14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz ceramic resonator, a USB connection, a power jack, an ICSP header, and a reset button. what is Arduino IDE Arduino consists of both a physical programmable circuit board (often referred to as a micro-

10

Experimental setup

Fig. 2.8 Vehicle Red Light Rurns On

Fig. 2.9 Arduino UNO controller) and a piece of software, or IDE (Integrated Development Environment) that runs on your computer, used to write and upload computer code to the physical board. The use of Arduino Board Arduino is an open-source electronics platform based on easy-to-use hardware and software. Arduino boards are able to read inputs - light on a sensor, a finger on a button, or a Twitter message - and turn it into an output - activating a motor, turning on an LED, publishing something online. How this will be used in this project Arduino board is used in this project to write the code for the following purposes 1. Alarming the Buzzer 2. To drive the vehicle 3. for measuring the number of Eye blinks and to comapare it with the desired count

11

2.7 GPS Antenna

Fig. 2.10 GPS Antenna 4. for sendig information through GSM 5. And to stop the vehicle

2.7

GPS Antenna

GPS stands for global position system. The content of the message will include the exact position of the concerned vehicle. So that the help could reach the person as soon as possible. This would be done using the GPS antenna which will give the location of the drive in longitudes and latitudes.

Chapter 3 Theoretical description In last discussed chapter,we gave description about all the equipment used in the project.In this chapter we will discuss about the theory behind drowsiness and the levels for drowsiness and we will define some parameters

3.1

Drowsiness

Drowsiness may lead to additional symptoms, such as forgetfulness or falling asleep at inappropriate times. Feeling abnormally sleepy or tired during the day is commonly known as drowsiness. Drowsiness may lead to additional symptoms, such as forgetfulness or falling asleep at inappropriate times.

3.1.1

Caffier’s Study For Drowsiness

BACKGROUND AND PURPOSE: To evaluate the spontaneous eye-blink as drowsiness/sleepiness indicator in patients with obstructive sleep apnoea (OSA) syndrome.

Fig. 3.1 when drowsiness affected

14

Theoretical description

PATIENTS AND METHODS: Using a contact-free sensor for the recording of spontaneous eye-blinks, we investigated the diagnostic value of spontaneous blink parameters in 21 OSA patients. Before the study, all patients underwent a night of polysomnography. Eye-blinks were studied the following morning before therapy, and again after the first therapy night with nasal continuous positive airway pressure (nCPAP), to investigate whether blink parameters reflected changes of alertness pre- and post-nCPAP treatment. General daytime sleepiness was assessed using the Epworth Sleepiness Scale (ESS). The current subjective state was determined by means of standardised questionnaires directly before recording the eye-blinks. Studies were conducted in two sleep laboratories in hospitals. RESULTS: In OSA patients with excessive daytime sleepiness (EDS; ESS >10, respiratory disturbance index [RDI]=42.4) several parameters proved informative for sleepiness diagnostics. Reduction of blink duration and reopening time as well as increase in blink frequency were significant; furthermore, proportion of long-closure duration blinks indicated reduced sleepiness. OSA patients without EDS (ESS < or =10, RDI=33.5) did not reveal systematic changes of the blink parameters registered after one night of nCPAP intervention. CONCLUSIONS: Specific parameters of the spontaneous eye-blink may be applied as a sleepiness index for diagnostics in OSA patients. Further studies are needed to prove the diagnostic value of blink parameters and their advantages in comparison to subjective measures commonly used in clinical studies.

3.2

Drowsiness levels according to caffier’s study

The following table describes the drowsiness levels S.NO. 1 2 3

Table 3.1 Drowsiness Levels. Drowsiness Level Description Awake Blink durations < Td Drowsy Blink durations >Td and Blink durations Ts

3.3 Physical parameters

3.3 3.3.1

15

Physical parameters Sensor

In the broadest definition, a sensor is a device, module, or subsystem whose purpose is to detect events or changes in its environment and send the information to other electronics, frequently a computer processor. A sensor is always used with other electronics, whether as simple as a light or as complex as a computer. Sensors are used in everyday objects such as touch-sensitive elevator buttons (tactile sensor) and lamps which dim or brighten by touching the base, besides innumerable applications of which most people are never aware. With advances in micromachinery and easy-to-use microcontroller platforms, the uses of sensors have expanded beyond the traditional fields of temperature, pressure or flow measurement,for example into MARG sensors. Moreover, analog sensors such as potentiometers and force-sensing resistors are still widely used. Applications include manufacturing and machinery, airplanes and aerospace, cars, medicine, robotics and many other aspects of our day-to-day life. A sensor’s sensitivity indicates how much the sensor’s output changes when the input quantity being measured changes. For instance, if the mercury in a thermometer moves 1 cm when the temperature changes by 1 °C, the sensitivity is 1 cm/°C (it is basically the slope Dy/Dx assuming a linear characteristic). Some sensors can also affect what they measure; for instance, a room temperature thermometer inserted into a hot cup of liquid cools the liquid while the liquid heats the thermometer. Sensors are usually designed to have a small effect on what is measured; making the sensor smaller often improves this and may introduce other advantages.Technological progress allows more and more sensors to be manufactured on a microscopic scale as microsensors using MEMS technology. In most cases, a microsensor reaches a significantly higher speed and sensitivity compared with macroscopic approaches.

3.3.2

BPM

Heart rate is the speed of the heartbeat measured by the number of contractions of the heart per minute (bpm). The heart rate can vary according to the body’s physical needs, including the need to absorb oxygen and excrete carbon dioxide. It is usually equal or close to the pulse measured at any peripheral point. Activities that can provoke change include physical exercise, sleep, anxiety, stress, illness, and ingestion of drugs. Several studies, as well as expert consensus, indicate that the normal resting adult human heart rate is probably a range

16

Theoretical description

Fig. 3.2 Wrist heart rate monitor

Fig. 3.3 Heart rate monitor with a wrist receiver between 50 and 90 bpm. Measurement: Heart rate is measured by finding the pulse of the heart. This pulse rate can be found at any point on the body where the artery’s pulsation is transmitted to the surface by pressuring it with the index and middle fingers; often it is compressed against an underlying structure like bone. (A good area is on the neck, under the corner of the jaw.) The thumb should not be used for measuring another person’s heart rate, as its strong pulse may interfere with the correct perception of the target pulse. The radial artery is the easiest to use to check the heart rate. However, in emergency situations the most reliable arteries to measure heart rate are carotid arteries. This is important mainly in patients with atrial fibrillation, in whom heart beats are irregular and stroke volume is largely different from one beat to another. In those beats following a shorter diastolic interval left ventricle doesn’t fill properly, stroke volume is lower and pulse wave is not strong enough to be detected by palpation on a distal artery like the radial artery. It can be detected, however, by doppler Possible points for measuring the heart rate are:

3.3 Physical parameters

17

1. The ventral aspect of the wrist on the side of the thumb (radial artery). 2. 2. The ulnar artery. 3. 3. The neck (carotid artery). 4. 4. The inside of the elbow, or under the biceps muscle (brachial artery). 5. 5. The groin (femoral artery). 6. 6. Behind the medial malleolus on the feet (posterior tibial artery). 7. 7. Middle of dorsum of the foot (dorsalis pedis). 8. 8. Behind the knee (popliteal artery). 9. 9. Over the abdomen (abdominal aorta). 10. 10. The chest (apex of the heart), which can be felt with one’s hand or fingers. It is also possible to auscultate the heart using a stethoscope. 11. 11. The temple (superficial temporal artery). 12. 12. The lateral edge of the mandible (facial artery). 13. 13. The side of the head near the ear (posterior auricular arter Electronic measurement: In obstetrics, heart rate can be measured by ultrasonography, such as in this embryo (at bottom left in the sac) of 6 weeks with a heart rate of approximately 90 per minute. A more precise method of determining heart rate involves the use of an electrocardiograph, or ECG (also abbreviated EKG). An ECG generates a pattern based on electrical activity of the heart, which closely follows heart function. Continuous ECG monitoring is routinely done in many clinical settings, especially in critical care medicine. On the ECG, instantaneous heart rate is calculated using the R wave-to-R wave (RR) interval and multiplying/dividing in order to derive heart rate in heartbeats/min. Multiple methods exist:

• HR = 1,500/(RR interval in millimeters) • HR = 60/(RR interval in seconds) • HR = 300/number of "large" squares between successive R waves.

18

Theoretical description • HR= 1,500 number of large blocks

Heart rate monitors allow measurements to be taken continuously and can be used during exercise when manual measurement would be difficult or impossible (such as when the hands are being used). Various commercial heart rate monitors are also available. Some monitors, used during sport, consist of a chest strap with electrodes. The signal is transmitted to a wrist receiver for display.

Chapter 4 Different approaches of analysis 4.1

Introduction

In previous chapters, we discussed the clear view of required experimental setup and theoretical description. In this chapter, we are going to involve the multiple ways of approaches for drowsiness detection. We will explain the various trajectories related to each conclusion.

4.2

Trail-1:Heart Beat Sensor

Heart beat sensor is designed to give digital output of heat beat when a finger is placed on it. When the heart beat detector is working, the beat LED flashes in unison with each heartbeat. This digital output can be connected to microcontroller directly to measure the Beats Per Minute (BPM) rate. It works on the principle of light modulation by blood flow through finger at each pulse. Beat sensor.jpg Beat sensor.jpg Beat sensor.jpg Beat sensor.jpg

Fig. 4.1 Heart Beat Sensor

20

Different approaches of analysis

Fig. 4.2 Heart beat sensor

4.2.1

Features: -

1. Heart beat indication by LED 2. Instant output digital signal for directly connecting to microcontroller 3. Compact Size 4. Working Voltage +5V DC

4.2.2

Using heart beat sensor: -

Connect regulated DC power supply of 5 Volts. Black wire is Ground, Next middle wire is Brown which is output and Red wire is positive supply. These wires are also marked on PCB. To test sensor you only need power the sensor by connect two wires +5V and GND. You can leave the output wire as it is. When Beat LED is off the output is at 0V. Put finger on the marked position, and you can view the beat LED blinking on each heartbeat. The output is active high for each beat and can be given directly to microcontroller for interfacing applications.

4.2.3

Working: -

• Heart Beat Sensor is designed to give digital output of heart beat when a finger is placed on it. • When the heart beat detector is working, the beat LED flashes in unison with each heartbeat. • This digital output can be connected to the microcontroller directly to measure the Beats Per Minute(BPM) rate.

4.2 Trail-1:Heart Beat Sensor

21

• It works on the principle of light modulation of blood flow through finger at each pulse.

4.2.4

Code for working:

#include int Con=20; LiquidCrystal lcd(12,11,5,4,3,2); int i=0; int lag=0; int von; int a,b,c; int on=A4; int nthresh; int upthresh=575; int heart=A0; int array1[5]; int bpm; int avg; int vout; int dc=7; int pin=13; void setup() analogWrite(6,Con); lcd.begin(16,2); // put your setup code here, to run once: pinMode(heart,INPUT); pinMode(on,INPUT); pinMode(dc,OUTPUT); pinMode(pin,OUTPUT); digitalWrite(dc,HIGH); Serial.begin(9600); void loop() von=analogRead(on); vout=analogRead(heart); Serial.println(vout); if(von>1000)

22

while(i<=4) vout=analogRead(heart); for(;vout>upthresh;) vout=analogRead(heart); if(vout>=lag) lag=vout; nthresh=vout-10; continue; else array1[i]=millis(); i=i+1; while(vout>=upthresh) vout=analogRead(heart); if(i==1) upthresh=nthresh; lag=0;

if(i==5) a=array1[2]-array1[1]; b=array1[3]-array1[2]; c=array1[4]-array1[3]; avg=(a+b+c)/3; bpm=60000/(avg+115); Serial.println(avg); Serial.println("BPM: "); Serial.print(bpm);

Different approaches of analysis

4.2 Trail-1:Heart Beat Sensor

23

// put your main code here, to run repeatedly: lcd.setCursor(0,0); lcd.print("Your BPM is "); lcd.setCursor(0,1); lcd.print(bpm); if(bpm>95) digitalWrite(pin,HIGH); delay(1000); digitalWrite(pin,LOW); delay(1000); while(1)

delay(10); //loop

4.2.5

Drawbacks Of This Approach

1. The sensor is sensitive to light. i.e.., when light falls on it cannot detect the heart-beat. So a holder should be put around the sensor which doesn’t allow light into it. 2. The heart rate of a person is not exactly same to everyone. It varies with age, sex, health issues (specially asthma and cardiac diseases). These shows an unwanted results while driving the vehicle as it cannot detect the drowsiness of that person. 3. It should be worn (around the finger or to the skull or to the chest) which is not desirable. Instead it can be placed exactly to the steering where the finger is meant to be placed. 4. Very costly. 5. Very sensitive to handle.

24

Different approaches of analysis

Fig. 4.3 Image Processing

4.3 4.3.1

Trail-2:Image Processing Intoduction

Digital image processing is the use of computer algorithms to perform image processing on digital images. As a subcategory or field of digital signal processing, digital image processing has many advantages over analog image processing. It allows a much wider range of algorithms to be applied to the input data and can avoid problems such as the build-up of noise and signal distortion during processing. Since images are defined over two dimensions (perhaps more) digital image processing may be modeled in the form of multidimensional systems.

4.3.2

Use Of Image Processing

However, image processing is more accurately defined as a means of translation between the human visual system and digital imaging devices. The human visual system does not perceive the world in the same manner as digital detectors, with display devices imposing additional noise and bandwidth restrictions.

4.3.3

Working

Digital image processing algorithms can be used to: 1. Convert signals from an image sensor into digital images. 2. Improve clarity, and remove noise and other artifacts.

4.3 Trail-2:Image Processing

25

3. Extract the size, scale, or number of objects in a scene. 4. Prepare images for display or printing. 5. Compress images for communication across a network. MATLAB: MATLAB is a general purpose programming language. When it is used to process images one generally writes function files, or script files to perform the operations. These files form a formal record of the processing used and ensures that the final results can be tested and replicated by others should the need arise.

MATLAB has several advantages over other methods or languages: Its basic data element is the matrix. A simple integer is considered an matrix of one row and one column. Several mathematical operations that work on arrays or matrices are built-in to the Matlab environment. so we use MATLAB here in this project.

4.3.4

Drawback of Image Processing

Devices worn to detect eye-blink have included mirrors, lenses, or cameras placed near the eye or in some instances special contact lenses to be placed on the eye. All the methods aim to obtain high-resolution or easily identifiable images of the eye that are independent of head-position. Again, as for head-pose direction, wearing a device of any sort is a disadvantage, as the user’s competence and acceptance to wearing the device then directly effects the reliability. Devices are generally intrusive and will affect a user’s behaviour, interfering with natural motion and operation. The infra-red technique involves shining an infra-red light on the face of the person being monitored then detecting and analysing the reflections from the person’s eyes. Infra-red reflection techniques operate by detecting either the reflection from the eye surface, or cornea of the eye, or both. The first reflection is from the spherical eye surface. This reflection determines the position of the eye. If the video camera is collocated with the source of the infra-red, the position of the reflection directly measures the position of the eyeball centre. The cornea, on

26

Different approaches of analysis

the other hand, acts as a corner reflector. Image processing is used to detect reflections from the eye surface or cornea, and to localise the centre of the limbus. An accurate gaze estimate can then be computed using the relative position difference between the iris centre and the reflections. Infra-red sensing can yield very precise eye-blink measurement. However, the technique is limited for the following reasons:

1. The cornea can only reflect light back to a source (act as a corner reflector) over a small range of angles. This limits the use of infra-red to applications where gaze is restricted to a small area 2. Natural lighting conditions can easily confuse the reflection detection process. Flashing techniques are often used to improve reliability, however saturation of the pupil with sunlight will cause a flashing detector to fail. Fluctuating light on the pupil, typical of driving conditions, will also produce erroneous measurements. 3. Techniques to compensate for motion toward or away from the camera are based on measuring the image area of the reflections or other regions on the face, and are prone to noise due to resolution constraints, overlapping reflections from other light sources, and distortion introduced by rotation of the head. Conclusion: So the best way for measuring the eye blink count is simply by a IR sensor which gives less erroneous and more comfort for detecting.

4.4

Main project:Eye Blink Sensor Approach

Total working of the system can be divided into four parts. 1. Drowsiness detection. 2. Alarming system. 3. Accident prevention system. 4. Information through GPS/GPRS.

4.4 Main project:Eye Blink Sensor Approach

27

1. Drowsiness Detection: The eye blink count of the driver is done by the IR Sensor fixed to the glasses. If the count exceeds to the fixed value or a pre-defined range, then this output is given to the alarming system that tries to wake the person. 2. Alarming System: A buzzer is provided and it buzzes if the output of the IR sensor is true. It buzzes for a duration of 30-40 seconds and an electronic switch is provided to ensure if the person is awake. Now there are two cases whether the switch provided is ON/OFF. Case(i): If the switch is pushed, i.e., ON the person was awake and thus the car moves normally Case(ii):If the switch is not pushed, i.e., OFF the person was still drowsy and then certain preventive measures like indicating others that the person is drowsy is done and this all is controlled in the accident prevention system.

3. Accident Prevention System: Now here comes the major part of the project where accidents occurs within seconds and the compensation is Invaluable. If the switch provided is not ON then the front and back headlights blinks continuously for a period of time indicating the other vehicle drivers to be safety that the person inside is drowsy and automatic brakes are applied slowly to halt the vehicle. Even in this case there might be a possibility of sudden driving by the person and this may cause accidents. So in order to reduce the cost of life a GPS/GPRS system is used to send the information for fast response. 4. Information through GPS/GPRS: A GPS/GPRS system is installed in the vehicle so that incase of unnatural happenings like occurrence of accidents, a message is sent to nearby hospital or police station or to the family along with its actual location for fast medical response thus saving the life of the person.

4.4.1

Code for Buzzer

int pin=12; void setup() // put your setup code here, to run once: pinMode(pin,OUTPUT);

void loop()

28

Different approaches of analysis

// put your main code here, to run repeatedly: digitalWrite(pin,HIGH); delay(1000); digitalWrite(pin,LOW); delay(1000);

4.4.2

GSM:

GSM stands for Global System for Mobile.There are different kinds of GSM modules available in market. The most popular module is based on Simcom SIM900 and Arduino Uno. A GSM Module is basically a GSM Modem (like SIM 900) connected to a PCB with different types of output taken from the board – say TTL Output (for Arduino, 8051 and other microcontrollers) and RS232 Output to interface directly with a PC (personal computer). The board will also have pins or provisions to attach mic and speaker, to take out +5V or other values of power and ground connections. These type of provisions vary with different modules. One of the key features of GSM is the Subscriber Identity Module, commonly known as a SIM card. The SIM is a detachable smart card containing the user’s subscription information and phone book. This allows the user to retain his or her information after switching handsets. Alternatively, the user can also change operators while retaining the handset simply by changing the SIM. Some operators will block this by allowing the phone to use only a single SIM, or only a SIM issued by them; this practice is known as SIM locking. Types Of GSM Modems: There are many GSM modems are available in market Simcom SIM300, SIM900 and Quectel M10. lets review on its features Points to consider while choosing GSM Modem There are may GSM modems available in market these are SIM300, SIM900 and SIM900A, Quectel M10 is much reliable and a little bit costly. 1. Power supply requirement 2. Available interface UART(TTL) or RS232 3. Size 4. Price 5. Audio interface(MIC/SPK)

4.4 Main project:Eye Blink Sensor Approach

29

Fig. 4.4 GSM Module SIM900A Power Supply Requirement Most GSM modem require 4.2V to operate and they are compatible with 5V and 3.3V some modems are also available in 3.3V. depending on your microcontroller requirement choose correct modem. GSM modem requires more current while sending SMS, making call and during registering on network. Remember always use 2 Amp Power supply. Most new people make mistakes in selecting correct power supply this will cause problem or modem reset while sending SMS. Booting the GSM Module! 1. Insert the SIM card to GSM module and lock it. 2. Connect the adapter to GSM module and turn it ON! 3. Now wait for some time (say 1 minute) and see the blinking rate of ‘status LED’ or ‘network LED’ (GSM module will take some time to establish connection with mobile network) 4. Once the connection is established successfully, the status/network LED will blink continuously every 3 seconds. You may try making a call to the mobile number of the

30

Different approaches of analysis sim card inside GSM module. If you hear a ring back, the gsm module has successfully established network connection.

Okay! Now let’s see how to connect a gsm module to Arduino! Connecting GSM Module to Arduino There are two ways of connecting GSM module to arduino. In any case, the communication between Arduino and GSM module is serial. So we are supposed to use serial pins of Arduino (Rx and Tx). So if you are going with this method, you may connect the Tx pin of GSM module to Rx pin of Arduino and Rx pin of GSM module to Tx pin of Arduino. You read it right ? GSM Tx –> Arduino Rx and GSM Rx –> Arduino Tx. Now connect the ground pin of arduino to ground pin of gsm module! So that’s all! You made 3 connections and the wiring is over! Now you can load different programs to communicate with gsm module and make it work.

4.4.3

Code for GSM modem

int pin=A2; int vout; void setup() pinMode(A0,INPUT); pinMode(9,OUTPUT); Serial.begin(9600); void loop() vout=analogRead(pin); Serial.println(vout); if(vout>1000) delay(10000); //Give enough time for GSM to register on Network SendSMS(); //Send one SMS while(1); //Wait forever

4.4 Main project:Eye Blink Sensor Approach

31

Fig. 4.5 Output After Sending Message void SendSMS() Serial˙println("AT+CMGF=1"); //To send SMS in Text Mode delay(1000); ¨ Serial˙println("AT+CMGS=}"+919951542515}r"); //Change to destination phone number delay(1000); Serial˙println("Accident has been occured...........need immediate help");//the content of the message delay(200); Serial˙println((char)26); //the stopping character Ctrl+Z delay(1000); } Note: As these happens in very less time say a few seconds the time delay of entire system should be so minute may be micro or nano seconds.

Chapter 5 Conclusions and Future works 5.1

Brief summary of the work

In this report, we explained the constrains for detecting drowsiness and accident prevention and different manual approaches of detecting drowsiness and accident prevention with suitable figures. We also included the complete experimental setup for preparing the Project. After that,we gave theoritical description about various parameters and then we discussed the various approaches of drowsiness detection.and finally discussed the main project work with eye blink sensor Eye Blink count cannot be most accurate in terms of detecting drowsiness. An IR sensor can causes damage to eye sight for continuous use and it is light sensitive. Heart beat sensor can detect accurate drowsiness but it may vary from person to person. A disadvantage is the heart rate, as it deals with the emotions such as tension, fear, sad, happy where the heart rate can match the fixed value and thus causes halt of the vehicle. Thus, using a system consisting of both eye blink and Heart rate detection can help detect drowsiness accurately. Finally a network can be created using a simple arduino board and such a system can save at least 70

5.2

Future work

Well, the following approaches for detecting the drowsiness of a person each one has its own advantages and disadvantages. The future scope of this project are as follows.

34

Conclusions and Future works

Using Artificial Intelligence the entire process is given to a learning mechanism such that there will be automatic detection of drowsiness and accidents prevention. It can be improved to wireless mechanism because to detect drowsiness we need to wear glasses, or put on a pulse sensor to the body which causes a must and should for safety purpose. Instead it can be made wireless so that the driving is comfort.

More Documents from "abdulsemed"