Beruflich Dokumente
Kultur Dokumente
BACHELOR OF THCHNOLOGY
IN
ELECTRICAL & ELECTRONICS ENGINEERING
By
Asst. Professor
CERTIFICATE
SYSTEM FOR DRUNK AND DRIVERS” that is being submitted by S.GANESH KUMAR
her under my guidance and supervision from September 2018 to October 2018.
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
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.
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
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
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
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
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
RTS CLASSIFICATION:
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.
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
Fig 2.1: Block diagram of Microcontroller based automatic engine locking system for drunken
drivers
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.
1. Keil software.
A brief description:
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:
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.
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.
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:
4.3.3 APPLICATIONS:
4.4.1 FEATURES:
4.4.2 APPLICATIONS:
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:
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 half-wave rectifier is the simplest type of rectifier since it only uses one diode, as
shown in figure 1.
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.
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.
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.
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.
4.9 LCD:
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
5. http://www.atmel.com/Images/doc1919.pdf