Implementation of Drowsiness, Vehicle Safety and Alcohol Intoxication Detection Using Raspberry PI

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

Implementation of Drowsiness, Vehicle Safety and Alcohol Intoxication Detection Using

Raspberry PI

Abstract:

Drowsiness and drunken driving causes the road accidents. This paper proposes a real time detection of
driver’s drowsiness as well as alcohol intoxication and subsequently alerting them. The main aim of this
proposed system is to reduce the number of accidents due to driver’s Drowsiness and alcohol intake to
increase the transportation safety. This proposed system contains 8-megapixels digital USB camera,
Raspberry-pi loaded with Raspbian-OS, Alcohol sensor (MQ-3) is used to detect the intake of alcohol in
percentage if the intoxication matching fails GSM get triggered on and transmits warming message. The
Raspberry-pi system board is serially interfaced with Arduino Uno. GSM, Bluetooth, relay circuitry and buzzers
are interfaced with Arduino Uno. This will perform some task like the alarm notification and switching off the
car power source.

Recently every individual person preferring to use own vehicle for transportation rather than public
transportation because of flexibility in schedule. Thefts are happening on parking and sometimes
driving insecurity places like highways. Hence the security and safety become a basic necessity for
the urban population and also everyone. In recent days vehicle security and accident prevention are
more challenging. The proposed system gives an alarm which represents vehicle tracking and
accident detection when theft and accident identifying. Raspberry-pi is the heart of the system,
which is connected to any moving vehicle, these make an easy option to track any moving vehicle
for that it matters in real time on Google-maps. An alert will be received to the authorized person,
the vehicle will be moved to stop mode through the GSM-GPRS or Wifi Module connected to the
raspberry-pi kit which is kept on inside of the vehicle. Which consist of rasp-pi-camera, sensors, and
android phone. The camera is used to take pictures when the vehicle is open or closed mode. This
system helps find-out the exact location of an accident with the server and sent the information to
an authorized person, give an alarm signal to save the human life. This system also detects the
behavior of the driver through the sensors whether he/she drowsy/drunk, the speed vehicle is
stopped. This system more securable reliable and economical.

The use of vehicle is a must for everyone. In the same way, safeguarding the vehicle against theft is
also very essential. Impediment of vehicle theft can be done remotely by an authorized person.
Embedded computing technology is an emergent field used in all the areas. A competent automotive
security system is implemented using embedded system along with Global System for Mobile (GSM)
and Fingerprint Recognition. This paper gives a literature survey on the vehicle security system using
person identification techniques. The survey mainly emphasizes on major approaches for automatic
person identification, namely fingerprint recognition and various existing vehicle security system. The
security system can be implemented using Microcontroller
Introduction:

Most of the road accidents are caused because of drowsiness and drunk driving and also working
environments, reduced sleep and time factor. Driver drowsiness and fatigue drunk driving reduces the driver
decision making capability and perception level. These two situations affect the ability to control the vehicle.
There are some techniques which are used to detect drowsiness in drivers like by sensing of driver operation
or physiological characteristics of driver like or vehicle movement etc. Traffic survey shows that driver fatigue
may be a contributory factor in up to 20% and due to alcohol drinking it is about 31% of all road accidents
[1].The primary purpose of this drowsiness and alcohol detection system is to develop a system that can
reduce the number of accidents from drowsiness and drunk driving of vehicle.[2] In the first part of the this
project is detection of drowsiness ,for that we use a camera for detecting image or face, Eye detection is the
important part of this project will be done using OpenCV.[3][4]The Input 8 megapixel camera, which is
capable of capturing real time images and video. The captured frame is to be processed by Raspberry pi.
Raspberry pi algorithm is implemented using Python.[5] Eye close detection is based on Haar cascade
classifier and canny edge detection technique and performs several comparisons from a database of positive
value and negative value of images and returns a red border rectangle over the detected area on matching.
[7][8]Eye closing rate is calculated after each 10 seconds, and if it crosses a predefined threshold value, then
Raspberry pi sends a high pulse signal serially to its slave device Arduino Uno. On receiving the high pulse
signal, the arduino performs a set of tasks like Alarm by buzzer or send message to its car owner.[9][10]On the
other hand alcohol sensor (MQ-3) is work as a breathalyzer and calculate blood alcohol content (BAC) from
breath alcohol content (BrAC).The arduino is interface with MQ-3,Bluetooth,buzzer and relay.Arduino
continuously checks alcohol content present in the air and also computes blood alcohol content in Percentage
from it.[11] If the calculated %BAC crosses the threshold limit, at that time it will get alarm through buzzer
and will turn off the relay.

In today’s world populations as increases day by day while the numbers of vehicles also increases on the
roads and highways, despite the vehicles have most essential element in our everyday life, here every
individual person preferring to use own vehicle for transportation rather than public transportation because
of flexibility in schedule, theft is happening on parking and sometimes driving insecurity places like highways.
The safe of vehicles is extremely important for the public.

These day's vehicle thefts are increasing to high as compared to other. In the automobiles, industries
thefts are expanding at an alarming rate in all over the world. For examples, a Thousands of automobiles are
lost each year in the state and half of that vehicles are recovered by the Police when they catch the from
thieves.

Usually, the problem occurred in recovering of the vehicle reaching the actual owners is not the same
jurisdiction as a compliant registered. Usually, the vehicles are recovered by the Police. They have traced the
actual owner of the vehicle from license is given by RTO office based. But this method is a lengthy and time-
consuming process for RTO officers trace out the actual owners from the records and inform to the Police
stations. From these delays, require more time to vehicles recovery to the actual owner.

Objectives:

 Track/stop the vehicle when unauthorized person theft the car.


 Capture the image of an unauthorized person when any pressure applied.
 The speed vehicle reduced/ stop when the person drowsy/drunk.
 Reduce the death after the accident by using the alarm.
 Drowsiness Detection Using Camera
 Accident detection using Tilt Sensor

Literature Survey:

In [1] This work on the real time detection of car driver drowsiness and alcoholic intoxication. This detects large
numbers of road accidents which takes place due to fatigue or alcohol drinking of driver. Computer vision and alcohol
gas sensor application is combined to an embedded system to achieve this goal. This system consist of Drowsiness
detection, alcoholic intoxication, Raspberry pi, Arduino UNO, Open CV and Embedded System.

In [2], Design of ARM based face Recognition system using Open CV library”, the authors have implemented a system
using ARM 7 based microcontroller and opencv based machine. This is interfaced to USB camera for continuous
images are captured and these images are processed with help of Opencv and compared with existing database.If the
current images are matching with any of the existing images the system generates commandto the output unit to
perform the location identification using GPS and forward the necessary information about the identified person using
GSM/GPRS to concern authorities.

In”Computer Vision System for Driver Fatigue Detection”,[3] in this system can actively monitors driver vigilance
level and alert the driver for any insecure driving condition. In that drowsiness detection of driver is based on viola
jones algorithm for face and eyes detection. System is developed using video camera, Raspberry Pi hardware, and open
source computer vision library (OpenCV) and Microsoft visual studio.

In “Tracking Eye State for Fatigue Detection”[4] the author focuses on eye states tracking. Images are capturedusing a
camera and used for tracking as input of the proposed method.In first step weuse color space for drivers’ face detection
and crop the face frombackground. In the next step, we estimate the area of the eyes andcrop image from this region.
Then top and bottom coordinates of theeyes are located using retrench the face pixels from this area andcanny operator
for edge detection. In the last step we count thenumber of white and black pixels and compare the distance
betweenthese coordinates for recognition of the driver’s fatigue.

In [8]”Advance Vehicle Control and Safety System Using Face Detection”, the design is based on computer vision and
embedded system application principles. System work is acombination of face detection, eye region detection and eye
closing rate detection in real time environment. The proposed system is realized with a digital camera supported by
embedded system board Raspberry Pi loaded with Raspian-OS and Python-IDLE with OpenCV installed. Also
different vehicle control functions like center locking and unlocking, opening and closing of windows, bonnets etc. can
be controlled by using Android mobilephone.

In, ,”Driver Behavior Analysis Using Non-Invasive sensors” [9], developed system uses an ARM7(LPC2129)
controller as the main control unit and CAN bus within a car. ARM7 is used to obtain high performance. Use of CAN
makes high-speed communication in control networks and also helps sharing of data between all nodes which results in
enhancing their collaborative work. With the help of this system we can detect ECG, eye blink and alcohol Detection.

In , “Finger Vein Recognition Based Driver Authentication and Alertness System Using GSM”, when a person wants to
drive, will just press their finger in the biometric system. When the finger vein are match automobile get ignited, this
will be keyless authentication system. If the matching fails GSM get triggered on and transmits warming message.
Same automobile has the facility to detect fatigue and intake of alcohol by the diver. GSM, camera and buzzers are
interfaced with Raspberry pi. Raspbian OS is loaded with python and open CV. Arduino is interfaced with alcohol gas
sensor.

N.Watthanawisuth,T.LomasandA.Tuantranont, “Wireless Black Box Using MEMS Accelerometer and GPS Tracking
for Accidental Monitoring of Vehicles”, Proceedings of the IEEE-EMBS International Conference on Biomedical and
Health Informatics (BHI 2012) Hong Kong and Shenzhen, China, 2-7 Jan 2012.

In the paper, ” A real-time GSM/GPS based tracking system based on GSM mobile phone” M. A. Al-Rashed,
Ousmane Abdoulaye Oumar, Damanjit Singh Faculty of Engineering, Science and the Built Environment, London
South Bank University, London, The system is able to provide real-time text alerts for speed and location.
In the paper ” Advanced Vehicle Security System” Pritpal Singh, 2Tanjot Sethi Department of Industrial design
National Institute of Technology Rourkela, India, advance vehicle security system that uses GPS and GSM system to
prevent theft and to determine the exact location of the vehicle using a microcontroller.
In the paper” Design of an Anti-theft vehicle Tracking System with a Smartphone Application” Manipal University DIAC,
Dubai, UAE. Using smart phone application the user can track the stolen vehicle with a click of a button

BLOCK DIAGRAM:
Hardware and Software Requirement:

Hardware :
1. Raspberry Pi
2. USB Camera
3. Alcohol Sensor
4. ARM Processor
5. Relay
6. Buzzer
7. Cell phone Detector
8. Tilt Sensor / Vibration Sesnor
9. Fingerprint Sensor

Software:

1. Python
2. Open CV
3. Arduino Suite
4. Embedded C

Methodology:

In this section results are obtained using software and hardware platforms to achieving the objective
of driver drowsiness detection and alcoholic intoxication. Besides eye and head movements, another
visual cue that can potentially capture one’s level of drowsiness is his/her eyes and faces detection
analysis. Making a real time application with computer vision is very effective and efficient
challenging task that needs processing powerful system. OpenCV is open source software, which is
used for creating computer vision. OpenCV is available in C, C++, and Python and Java
programming languages extension. Raspberry controller small sized ARM 11 open source controller
with the GPU provides up to 1.5Gpixels of graphics processing and processing700 MHz It can be
over clocked maximum 1500MHz Raspberry-pi can work with Raspbian operating system, which is
a light weight Linux. Raspbian OS is loaded with programming software and OpenCV. It supports
interfacing of various low level and high level peripherals including USB camera and GPIO’s. In
case of driver is in sleepy or finding fatigue, the message will be sent by using GSM and buzzer will
be turned on till the GSM positive message from car owner.. Fig. 1 shows the basic block diagram of
the proposed system. Haar Feature based Cascade Classifier technique, it is a machine learning based
approach where a cascade function is trained from a lot of positive and negative images, and this
positive image is used for detecting face region and eye region the update of region of interest ROI.
Open CV is packed with a trainer as well as detector. The open CV is used for creating user defined
object classifier. The object classifier that has been created is stored in.xml file extension classifier
can be used in the later stages of programming. Also in this paper we use canny operator edge
detection for recognize exact coordinate of eyes region. On the other hand of the system arduino is
used for detection of the alcohol consumption by the person, alcohol gas sensor or breathalyzer MQ-
3 is interfaced. Arduino will detect samples of the person who is driving drunk or not. Based on the
output from arduino, an alarm will be turned on and the car’s ignition power source can be cut down
through a relay to stop the car or preventing the driver to start the car. Cellphone ring detector used
here to detect cellphone usage during the driving and warn the driver to restrict driver not to use
mobile while driving.

In the proposed system provides security and safety. This system consist of raspberry-pi, tilt sensor,
alcohol sensor and pressure sensor are the input of the system. Here motor, motor drives, GSM
(twillio) with GPRS, buzzer is output of the system. During the normal operation of the vehicle is,
when the authorized person open door of vehicle then motor of the vehicle as start to run. Here
alcohol content is not detected, buzzer is on mode, there is no information are sent to authorized
person. Hence these systems is sleeping mode in authorized person only and normal condition
otherwise goes to active mode i.e. When the persons are drowsy/drunk, motor of the vehicle start to
reduced and come to off state. The SMS (Short Messaging Services) sent to preloaded number using
GSM (Global System For Mobile Communication), location also shared by this message. image is
captured by the USB camera connected to raspberry-pi. This images is stored on SD card of
raspberry-pi. The door of the vehicle any interruption are occurred then the IR sensor senses and
gives an information to raspberry-pi, to stop the vehicle, and SMS is sent to authorized person or
owner with the location. And also the pressure is applied by unauthorized person on vehicle then
vehicle stop to run slowly while message sent. Another most important is, when an accident occurred
raspberry-pi gives an alarm using buzzer from these reduces the death after an accidents.

Road Accidents Detection: The system design for accident detection and reporting is based on Tilt
Sensor and Pi. When vehicle meets an accident, at that time the accident will be detected by
accelerometer. MEMS accelerometer sensor can be used as a crash detector of vehicle during and
after crash. At that time vibration sensor is used as alarm application to gain attention of people
towards accident spot. According to this project when a vehicle meets with an accident, a Micro
electro mechanical system (MEMS) sensor will detects the signal and sends it to controller.
Immediately microcontroller collect the current position co-ordinates values which contains
longitude (N or S), latitude (E or W), time and date. After that the microcontroller sends the alert
message to family member or emergency medical service (EMS) Due to this alert message we can
provide immediate medical treatment at accident location and victim can get the treatment as fast as
possible.

Fingerprint Authentication: A fingerprint sensor is also used for bio-metric verification. There
are many fingerprint sensor technologies i.e. optical, capacitive, thermal, RF, ultrasonic, piezo-
electric, piezo-resistive, MEMS. Optical sensor technology has been used here. Captured finger image
is digitally processed and stored in memory as a template. The fingerprint of Vehicle’s driver is taken
by this device before the starting of vehicle. Fingerprint matching algorithm is used to compare with
previously enrolled image for checking authentication. Among correlation-based matching, ridge
feature-based matching and minutiae-based matching, last one is popular as it is efficient and
accurate. If vehicle’s location is changed without fingerprint verification, the system will consider that
something is going wrong. Then the GPS engine will collect the co-ordinate of that place and send
SMS to the cell phone number of the owner of the vehicle.

SYSTEM HARDWARE AND SOFTWARE CONFIGURATION

A. SOFTWARE CONFIGURATION
In this proposed system there are some necessary software tools required for the system includes Raspbian
operating system, Python IDLE, Open CV, computer vision software extension for python with Haar cascade classifier
and object detection ,Canny edge detector and Arduino IDE programming for alcohol sensors and corresponding
outputs and AT commands use for GSM modem for messaging purpose.

B. HARDWARE MODULES
i) RASPBERRY PI BOARD
Raspberry Pi (represented in Figure.2) is a credit card sized single-board computer. Generation 2 Model B also has 4
USB ports, 1 GB RAM, USB camera interface and 1HDMI interface and 40 GPIO allows us to control and interact
with real world.

Fig.2. Raspberry pi2 model B.

We implemented system using raspberry pi2 Model B. IT has a Broadcom BCM2836 system on chip which
includes an ARM1176JZF-S 900 MHz processor, Video Core IV GPU, and an SD card. The GPU is capable of Blu-ray
quality playback, using H.264 at 40MBits/s. It has a fast 3D core accessed using the supplied Open GL ES2.0 and Open
VG libraries. The chip specifically provides HDMI and there is no VGA support. The foundation provides Debian and
Arch Linux ARM distributions and also Python as the main programming language, with the support for BBC BASIC,
C and Perl.

ii) ARM development board

ARM7 is one of the widely used micro-controller family in embedded system application. This section is humble effort for explaining basic
features of ARM-7.ARM is a family of instruction set architectures for computer processors based on a reduced instruction set
computing (RISC)architecture developed by British company ARM Holdings.

A RISC-based computer design approach means ARM processors require significantly fewer transistors than typical processors in average
computers. This approach reduces costs, heat and power use. These are desirable traits for light, portable, battery-powered devices—including
smartphones, laptops, tablet and notepad computers), and other embedded systems. A simpler design facilitates more efficient multi-
core CPUs and higher core counts at lower cost, providing higher processing power and improved energy efficiency for servers and
supercomputers

iii) CAMERA INTERFACE


The USB camera module (shown in the Figure 4)used in this project . The camera plugs directly into the USB
connector on the Raspberry Pi. It's able to deliver clear 8MP resolution image, or 1080p HD video recording at 30fps.
This USB camera which has no infrared filter making it perfect for taking infrared photographs or photographing
objects in low light (twilight) conditions.
iv)ALCOHOL SENSOR (MQ-3)
The alcohol sensor will detect the alcohol depends on human breath i.e. if the driver has consumed alcohol, it will
be identified by his breath, and the sensor will display on the LCD regularly. The sensor is placed in front of the
driver.

Fig.6 MQ-3 alcohol gas sensor

The alcohol sensor MQ-3 is selected in this system due to its high sensitivity in detection and has good resistance
to disturb of gasoline, smoke and vapor. The sensor able to detect BAC with different concentration and classified
the range of BAC detected into a few level. The alcohol sensor MQ-3 is a heater-driven alcohol gas sensor, its
output is an analog signal which measures alcohol content.

References:

1. DwipjoySarkar and AtanuChowdhury, “A Real Time Embedded System Application for


Driver Drowsiness and Alcoholic Intoxication Detection”, International Journal of
Engineering Trends and Technology (IJETT), Volume 10, Number 9, pp. 461-465,2014
2. T.D Prasanthi,K.Rajasekhar,T.V.Janardhanarao,and B.V.V.satyanarayana,”Design of ARM
based face Recognition system using Open CV library”, International Journal of Advanced
Research in Computer & Technology(IJARCET),Volume 01,Issue-9, pp-233-240, 2012
3. Varsha.E.dahiphale and Prof.sathyanarayanaR,”Computer Vision System for Driver
Fatigue Detection”, International Journal of Advanced Rsearch in Electronics and
communication Engineering(IJARECE), volume 04,Issue-9, pp-2331-2334,2015
4. Saeid.fazli and Parisa .Esfehani,”Tracking Eye State for Fatigue Detection”, International
Conference on advanced in Computer and Electrical Engineering (ICACEE’2012), 2012
5. Lorraine Saju, ChristeenaJestine, FarhanaYasmin, and Surekha Mariam Varghese,
“Drowsiness Detection System for Drivers using Haartraining and Template Matching”,
International Journal of Engineering Applied Sciences and Technology, Vol. 1, Issue 6, pp.
106-110, 2016.
6. DhavalPimplaskar,Dr.M.S.Nagmode,AtulBorkar,”Real Time Eye Blinking Detection and
Tracking Using OpenCV”,International Journal of Engineering Research and
Application,Vol.03,Issue 05, PP-1780-1787,2013
7. Naveen M. and Sudarvizhi S., “Finger Vein Recognition Based Driver Authentication and
Alertness System Using GSM”, International Journal of Research in Engineering &
Advanced Technology (IJREAT), Volume 3, Issue 1, pp.211-216,2015
8. SrinivasuBatchu and S. Praveen Kumar, “Driver Drowsiness Detection to Reduce the
Major Road Accidents in Automotive Vehicles”, International Research Journal of
Engineering and Technology (IRJET), Volume 02, Issue 01, pp. 345-349,2015
9. L.Nikitha,J.Kiranmai,B.Vidhyalakshmi,”Driver Behaviour Analysis Using Non-Invasive
sensors”, International Journal of Advance in Engineering and Science(IJATES),Volume
03,Issue 01,pp 707-714,2015
10. Prof.Saurabh Thakur, ShekharDure, AjinkyaKhutwad,”Advance Vehicle Control and Safety
System Using Face Detection”, International Journal of Advance Research In Science And
Engineering (IJARSE),Vol.No.4,Issue 05,pp.141-146,2015
11. AshutoshU.Jadhav and N.M.Wagdarikar,”Intelligent Vehicle System for Driver
Assistance”, International Journal of Advance Research In Electrical, Electronics And
Instrumentation Engineering(IJAREEIE),Vol.No.4,Issue 07,pp.6616-6623,2015
12. Element14 website. Raspberry-Pi Technical Data Sheet
[online].Available: http://www.element14.com/community/docs/DOC-
65470/l/raspberry-pi-technical-data-sheet
13. Arduino.cc. ArduinoUno Overview [online].Available
http://arduino.cc/en/Main/arduinoBoardUno.
14. OpenCV website. Installation in Linux [online].
Available:http://docs.opencv.org/doc/tutorials/introduction/linux_install/linux_inst all.html
15. Hanwei Electronics Co., Ltd. TECHNICAL DATA MQ-3 GAS SENSOR [online].
Available: http://www.hwsensor.com
Python website. Python versions [online]. Available :https://www.python.org/download

You might also like