You are on page 1of 61

1.

INTRODUCTION

Drinking and driving is already a serious public health problem ,which is likely to emerge as one of
the most significant problems in near future .the system implemented by us aims at reducing the
road accident in the near future due to drunken and drive . This paper present the progress in using
the alcohol detector ,a device that senses a change in the alcoholic gas content of the surrounding air
these device is more commonly referred to as a breath analysis, as it analysis the alcohol content
from person’s breath. The system detects the presence of alcohol in the vehicle and immediately
locks the engine of the vehicle.

ADVANTAGES:

Low cost

. Automated operation.

Low Power consumption

. It provides an automatic safety system for cars and other vehicles

.
Applications and Advantages:

Applications of Alcohol Detector in Car:

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 .

Advantages of Alcohol Detector project:

3) “Alcohol Detection System in Cars” provides an automatic safety system for


cars and other vehicles as well.

3. Block diagram
4.WORKING

MQ3 sensor is basic sensing element used for alcohol detection. When alcohol
is detected it gives logic high(1) as per the program and remaining circuit run
simultaneously.

When MQ3 sensor goes to logic 1, it sends an high signal to micro controller
89S52. The micro controller send this signal to engine circuit driving through
LM293D driver IC , i.e., as per the program and our aim is that when alcohol is
detected then the engine speed starts decreasing ultimately and engine stops
through this process i.e., engine is locked.

Along with this operation 16X2 Lcd connected to micro controller , it displays
the engine status as well as sensor status w.r.t above operation when alcohol
detected the buzzer starts ringing at the same time.

The power supply requirement are arranged along with a reset switch is places at
pin.9 of micro controller 89S52 to reset the process.

If the sensor is in condition logic low(0) then Lcd displays no alcohol detected.
So engine is in unlocked state and runs by the above process.
HARDWARE COMPONENTS DESCRIPTION
MQ3 sensor (4 pin)

89S52 micro controller

40 pin IC base

Crystal oscillator (11.0592Mhz)

Capacitors

Resistors

Ignition lock

BC 547 transistor

Red LED

16×2 LCD

Transformer (9V, 1A)


DB107 rectifier

IC Regulator (7805)

LM 293D

Buzzer

DC motor 5V, B.O

Push button switch

MICROCONTROLLER AT89S52

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.

FEATURES:

8K Bytes of In-System Programmable (ISP) Flash Memory -


Endurance: 10,000 Write/Erase Cycles

. 4.0V to 5.5V Operating Range

. Fully Static Operation: 0 Hz to 33 Mhz.

Three- bit Internal RAM.

32 Programmable I/O Lines.

Three 16-bit Timer/Counters.

Eight Interrupt Sources.

Full Duplex UART Serial Channel.


Low-power Idle and Power-down Modes
Interrupt Recovery from Power-down

Watchdog Timer.

Dual Data Pointer.

Power-off Flag.

Fast Programming Time.

Level Program Memory Lock.

Flexible ISP Programming (Byte and Page Mode)


PIN DESCRIPTION:

VCC: Supply voltage.

GND: Ground.

PORT 0:
Port 0 is an 8-bit open-drain bi-directional I/O port. As an output port, each pin
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.

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 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.

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.

Port Pin Alternate Functions

P3.0 RXD (serial input port)

P3.1 TXD (serial output port)

P3.2 INT0 (external interrupt 0)

P3.3 INT1 (external interrupt 1)

P3.4 T0 (timer 0 external input)

P3.5 T1 (timer 1 external input)

P3.6 WR (external data memory Write strobe)


P3.7 RD (external data memory read strobe)

Note, however, that if lock bit 1 is programmed, EA will be internally


latched on reset.

EA should be strapped to VCC for internal program executions.

XTAL1:

Input to the inverting oscillator amplifier and input to the internal clock
operating circuit.

XTAL2:

Output from the inverting oscillator amplifier.

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. 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.
Alcohol Gas Sensor MQ3:

It is a low cost semiconductor sensor which can detect the presence of alcohol
gases at concentrations from 0.05 mg/L to 10 mg/L. The sensitive material used
for this sensor is SnO2, whose conductivity is lower in clean air. It’s
conductivity increases as the concentration of alcohol gases increases. It has
high sensitivity to alcohol and has a good resistance to disturbances due to
smoke, vapor and gasoline. This module provides both digital and analog
outputs. MQ3 alcohol sensor module can be easily interfaced with
Microcontrollers, Arduino Boards, Raspberry Pi etc.

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

o
Features :

Operating voltage: 5V ±0.1

Concentration: 0.05mg/L to 10mg/L alcohol

Current consumption: 150Ma

Output sensitivity: adjustable


Analog output: 0V to 5V

Digital output: 0V or 5V

Low cost and fast response

Stable and long life

Fair sensitivity to alcohol gas

Both digital and analog outputs

Operation temperature: ‒10⁰C to 70⁰C

Application

* Vehicle alcohol detector

* Portable alcohol detector


Resistance of sensor(Rs): Rs=(Vc/VRL-1)×RL
TRANSISTOR:

BC547 is a NPN transistor hence the collector and emitter will be left open
(Reverse biased) when the base pin is held at ground and will be closed
(Forward biased) when a signal is provided to base pin. BC547 has a gain value
of 110 to 800, this value determines the amplification capacity of the transistor.
The maximum amount of current that could flow through the Collector pin is
100mA, hence we cannot connect loads that consume more than 100mA using
this transistor. To bias a transistor we have to supply current to base pin, this
current (IB) should be limited to 5mA.

When this transistor is fully biased then it can allow a maximum of 100mA to
flow across the collector and emitter. This stage is called Saturation Region
and the typical voltage allowed across the Collector-Emitter (VCE) or Base-
Emitter (VBE) could be 200 and 900 mV respectively. When base current is
removed the transistor becomes fully off, this stage is called as the Cut-off
Region and the Base Emitter voltage could be around 660 mV.

BC547 Transistor Features

Bi-Polar NPN Transistor


DC Current Gain (hFE) is 800 maximum
Continuous Collector current (IC) is 100mA
Emitter Base Voltage (VBE) is 6V
Base Current(IB) is 5mA maximum
Available in To-92 Package
Description on 7805 Voltage Regulator IC

Voltage regulators are very common in electronic circuits. They provide a


constant output voltage for a varied input voltage. In our case the 7805 IC is an
iconic regulator IC that finds its application in most of the projects. The name
7805 signifies two meaning, “78” means that it is a positive voltage regulator
and “05” means that it provides 5V as output. So our 7805 will provide a +5V
output voltage.

The output current of this IC can go up to 1.5A. But, the IC suffers from heavy
heat loss hence a Heat sink is recommended for projects that consume more
current. For example if the input voltage is 12V and you are consuming 1A, then
(12-5) * 1 = 7W. This 7 Watts will be dissipated as heat.

7805 Regulator Features

5V Positive Voltage Regulator


Minimum Input Voltage is 7V

Maximum Input Voltage is 25V


Operating current(IQ) is 5mA

Internal Thermal Overload and Short circuit current limiting protection is


available.
Junction Temperature maximum 125 degree Celsius
Pin Configuration

Pin Number Pin Name Description

1 Input (V+) Unregulated Input Voltage

Ground

2 Connected to Ground

(Gnd)

3 Output (Vo) Outputs Regulated +5V


Applications

Constant +5V output regulator to power microcontrollers and sensors in


most of the projects

Adjustable Output Regulator


Current Limiter for certain applications
Regulated Dual Supply
Output Polarity-Reversal-Protection Circuit
LM 293D driver

The L293D is a famous 16-Pin Motor Driver IC. As the name suggests it is
mainly used to drive motors. A single L293D IC is capable of running two DC
motors at the same time; also the direction of these two motors can be controlled
independently. So if you have motors which has operating voltage less than 36V
and operating current less than 600mA, which are to be controlled by digital
circuits like Op-Amp, 555 timers, digital gates or even Micron rollers like
Arduino, PIC, ARM etc.. this IC will be the right choice for you. Using this
L293D motor driver IC is very simple. The IC works on the principle of Half H-
Bridge.
Features

Can be used to run Two DC motors with the same IC.


Speed and Direction control is possible
Motor voltage Vcc2 (Vs): 4.5V to 36V
Maximum Peak motor current: 1.2A
Maximum Continuous Motor Current: 600mA

Supply Voltage to Vcc1(vss): 4.5V to 7V


Transition time: 300ns (at 5Vand 24V)
Automatic Thermal shutdown is available
Available in 16-pin DIP, TSSOP, SOIC packages
Buzzer

A buzzer is a small yet efficient component to add sound features to our


project/system. It is very small and compact 2-pin structure hence can be easily
used on breadboard, Perf Board and even on PCBs which makes this a widely
used component in most electronic applications.

There are two types are buzzers that are commonly available. The one shown
here is a simple buzzer which when powered will make a Continuous
Beeeeeeppp.... sound, the other type is called a readymade

buzzer which will look bulkier than this and will produce a Beep. Beep. Beep.
Sound due to the internal oscillating circuit present inside it. But, the one shown
here is most widely used because it can be customised with help of other circuits
to fit easily in our application.

This buzzer can be used by simply powering it using a DC power supply ranging
from 4V to 9V. A simple 9V battery can also be used, but it is recommended to
use a regulated +5V or +6V DC supply. The buzzer is normally associated with
a switching circuit to turn ON or turn OFF the buzzer at required time and
require interval.

Radio-frequency identification (RFID) uses electromagnetic fields to


automatically identify and track tags attached to objects. The tags contain
electronically-stored information. Passive tags collect energy from a nearby
RFID reader's interrogating radio waves. Active tags have a local power source
(such as a battery) and may operate hundreds of meters from the RFID reader.
Unlike a barcode, the tag need not be within the line of sight of the reader, so it
may be embedded in the tracked object. RFID is one method for Automatic
Identification and Data Capture (AIDC).[1]
RFID tags are used in many industries, for example, an RFID tag attached to an
automobile during production can be used to track its progress through the
assembly line; RFID-tagged pharmaceuticals can be tracked through
warehouses; and implanting RFID microchips in livestock and pets allows for
positive identification of animals.
Since RFID tags can be attached to cash, clothing, and possessions, or implanted
in animals and people, the possibility of reading personally-linked information
without consent has raised serious privacy concerns.[2] These concerns resulted
in standard specifications development addressing privacy and security
issues. ISO/IEC 18000 and ISO/IEC 29167 use on-chip cryptography methods
for untraceability, tag and reader authentication, and over-the-air
privacy. ISO/IEC 20248specifies a digital signature data structure for RFID
and barcodes providing data, source and read method authenticity. This work is
done within ISO/IEC JTC 1/SC 31 Automatic identification and data capture
techniques. Tags can also be used in shops to expedite checkout, and to prevent
theft by customers and employees.
Crystal oscillator:
A crystal oscillator is an electronic oscillator circuit that uses the

mechanical resonance of a vibrating crystal of piezoelectric material to create an


electrical signal with precise frequency. This frequency is often used to keep
track of time, as in quartz wristwatches, to provide a stable clock signal for
digital integrated circuits, and to stabilize frequencies for radio transmitters and
receivers. The most common type of piezoelectric resonator used is the quartz
crystal, so oscillator circuits incorporating them became known as crystal
oscillators, but other piezoelectric materials including polycrystalline ceramics
are used in similar circuits. Typically widely using crystal frequency is
11.05192Mhz…. various types of packages available in market with this

frequency…
Description on LCD modules

LCD modules are vey commonly used in most embedded projects, the reason
being its cheap price, availability and programmer friendly. Most of us would
have come across these displays in our day to day life, either at PCO’s or
calculators. The appearance and the pinouts have already been visualized above
now let us get a bit technical.

16×2 LCD is named so because; it has 16 Columns and 2 Rows. There are a lot
of combinations available like, 8×1, 8×2, 10×2, 16×1, etc. but the most used one
is the 16×2 LCD. So, it will have (16×2=32) 32 characters in total and each
character will be made of 5×8 Pixel Dots. A Single character with all its Pixels
is shown in the below picture.
Features of 16×2 LCD module

Operating Voltage is 4.7V to 5.3V


Current consumption is 1mA without backlight

Alphanumeric LCD display module, meaning can display alphabets and


numbers

Consists of two rows and each row can print 16 characters.


Each character is build by a 5×8 pixel box
Can work on both 8-bit and 4-bit mode

It can also display any custom generated characters


Available in Green and Blue Backlight
IGNITION OFF:
An ignition interlock device or breath alcohol ignition interlock device (IID
and BAIID) is a breathalyzer for an individual's vehicle. It requires the driver to
blow into a mouthpiece on the device before starting the vehicle. If the resultant
breath-alcohol concentration analyzed result is greater than the programmed
blood alcohol concentration (which varies between countries), the device
prevents the engine from being started. The interlock device is located inside the
vehicle, near the driver’s seat, and is directly connected to the engine’s ignition
system.

An ignition interlock interrupts the signal from the ignition to the starter until a
valid breath sample is provided that meets minimal alcohol guidelines in that
state. At that point, the vehicle can be started as normal. At random times after
the engine has been started, the IID will require another breath sample, referred
to as a rolling retest. The purpose of the rolling retest is to prevent someone
other than the driver from providing a breath sample. If the breath sample isn't
provided, or the sample exceeds the ignition interlock's preset blood alcohol
level, the device will log the event, warn the driver, and then start up an alarm in
accordance to state regulations (e.g., lights flashing, horn honking) until the
ignition is turned off, or a clean breath sample has been provided. A common
misconception is that interlock devices will simply turn off the engine if alcohol
is detected; this would, however, create an unsafe driving situation and expose
vehicle off manufacturers to considerable liability. Ignition interlock devices do
not have an automatic engine shut off feature.

Resistors :
A resistor is a passive two-terminal electrical component that implements
electrical resistance as a circuit element. In electronic circuits, resistors are used
to reduce current flow, adjust signal levels, to divide voltages, bias active
elements, and terminate transmission lines, among other uses. High-power
resistors that can dissipate many watts of electrical power as heat, may be used
as part of motor controls, in power distribution systems, or as test loads for
generators. Fixed resistors have resistances that only change slightly with
temperature, time or operating voltage. Variable resistors can be used to adjust
circuit elements (such as a volume control or a lamp dimmer), or as sensing
devices for heat, light, humidity, force, or chemical activity.

A preset resistor is a smaller PCB mounted version of a potentiometer. These are


useful where adjustment or configuration of a circuit needs to be made but such
adjustment only occurs during building a circuit, not during normal use. An
appropriate value for the PICAXE system is 10k (do not use 100k

devices).
capacitor:

A capacitor is a passive two-terminal electrical component that stores potential


energy in an electric field. The effect of a capacitor is known as capacitance.
While some capacitance exists between any two electrical conductors in
proximity in a circuit, a capacitor is a component designed to add capacitance to
a circuit. The capacitor was originally known as a condenser

Capacitor is one of the most fundamental passive components with 2 pins.


Almost every circuit has one or more capacitors. Capacitors are used in
Electronic Circuits to store electrical energy for a short period of time. It is just
like RAM or Main Memory in a computer system. Capacitors are used to store
and supply little electrical charges momentarily. Farad is the unit of capacitance
which signifies how much electrical charge the capacitor can hold at once. The
higher the rating, the more charge holding capacity is. Farad is a very large unit
of capacitance, usually way too much than an ordinary electrical circuit needs.
So, the widely available capacitors have a capacitance ranging from few pico
farads (10 to the power -12) to few milifarads (one thousandth).
6. program or source code

sbit D0 = P2^0;

sbit D1 = P2^1;

sbit D2 = P2^2;

#include<reg52.h> sbit D3 = P2^3;

registers for ports of the controller sbit D4 = P2^4;

#include<lcd.h> sbit D5 = P2^5;

//LCD Module Connections sbit D6 = P2^6;

sbit RS = P0^6; sbit D7 = P2^7;

sbit EN = P0^7; sbit ac = P3^0;


sbit buz = P0^5;

//including sfr
sbit mp = P1^0;

sbit mn = P1^1;

//End LCD Module Connections

void Delay(int a)

int j;

int i;

for(i=0;i<a;i++)

for(j=0;j<100;j++)
{

void main()

int i;

buz=0;

ac=0;
mp=1;
mn=0;

Lcd8_init();

Lcd8_Set_Cursor(1,1);

Lcd8_Write_String("Alcohol sensor");

Lcd8_Set_Cursor(2,6);

Lcd8_Write_String("system");

for(i=0;i<15;i++)

Delay(100);

}
While(1)

if(ac==1)

buz=1;

mp=mn=0;

Lcd8_Set_Cursor(1,0);
Lcd8_Write_String("Alcohol : YES. ");
Lcd8_Set_Cursor(2,0);
Lcd8_Write_String("Engine : locked");

else

mp=1;

mn=0;

buz=0;

Lcd8_Set_Cursor(1,0);

Lcd8_Write_String("Alcohol : NO. ");

Lcd8_Set_Cursor(2,0);
Lcd8_Write_String("Engine :Unlocked");

}
part 2

//LCD Functions Developed by YASHWANTHSAAI


//LCD Module Connections

extern bit RS;

extern bit EN;

extern bit D0;

extern bit D1;

extern bit D2;

extern bit D3;

extern bit D4;

extern bit D5;

extern bit D6;


extern bit D7;

//End LCD Module Connections

void Lcd_Delay(int a)

int j;

int i;
for(i=0;i<a;i++)

{
for(j=0;j<100;j++)

//LCD 8 Bit Interfacing Functions

void Lcd8_Port(char a)

{
if(a & 1)

D0 = 1;

else

D0 = 0;

if(a & 2)

D1 = 1;

else

D1 = 0;
if(a & 4)
D2 = 1;

else

D2 = 0;

if(a & 8)

D3 = 1;

else

D3 = 0;
if(a & 16)

D4 = 1;

else

D4 = 0;

if(a & 32)

D5 = 1;

else

D5 = 0;
if(a & 64)
D6 = 1;

else

D6 = 0;

if(a & 128)

D7 = 1;

else

D7 = 0;

}
void Lcd8_Cmd(char a)

RS = 0; // => RS = 0

Lcd8_Port(a); //Data transfer

EN = 1; // => E = 1

Lcd_Delay(5);

EN = 0; // => E = 0

8.FEATURES

7.1 ADVANTAGES:

Low cost.

Automated operation.
Low Power consumption.

It provides an automatic safety system for cars and other vehicles as


well.
7.2 APPLICATIONS:

System configuration:

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.

7.3 FUTURE ENHANCEMENT:

1) We can implement GSM technology to inform the relatives or


owners of the vehicle about the alcohol consumption.

2) We can implement GPS technology to find out the location of the


vehicle.
10.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.

This is a developed design to efficiently check drunken driving. By


implementing this design a safe car journey is possible decreasing the accident
rate due to drinking. By implementing this design, drunken drivers can be
controlled so are the accidents due to drunken driving.

Government must enforce laws to install such circuit in every car and must
regulate all car companies to preinstall such mechanisms while manufacturing
the car itself. If this is achieved the deaths due to drunken drivers can be brought
to minimum level. In this type of system, future scope can be safely landing of
car aside without disturbing other vehicles.
11. BIBILOGRAPHY

1. www.wikipedia.org

2. www.atmel.com

3. Passive Alcohol Sensors Tested in 3 States of Youth Alcohol


EnforcementNHSA(1996)

4. Muhammad Ali Mazidi,Janice Gillispie Mazidi “The 8051

Microcontroller and Embedded Systems Using Assembly and C-2nd-ed”

5. http://www.atmel.com/Images/doc1919.pdf

6. Infrared sensors: detectors, electronics, and signal processing 7. Practical


Aspects of Embedded System Design Using Microcontrollers

You might also like