Sie sind auf Seite 1von 31

A

Mini Project Report


On
“AUTOMATIC ENGINE LOCKING SYSTEM FOR DRUNK
AND DRIVE”
Submitted in partial fulfilled of requirement

For the award of the Degree of

BACHELOR OF THCHNOLOGY
IN
ELECTRICAL & ELECTRONICS ENGINEERING
By

S.GANESH KUMAR (14S41A02A0)


Under the Guidance of
Mr. M.RAMESH
[BTech, MTech, IEE]

Asst. Professor

DEPARTMENT OF ELECTRICAL & ELECTRONICS ENGINEERING

VAAGESWARI COLLEGE OF ENGINEERING


(Approved by AICTE, New Delhi, Affiliated to JNTUH, Hyderabad)
Rama Krishna Colony, Karimnagar, Andhra Pradesh, 505481
DEPARTMENT OF ELECTRICAL & ELECTRONICS ENGINEERING

VAAGESWARI COLLEGE OF ENGINEERING


(Approved by AICTE, New Delhi, Affiliated to JNTUH, Hyderabad)
Rama Krishna Colony, Karimnagar, Andhra Pradesh, 505481

CERTIFICATE

This is to certify that the dissertation entitled “AUTOMATIC ENGINE LOCKING

SYSTEM FOR DRUNK AND DRIVERS” that is being submitted by S.GANESH KUMAR

(14S41A02A0) in partial fulfillment for the award of the Degree of BACHELOR OF

TECHNOLOGY IN ELECTRICAL & ELECTRONICS ENGINEERING from

Jawaharlal Nehru Technological University, Hyderabad. This is a bonafide work done by

her under my guidance and supervision from September 2018 to October 2018.

Internal Guide Head of the Department


ACKNOWLEDGEMENT

The satisfaction that accompanies the successful completion of any task would be

incomplete without the mention of the people who made it possible and whose constant

guidance and encouragement crown all the efforts success.

I am extremely grateful to our respected Principal, Mr. SRINIVAS for fostering


an excellent academic climate in our institution. I also express my sincere gratitude to our
respected Head of the Department Prof. Mr. M.RAMESH for his encouragement, overall
guidance in viewing this project a good asset and effort in bringing out this project.

I would like to convey thanks to our Project guide at college Prof. Mr.
M.RAMESH for his guidance, encouragement, co-operation and kindness during the
entire duration of the course and academics.

I am deeply indebted to our Project trainer Mr. VENKAT GAUD of Kit Tech
Solutions for regular guidance and constant encouragement and we are extremely grateful
to him for his valuable suggestions and unflinching co-operation throughout project work.

Last but not the least we also thank our friends and family members for helping us
in completing the project.

S.GANESH KUMAR (14S41A02A0)


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 sytem 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, then the system will

lock the engine.

As vehicle automobiles are beyond the scope of this project, we are

simulating the process by activating the relay.


CONTENTS

LIST OF FIGURES i
LIST OF TABLES ii
1. INTRODUCTION 1
1.1 INTRODUCTION TO EMBEDDED SYSTEMS 1
1.1.1 EMBEDDED SYSTEMS 1
1.1.2 CHARACTERISTICS OF EMBEDDED SYSTEMS 1
1.1.3 CLASSIFICATION OF EMBEDDED SYSYEMS 2
1.14 APPLICATIONS OF EMBEDDED SYSTEMS 3
1.2 INTRODUCTION TO MICROCONTROLLER BASED 4
AUTOMATIC ENGINE LOCKING SYSTEM FOR
DRUNKEN DRIVERS

2. BLOCK DIAGRAM
2.1 BLOCK DIAGRAM OF MICROCONTROLLER BASED 5
AUTOMATIC ENGINE LOCKING SYSTEM FOR
DRUNKEN DRIVERS
2.2 BLOCK DIAGRAM DESCRIPTION 5
2.2.1 HARDWARE COMPONENTS 6
2.2.2 SOFTWARE COMPONENTS 6

3. SCHEMATIC CIRCUIT DIAGRAM 7

4. HARDWARE COMPONENTS DESCRIPTION 8

4.1 POWER SUPPLY 8


4.2 MICROCONTROLLER AT89S52 8
4.2.1 FEATURES 9
4.2.2 PIN DIAGRAM 10
4.2.3 BLOCK DIAGRAM 11
4.2.4 PIN DESCRIPTION 12
4.3 ALCOHOL DETECTION SENSOR 15
4.3.1 DESCRIPTION 15
4.3.2 FEATURES 15
4.3.3 APPLICATIONS 15
4.4 BUZZER 16
4.4.1 FEATURES 16
4.4.2 APPLICATIONS 16
4.5 BUZZER DRIVER CIRCUIT 16
4.5.1 BLOCK DIAGRAM OF BUZZER DRIVER 17
CIRCUIT
4.6 TRANSFORMER 17
4.7 RECTIFIER 18
4.7.1 HALF WAVE RECTIFIER 18
4.7.2 FULL WAVE RECTIFIER 19
4.8 REGULATOR 20
4.8.1 THE 78XX SERIES OF REGULATORS 20
4.9 LCD 21
4.10 MOTORS 22
4.11 LM324 OP-AMP 22
4.11.1 FEATURES 23
4.12 RESISTORS 24
4.13 CAPACITORS 24

5. SOFTWARE COMPONENTS DESCRIPTION 25

5.1 KEIL SOFTWARE 25


5.2 KEIL SOFTWARE PROGRAMMING PROCEDURE 27

6. SOURCE CODE 39

7. FEATURES 44

7.1 ADVANTAGES 44
7.2 APPLICATIONS 44
7.3 FUTURE ENHANCEMENT 45
7.3.1 DETECTION USING FACIAL MONITORING 45
SYSTEM
7.3.2 DETECTION USING THE DRIVER’S STATE 46
FROM THE DRIVING BEHAVIOR

8. CONCLUSION 47

9. BIBILOGRAPHY 47
LIST OF FIGURES
SNO FIGURE PAGE NO
1. BLOCK DIAGRAM OF MICROCONTROLLER BASED 5
AUTOMATIC ENGINE LOCKING SYSTEM FOR
DRUNKEN DRIVERS
2. SCHEMATIC CIRCUIT DIAGRAM 7
3. PIN DIAGRAM OF MICROCONTROLLER 10
4. BLOCK DIAGRAM OF MICROCONTROLLER 11
5. CONNECTIONS OF OSCILLATOR 14
6. MQ-3 ALCOHOL DETECTION SENSOR 15
7. BUZZER 16
8. BLOCK DIAGRAM OF BUZZER DRIVER CIRCUIT 17
9. HALF-WAVE RECTIFIER 18
10. HALF-WAVE RECTIFICATION 19
11. FULL-WAVE RECTIFIER 19
12. FULL-WAVE RECTIFICATION 20
13. WIRING UP A REGULATOR IC 21
14. LCD DISPLAY 21
15. MOTOR 22
16. BLOCK DIAGRAM OF LM324 OP-AMP 23
17. RESISTORS 24
18. CAPACITORS 24
19. SYSTEM CONFIGURATION 44
20. DETECTION USING FACIAL MONITORING SYSTEM 45
21. DETECTION USING THE FACIAL MONITORING SYSTEM 46
THE DRIVING BEHAVIOR
LIST OF TABLES

SNO TABLE PAGE NO


1. PORT PIN’S DESCRIPTION 13
2. REGULATOR VOLTAGE REPRESENTATION 20
1.INTRODUCTION

1.1 INTRODUCTION TO EMBEDDED SYSTEMS:

1.1.1 EMBEDDED SYSTEMS:

An Embedded System is a combination of computer hardware and software, and


perhaps additional mechanical or other parts, designed to perform a specific function. An
embedded system is a microcontroller-based, software driven, reliable, real-time control
system, autonomous, or human or network interactive, operating on diverse physical
variables and in 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 software system on PC or UNIX, not a traditional business or scientific
application. High-end embedded & lower end embedded system. High-end embedded
system – Generally 32, 64 Bit Controller used with OS. Examples Personal Digital
Assistant and Mobile phones etc . Lower end embedded system – Generally 8,16 Bit
Controllers used with an minimal operating systems and hardware layout designed for the
specific purpose.

1.1.2 CHARACTERISTICS OF EMBEDDED SYSTEMS:

 An embedded system is any computer system hidden inside a product other than a
computer.
 Embedded systems have a microprocessor/ microcontroller and a memory. Some
have a serial port or a network connection. They usually do not have keyboards,
screens or disk drivers.
 They will encounter a number of difficulties when writing embedded system
software in addition to those we encounter when we write applications.
- Throughput: Our system may need to handle a lot of data in a short period
of time.
- Response: Our system may need to react to events quickly.
- Testability: Setting up equipment to test embedded software can be difficult.
- Debugability: Without a screen or a keyboard, finding out what the software
is doing wrong (other than not working) is a troublesome problem.
- Reliability: Embedded systems must be able to handle any situation without
human intervention.
- Memory space: Memory is limited on embedded systems, and you must
make the software and the data fit into whatever memory exists.
- Program installation: You will need special tools to get your software into
embedded systems.
- Power consumption: Portable systems must run on battery power, and the
software in these systems must conserve power.
- Processor hogs: Computing that requires large amounts of CPU time can
complicate the response problem.
- Cost: Reducing the cost of the hardware is a concern in many embedded
system projects; software often operates on hardware that is barely adequate
for the job

1.1.3 CLASSIFICATION OF EMBEDDED SYSTEMS:

REAL TIME SYSTEMS (RTS):

 RTS is one which has to respond to events within a specified deadline.


 A right answer after the dead line is a wrong answer

RTS CLASSIFICATION:

 Hard Real Time Systems.


 Soft Real Time System.
1. HARD REAL TIME SYSTEM:

 Hard real-time systems have very narrow response time.


 Example: Nuclear power system, Cardiac pacemaker.

2. SOFT REAL TIME SYSTEM:

 Soft real-time systems have reduced constrains on "lateness" but still must operate
very quickly and repeatable.
 Example: Railway reservation system – takes a few extra seconds the data remains
valid.

1.1.4 APPLICATIONS OF EMBEDDED SYSTEMS:

1. Military and aerospace embedded software applications.


2. Communication Applications.
3. Industrial automation and process control software.
4. Mastering the complexity of applications.
5. Reduction of product design time.
6. Real time processing of ever increasing amounts of data.
7. Intelligent, autonomous sensors.
1.2 INTRODUCTION TO MICROCONTROLLER BASED
AUTOMATIC ENGINE LOCKING SYSTEM FOR
DRUNKEN DRIVERS:

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.

The system uses a compact circuitry built around Flash version of AT89S52
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.
2.BLOCK DIAGRAM

2.1 BLOCK DIAGRAM OF MICROCONTROLLER BASED


AUTOMATIC ENGINE LOCKING SYSTEM WHEN DRUNKEN
DRIVERS:

Fig 2.1: Block diagram of Microcontroller based automatic engine locking system for drunken
drivers

2.2 BLOCK DIAGRAM DESCRIPTION:

The following hardware and software is used in this system. Detailed explanations of
these components follow in the later sections.
2.2.1 HARDWARE COMPONENTS:

1. Power supply.
2. Microcontroller AT89S52.
3. Alcohol detection sensor.
4. Buzzer.
5. Buzzer Driver circuit.
6. Transformer.
7. Rectifier.
8. Regulator.
9. LCD.
10. Engine/Motors.
11. LM324 op-amp.
12. Resistors.
13. Capacitors.

2.2.2 SOFTWARE COMPONENTS:

1. Keil software.

2.Keil software programming.


3. SCHEMATIC CIRCUIT DIAGRAM:

Fig 3: Schematic circuit diagram


4. HARDWARE COMPONENTS DESCRIPTION

4.1 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:

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

4.2 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.
4.2.1 FEATURES:

Compatible with MCS®-51 Products:

 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 Mode.
 Watchdog Timer.
 Dual Data Pointer.
 Power-off Flag.
 Fast Programming Time.
 level Program Memory Lock.
 Flexible ISP Programming (Byte and Page Mode).
 Green (Pb/Halide-free) Packaging Option.
4.2.2 PIN DIAGRAM:

Fig 4.1: Pin diagram of microcontroller


4.2.3 BLOCK DIAGRAM:

Fig 4.2: Block diagram of micro controller


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

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.
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)
Table 4.1: Port pin’s description

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

Fig 4.3: Connections of oscillator


4.3 ALCOHOL DETECTION SENSOR:
The alcohol detector sensor used in our project is MQ-3 Sensor.

Fig 4.4: MQ-3 alcohol detection sensor

The features and applications of the alcohol sensor are as follows:

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

4.3.2 FEATURES:

 High sensitivity to alcohol and small sensitivity to benzene.


 Fast response and high sensitivity.
 Stable and long life.

4.3.3 APPLICATIONS:

 They are suitable for alcohol checker, breath analyzer.


4.4 BUZZER:

Fig 4.5: Buzzer

4.4.1 FEATURES:

 These high reliability electromagnetic buzzers are applicable to automobile


equipment.
 Compact, pin terminal type electromagnetic buzzer with 2048Hz output.
 Pin type terminal construction enables direct mounting onto printed circuit
boards.

4.4.2 APPLICATIONS:

 Clocks, travel watches, keyboards, toys, various alarms of automobile


equipment.

4.5 BUZZER DRIVER CIRCUIT:

Digital systems and microcontroller pins lack sufficient current to drive the
circuits like relays, buzzer circuits etc. While these circuits require around 10milli amps
to be operated, the microcontroller’s pin can provide a maximum of 1-2milli amps
current. For this reason, a driver such as a power transistor is placed in between the
microcontroller and the buzzer circuit.
4.5.1 BLOCK DIAGRAM OF BUZZER DRIVER CIRCUIT:

Fig 4.6: Block diagram of buzzer driver circuit

The input to the base of the transistor is applied from the microcontroller port pin
P1.0. The transistor will be switched on when the base to emitter voltage is greater than
0.7V (cut-in voltage). Thus when the voltage applied to the pin P1.0 is high i.e., P1.0=1
(>0.7V), the transistor will be switched on and thus the buzzer will be ON.

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

4.7 RECTIFIER:

The purpose of a rectifier is to convert an AC waveform into a DC waveform. There are


two different rectification circuits, known as 'half-wave' and 'full-wave' rectifiers. Both
use components called diodes to convert AC into DC.

4.7.1 HALF-WAVE RECTIFIER:

The half-wave rectifier is the simplest type of rectifier since it only uses one diode, as
shown in figure 1.

Fig 4.7: Half-wave rectifier

Figure 2 shows 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.
Fig 4.8: Half-wave rectification

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.

4.7.2 FULL-WAVE RECTIFIER:

The circuit in figure 3 addresses the second of these problems since at no time is
the output voltage 0V.

Fig 4.9: Full-wave rectifier


Fig 4.10: Full-wave rectification

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.

4.8 REGULATOR:

While there are many circuits that will tolerate a smoothed power supply, some
must have a completely regular supply with no ripple voltage.

4.8.1 THE 78XX SERIES OF REGULATORS:

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.

Type Number Regulation voltage Maximum current Minimum voltage


7805 +5V 1A +7V
7812 +12V 1A +14.5V
Table 4.2: Regulator voltage representation
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.

Fig 4.11: Wiring up a regulator IC

4.9 LCD:

Fig 4.12: LCD display

LCD (Liquid Crystal Display) screen is an electronic display module and find a
wide range of applications. A 16x2 LCD display is very basic module and is very
commonly used in various devices and circuits. These modules are preferred over seven
segments and other multi segment LEDs. The reasons being: LCDs are economical;
easily programmable; have no limitation of displaying special & even custom characters
(unlike in seven segments).
9. BIBILOGRAPHY:

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”

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

Das könnte Ihnen auch gefallen