Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
INTERNAL ADVISOR
ENGR AQIB NOOR
INTERNAL CO-ADVISOR
ENGR.UMAIR NAEEM
EXTERNAL ADVISOR
DR. MUHAMMAD SHAHID SHEIKH
DECLARATION
We hereby declare that this project report entitled “CAR DRIVER SAFETY
DEVICE” submitted to the “DEPARTMENT OF ELECTRICAL
ENGINEERING” is a record of an original work done by us under the guidance of
Supervisor “SIR AQIB NOOR” and Co-supervisor “SIR UMAIR NAEEM” that no
part has been plagiarized without citations. Also, this project work is submitted in the
partial fulfillment as per required for degree of Bachelor of Electrical Engineering.
Members Signature
Muhammad Abdullah
Iftikhar
Ayesha Imran
Supervisor: Signature
Date:
Place:
3
ACKNOWLEDGEMENTS
By the grace of Allah Subhanahu Wa Ta'ala, we were able to finish our project
smoothly within due time. We would like to thank our parents for their constant
support, our teachers for providing guidance and sharing us their wisdom and
lastly our FYP mates for helping us during the course of this project.
We express our deepest appreciation for our internal advisor Sir Aqib Noor and
advisor. They guided us whenever we came across a few problems and helped us
in overcoming the obstacles we faced during our project. We have nothing but
pure respect and admiration for our teachers and we will never forget the
TABLE OF CONTENTS
Chap Topic
Page
1 Introduction
1.1 Introduction
1.2 Motivation
1.3 Literature Review
1.4 Problem Defintion &
Solution
2 Methadology
2.1 Basic Tools
2.2 Main Project Features
2.3 Frame & Body Design
2.4 Complete Circuit Diagram
3 Code & Simulation Results
3.1 Programming Code-1
3.2 Programming Code-2
3.3 Simulation Results
4 Cost,Future Work &
Conclusion
4.1 Cost Analyses
4.2 Future Work
4.3 Conclusion
References
5
TABLE OF FIGURES
2.1
2.2
2.3
2.4
2.5
2.6
2.7
2.8
2.9
2.10
2.11
2.12
2.13
2.14
2.15
2.16
6
2.17
2.18
2.19
2.20
2.21
2.22
2.23
2.24
2.25
2.26
2.27
2.28
3 Chapter-3
3.1 (a,b)
3.2(a,b)
3.3 (a,b)
3.4(a,b)
3.5(a,b)
7
ABSTRACT
Car and law developers are cooperating together for many years to make improvements on cars
so that people can have safe journeys. According to WHO (World Health Organization), around
1.25 million people die each year due to car accidents. This project consists of many safety
devices which will provide safety to drivers in case of many emergencies situations.
Furthermore, this system ‘Car driver Safety Device’ is designed specifically to minimize car
accidents as much as possible. It consists of alcohol sensor which detects alcohol in the driver’s
body, eye blink sensor which detects drowsiness of the driver, PIR (motion sensor), it detects the
presence of an un authorized person in the car in case of driver’s absence, ultra sonic sensors
gives anti-collision detection warning, fire sensor detects if a fire occurs inside the car, 800L
module is used for tracking the car’s location through GPS and informs to a predefined number
in case of any accident. In short, this system will provide maximum solutions for the safety of
CHAPTER-1
INTRODUCTION
1.1 Introduction
Due to increasing number of cars the demand of safety and security of the
drivers are also increasing day by day which signifies the importance of this project in this
modern world. These days, majority of road accidents are caused by drink-driving. Drunken
drivers are in an unstable condition and so, rash decisions are made on the highway which
endangers the lives of road users, the driver inclusive. Furthermore, it was found that vehicle
safety has become a high priority during the process of purchasing of new vehicles. Previous
researches on car safety includes a new kind of air bag system, anti-lock braking system,
password protected vehicle monitoring system, advanced auto mobile safety features, and
smart vehicle protection system. The microcontroller board used is Arduino Mega which is able
to read inputs through sensors and give an output i.e activating a motor or an LED. This
research is a system of combination of vehicle safety features of the driver and anti-theft
monitoring and controlling system with the help of tracking. Furthermore, this device includes
fire sensor, ultrasonic sensor, motion sensor, eye sensor, alcohol sensor, GSM module 800L
and GPS. The GSM module acts as an interface for communication between the driver and a
predefined number to send alert messages in case if an emergency occurs. The overall
approach of this project is to improve the safety and security of the car through advanced
technology by using social communication media
1.2 Motivation
Remember the days when safety features on a car included anti-lock brakes, airbags, seatbelts
and traction control? Those days are over. Today most buyers will not let go of their hard-earned cash
unless the majority of the latest safety features and system are build in their new car. This project is made
specifically for this purpose it includes majority of the safety features needed to drive safely.For the last
30 years, or even further back, most of the focus on making vehicles safer was on protection That's why
seatbelts and airbags were invented but all of these features are for the purpose of reducing the risk of
being injured, given that crashes are going to occur which can only be reduced with computer
technology and sensing technology. The microcontroller board used is Arduino Mega which is able to
read inputs through sensors and give an output i.e activating a motor or an LED.The interfacing between
9
the hardware and software is done using parallel port of the personal computer. This system contains a
fire protection, alcohol detection, collision prevention , drowsiness detection, accident spot identification
and also anti-theft tracking features. All of these features are controlled by sensors which send a signal to
Arduino. GSM and GPS modules are connected to the Arduino that sends a message to the predefined
mobile and informs about the occurrence of an accident. In total the system is aimed to provide a total
protection to the vehicle.
well as an op amp which adjusts the sensitivity through a potentiometer. If a fire is detected, an
alarm is sounded and a relay switch connected to the motors of the car window is switched on which
in turn rolls down the windows of the car.
The fifth feature is vehicle tracking system. This feature requires two sensors shock sensor and
accelerometer which is used to send the location of the vehicle through GPS and GSM module
800L.When there is an accident the shock sensor is used to send the data to the GSM module. The
GSM module has a SIM implanted which automatically sends a distress signal to the predefined
number and notify the condition of the vehicle as well the the location of the vehicle where the
accident took place through GPS. The accelerometer is used to monitor the acceleration and the axis
of the vehicle, if there is a sudden de-acceleration of vehicle as well as sudden change in the axis of
the vehicle it compares the value with the threshold value and if the value is greater than the
threshold value the GSM module sends a message to the predefined number to notify about the
occurrence of the accident of the vehicle.
CHAPTER 2
METHADOLOGY
This project is basically a combined network of various sensors in which a micro-controller acts as
a main interfacing host. The response from the interfaced sensors either analog or digital is notified
to microcontroller via different pins and then micro-processor generates the output as per burned
code requirement..There are multiple tools that are used in this project which will be discussed in
this next section.
FIG 2.1
12
Reset (RST) Pin: The RST pin can be used for initializing the board by setting it to low.
VIN Pin: Range of input voltage ranges from 7volts to 20volts.The board has a voltage regulator
Serial Communication: These pins like TXD and RXD transmit & receive the serial data. Tx
indicates data transmission whereas RX indicates data receiving. The serial pins have four
combinations. For serial 0, it is Tx (1) and Rx (0), for serial 1 it is Tx(18) & Rx(19), for serial 2 it is
Tx(16) & Rx(17), and at last for serial 3, it is Tx(14) & Rx(15).
External Interrupts: The external interrupts are found by using 6-pins like interrupt 0(0), interrupt
1(3), interrupt 2(21), interrupt 3(20), interrupt 4(19), interrupt 5(18). These pins generate interrupts
through different ways like giving LOW value, rising or falling edge or changing value of the
interrupt pins.
AREF: AREF stands for Analog Reference Voltage that is a reference voltage for analog inputs.
Analog Pins: There are 16-analog pins embedded on the board marked as A0-A15. The analog pins
I2C: The I2C communication is controlled by two pins 20 & 21 where 20-pin is Serial Data Line
(SDA) used for holding the data & 21-pin is Serial Clock Line (SCL) utilized for data synchronization
SPI Communication: SPI stands for serial peripheral interface that is used to transmit data among
the controller & other parts. It includes four pins i.e. MISO (50), MOSI (51), SCK (52), and SS (53)
Arduino Nano
The miniature version of ardiuino having 16 I/O pins (6 are PWM pins) and 8
Analog pins. It provides a much small room and used to perform simpler tasks.
FIG 1.2
FIG 2.3
14
FIG 2.4
9 V Battery
The battery is to power the Arduino Module in order to carry freely.
FIG 2.5
Buzzer
The buzzer consists of two pins +ve & -ve attached to it with a ceramic disc inside
it. On passing electric current, the disc vibrates and produces a shrill sound. It is
normallyused for alarming or “HIGH” indications. It contains two pins Vcc(5volt) & GND
15
(ground).
FIG 2.6
Relay Module
A 5V relay module is a device that is normally used for switching. In this project it
is used for ignition switching upon activation of alcohol sensor. It contains 6 pins
Vcc(5v),Gnd(Ground) & In 1- 4 (digital input).
FIG 2.7
LED
Micro LED light indicators up to 5mm in size.
FIG 2.8
16
FIG 2.9
5v DC Motor: -
DC motor with two terminals +ve & -ve works on the principle of electromagnetic
induction. It is used in this project for sliding down car window.
FIG 2.10
OLED
OLED or organic light emitting diode is a unique kind of display module that
contains thin organic layers rather than crystalline layers in other LEDs. They are more
energy efficient, provide much wider view and dark displays (best for dark
environments).They work on I2C protocol (two wire communication).It contains 4 pins
Vcc(5v),Gnd(Ground),SCL(serial clock pin) & SDA (serial data transfer pin).
17
FIG 2.11
FIG 2.12
Anti-Sleep System:-
This feature consist of a light weight plastic goggle with a circuitry of IR sensor
18
Attached to it.IR sensor of a minimal range monitors the blinking of an eye which generates
Digital “HIGH” signal if the eye lid is closed for more than 3 seconds. A buzzer is triggered to
alarm or awake the subject.
Working: -
We know that IR sensor emits Infrared Rays at some predefined range. Some IR
sensors also contain potentiometer to control range. At ideal condition, IR sensor generates
digital “HIGH” Output due absence of any obstacle within its range. Soon as some object or
obstacle is placed, the IR rays will bounce back setting the module response to digital
“LOW”. The low “Output” response will trigger the buzzer to honk.
FIG 2.13
Circuit Diagram
19
FIG 2.14
Flow Chart
Start
Check for
obstacles
YES NO
sensor activation and shuts the car ignition to “OFF” position. This is how the subject
cannot drive with alcohol consumed.
Working: -
The MQ3 Gas sensor module has the ability to detect the presence of gases like propane,
methane, alcohol etc.It contains a layer of tin oxide whose electrical conductivity increases with the
presence of alcohol in air. It gives both digital and analog output.
Circuit Diagram: -
FIG 2.15
Flow Chart
21
Anti-collision System: -
An anti-collision system consists of an ultrasonic sensor which helps the driver to navigate through
traffic as well as alerts the driver from possibilities of collision occurrence. Furthermore, it also helps the
22
driver to stay at a safe distance from the other vehicles. This system also solves the problem of accidents
occurring due to poor visibility. The driver can be warned about the obstacle either through an alarm or a
voice message by calculating the distance between the obstacle and the car. This system aim is to further
improve the overall control system and to increase the robustness of the car in case of the detection of any
kind of obstacle, thus increasing the safety and minimizing the risk in the aspect of vehicle technology.
Working: -
Sensors, microcontroller and alert signals are the key factor for collision avoidance, monitoring and
control which is implanted in the system. As shown below the front and the back of the car consists of
ultrasonic sensors which detect obstacles and pass the information to the microcontroller. As from the
sensor name, it clearly indicates that it emits ultrasonic waves. The sensor as discussed earlier triggers the
ultrasonic waves through transmitter when a pulse is applied at TRIG pin. Soon as we place some obstacle
within the wave’s path, it will reflect back and collected at receiver. The echo pin pulses to HIGH as the
wave transmits and turns LOW on its return. The width of the pulse is the time taken by the wave to return.
This sensor will not wait for more than 38mS (milliseconds) as this is the maximum time range. It indicates
no obstruction within the wave path setting the echo pulse automatically to LOW. The time is recorded and
the distance is calculated by speed distance
formula,
FIG 2.16
FIG 2.17
24
FIG 2.18
The ultrasonic sensor has four pins: the VCC pin is connected to the 3.3v pin of the Arduino. The
ground pin is connected to the ground pin of Arduino. The trigger pin is connected to pin 7 of the Arduino.
The echo pin is connected to pin6 of Arduino. The two LEDs are connected to pin 22 and 24 and the
buzzer is connected to pin 30. The negative leg of buzzer and leds are connected to ground. The red led
lights up when the distance between the car and the object is less than 20 while the blue led lights up when
the distance is between 20 and 50.
25
FlowChart:-
26
It is said that 80% of the losses due to occurrence of fire would have been
prevented if the fire was detected immediately. In This system a flame sensor is interfaced with
the arduino to detect fire inside the car. The purpose of this system is to detect fire before it goes
out of control. The flame sensor continuously monitors the car and alerts the driver in case of fire
by activating a buzzer and led light. As a result the windows are pulled down so that the driver
and the passenger can leave the car in case the door is stuck. The reason we used a flame detector
for this system is because it can give us the fastest response in case of fast developing flaming
Working: -
The fire emits a small amount of Infra-red light, which is received by the Photodiode (IR
receiver) mounted on a flame sensor module. The Op-Amp is used to check for change in voltage across the
IR Receiver, hence if fire is detected the output pin (DO) sets to 0V (LOW) and 5V (HIGH) at ideal
condition. Soon as we receive a LOW output, a buzzer will beep with and a dc motor is turned ON which
slides down the glass window.
Flow Chart:-
FIG 2.20
B
29
FIG 2.21
Module Features: -
GSM 800L Module provides the following features:
Specifications: -
FIG 2.22
3. MPU6050 Module: -
MPU6050 sensor module is a complete 6-pivot Motion Tracking Device. It joins 3-pivot
Gyroscope, 3-hub Accelerometer and Digital Motion Processor all in a small module. It uses I2C
bus to communicate with microcontrollers. It has an auxiliary I2C bus to speak with other sensor
gadgets like 3-hub Magnetometer, Pressure sensor and so on. The 3-pivot Magnetometer provides
31
a complete 9-axis motion output if connects with I2C bus. Lets discuss the working elements of
this module.
3-Axis Gyroscope:-
This module comprises of 3-axis Gyroscope having Micro Electro Mechanical System
(MEMS) technology. It measures angular velocity on the X, Y, Z axes as shown in figure.
FIG 2.23
Due to rotation of gyro about any of axes (X, Y, Z), a Coriolis Effect produces vibration which is
detected by MEM inside MPU6050.The generated signal is amplified, demodulated, and filtered to
produce a voltage proportional to the angular rate.
This voltage signal is converted to digital using 16-bit ADC (Analog to Digital Converter) to sample
each axis. The complete-scale range of output is +/- 250, +/- 500, +/- 1000, +/- 2000. It measures
angular velocity along all axes in degrees per second.
32
3-Axis Accelerometer:-
This module comprises of 3-axis Accelerometer with Micro Electro Mechanical (MEMs)
technology. It detects tilting angle or inclination along the X, Y and Z axes as shown in below figure.
FIG 2.24
Acceleration along the axes diverts the moving object. This displacement of moving object
unbalances the differential capacitor which results in sensor output. The output amplitude is
proportional to acceleration whereas a 16-bit ADC is used to get digital output. The complete-scale
ranges of acceleration are +/- 2g, +/- 4g, +/- 8g, +/- 16g measured in meters per second square. The
sensor measures 0g on X and Y axis and +1g on Z axis when placed on a flat surface
33
FIG 2.25
The MPU-6050 module has 8 pins,
XCL: Auxiliary Serial Clock pin. This pin connects other I2C interface enabled sensors SCL pin to
MPU-6050.
XDA: Auxiliary Serial Data pin. This pin is connects other I2C interface enabled sensors SDA pin to
MPU-6050.
SCL: Serial Clock pin. Connect this pin to microcontrollers SCL pin.
SDA: Serial Data pin. Connect this pin to microcontrollers SDA pin.
GND: Ground pin. VCC: Power supply pin. Connect this pin to +5V DC supply.
34
FIG 2.26
35
Working: -
During accident, the collision generates a shock wave which activates the shock sensor. The
GPS records the location of accident and sends the information to the GSM module which further directs
an emergency message (with location) to the predefined number. In case of car tilt monitored by the
accelerometer, an emergency message “The car has being tilted” is sent.
FIG 2.28
2.4 COMPLETE CIRCUIT DIAGRAM OF THE MODULE:-
FIG 2.29
37
CHAPTER-3
PROGRAMMING CODE & SIMULATION RESULTS
The following code is for OLED, collision sensor, eye blink sensor, MQ3 sensor, relay,
motor and fire sensor. We have applied conditional structure (if-else) technique for each sensor in
our code. This technique forces the sensor to act or stay idle as per state condition.
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define OLED_RESET 4
#define NUMFLAKES 10
#define XPOS 0
#define YPOS 1
#define DELTAY 2
#define LOGO16_GLCD_HEIGHT 16
#define LOGO16_GLCD_WIDTH 16
38
{ B00000000, B11000000,
B00000001, B11000000,
B00000001, B11000000,
B00000011, B11100000,
B11110011, B11100000,
B11111110, B11111000,
B01111110, B11111111,
B00110011, B10011111,
B00011111, B11111100,
B00001101, B01110000,
B00011011, B10100000,
B00111111, B11100000,
B00111111, B11110000,
B01111100, B11110000,
B01110000, B01110000,
B00000000, B00110000 };
#endif
int limit;
int value;
long duration;
int distance;
long duration1;
int distance1;
void setup()
{ // by default, we'll generate the high voltage from the 3.3v line internally! (neat!)
// init done
display.display();
delay(2000);
display.clearDisplay();
pinMode(coll,INPUT);
pinMode(coled, OUTPUT);
pinMode(buz, OUTPUT);
pinMode(flamePin, INPUT);
pinMode(redled, OUTPUT);
41
pinMode(greenled, OUTPUT);
pinMode(CW, OUTPUT);
pinMode(buzzerPin, OUTPUT);
pinMode(MQ3, INPUT);
pinMode(Buzzer, OUTPUT);
pinMode(LED, OUTPUT);
digitalWrite(Buzzer,LOW);
digitalWrite(LED,LOW);
pinMode(CCW, OUTPUT);
// front Collision
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
pinMode(LED1, OUTPUT);
pinMode(LED2, OUTPUT);
// back Collision
pinMode(trigPin1, OUTPUT);
pinMode(echoPin1, INPUT);
pinMode(LED11, OUTPUT);
pinMode(LED21, OUTPUT);
Serial.begin(9600);
}
42
void loop()
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
// Reads the echoPin, returns the sound wave travel time in microseconds
distance= duration*0.034/2;
{ digitalWrite(LED1, HIGH);
else
{ digitalWrite(LED1, LOW);
// turn the LED off by making the voltage LOW
// wait for a second }
43
{ digitalWrite(LED2, HIGH);
tone(buzz, 2000);
delay(100);
noTone(buzz);
delay(100);
tone(buzz, 2000);
delay(100);
noTone(buzz);
delay(100);
tone(buzz, 2000);
delay(100);
noTone(buzz);
tone(buzz, 2000);
delay(100);
noTone(buzz);
delay(100);}
else
{ digitalWrite(LED2, LOW);
digitalWrite(trigPin1, LOW);
delayMicroseconds(5);
digitalWrite(trigPin1, HIGH);
delayMicroseconds(15);
digitalWrite(trigPin1, LOW);
// Reads the echoPin, returns the sound wave travel time in microseconds
distance= duration*0.034/2;
{ digitalWrite(LED11, HIGH);
// turn the LED on (HIGH is the voltage level) }
else
{ digitalWrite(LED11, LOW);
// turn the LED off by making the voltage LOW
// wait for a second }
tone(buzz, 2000);
delay(100);
noTone(buzz);
delay(100);
tone(buzz, 2000);
delay(100);
noTone(buzz);
delay(100);
tone(buzz, 2000);
delay(100);
noTone(buzz);
tone(buzz, 2000);
delay(100);
noTone(buzz);
delay(100); }
else
{ digitalWrite(LED21, LOW);
// turn the LED off by making the voltage LOW
// wait for a second }
//value= analogRead(AOUTpin);
//reads the analaog value from the alcohol sensor's AOUT pin
//Serial.println(value);
46
display.clearDisplay();
display.setCursor(0,0);
display.setTextSize(1);
display.setTextColor(WHITE);
Serial.print("IRSensorip ");
Serial.println(digitalRead(coll));
value= analogRead(MQ3);
Serial.println(value);
Flame = digitalRead(flamePin);
if (Flame== LOW)
{ Serial.println("Fire");
display.println(" FIRE");
digitalWrite(buzzerPin, HIGH);
digitalWrite(redled, HIGH);
digitalWrite(greenled, LOW);
digitalWrite(CW, LOW); }
else
{ Serial.println("NO fire");
display.println("No Fire");
digitalWrite(buzzerPin, LOW);
digitalWrite(greenled, HIGH);
47
digitalWrite(redled, LOW);
digitalWrite(CW, HIGH); }
if (digitalRead(coll)==LOW)
{ Serial.println("Sleep");
display.println("Sleeping");
digitalWrite(coled,HIGH);
digitalWrite(buz,HIGH); }
else
{ Serial.println("Awake");
display.println("Awaked");
digitalWrite(coled,LOW);
digitalWrite(buz,HIGH); }
if(value>600)
{ Serial.println(value);
display.println("DRUNK ");
digitalWrite(Buzzer,HIGH);
digitalWrite(LED,HIGH);
digitalWrite(CCW, HIGH); }
else
{ Serial.println(value);
display.println("SOBER");
digitalWrite(Buzzer,LOW);
48
digitalWrite(LED,LOW);
digitalWrite(CCW, LOW); }
display.display();
delay (500);
}
#include<Wire.h>
#include <SoftwareSerial.h>
#include <TinyGPS.h>
SoftwareSerial gsmk(7, 11);
TinyGPS gps;
SoftwareSerial ssk(12, 10);
//char c;
float flat=0;
float flon=0;
char phone_no1[] = "03323050346";
const int MPU_addr=0x68;
int16_t AcX,AcY,AcZ,Tmp,GyX,GyY,GyZ;
int minVal=265;
int maxVal=402;
double x;
double y;
double z;
int shk;
int shockPin 1= 4; // Pin 4 Input
int shockVal1 = HIGH; // Shock measurement
49
void setup()
{
Serial.begin(9600);
ssk.begin(9600);
gsmk.begin(9600);
void loop ()
{
shock();
if(shk==1)
{ digitalWrite(13,HIGH);
delay(500);
gpsdata();
delay(500);
angle();
delay(500);
sms();
digitalWrite(13,LOW); }
}
void shock()
{ shockVal1 = digitalRead (shockPin1) ; // read the value from our sensor
50
if (!bAlarm)
{ Serial.println("ACCIDENT!");
Serial.println("-----------------------------------------");
bAlarm = true;
shk=1; }
}
else
{
// if( (millis()-lastShockTime) > shockAlarmTime && bAlarm){
// Serial.println("no alarm");
bAlarm = false;
shk=0;
}
}
void angle()
{
Wire.beginTransmission(MPU_addr);
Wire.write(0x3B);
Wire.endTransmission(false);
Wire.requestFrom(MPU_addr,14,true);
AcX=Wire.read()<<8|Wire.read();
AcY=Wire.read()<<8|Wire.read();
AcZ=Wire.read()<<8|Wire.read();
int xAng = map(AcX,minVal,maxVal,-90,90);
int yAng = map(AcY,minVal,maxVal,-90,90);
int zAng = map(AcZ,minVal,maxVal,-90,90);
51
Serial.print("AngleX= ");
Serial.println(x);
Serial.print("AngleY= ");
Serial.println(y);
Serial.print("AngleZ= ");
Serial.println(z);
Serial.println("-----------------------------------------");
delay(200);
void gpsdata()
{
ssk.listen();
Serial.println("getting data");
bool newData = false;
unsigned long chars;
unsigned short sentences, failed;
// For one second we parse GPS data and report some key values
for (unsigned long start = millis(); millis() - start < 1000;)
{
while (ssk.available())
{ char c = ssk.read();
52
Serial.write(c); // uncomment this line if you want to see the GPS data flowing
if (gps.encode(c)) // Did a new valid sentence come in?
newData = true;
}
}
if (newData)
{ float flat, flon;
unsigned long age;
gps.f_get_position(&flat, &flon, &age);
Serial.print("LAT=");
Serial.print(flat == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : flat, 6);
Serial.print(" LON=");
Serial.print(flon == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : flon, 6);
Serial.print(" SAT=");
Serial.print(gps.satellites() == TinyGPS::GPS_INVALID_SATELLITES ? 0 : gps.satellites());
Serial.print(" PREC=");
Serial.print(gps.hdop() == TinyGPS::GPS_INVALID_HDOP ? 0 : gps.hdop()); }
if (chars == 0)
{ Serial.println("** No characters received from GPS: check wiring **"); }
void sms()
{ gsmk.listen();
Serial.println("SENDING THE SMS");
53
Serial.println(text);
Serial.println(flat,6);
Serial.println(flon,6);
gsmk.print("AT+CMGF=1\r");
delay(400);
gsmk.print("AT+CMGS=\"");
gsmk.print(phone_no1);
gsmk.println("\"");
delay(300);
gsmk.println(text);
gsmk.print("http://maps.google.com/?q=");
gsmk.print(flat, 6);
gsmk.print(",");
gsmk.print(flon, 6);
delay(200);
gsmk.println((char)26); // End AT command with a ^Z, ASCII code 26
delay(200);
gsmk.println();
delay(1000);
Serial.println("SENT");
}
54
The fire detection system was installed in a car model and a number of simulation tests were carried out
by using flame sensor for detecting fires in cars. The software used is Arduino which analyses and
complies the code for analyzing and detecting flame. When a fire was lit in front ofthe sensor there was
an immediate response from the sensor and an alarm buzzer was sounded and a light was lit. The
microcontroller receives the data as an input from the flame sensor nodes and displays it on the LCD
screen. Two sets of scenarios were chosen one is of no fire and the other is for fire detection which is
continuously displayed on the LCD screen. The flame sensor takes a Boolean input (0,1) and the next
step is repeat in case the input is 0 that is ‘no fire’. After the microcontroller receives the data, it gives
high pulse to the buzzer circuit and the buzzer is turned on. Continuous testing confirms the ability of the
system to detect sudden fires and the buzzer was efficiently sounded with the LED light with the
probability of 0.98.
ANTI-COLLISION SYSTEM
The analysis and simulation testing is done using ultrasonic sensors which are placed in front
and the back of the vehicle so that it can be monitored and controlled from both sides. The
software used for the simulation is Arduino, this software runs the program of the anti-
collision system which is then uploaded to the IC of the microcontroller. The data from the
positioned ultrasonic sensors are collected which hasan approximate range detection stored in
the microcontroller for the detection of objects. The working of the system can be explained
in terms of zones. The zones are divided into three parts. The first part covers the distance of
greater than 50 cm from the sensor, the second part of the zone covers the distance of 20 cm
from the sensor and the third part covers the distance which is less than 20cm. The system has
two led lights blue and red. The blue LED light represents the distance which is less than 50
cm but greater than 20cm from the sensor, while the red light is considered a dangerous zone
which is less than 20cm from the sensor. The ultrasonic sensor monitors the distance of the
object continuously, once an object or an obstacle is detected, it calculates the distance
between the sensor and the object. If the object is within the range of 50 cm and 20cm a red
light is lit to warn the driver, and if the object is in the range of 20 cm or less a blue light is lit
and a buzzer is sounded to warn the driver to take necessary action against possibl collision
occurrence. The testing results are shown below
56
57
An alcohol detection system consists of MQ-3 sensor which detects the presence of alcohol in the
air. The sensor is attached to the left and right side of the driver seat. If the driver has consumed
alcohol, the sensor detects the ethanol molecules in air sends a signal to the microcontroller which is
58
the brain of the system in the Arduino. The software used in this system in Arduino which compiles
the C language program of the system and uploads it to the microcontroller. We tested the efficiency
of the system by spraying a perfume to stimulate the response of alcohol concentration.The system
can be divided in 3 units:
Indication: LED light and a buzzer is used as indication of presence of alcohol. When the sensor
detects the presence of alcohol it sends a voltage signal to the microcontroller which in turn gives a
signal to the circuit and as a result the LED is lit and a buzzer is sounded.
DISPLAY: a LCD screen is used to display whether the driver has an alcohol consumption or not.
The LCD is powered by Arduino which is connected to the Arduino.
RELAY SWITCH: if the system does not meet the fitness threshold value of the driver than the
microcontroller takes action and switches of the relay switch which shuts down the engine of the
driver that is the ignition system is turned off.
59
ANTI-SLEEP SYSTEM
Since we have discussed earlier that IR sensor activates when an obstacle is placed within its range.
The sensor mounted on a glass is monitoring the eye blinking. Soon as the eye blinks, it acts as an
obstacle for the sensor and a buzzer will beep after a delay of 3 seconds. Simulation results have
shown below.
Since we have discussed earlier that there is a shock sensor and accelerometer embedded in it, the
GSM module will send an emergency message to the predefined number with location. The results
are attached below.
61
CHAPTER-4
COST ANALYSES, FUTURE WORK AND CONLUSION
TOTAL 24,750
62
There are lots of areas in this safety module which can be improved further and can be
applied with more sophisticated or mature approach. In vehicle detection feature, the emergency
message can be conveyed directly to the rescue services (in nearby proximity) instead to the third
party. Whereas, wearing a complete anti sleep goggle can be feasible but moreover can be a hassle.
We can mount the IR sensor with limited proximity (should only monitor the eye) on a steering
wheel or sunlight visor. The anti-fire system can also be further improved through the idea of
installing mini fire extinguisher cylinders with auto control. Therefore, there are many ways through
which we can improve this module. We have plans to make it a much better example which can
compete in the automobile industry.
4.3 CONCLUSION
In this modern era of fast growing technology, safety is the most important and key factor
that can’t be neglected. We can rather say the whole technological market relies on safety
precautions. The automobile industry in Pakistan controls a wide market for multiple car variants auto
and manual both. Unfortunately, the safety bracket is often ignored and neglected. Hence we believe
that a little more improvement and a mature approach towards “CAR DRIVER SAFETY DEVICE”
will lead to many safety problem solutions. We can conclude that combining various approaches or
methods can provide exciting and more robust results to create a safer environment.
63
REFERENCES
http://www.physics.org/
Drivers with Automatic Car Engine Locking System.
http://www.diva-portal.org/smash/get/diva2:962827/FULLTEXT01.pdf
Kavish Atul Sanghvi,Mukesh. Drunk Driving Detection, Patel School of
Technology,Management and Engineering, India
https://create.arduino.cc/projecthub/Vijendra/arduino-based-collision-detection-warning-
system-d1beec
https://pdfs.semanticscholar.org/020b/c4a1bdd27d53016e23830cd0a3323072eaec.pdf
https://www.irjet.net/archives/V4/i12/IRJET-V4I12227
http://www.ijsdr.org/papers/IJSDR1706041
https://github.com/BSP-Embed/Drowsy-Driver-Detection
https://lastminuteengineers.com/sim800l-gsm-module-arduino-tutorial/