Académique Documents
Professionnel Documents
Culture Documents
Abstract -------------------------------------------------------------------------------- 2
1.Introduction for VMS -------------------------------------------------------------3
2.Existing System ----------------------------------------------------------------------5
2.1Proposed System--------------------------------------------------------------------5
3 Feasibility Study ---------------------------------------------------------------------7
4 Literature Survey --------------------------------------------------------------------9
5.Block Diagram of VMS ------------------------------------------------------------10
6.UML Diagrams
6.1Use Case Diagram -----------------------------------------------------------------11
6.2Sequence ----------------------------------------------------------------------------12
6.3Circuit Diagram --------------------------------------------------------------------13
7.Description of Embedded systems ------------------------------------------------14
7.1Hardware Components ------------------------------------------------------------16
7.2Software Components ------------------------------------------------------------29
7.3 Arduino Programming Procedure-----------------------------------------------31
8. Source code for VMS --------------------------------------------------------------38
8.1 Output ------------------------------------------------------------------------46
9 .Conclusion ----------------------------------------------------------------------48
10.Reference ---------------------------------------------------------------------49
1
Abstract
Most of these days, we hear lot of accidents due to drunken driving. Drunken drivers will
not be in stable condition and so the rash driving is the inconvenience for other road users and
also question of life and death for the drunken driver and for others.
In this project, we are developing an Auto Lock System. The input for the system is from
Detection Sensors either from Alcohol Breath or any other mechanism. The controller keeps
looking for the output from these sensors. If there are any traces of Alcohol above the set limit,
As vehicle automobiles are beyond the scope of this project, we are simulating the
G.Akhil Sai(15N81A05P2)_______________________
P.Indudhar(15N81A05P3)________________________
2
1.Introduction to Vehicle Management System:
1) “Alcohol Detector project” can be used in the various vehicles for detecting whether the driver
has consumed alcohol or not.
2) This project can also be used in various companies or organization to detect alcohol
consumption of employees.
Most of these days, we hear lot of accidents due to drunken driving. Drunken drivers will
not be in stable condition and so the rash driving is the inconvenience for other road users and
also question of life and death for the drunken driver and for others.
3
The system uses a compact circuitry built around Flash version of ATmega328P
microcontroller with a non-volatile memory capable of retaining the password data for over ten
years. Programs are developed in embedded C. ISP is used to dump the code into the
microcontroller.
The main purpose behind this project is “Drunken driving detection”. Now-a-days, many
accidents are happening because of the alcohol consumption of the driver or the person who is
driving the vehicle. Thus drunk driving is a major reason of accidents in almost all countries all
over the world. Alcohol Detector in Car project is designed for the safety of the people seating
inside the car. This project should be fitted / installed inside the vehicle.
4
2.Existing System
As the population increasing gradually most of us prefer automobiles for the transportation.
Accidents are occurring due to rash driving, mainly on highways. Most of the accidents take
place because of crossing speed limits or by not following the traffic rules and most importantly
by consuming alcohol. thus drunk driving is a significant reason for accidents in most countries.
Our Traffic police use breathalyzer to detect whether the driver is drunken or not. This process is
only done at traffic signals and other checkpoints. As it’s a time consuming process. Also they
might not check everyone in day-to-day. Even with all this process, accidents might occur at the
2.1Proposed System:
The Alcohol Detector is a device which is meant for protection of the people seating inside the
vehicle and in many situations when the ambulance and the police authority are not in the hip in
time. This lead to delaying the help reached to the person suffered as a result of an accident. So,
the alcohol detection will stop the ignition of the vehicle automatically and it sends location of
the person to his higher authority’s mobile using an IOT device, It also support alcohol limit
based on this the system will decide whether it should stop the ignition of vehicle for safety
reasons. In case of any accident an emergency message with location details are sent to his
higher officials.
ADVANTAGES:
Low cost.
Automated operation.
5
Low Power consumption.
It provides an automatic safety system for cars and other vehicles as well.
6
3.Feasibility study
Operational Feasibility:
Operational Feasibility deals with the study of prospects of the system to be developed. This
system detects alcohol and show the notification whether he has drunkin the limit or not,
7
based on alcohol consumption level is above the threshold level then engine will be
locked and send an emergency message with location details to a specified number.
Economic Feasibility:
Economic Feasibility or Cost-benefit is an assessment of the economic justification for a
computer based project. As compared to the cost of the vehicle, the components cost will be
comparatively low. So it won’t be much of a problem to install these arduino, gsm and gps
modules. other than this, the sim used must have enough balance to send the sms immediately .
Technical Feasibility
According to Roger S. Pressman, Technical Feasibility is the assessment of the technical
resources of the organization. The system is developed for platform Independent environment.
The system is technically feasible for development and can be developed with the existing
facility. We used Arduino UNO IDE software, gsm, gprs, C programming language, alcohol
sensor
Notification lights. So, the project is technically achieved.
8
4.Literature Survey
The alcohol detection system is designed in such a way that if the driver who is driving the
vehicle is drunk then the alcohol detection system locks the vehicle and sends the message to the
vehicle owner with the car location. As it is an autonomous system everything will be synced it
also store the information whenever it is required as proof.
The purpose of this project is to develop vehicle accident prevention by method of a
alcohol detector in an effort to reduce traffic accident.This is developed by integrating an alcohol
sensor with microcontroller. It can be used as security purpose when owner is not in car.
Scope:
VMS has a wide scope as it can be used in any car to reduce accidents caused due to
alcohol consumption
It uses Atmel ATmega 328-P Arduino Uno which is efficient for giving information such
as drunken limit for driver and also the location details at the same time.
It needs a built in wifi and an external DC power supply which is mounted on to the car
9
5.BLOCK DIAGRAM OF VMS:
POWER
SUPPLY
BUZZER
MICROCONTROLLER
ATmega328P
Alcohol
Detection
SENSORS RELAY MOTOR
GPS
GSM
10
6.Unified Modeling Language Diagrams:
LCD
PERSON MQ-3
MQ-3
MQ-3SENSOR
SENSOR
SENSOR
GPS
GPS
BUZZER MICROCONTROLLER
CLIENT
RELAY GSM
11
6.2 Sequence Diagram
:PERSON :MQ3 SENSOR :MICROCONTROLLER :GSM :GPS :BUZZER :RELAY :CLIENT :LCD
acknowledgement to client
12
6.3 Circuit Diagram:
13
7.DESCRIPTION:
diverse environments and sold into a competitive and cost conscious market.
An embedded system is not a computer system that is used primarily for processing, not a
embedded & lower end embedded systems. High-end embedded system - Generally 32, 64
Bit
Controllers used with OS. Examples Personal Digital Assistant and Mobile phones etc .Lower
end embedded systems - Generally 8,16 Bit Controllers used with an minimal operating systems
The following hardware and software is used in the Vehicle Management System.
HARDWARE COMPONENTS:
Power supply.
Microcontroller ATmega328P
Alcohol detection sensor.
Buzzer.
Transformer.
14
Rectifier.
Regulator.
Motors.
Resistors.
Capacitors.
Gps
Gsm
SOFTWARE COMPONENTS:
Arduino software(UNO).
15
7.1 HARDWARE COMPONENTS DESCRIPTION:
POWER SUPPLY:
Power supply is a supply of electrical power. A device or system that supplies electrical
or other types of energy to an output load or group of loads is called a power supply unit or PSU.
The term is most commonly applied to electrical energy supplies, less often to mechanical ones,
and rarely to others.
A power supply may include a power distribution system as well as primary or secondary
sources of energy such as:
16
Chemical fuel cells and other forms of energy storage systems.
Solar power and batteries.
Generators or alternators.
A brief description:
Transformer-steps down high voltage AC mains to low voltage AC
Rectifier-converts AC to DC, but the DC output is varying.
MICROCONTROLLER ATMEGA328P:
Microcontrollers are "embedded" inside some other device. They can control the
features or actions of the product. Another name for a microcontroller is "embedded controller”.
Microcontrollers are dedicated to one task and run one specific program. The program is stored
in ROM (read-only memory) and generally does not change. Microcontrollers are often low-
power devices. A microcontroller has a dedicated input device and has a small LED or LCD
display for output. A microcontroller also takes input from the device it is controlling and
controls the device by sending signals to different components in the device.
17
PIN DIAGRAM:
GND: Ground.
PORT 0:
Port 0 is an 8-bit open-drain bi-directional I/O port. As an output port, each pin can sink
eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as high impedance
inputs. Port 0 may also be configured to be the multiplexed low order address/data bus during
accesses to external program and data memory. In this mode P0 has internal pull-ups.
18
PORT 1:
Port 1 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 1 output buffers
can sink/source four TTL inputs. When 1s are written to Port 1 pins they are pulled high by the
internal pull-ups and can be used as inputs.
PORT 2:
Port 2 is a 8-bit bi-directional I/O port with internal pull-ups. The Port 2 output buffers
can sink/source four TTL inputs. When 1s are written to Port 2 pins they are pulled high by the
internal pull-ups and can be used as inputs. As inputs, Port 2 pins that are externally being
pulled low will source current During accesses to external data memory that uses (IIL) because
of the internal pull-ups.
PORT 3:
Port 3 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 3 output buffers
can sink/source four TTL inputs. When 1s are written to Port 3 pins they are pulled high by the
internal pull-ups and can be used as inputs. As inputs, Port 3 pins that are externally being pulled
low will source current (IIL) because of the pull-ups.
RESET:
Reset input. A high on this pin for two machine cycles while the oscillator is running
resets the device.
19
ALE/PROG :
Address Latch Enable output pulse for latching the low byte of the address during
accesses to external memory. This pin is also the program pulse input (PROG) during Flash
programming. In normal operation ALE is emitted at a constant rate of 1/6 the oscillator
frequency, and may be used for external timing or clocking purposes.
EA / VPP:
External Access Enable must be strapped to GND in order to enable the device to fetch
code from external program memory locations starting at 0000H up to FFFFH. Note, however,
XTAL1 :
Input to the inverting oscillator amplifier and input to the internal clock operating circuit.
XTAL2:
OSCILLATOR CHARACTERISTICS:
XTAL1 and XTAL2 are the input and output, respectively, of an inverting amplifier
which can be configured for use as an on-chip oscillator, as shown in Figure3.3. Either a quartz
crystal or ceramic resonator may be used.
To drive the device from an external clock source, XTAL2 should be left unconnected
while XTAL1 is driven as shown in Figure.
20
ALCOHOL DETECTION SENSOR:
DESCRIPTION:
This alcohol sensor is suitable for detecting alcohol concentration on your breath, just
like your common breathalyzer. It has a high sensitivity and fast response time. Sensor provides
an analog resistive output based on alcohol concentration. The drive circuit is very simple, all it
needs is one resistor. A simple interface could be a 0-3.3V ADC.
21
TRANSFORMER:
A suitable ready-built mains power supply unit, such as those used to control model
trains, will include a transformer. I wouldn't recommend building your own due to the safety
Considerations when dealing with mains voltages if such a unit does not incorporate
smoothing, rectification, and regulation, then you will need to build these blocks as described in
part 1 of this series. If the unit does not have a fuse or a cut-out on the output of the transformer,
you will also need to add a fuse of an appropriate rating. This fuse is in addition to the mains
fuse in the unit's plug and is needed to protect the low voltage winding of the transformer and
any circuits you connect to it. Although we won't be building the transformer block of our 5V
regulated power supply, it is interesting to know how it works.
RECTIFIER:
22
HALF-WAVE RECTIFIER:
The half-wave rectifier is the simplest type of rectifier since it only uses one diode.
The AC input waveform to this circuit and the resulting output. As you can see, when the
AC input is positive, the diode is forward-biased and lets the current through.
23
While the output of the half-wave rectifier is DC (it is all positive), it would not be
suitable as a power supply for a circuit.
FULL-WAVE RECTIFIER:
The circuit in figure 3 addresses the second of these problems since at no time is the
output voltage 0V.
When the AC input is positive, diodes A and B are forward-biased, while diodes C and D
are reverse-biased. When the AC input is negative, the opposite is true - diodes C and D are
forward-biased, while diodes A and B are reverse-biased.
24
REGULATOR:
While there are many circuits that will tolerate a smoothed power supply, some must
have a completely regular supply with no ripple voltage.
There are many types of regulator IC and each type will have different pin-outs and will
need to be connected up slightly differently. Therefore, this article will only look at one of the
common ranges of regulator, the 78xx series.
If you are using a regulator after the smoothing block of the power supply, then you
shouldn't need to worry about the ripple voltage, since the whole point of using a regulator is to
get a stable, accurate, known voltage for your circuits.
25
RESISTORS:
by producing a voltage drop between its terminals in proportion to the current, that is, in
V = IR
CAPACITORS:
26
GSM :
27
GPS:
A GPS navigation device or GPS receiver, and when used for vehicle navigation commonly
referred to simply as a GPS, is a device that is capable of receiving information
from GPSsatellites and then to accurately calculate its geographical location.
28
7.2 Software Component
Microcontroller: ATmega328
Operating Voltage: 5V
Input Voltage (recommended): 7-12V
Input Voltage (limits): 6-20V
Digital I/O Pins: 14 (of which 6 provide PWM output)
Analog Input Pins: 6
DC Current per I/O Pin: 40 mA
DC Current for 3.3V Pin: 50 mA
Flash Memory: 32 KB of which 0.5 KB used by bootloader
SRAM: 2 KB (ATmega328)
EEPROM: 1 KB (ATmega328)
29
Clock Speed: 16 MHz
30
7.3 ARDUINO IDE PROGRAMMING PROCEDURE:
Plug in your board and wait for Windows to begin it’s driver installation process
After a few moments, the process will fail, despite its best efforts
Click on the Start Menu, and open up the Control Panel
While in the Control Panel, navigate to System and Security. Next, click on System
Once the System window is up, open the Device Manager
Look under Ports (COM & LPT). You should see an open port named “Arduino UNO
(COMxx)”. If there is no COM & LPT section, look under ‘Other Devices’ for
‘Unknown Device’
31
Right click on the “Arduino UNO (COMxx)” or “Unknown Device” port and choose the
“Update Driver Software” option
Next, choose the “Browse my computer for Driver software” option
Finally, navigate to and select the Uno’s driver file, named “ArduinoUNO.inf”, located in
the “Drivers” folder of the Arduino Software download (not the “FTDI USB Drivers”
sub-directory). If you cannot see the .inf file, it is probably just hidden. You can select the
‘drivers’ folder with the ‘search sub-folders’ option selected instead.
Windows will finish up the driver installation from there
For earlier versions of the Arduino boards (e.g.Arduino Duemilanove, Nano, or Diecimila) check
out this page for specific directions.
After following the appropriate steps for your software install, we are now ready to test your first
program with your Arduino board!
32
33
Select the type of Arduino board you’re using: Tools > Board > your board type
34
Select the serial/COM port that your Arduino is attached to: Tools > Port > COMxx
If you’re not sure which serial device is your Arduino, take a look at the available ports,
then unplug your Arduino and look again. The one that disappeared is your Arduino.
With your Arduino board connected, and the Blink sketch open, press the ‘Upload’
button
35
After a second, you should see some LEDs flashing on your Arduino, followed by the
message ‘Done Uploading’ in the status bar of the Blink sketch.
If everything worked, the onboard LED on your Arduino should now be blinking! You
just programmed your first Arduino!
If you already have projects created in the classic Arduino IDE, then you can create Visual
Studio/Atmel Studio projects from them and continue to work in Visual Studio/Atmel Studio.
36
Click on File > Open > Arduino Project (with .INO or .PDE file extension).
37
8.SOURCE CODE FOR VMS:
The following Source code for Arduino Uno Mega ATMG-328P is written in C programming
language.
#include <SoftwareSerial.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,2,1,0,4,5,6,7);
float alcohol;
//gps
//String str="";
char str[70];
String gpsString="";
char *test="$GPGGA";
38
int temp=0,i;
boolean gps_status=0;
//gsm sms
int timeTosend=1;
int count=0;
char phone_no[]="7995916776";
void setup() {
Serial.begin(9600);
pinMode(13,OUTPUT);
pinMode(buzzer, OUTPUT);
gps.begin(9600);
get_gps();
delay(2000);
delay(2000);
Serial.println("AT+CMGF=1");
delay(200);
temp=0;
void loop() {
alcohol=analogRead(A0);
39
Serial.println(alcohol);
float percentage=(alcohol/10000);
Serial.println(percentage);
Serial.println(' ');
delay(3000);
digitalWrite(13,HIGH);//relay
Sending_sms();
delay(99999999);
count++;
else{
digitalWrite(13,LOW); //relay
delay(400);
void gpsEvent()
40
gpsString="";
while(1)
i++;
if (i < 7)
i=0;
gpsString="";
if(inChar=='\r')
if(i>65)
gps_status=1;
break;
else
41
i=0;
if(gps_status)
break;
void loop() {
alcohol=analogRead(A0);
Serial.println(alcohol);
float percentage=(alcohol/10000);
Serial.println(percentage);
Serial.println(' ');
Delay(3000);
digitalWrite(13,HIGH);//relay
Sending_sms();
delay(99999999);
count++;
42
}
38
else{
digitalWrite(13,LOW); //relay
delay(400);
void get_gps()
gps_status=0;
int x=0;
while(gps_status==0)
gpsEvent();
int str_lenth=i;
latitude="";
longitude="";
int comma=0;
while(x<str_lenth)
if(gpsString[x]==',')
43
comma++;
latitude+=gpsString[x+1];
longitude+=gpsString[x+1];
x++;
int l1=latitude.length();
latitude[l1-1]=' ';
l1=longitude.length();
longitude[l1-1]=' ';
i=0;x=0;
str_lenth=0;
delay(2000);
void Sending_sms()
Serial.begin(9600);
delay(2000);
Serial.println("AT+CMGF=1");
delay(200);
while(count<timeTosend){
delay(1500);
Serial.print("AT+CMGS=\"");
44
Serial.print(phone_no);
Serial.println("\"");
while(Serial.read()!='>');
Serial.print("Latitude:");
Serial.print(latitude);
Serial.print("Longitude:");
Serial.print(longitude);
delay(500);
Serial.write(0x1A);
Serial.write(0x0D);
Serial.write(0x0A);
delay(5000);
count++;
45
OUTPUT:
46
Verified successful and uploading to Arduino Uno Mega
47
CONCLUSION:
In this project we have developed a real time model that can automatically lock the
engine when a drunken driver tries to drive a car. Now-a-days car accidents are mostly seen. By
fitting this alcohol sensor into the car, we can save guard the life of the driver and also the
remaining passengers. It is very simple application. The life time of the project is high. It has low
or zero maintenance cost and of course low power consumption.
48
Reference:
1. www.wikipedia.org
2. www.atmel.com
3. Passive Alcohol Sensors Tested in 3 States of Youth Alcohol Enforcement-NHSA(1996)
4. Muhammad Ali Mazidi,Janice Gillispie Mazidi “The 8051 Microcontroller and
Embedded Systems Using Assembly and C-2nd-ed”
49
50