Project Report
Project Report
INTRODUCTION
1
Driver fatigue is a significant factor in a large number of vehicle accidents. Recent statistics estimate that
annually 1,200 deaths and 76,000 injuries can be attributed to fatigue related crashes.
Drowsiness increases the impairment caused by alcohol. Teenagers, professional drivers (including truck
drivers) military personnel on leave, and shift workers are at particular risk.
Drowsiness appears in situations of stress and fatigue in an unexpected and inopportune way and may be
produced by sleep disorders, certain types of medications, and even, boredom, for example, driving for
long periods of time. The sleeping sensation reduces the level of vigilante producing danger situations and
increases the probability of an accident occurring.
The development of technologies for detecting or preventing drowsiness at the wheel is a major challenge
in the field of accident avoidance systems. Because of the hazard that drowsiness presents on the road,
methods need to be developed for counteracting its affects.
The innovations in the automobile industry over the last hundred years have made our vehicles more
powerful, easier to drive and control safer more energy efficient, and more environmentally friendly.
Majority of the accidents caused today by cars are mainly due to the driver fatigue. Driving for a long
period of time causes excessive fatigue and tiredness which in turn makes the driver sleepy or loose
awareness. With the rapid increase in the number of accidents seems to be increasing day to day.
Therefore a need arises to design a system that keeps the driver focused on the road. Data on road
accidents in India are collected by Transport Research Wing of Ministry of Road Transport & Highways.
The aim of this paper is to develop a prototype of drowsy driver warning system. Devices to detect when
drivers are falling asleep and to provide warnings to alert them of the risk, or even control the vehicle’s
movement, have been the subject to much research and development. Driver fatigue is a serious problem
resulting in many thousands of road accidents each year. It is not currently possible to calculate the exact
number of sleep related accidents because of the difficulties in detecting whether fatigue was a factor and
in assessing the level of fatigue. However research suggests that up to 25% of accidents on monotonous
roads in India are fatigue related. Research in other countries also indicates that driver fatigue is a serious
problem. Young male drivers, truck drivers, company car drivers and shift workers are the most at risk of
falling asleep while driving. However any driver travelling long distances or when they are tired, it is at
the risk of a sleep related accidents. The early hours of the morning and the middle of the afternoon are the
peak times for fatigue accidents and long journeys on monotonous roads, particularly motor-ways, are the
most likely to result in a driver falling asleep.
As a solution I made a smart cap an innovative solution to travel fatigue, the wearable device detects
driver’s movements that indicate drowsiness, drivers are alerted by vibrations, sound and lights from the
device, which looks like a common Cap.
Primarily, this headgear is intended for use by long distance truck drivers, as well as taxi drivers. Equally,
there is much benefit in use by non-commercial drivers too, and the regular public is not exempt from the
risk of themselves nodding-off while driving. The cap is equipped with gyroscopes and a number of
digital instruments that register the position and movement of a driver’s head. This high-tech cap analyzes
the readings of all of its onboard instruments and, if a sudden change in the position of the head or its
tilting is recorded, the cap begins to vibrate vigorously, as well blink LEDs into a driver’s eyes from their
location on the cap’s brim.
It is hoped and intended that this unique product and its system will shock a driver into lucidity
sufficiently enough to provide a burst of energy that will facilitate their finding a safe place to stop to
recuperate, before commencing their onward journey.
2
CHAPTER-2
PROBLEM
3
2.1 CAUSES OF ROAD ACCIDENTS IN INDIA
Distracted Driving
Holes in roads - especially during rainy season
Driving in wrong way
Incompletion lighting along the road at night
Drowsy Driving
Drunken Driving
Rash and negligent driving
Jumping from traffic signal
Over take -over speeding and so on
In this project we are going to tackle the most under-rated cause of road accident which is drowsy driving.
Many traffic researchers believe drowsy driving has been under-reported and underestimated. It has been
estimated that drowsiness causes between 10% and 20% of traffic accidents, causing both fatalities and
injuries. Whereas within the trucking industry 57% of fatal truck accidents are caused by this problem.
30% of all traffic accidents have been caused by drowsiness.20% of all accidents are caused by fatigue
and lack of attention.
• In the USA, drowsiness is responsible for 100,000 traffic accidents.
• In Germany, one out of four traffic accidents originate from drowsiness.
• In England 20% of all traffic accidents are produced by drowsiness.
• In Australia 1,500 million dollars has been spent on fatalities resulting from this problem.
There is insufficient data present on this problem in India.The Times of India has merely 800 results for
sleepy driver’ but a whopping 2.23 lakh for speeding car.
One in six (16.5%) of deadly crashes, one in eight of crashes resulting in a hospitalization, and one in
eight out of fourteen crashes in which a vehicle had to be towed involved a drowsy driver.
The National Highway Safety Administration (NHSA) estimates that drowsy driving results in 1,550
deaths, 71,000 injuries and more than 100,000 accidents per year.
4
2.2 WHAT IS DROWSY DRIVING?
Drowsy driving, also refers to as ‘driver fatigue’, occurs when someone is too tired to operate a motor
vehicle due to sleepiness and fatigue.
Drowsy driving, the dangerous combination of sleepiness and driving or driving while fatigued, and can
result from many underlying causes, including excessive sleepiness, sleep deprivation, changes in
circadian rhythm due to shift work, fatigue, medications with sedatives and consuming alcohol when tired.
The cumulative effects of these factors have severe effects on performance, alertness, memory,
concentration and reaction times.
6
CHAPTER 3
SOLUTION
7
3.1 INNOVATION
SMART CAP
An innovative solution to travel fatigue. The wearable device detects driver’s movements that indicate
drowsiness. Drivers are alerted by vibrations, sound and lights from the device, which looks like a
common cap. It comes equipped with sensors capable of interpreting the driver’s head movements to warn
if the user is tired or sleepy behind the wheel.
The alert is issued by three kinds of signals:-
-vibration
-sound
-light flashes
to guide the driver to stop for a rest before following with the drip.
Primarily, this headgear is intended for use by long distance truck drivers, as well as taxi drivers. Equally,
there is much benefit in use by non-commercial drivers too, and the regular public is not exempt from the
risk of themselves nodding-off while driving. The cap is equipped with gyroscopes and a number of
digital instruments that register the position and movement of a driver’s head. This high-tech cap analyzes
the readings of all of its onboard instruments and, if a sudden change in the position of the head or its
tilting is recorded, the cap begins to vibrate vigorously, as well blink LEDs into a driver’s eyes from their
location on the cap’s brim.
8
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.
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 micro machinery and easy-to-use microcontroller platforms, the uses of
sensors have expanded beyond the traditional fields of temperature, pressure or flow measurement,[1] 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 micro sensors using MEMS technology. In most cases, a
micro sensor reaches a significantly higher speed and sensitivity compared with macroscopic approaches.
• Temperature Sensor
• Proximity Sensor
• IR Sensor (Infrared Sensor)
• Pressure Sensor
• Light Sensor
• Ultrasonic Sensor
• Smoke Sensor
• Gas Sensor
• Alcohol Sensor
• Touch Sensor
• Color Sensor
• Humidity Sensor
• Tilt Sensor
• Flow and Level Sensor
In this project we are going to use an accelerometer which is a type of tilt sensor in order to detect the
movement of head beyond a certain angle to activate the alert system.
9
3.2 BLUEPRINT
10
11
CHAPTER-4
12
4.1 ALGORITHM
Block Diagram
13
Circuit diagram
14
SOURCE CODE FOR ACCELEROMETER
#define OUTPUT_READABLE_YAWPITCHROLL
#define INTERRUPT_PIN 2 // use pin 2 on Arduino Uno & most boards
#define LED_PIN 13 // (Arduino is 13, Teensy is 11, Teensy++ is 6)
bool blinkState = false;
// orientation/motion vars
Quaternion q; // [w, x, y, z] quaternion container
VectorInt16 aa; // [x, y, z] accel sensor measurements
VectorInt16 aaReal; // [x, y, z] gravity-free accel sensor measurements
VectorInt16 aaWorld; // [x, y, z] world-frame accel sensor measurements
VectorFloat gravity; // [x, y, z] gravity vector
float euler[3]; // [psi, theta, phi] Euler angle container
float ypr[3]; // [yaw, pitch, roll] yaw/pitch/roll container and gravity vector
// ================================================================
15
// === INTERRUPT DETECTION ROUTINE ===
// ================================================================
volatile bool mpuInterrupt = false; // indicates whether MPU interrupt pin has gone high
void dmpDataReady() {
mpuInterrupt = true;
}
// ================================================================
// === INITIAL SETUP ===
// ================================================================
void setup() {
// join I2C bus (I2Cdev library doesn't do this automatically)
#if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE
Wire.begin();
Wire.setClock(400000); // 400kHz I2C clock. Comment this line if having compilation difficulties
#elif I2CDEV_IMPLEMENTATION == I2CDEV_BUILTIN_FASTWIRE
Fastwire::setup(400, true);
#endif
// NOTE: 8MHz or slower host processors, like the Teensy @ 3.3V or Arduino
16
// Pro Mini running at 3.3V, cannot handle this baud rate reliably due to
// the baud timing being too misaligned with processor ticks. You must use
// 38400 or slower in these cases, or use some kind of external separate
// crystal solution for the UART timer.
// initialize device
Serial.println(F("Initializing I2C devices..."));
mpu.initialize();
pinMode(INTERRUPT_PIN, INPUT);
// verify connection
Serial.println(F("Testing device connections..."));
Serial.println(mpu.testConnection() ? F("MPU6050 connection successful") : F("MPU6050 connection
failed"));
// supply your own gyro offsets here, scaled for min sensitivity
mpu.setXGyroOffset(220);
mpu.setYGyroOffset(76);
mpu.setZGyroOffset(-85);
mpu.setZAccelOffset(1788); // 1688 factory default for my test chip
17
// make sure it worked (returns 0 if so)
if (devStatus == 0) {
// turn on the DMP, now that it's ready
Serial.println(F("Enabling DMP..."));
mpu.setDMPEnabled(true);
// set our DMP Ready flag so the main loop() function knows it's okay to use it
Serial.println(F("DMP ready! Waiting for first interrupt..."));
dmpReady = true;
18
// ================================================================
// === MAIN PROGRAM LOOP ===
// ================================================================
void loop() {
// if programming failed, don't try to do anything
if (!dmpReady) return;
19
fifoCount = mpu.getFIFOCount();
// check for overflow (this should never happen unless our code is too inefficient)
if ((mpuIntStatus & 0x10) || fifoCount == 1024) {
// reset so we can continue cleanly
mpu.resetFIFO();
Serial.println(F("FIFO overflow!"));
// otherwise, check for DMP data ready interrupt (this should happen frequently)
} else if (mpuIntStatus & 0x02) {
// wait for correct available data length, should be a VERY short wait
while (fifoCount < packetSize) fifoCount = mpu.getFIFOCount();
#ifdef OUTPUT_READABLE_QUATERNION
// display quaternion values in easy matrix form: w x y z
mpu.dmpGetQuaternion(&q, fifoBuffer);
Serial.print("quat\t");
Serial.print(q.w);
Serial.print("\t");
Serial.print(q.x);
Serial.print("\t");
Serial.print(q.y);
Serial.print("\t");
20
Serial.println(q.z);
#endif
#ifdef OUTPUT_READABLE_EULER
// display Euler angles in degrees
mpu.dmpGetQuaternion(&q, fifoBuffer);
mpu.dmpGetEuler(euler, &q);
Serial.print("euler\t");
Serial.print(euler[0] * 180/M_PI);
Serial.print("\t");
Serial.print(euler[1] * 180/M_PI);
Serial.print("\t");
Serial.println(euler[2] * 180/M_PI);
#endif
#ifdef OUTPUT_READABLE_YAWPITCHROLL
// display Euler angles in degrees
mpu.dmpGetQuaternion(&q, fifoBuffer);
mpu.dmpGetGravity(&gravity, &q);
mpu.dmpGetYawPitchRoll(ypr, &q, &gravity);
Serial.print("ypr\t");
Serial.print(ypr[0] * 180/M_PI);
Serial.print("\t");
Serial.print(ypr[1] * 180/M_PI);
Serial.print("\t");
Serial.println(ypr[2] * 180/M_PI);
#endif
#ifdef OUTPUT_READABLE_REALACCEL
// display real acceleration, adjusted to remove gravity
21
mpu.dmpGetQuaternion(&q, fifoBuffer);
mpu.dmpGetAccel(&aa, fifoBuffer);
mpu.dmpGetGravity(&gravity, &q);
mpu.dmpGetLinearAccel(&aaReal, &aa, &gravity);
Serial.print("areal\t");
Serial.print(aaReal.x);
Serial.print("\t");
Serial.print(aaReal.y);
Serial.print("\t");
Serial.println(aaReal.z);
#endif
#ifdef OUTPUT_READABLE_WORLDACCEL
// display initial world-frame acceleration, adjusted to remove gravity
// and rotated based on known orientation from quaternion
mpu.dmpGetQuaternion(&q, fifoBuffer);
mpu.dmpGetAccel(&aa, fifoBuffer);
mpu.dmpGetGravity(&gravity, &q);
mpu.dmpGetLinearAccel(&aaReal, &aa, &gravity);
mpu.dmpGetLinearAccelInWorld(&aaWorld, &aaReal, &q);
Serial.print("aworld\t");
Serial.print(aaWorld.x);
Serial.print("\t");
Serial.print(aaWorld.y);
Serial.print("\t");
Serial.println(aaWorld.z);
#endif
#ifdef OUTPUT_TEAPOT
// display quaternion values in InvenSense Teapot demo format:
22
teapotPacket[2] = fifoBuffer[0];
teapotPacket[3] = fifoBuffer[1];
teapotPacket[4] = fifoBuffer[4];
teapotPacket[5] = fifoBuffer[5];
teapotPacket[6] = fifoBuffer[8];
teapotPacket[7] = fifoBuffer[9];
teapotPacket[8] = fifoBuffer[12];
teapotPacket[9] = fifoBuffer[13];
Serial.write(teapotPacket, 14);
teapotPacket[11]++; // packetCount, loops at 0xFF on purpose
#endif
23
4.2 HEAD-MOVEMENT DETECTION
The first step is to create the accessory which came from a study conducted to identify the movements
from the truck driver that are related to its normal work routine and the movements that indicate
drowsiness. This database was then transferred to the central processing unit of the cap which works
connected to an Accelerometer and Gyroscope to identify each type of situation.
24
4.3 APPLICATION
• Automobiles.
• Security Guard Cabins.
• Operators at nuclear power plants where continuous monitoring is necessary.
• Pilots of airplane.
• Military application where high intensity monitoring of soldiers is needed.
25
CHAPTER-5
RESULT
26
5.1 SUMMARY
To obtain the result, system was tested for different people in different conditions. For this project I used
a circuit consisting a programmed accelerometer in arduino, vibrator motor, LED and a buzzer fitted inside a
cap to a battery to prevent the driver from falling asleep behind the wheels.
5.2 ADVANTAGES
Cheap
Affordable by anyone
Anyone can use it while driving
More efficient
Simple design
Uses more than one senses to alert the driver
5.3 DISADVANTAGES
All studies have been done in unrealistic environment. For assessing the prevalence of drowsy
driving in real traffic, and in order to investigate what drivers actually do when they receive a
sleepiness warning it is absolutely necessary to study their natural behavior when they go about
their daily routines.
Lack of control on situations. Sometimes it gets activated when driver is not actually feeling sleepy
because of touching the required angle.
5.5 CONCLUSION
Thus, I have successfully designed a prototype drowsiness detection system using sensor technology. The
system so developed was successfully tested, its limitations identified and a future plan of action
developed.
27
REFERENCES
[1] T Brandt, R Stemmer, B Mertsching, A Rakotonirainy, Affordable visual driver monitoring system for
fatigue and monotony. Proceedings of the IEEE International Conference on Systems, Man and
Cybernetics (SMC '04), October 2014 , 6451–6456
[2] Z Tian, H Qin, Real-time driver's eye state detection Proceedings of the IEEE International
Conference on Vehicular Electronics and Safety, October 2015, 285–289
[3] Peters, Robert D. "Effects of Partial and Total Sleep Deprivation on Driving Performance", US
Department of Transportation, February 2009
[4] NHTSA, Evaluation of techniques for ocular measurement as an index of fatigue and the basis for
alertness (National Highway Traffic Safety Administration,USA, 2017)
[5] Philadelphia.cbslocal.com/2013/10/02/drowsy-driving becoming-dangerous-problem/
drowsydriving.org/about/whos-at-risk
28