1
Appendix 1
ALCOHOL DETECTION WITH VEHICLE
CONTROLLING
A PROJECT REPORT
Submitted by
BHARGAV L. JHA (Enrollment no.: 100620111019)
SHUBHAM R. PATEL (Enrollment no.: 100620111015)
In fulfillment for the award of the degree
Of
BACHELOR OF ENGINEERING
in
ELECTRONICS & COMMUNICATION
GUJARAT INSTITUTE OF TECHNICAL STUDIES, PRANTIJ.
Gujarat Technological University, Ahmadabad
May, 2014
2
Appendix 2
GUJARAT INSTITUTE OF TECHNICAL STUDIES
ELECTRONICS & COMMUNICATION
2014
CERTIFICATE
This is to certify that the dissertation entitled “ALCOHOL
DETECTION WITH VEHICLE CONTROLLING” has been carried
out by PATEL SHUBHAM R. & JHA BHARGAV L. under my guidance
in fulfillment of the degree of Bachelor of Engineering in Electronics &
communication (7th
Semester) of Gujarat Technological University,
Ahmadabad during the academic year 2013-14.
Guides:-
Prof. Mitesh Prajapati
Internal Guide, Lecturer,
E.C. Department,
G.I.T.S. .
Prof. Maulik Darji
Head of Department,
E.C. Department,
G.I.T.S.
3
ACKNOLEDGEMENT
We take this an opportunity to humbly express our thankfulness to all those concerned
with our project.
We are greatly indebted to Mr. Mitesh Prajapati of our institute Gujarat Institute Of
Technical Studies for providing us such opportunity to learn technical aspects. We
particularly wish to acknowledge our deep sense of gratitude to our guide Mr. Mitesh
Prajapati for their inspiration, constant encouragement, valuable guidance, affection and
support without whose constant supervision, this work would have been not possible. His
precious guidance has proved to be a beacon of light that has helped us in our project to
reach this presentable form.
I also want to acknowledge the guidance provided by other faculty member which proved
very useful to as in our project. We wish to express our thanks to all those who Associated
with this project report either directly or indirectly for sparing time out of their busy
schedule.
4
ABSTRACT
Purpose: The main purpose behind this project is drunken driving detection.
Principle: Alcohol Detector in Car project is designed for the safety of the
people seating inside the car.
Keyword: Gas sensor, GSM, ignition lock, buzzer, LCD, Controller.
Introduction: The main purpose behind this project is drunken driving
detection. Now 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. The main unit of this project is an Alcohol
ssensor. This project should be installed inside the vehicle.
Now a day’s most of the peoples use cell phone for communication.
Controlling devices through wireless media becomes very popular. GSM
technology is very powerful because it overcomes the limited range of
infrared and radio remote controls. We run the vehicle by using wireless
communication system. In this system Control section acts as transmitter we
are ejecting the control signals, then the vehicle receives acts as receiver the
signals, according to the signals it will give an alarm or buzzer.
5
Appendix 3
LIST OF TABLES
Table No. Table Descriptions Page No.
Table 1 Specification of Alcohol Gas Sensor 32
Table 2 Pin outs of Alcohol Gas Sensor 33
6
Appendix 4
LIST OF FIGURES
NO. FIGURE NAME Page no:
1 Block diagram of system 13
2 PIN diagram of ATmega32 controller 17
3 ATmega32 controller 17
4 Block diagram of ATmega32 18
5 16x2 LCD with pin function 24
6 PIN diagram of 16x2 LCD 25
7 Circuit diagram of LCD interfacing of ATmega32 27
8 Alcohol gas sensor MQ-3 29
9 Resistance ratio and abscissa in alcohol concentration 30
10 Sensitivity of Alcohol gas sensor 31
11 Buzzer 34
12 Circuit of buzzer 35
13 Relay 36
14 Relay Driver Circuit 37
15 Power supply 38
16 Voltage regulator 39
17 Push Switch 39
18 Hardware of motor driving circuit 40
19 Diagram of Courtesy of motor 41
20 ADC Processing 42
21 Sim900 43
22 Schematic layout of altium sheet 47
23 PCB circuit designing 47
24 Different layout in PCB Design circuit in 3D view 48
25 Hardware of the project 49
7
Appendix5
LIST OF ABBREVIATION
Symbol Name Abbreviation
RF Radio frequency
LCD Liquid crystal display
LED Light emitting diode
AC Alternating current
DC Direct current
MCU Microcontroller unit
RAM Random access memory
CPU Central processing unit
RST Reset
ALE Address latch enable
GND Ground
V Volt
Hz Hertz
KHz Kilo hertz
MHz Mega hertz
8
Appendix6
TABLE OF CONTENT
SR.NO. CONTENTS PAGE NO.
Title Page I
Certificate Page II
Acknowledgements III
Abstract IV
List of Tables V
List of Figures VI
Chapter 1 INTRODUCTION 11
1.1 Introduction 11
1.2 Problem Statement. 11
1.3 Contribution of Project 12
1.4 Planning of working 12
Chapter 2 OVERVIEW OF SYSTEM 13
2.1 Block diagram of system 13
2.2 Process of Block diagram 13
2.3 Detail of Component 14
2.4 Features 16
Chapter 3 ATmega32 MICROCONTROLLER 17
3.1 Pin configuration 17
3.2 Block diagram of Atmega32 controller 18
3.3 PIN description 20
3.4 History of Atmega32 controller 21
9
3.5 Advantages of Atmega32 controller 23
3.6 Disadvantages of Atmega32 controller 23
3.7 Application of Atmega32 controller 23
Chapter 4 LCD 24
4.1 16x2 LCD module 24
4.2 Features 24
4.3 Advantages of LCD over LED 25
4.4 PIN diagram of 16x2 LCD Module 25
4.5 PIN description 26
4.6 How to write on LCD 26
4.7 Using on LCD in 4 and 8 mode 26
4.8 Circuit diagram of LCD interfacing with Atmega32 27
Chapter 5 ALCOHOL SENSOR 29
5.1 Alcohol gas sensor 29
5.2 Application of Alcohol sensor 30
5.3 Feature ofAlcohol sensor 30
5.4 Sensitivity ofAlcohol sensor 32
5.5 Specification table 32
5.6 warm up time 32
5.7 Using the sensor 32
5.8 Testing the sensor 32
5.9 Pin outs 33
Chapter 6 BUZZER 34
6.1 Introduction of Buzzer 34
6.2 Specification 34
6.3 Advantages of buzzer 35
10
6.4 Disadvantages of buzzer 35
Chapter 7 RELAY 36
7.1 Introduction of relay 36
7.2 Relay Driver circuit 37
7.3 Advantages of Relay 37
Chapter 8 SYSTEM COMPONENTS 38
8.1 Power supply 38
8.2 Voltage regulator 38
8.3 Push Switch 39
8.4 L293D motor circuit 40
8.6 ADC 42
Chapter 9 GSM 43
9.1 SIM900 43
9.2 SIM900 Overview 44
9.3 FEATURES 44
9.4 SPECIFICATIONS 45
Chapter 10 PCB DESIGNING & APPLICATION 46
10.1 Introduction of Altium Designer 46
Chapter 11 WORKING OF PROJECT 49
11.1 Hardware of project 49
11.2 Working 49
CONCLUSION 51
REFERENCES 52
11
INTRODUCTION CHAPTER 1
1.1. INTRODUCTION :
The main aim of this embedded application is to detect the alcohol drunken people. We
are developing an embedded kit which will be placed in a vehicle. Now, the vehicle will
be under the control of the kit .If any drunken person enter in to the vehicle it gives a
buzzer sound immediately , and now the car will be under the control of the hardware
used.
We run the vehicle by using wireless communication i.e. from Control section (acts as
transmitter) we are ejecting the control signals, then the vehicle receives (acts as receiver)
the signals, according to the signals it will give a alarm or buzzer.
It aims at designing and executing the vehicle controlling using RF. By using the RF
communication, whenever alcohol is detected using the alcohol detector, the micro
controller sends the information to the encoder and the encoder encodes the values and is
received by the RF Transmitter. RF Receiver receives the information from the RF
Transmitter and decoder decodes the serial input and sends the output to the micro
controller and according to the information received by the micro controller the robot will
move in that particular direction. The robot movement is driven with the help of L293D
as driver IC.
1.2. PROBLEM STATEMENT :
A government-auto industry program that is trying to develop a device to detect drunken
drivers, which would be installed in all new vehicles, is on track to get a six-fold increase
in funding.
The device, which would automatically sniff the driver‟s breath or use a light beam to test
the alcohol content of tissue, would prevent drunken operators from starting the vehicle.
There is no plan for the device to be mandatory. Those working on the project hope
consumers will accept the alcohol interlock voluntarily because of the safety advantages.
12
In 2008, almost 12,000 people died in “alcohol-impaired” crashes, according to federal
records. In a statement Mr. Udall said “drunk driving is a completely preventable tragedy
that destroys thousands of lives each year in the United States.”Those who favor the
devices say when they are in all vehicles they could save 8,000 to 9,000 lives a year by
stopping drunks before they get on the road.
“I think it is equivalent to the next seat belt It could make a huge difference in highway
safety,”
1.3 CONTRIBUTION OF PROJECT:
In order to achieve our objective, we have contributed ourselves by designing circuit of
Alcohol detection and vehicle controlling system by using Alcohol sensor. We have used
microcontroller Atmega32, LCD, gas sensor, GSM, buzzer, Motor and connecters.
1.4PLANNING OF WORKING:
13
OVERVIEW OF SYSTEM CHAPTER 2
2.1 BLOCK DIAGRAM:
Figure 1: Block diagram of system
2.2. PROCESS OF BLOCK DIAGRAM:
 In this project, If any drunken person enter in to the vehicle it gives a buzzer
sound immediately, and now the car will be under the control of the hardware
used.
 We run the vehicle by using wireless communication i.e. from Control section
(acts as transmitter) we are ejecting the control signals, then the vehicle receives
(acts as receiver) the signals, according to the signals it will give an alarm or
buzzer.
 It aims at designing and executing the vehicle controlling using RF. By using the
RF communication, whenever alcohol is detected using the alcohol detector, the
ALCOHOL
SENSOR
LCD
BUZZER
MICROCONTROL
LERATmega32
MOTOR
GSM
14
micro controller sends the information to the encoder and the encoder encodes the
values and is received by the RF Transmitter.
 RF Receiver receives the information from the RF Transmitter and decoder
decodes the serial input and sends the output to the micro controller and according
to the information received by the micro controller the robot will move in that
particular direction.
2.3. DETAILS OF COMPONENTS:
 MICROCONTROLLER :
Microcontroller is a small computer on a single integrated circuit containing a
processor core, memory, and programmable input/output peripherals.
 FEATURES:
 High performance, Low power 8 –bit Microcontroller
 Advanced RISC Architecture
131 Powerful Instruction-most single clock cycle Execution
32*8 General Purpose Working Registers
Fully Static Operation
 Data and Non-Volatile Program Memory
16/32/64k Bytes Flash Of In-System
512B/1K/2K Bytes of In-System Programmable EEPROM
1/2/4k Bytes Internal SRAM
 Software use
WinAVR20100110
Protius7.7 Actium PCB Designer
 Special microcontroller features
15
Low power idle, noise reduction and power down modes
Power on reset and programmable brown out detection
In – system programmable via spy port
High precision crystal oscillator for can operations (16 MHz)
 LCD:
LCD stands for liquid crystal display is a flat panel display, electronic visual
display that uses the light modulating properties of liquid crystals. Liquid
crystals do not emit light directly. It can be interfaced to microcontroller to show
the output.
 POWER SUPPLY:
It is the electrical power applied to microcontroller. To run the circuit we need
electrical power supply.
 RELAY:
A relay is an electrically operated switch. Many relays use an electromagnet to
operate
a switching mechanism mechanically, but other operating principles are also used.
Relays are used where it is necessary to control a circuit by a low-power signal
(with complete electrical isolation between control and controlled circuits), or
where several circuits must be controlled by one signal.
 ALCOHOL SENSOR:
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 output based on alcohol concentration.
 BUZZER:
The buzzer acts as an alarm in the circuit which is used to keep the driver in a
conscious state when he or she has consumed alcohol the buzzer used here is a
piezo circuit that produces a sharp sound when provided with a suitable amount of
voltage. When a voltage is being applied across the poles the metal plate vibrates
due to the electromagnetic effect. Thus the vibration of metal plate causes a sound.
16
 GSM:
Sitcom presents an ultra compact and reliable wireless module-SIM900. This is a
complete Quad-band GSM/GPRS module in a SMT type and designed with a very
powerful single-chip processor integrating AMR926EJ-S core, allowing you to
benefit from small dimensions and cost-effective solutions.
Featuring an industry-standard interface, the SIM900 delivers GSM/GPRS
850/900/1800/1900MHz performance for voice, SMS, Data, and Fax in a small
form factor and with low power consumption. With a tiny configuration of 24mm
x 24mm x 3 mm, SIM900 can fit almost all the space requirements in your M2M
applications, especially for slim and compact demands of design.
2.4. FEATURES:
1. Quad-Band 850/ 900/ 1800/ 1900 MHz
2. GPRS multi-slot class 10/8
3. GPRS mobile station class B
4. Compliant to GSM phase 2/2+
5. Class 4 (2 W @850/ 900 MHz)
6. Class 1 (1 W @ 1800/1900MHz)
7. Weight: 3.4g
8. Control via AT commands (GSM 07.07 ,07.05 and SIMCOM enhanced AT
Commands)
9. Supply voltage range: 3.2 … 4.8V
10. Low power consumption: 1.0mA (sleep mode)
11. Operation temperature: -40°C to +85 °C
17
Atmega32 MICROCONTROLLER CHAPTER 3
3.1. PIN CONFIGURATION:
Figure 2: Pin Diagram of Atmega32 controller
Atmega32 CONTROLLER:
Figure 3: Atmega32 Controller
18
3.2. BLOCK DIAGRAM OF Atmega32 CONTROLLER:
Figure 4: Block Diagram of Atmega32 Controller
The AVR core combines a rich instruction set with 32 general purpose working registers.
All the 32 registers are directly connected to the Arithmetic Logic Unit (ALU), allowing
two independent registers to be accessed in one single instruction executed in one clock
cycle. The resulting architecture is more code efficient while achieving throughputs up to
19
ten times faster than conventional CISC microcontrollers.
The Atmega32 provides the following features: 32K bytes of In-System Programmable
Flash Program memory with Read-While-Write capabilities, 1024 bytes EEPROM, 2K
byte SRAM, 32 general purpose I/O lines, 32general purpose working registers, a
JTAG interface for Boundary-scan, On-chip Debugging support and programming, three
flexible Timer/Counters with compare modes, Internal and External Interrupts, a serial
programmable USART, a byte oriented Two-wire Serial Interface, an 8-channel, 10-bit
ADC with optional differential input stage with programmable gain (TQFP package only),
a programmable Watchdog Timer with Internal Oscillator, an SPI serial port, and six
software selectable power saving modes. The Idle mode stops the CPU while allowing the
USART, Two-wire interface, A/D Converter, SRAM; Timer/Counters, SPI port, and
interrupt system to continue functioning. The Power-down mode saves the register con-
tents but freezes the Oscillator, disabling all other chip functions until the next External
Interrupt or Hardware Reset. In Power-save mode, the Asynchronous Timer continues to
run, allowing the user to maintain a timer base while the rest of the device is sleeping. The
ADC Noise Reduction mode stops the CPU and all I/O modules except Asynchrony-nous
Timer and ADC, to minimize switching noise during ADC conversions. In Standby mode,
the crystal/resonator Oscillator is running while the rest of the device is sleeping. This
allows very fast start-up combined with low-power consumption. In Extended
Standby mode, both the main Oscillator and the Asynchronous Timer continue to run.
The device is manufactured using Atmel‟s high density nonvolatile memory technology.
The On-chip ISP Flash allows the program memory to be reprogrammed in-system
through an SPI serial interface, by a conventional nonvolatile memory programmer, or by
an On-chip Boot program running on the AVR core. The boot program can use any
interface to download the application program in the Application Flash memory.
Software in the Boot Flash section will continue to run while the Application Flash section
is updated, providing true Read-While-Write operation. By combining an 8-bit RISC
CPU with In-System Self-Programmable Flash on a monolithic chip, the Atmel Atmega32
is a powerful microcontroller that provides a highly-flexible and cost-effective solution to
many embedded control applications.
The Atmega32 AVR is supported with a full suite of program and system development
tools including: C compilers, macro assemblers, program debugger/simulators, in-circuit
emulators, and evaluation kits.
20
3.3. PIN DISCRIPTION:
 VCC: Digital supply voltage.
 GND: Ground.
 Port A (PA7.PA0): Port A serves as the analog inputs to the A/D Converter.
Port A also serves as an 8-bit bi-directional I/O port, if the A/D Converter is not
used. Port pins can provide internal pull-up resistors (selected for each bit). The
Port A output buffers have symmetrical drive characteristics with both high sink
and source capability. When pins PA0 to PA7 are used as inputs and are externally
pulled low, they will source current if the internal pull-up resistors are activated.
The Port A pins are tri-stated when a reset condition becomes active, even if the
clock is not running.
 Port B (PB7.PB0): Port B is an 8-bit bi-directional I/O port with internal
pull-up resistors (selected for each bit). The Port B output buffers have
symmetrical drive characteristics with both high sink and source capability. As
inputs, Port B pins that are externally pulled low will source current if the pull-up
resistors are activated. The Port B pins are tri-stated when a reset condition
becomes active, even if the clock is not running.
 Port C (PC7.PC0): Port C is an 8-bit bi-directional I/O port with internal
pull-up resistors (selected for each bit). The Port C output buffers have symmetrical
drive characteristics with both high sink and source capability. As inputs, Port C
pins that are externally pulled low will source current if the pull-up resistors are
activated. The Port C pins are tri-stated when a reset condition becomes active,
even if the clock is not running. If the JTAG interface is enabled, the pull-up
resistors on pins PC5 (TDI), PC3 (TMS) and PC2(TCK) will be Activated even if
a reset occurs. The TD0 pin is tri-stated unless TAP states that shift out data are
entered.
 Port D (PD7..PD0): Port D is an 8-bit bi-directional I/O port with internal
pull-up resistors (selected for each bit). The Port D output buffers have
symmetrical drive characteristics with both high sink and source capability. As
inputs, Port D pins that are externally pulled low will source current if the pull-
up resistors are activated. The Port D pins are tri-stated when a reset condition
becomes active, even if the clock is not running.
21
 RESET: Reset Input. A low level on this pin for longer than the minimum pulse
length will generate a reset, even if the clock is not running. Shorter pulses are not
guaranteed to generate a reset.
 XTAL1: Input to the inverting Oscillator amplifier and input to the internal
clock operating circuit.
 XTAL2: Output from the inverting Oscillator amplifier.
 AVCC: AVCC is the supply voltage pin for Port A and the A/D Converter. It
should be externally connected to VCC, even if the ADC is not used. If the ADC
is used, it should be connected to VCC through a low-pass filter.
 AREF: AREF is the analog reference pin for the A/D Converter.
3.4. HISTORY OF Atmega32 MICROCONTROLLER:
Basic families:
AVRs are generally classified into six broad groups:
 Tiny AVR :
0.5–16 kB program memory
6–32-pin package
Limited peripheral set
 Mega AVR
4–512 kb program memory
28–100-pin package
Extended instruction set (multiply instructions and instructions for handling larger
program memories)
Extensive peripheral set
22
 XMEGA
16–384 kB program memory
44–64–100-pin package (A4, A3, A1)
Extended performance features, such as DMA, “Event System”, and cryptography
support.
Extensive peripheral set with ADCs.
 Application-specific AVR
Mega AVRs with special features not found on the other members of the AVR
family, such as LCD controller, USB controller, advanced PWM, CAN, etc.
 FPSLIC (AVR with FPGA)
FPGA 5K to 40K gates
SRAM for the AVR program code, unlike all other AVRs
AVR core can run at up to 50 MHz
 32-bit AVRs
Main article: AVR32
In 2006 Atmel released microcontrollers based on the new, 32-bit, AVR32
architecture. They include SIMD and DSP instructions, along with other audio
and video processing features. This 32-bit family of devices is intended to
compete with the ARM based processors. The instruction set is similar to other
RISC cores, but it is not compatible with the original AVR or any of the various
ARM cores.
23
3.5. ADVANTAGE of Atmega32:
 Cost: At the moment, the very lowest-price microcontroller available from any
manufacturer is the $0.54 Atmel AVR Attiny11 6 MHz FLASH (same price for 8
pin DIP and 8 pin SOIC)(price in singles from Digikey as of 2004-07-06).
 Speed: Not only are most AVRs capable of 20MHz (even really cheap ones like
the Attiny25/45/85 and Atmega48), but they actually run at near 20 MIPS; the PIC
chips I‟m aware of at a higher price (for example, PIC16F88) only run at 5 MHz
with a 20 MHz oscillator frequency. In addition, with the better addressing modes
and registers of the AVRs, most operation can be done in only one instruction,
where it often takes more than one instruction to do the same thing on a PIC.
 Peripherals: Many Atmel AVR µcontrollers, like many Microchip PIC
µcontrollers, have a built-in 10 bit ADC. Some have LCD or USB drivers.
3.6. DISADVANTAGE OF Atmega32:
 Single source: only available from Atmel.
 Power: Atmel AVRs have fairly low power, but the TI MSP430 series has the
lowest power of any microcontroller.
 Speed: near 20MIPS is great, but the SX chips regularly run at near 50MIPS and
can run at 75 or even 100 (in rare cases)
3.7. APPLICATION OF Atmega32 CONTROLER:
 Industrial automation
 Lighting
 Smart energy
 Mobile Electronics
 Automotive
 Building Automation
 Home Appliances
 Home Entertainment
24
LCD CHAPTER 4
4.1. 16 X 2 LCD MODULES:
Figure 5: 16X2 LCD with PIN function
A Liquid Crystal Display (LCD) is a thin, flat display device made up of any number of
color or monochrome pixels arrayed in front of a light of a light source or reflector.
Each pixel consists of a column of liquid crystal molecules suspended between two
transparent electrodes, and two polarizing filters, the axes of polarity of which are
perpendicular to each other. Without the liquid crystal between them, light passing
through one would be blocked by the other. The liquid crystal twists the polarization of
light entering one filter to allow it to pass through the other.
Many microcontroller devices use smart LCD to output visual information, LCD displays
are inexpensive, easy to use, and it is even possible to produce a readout using the 8x80
pixels of the displays. They have a standard ASCII set of characters and mathematical
symbols.
4.2. FEATURES:
 5 x 8 dots with cursor
 Built-in controller (KS 0066 or Equivalent)
 + 5V power supply (Also available for + 3V)
25
 1/16 duty cy
 B/L to be driven by pin 1, pin 2 or pin 15, pin 16 orA.K (LED)
4.3. ADVANTAGE OF LCD OVER LED:
 The declining prices of LCD‟s.
 The ability to display numbers, characters, and graphics. This is in contrast to LED‟s
which are limited to numbers and a few characters.
 Incorporation of a refreshing controller in to the LCD, thereby relieving the CPU of
the task of refreshing the LCD. In contrast, the LED must be refreshed by the CPU to
keep displaying the data.
 Ease of programming for characters and graphics.
4.4. PIN DIAGRAM OF 16x2 CHARACTER LCD:
Figure 6: Pin Diagram of 16x2 LCD
A 16x2 LCD means it can display 16 characters per line and there are 2 such lines. In this
LCD each character is displayed in 5x7 pixel matrix.
This LCD has two registers:
 Command/Instruction Register: Stores the command instructions given to the
LCD. A command is an instruction given to LCD to do a predefined task like
initializing, clearing the screen, setting the cursor position, controlling display etc.
26
 Data Register: Stores the data to be displayed on the LCD. The data is the ASCII
value of the character to be displayed on the LCD.
4.5. PIN DISCRIPTION:
 EN: Line is called “Enable.” This control line is used to tell the LCD that you are
sending it data. To send data to the LCD bring EN high (1) and wait for the
minimum amount of time required by the LCD datasheet (this varies from LCD to
LCD), and end by bringing it low (0) again.
 RS: Line is the “Register Select” line. When RS is low (0), the data is to be treated as
a command or special instruction (such as clear screen, position cursor, etc.).
When RS is high (1), the data being sent is text data which should be displayed on
the screen. For example, to display the letter “T” on the screen you would set RS
high.
 RW: Line is the “Read/Write” control line. When RW is low (0), the information on
the data bus is being written to the LCD. When RW is high (1), the program is
effectively querying (or reading) the LCD. Only one instruction (“Get LCD status”)
is a read command.
 Vcc, Vss, VEE: While Vcc and Vss provide +5v and ground, respectively, VEE is
used for controlling LCD contrast.
 D0 – D7: The 8 – bit data pins, D0 – D7, are used to send information to the LCD
or read the contents of the LCD‟s internal registers.
4.6. How to write on LCD:
We also used RS (RESISTOR SELECT) =0 to check busy flag bit to see that LCD is ready
to receive information. The busy flag is D7 and can be read when R/W =1 and RS =0 as
follows: If R/W (READ/WRITE) =1 RS=0. When D7=1(Busy flag) =1 the LCD is busy
taking care of internal operation and we will not any new information. When D7=0 the
LCD is ready to receive the new information. Note: It is recommended to check before
writing any data to the LCD.
4.7. Using an LCD in 4 and 8 bit Mode:
In 8-bit mode, you will be needing 8 pins for sending or reading a whole byte of data at
27
once, and 3 control lines: enable (EN), register select (RS), and read/write (RW). Basic
procedure is to prepare all other lines, and then pulse the enable line high for a short while
in which LCD reads your command (when RW is low) or writes data (when RW is high).
For control messages, RS line is low, and for writing letters, RS line is high. The 4 bit
mode of HD44780 compatible LCDs can be used. In this mode only the upper 4 data lines
are used and the control lines stay the same, which makes a total of 7 lines for the LCD.
However, the code size and execution time increase, as each data or control byte has to
be sent to the LCD in 2 nibbles.
The basic principles of using LCDs are the same as in 8-bit mode. The commands are the
same and the busy flag should be checked before any operation.
4.8. Circuit Diagram for LCD interfacing with Atmega32:
Figure 7: Circuit Diagram for LCD interfacing with Atmega32
28
There are three control signals called R/W, DI/RS and En. By making RS/DI
signal 0 you can send different commands to display. These commands are used to
initialize LCD, to display pattern, to shift cursor or screen etc.AT89S52 can be divided in to
4 ports, and each port consists of 8 pins. All the data lines of LCD are connected with port
P1. i.e., data lines D0-D1 are connected to portP1 i.e., to pin numbers 1 to 8 through a
SIL, SIL is a few ohms of resistance connected to withstand the large voltages and
currents.
29
ALCOHOL SENSOR CHAPTER 5
5.1. ALCOHOL GAS SENSOR MQ-3:
A sensor is a technological device that detects / senses a signal, physical condition
and chemical compounds. It is also defined as any device that converts a signal from one
form to another. Sensors are mostly electrical or electronic.
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.
Figure 8: Alcohol Gas Sensor MQ-3
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 output based on alcohol concentration.
30
5.2. APPLICATION:
 It is used as part of the breathalyzers or breath testers for the detection of ethanol
in the human breath.
 They are suitable for alcohol checker, Breath analyzer.
 Vehicle alcohol detector
 Portable alcohol detector
 Breath Analyzer
 Blood Alcohol Concentration Checker
 Alcohol Gas Sensor
5.3. FEATURES:
 High sensitivity to alcohol and small sensitivity to Benzine
 Fast response and High sensitivity
 Stable and long life
 Simple drive circuit of 5V DC with analog output
 Operation Temperature: -10 to 70 degrees C
5.4. SENSITIVITY:
Figure 9: resistance ratio and abscissa is alcohol concentration
31
Figure 10: Sensitivity of Alcohol Gas Sensor
5.4.1. Typical Sensitivity Characteristics of sensor for several gases in
their
 Temp: 20 deg C
 Humidity: 65%
 Oxygen concentration: 21%
 RL = 10K Ohm
 Ro = Sensor resistance at 0.4mg/L of
 Alcohol in clean air
 Rs = Sensor resistance at various
 concentrations of gases
32
5.5. SPECIFICATION:
Parameter Value Unit
Target Gas Alcohol
Detection Range 0.05mg/L—10mg/L PPM (part per millions)
Output Voltage Range 0 to 5 VDC
Working Voltage 5 VDC
Current Consumption ≤180 mA
Warm up Time 10 Minutes
Calibrated Gas 0.4 mg/L Alcohol
Response Time ≤10s Seconds
Resume Time ≤30s Seconds
Standard Working
Condition
Temperature:-10 to 65 deg C.
Humidity: ≤95%RH
Storage Condition Temperature: -20-70 deg C
Hum: ≤ 70%RH
Table 1: Specification of Alcohol Gas Sensor
5.6. Warm up Time:
The sensor needs 10 minutes of warm up time after first power is applied. After 10
minutes you can take its readings. During warm up time the output analog voltage would
go up from 4.5V to 0.5V in variation down gradually. During this warm up time the
sensor reading should be ignored.
5.7. Using the Sensor:
The sensor needs 5V to operate, Give regulated +5V DC supply, the sensor will
take around 180mA supply. The sensor will heat a little bit since it has internal heater that
heats the sensing element.
5.8. Testing the sensor:
Measure the output voltage through multi-meter between A.OUT and Ground pins
or Use a Microcontroller to measure the voltage output. Best way to check the sensor is
take a bottle of aftershave liquid and open the cap. Take the sensor near the bottle output.
You will see increase in thereadings.
33
5.9. PIN OUTS:
Sr. Pin Details
1 GND Power Supply Ground
2 A.OUT Analog Voltage Out
3 +5V Supply voltage DC +5V regulated
Table 2: Pin outs of Alcohol Gas Sensor
34
BUZEER CHAPTER 6
6.1. INTRODUCTION OF BUZZER:
Figure 11: Buzzer
The buzzer acts as an alarm in the circuit which is used to keep the driver in a conscious
state when he or she has consumed alcohol the buzzer used here is a piezo circuit that
produces a sharp sound when provided with a suitable amount of voltage. When a voltage
is being applied across the poles the metal plate vibrates due to the electromagnetic effect.
Thus the vibration of metal plate causes a sound.
6.2. SPESIFICATION:
 Rated Voltage: A piezo buzzer is driven by square waves (V p-p).
 Operating Voltage: For normal operating. But it is not guaranteed to make the
minimum SPL under the rated voltage.
 Consumption Current: The current is stably consumed under the regular
operation. However, it normally takes three times of current at the moment of
starting to work.
 Capacitance: A piezo buzzer can make higher SPL with higher capacitance,
but it consumes more electricity.
 Sound Output: The sound output is measured by decibel meter. Applying
rated voltage and square waves, and the distance of 10 cm.
35
 Rated Frequency: A buzzer can make sound on any frequencies, but we
suggest that the highest and the most stable SPL come from the rated
frequency.
 Operating Temp.: Keep working well between -30~ and +70~.
Figure 12: Circuit of Buzzer
Hear, R=VDC*100(ohm)
If VDC=5V
R= 5*100
R=500 ohm
6.3. ADVANTAGE:
 Electrically operated device that is good for drawing attention to a condition that
requires attention.
6.4. DISADVANTAGE:
 Annoying sound to those that don‟t know its significance.
 Requires training to know what the buzzer means, and how to repair the condition
without just shutting off the buzzer.
 Could trigger a fire in an explosive atmosphere.
 Most likely device to receive “emotional outbursts” like misguided forklift strikes,
stray bullets, and attacks by roving wire cutters.
36
RELAY CHAPTER 7
7.1. RELAY:
A relay is switch worked by electromagnet .it is useful if we want a small current in one
circuit to control another circuit containing a device such as lamp or electric motor which
requires a large current or if we wish several differential switch contacts to be operated
simultaneously. There are two types of relays
1. Normally closed
2. Normally opened
We are using normally opened type relay. When controller output from the PC is high,
transistor will be in ON state, so relay is energized in the reverse condition relay is
dennergized.
Figure 13: Relay
A relay is an electrically operated switch. Current flowing through the coil of the relay
creates a magnetic field, which attracts a lever and changes the switch contacts. The coil
current can be on or off so relays have two switches positions and they are double throw
(changeover) switches.
Relays allow one circuit to switch a second circuit, which can be completely separate from
the first. For example a low voltage battery circuit can use a relay to switch a 230V AC
37
mains circuit. There is no electrical connection inside the relay between the two
circuits; the link is magnetic and mechanical.
7.2. RELAY DRIVER CIRCUIT:
Figure 14: Relay Driver Circuit
Relays are components which allow a low-power circuit to switch a relatively high current
on and off, or to control signals that must be electrically isolated from the controlling
circuit itself.
Relay for this type of application, but are unsure about the details of doing so. It is a quick
rundown. To make a relay operate, you have to pass a suitable .pull-in and holding.
Current (DC) through its energizing coil. And generally relay coils are designed to
operate from a particular supply voltage. Often 12V or 5V, in the case of many of the
small relays used for electronics work.
In each case the coil has A resistance which will draw the right pull-in and holding
currents when it‟s connected to that supply voltage. So the basic idea is to choose a relay
with a coil designed to operate from the supply voltage.
7.3. ADVANTAGES OF RELAY:
 Relays can switch AC and DC, transistors can only switch DC.
 Relays can switch high voltages, transistors cannot.
 Relays are a better choice for switching large currents (> 5A)
38
SYSTEM COMPONENTS CHAPTER 8
8.1. POWER SUPPLY:
Figure 15: Power Supply
The Power supply from any filter capacitors, we need to reduce 240V from transformer to
15V, but this 15V is AC which is converted into DC by bridge, this 15V DC is reduce to 5V
which is the simply job of the IC 7805.
Usually we add filter capacitors, when there is a lot of disturbance like in motor controllers,
or AC to DC power supplies.
8.2. VOLTAGE REGULATOR:
Voltage regulator Ics are available with fixed (typically 5, 12 and 15V) or variable output
voltages.
They are also rated by the maximum current they can pass. Negative voltage
regulators are available, mainly for use in dual supplies. Most regulators include some
automatic protection from excessive current („overload protection‟) and overheating
(„thermal protection‟).
39
Figure 16: Voltage Regulator
Many of the fixed voltage regulator Ics has 3 leads and look like power transistors, such
as the 7805 +5V 1A regulator. The regulators are mainly classified for low voltage and for
high voltage. Further they can also be classified as:
 Positive regulator: Input pin
Output pin
Ground pin
It regulates the positive voltage.
 Negative regulator: Ground pin
Input pin
Output pin
It regulates the negative voltage.
8.3. PUSH SWITCH:
Figure 17: PUSH SWITCH
A switch is an electrical component that can break an electrical circuit, interrupting the
current or diverting it from one conductor to another. Here we use PUSH SWITCH.
A push switch is a momentary or non-latching switch which causes a temporary change in
40
the state of an electrical circuit only while the switch is physically actuated. An
automatic mechanism (i.e. a spring) returns the switch to its default position immediately
afterwards, restoring the initial circuit condition.
There are two types:
 A push to make switch allows electricity to flow between its two contacts when
held in.
When the button is released, the circuit is broken.
Symbol of Push to make switch electronic
 A push to break switch does the opposite, i.e. when the button is not pressed,
electricity
Can flow, but when it is pressed the circuit is broken.
Symbol of Push to break switch electronic
8.4. L293D Motor Driving Circuit :
Figure.18 hardware of L293D motor driving circuit
41
 Introduction of L293D Motor Driving Circuit.
The L293D motor driver is available for providing User with ease and user
friendly interfacing for embedded application. L293D motor driver is mounted on
a good quality, single sided non-PTH PCB. The pins of L293D motor driver IC
are connected to connectors for easy access to the driver IC‟s pin functions. The
L293D is a Dual Full Bridge driver that can drive up to 1Amp per bridge with
supply voltage up to 24V. It can drive two DC motors, relays, solenoids, etc. The
device is TTL compatible. Two H bridges of L293D can be connected in parallel
to increase its current capacity to 2 Amp.
 Features:
1) Easily compatible with any of the system
2) Easy interfacing through FRC (Flat Ribbon Cable)
3) External Power supply pin for Motors supported
4) Onboard PWM (Pulse Width Modulation) selection switch
5) 2pin Terminal Block (Phoenix Connectors) for easy Motors Connection
6) Onboard H-Bridge base Motor Driver IC (L293D)
 Motor:
In small motors, an alternative design is often used which feature a coreless armature
winding. This design depend upon the coil wire itself for structural integrity. As a result,
the armature is hollow and the permanent magnate can be mounted inside the rotor coil.
Coreless DC motor have much lower armature induction then iron core motors of
comparable size, extending brush and commutator life.
Figure.19 Diagram courtesy of Micro Motor
In any electric motor, operation is based on simple electromagnetism. A current-carrying
conductor generates a magnetic field; when this is then placed in an external magnetic
42
field, it will experience a force proportional to the current in the conductor, and to the
strength of the external magnetic field. As you are well aware of from playing with
magnets as a kid, opposite (North and South) polarities attract, while like polarities
(North and North, South and South) repel. The internal configuration of a DC motor is
designed to harness the magnetic interaction between a current-carrying conductor and an
external magnetic field to generate rotational motion.
8.6. ADC:
Figure.20 ADC PROCESSING
An electronic integrated circuit which transforms a signal from analog (continuous) to
digital (discrete) form. Analog signals are directly measurable quantities. Digital signals
only have two states. For digital computer, we refer to binary states, 0 and 1.
43
GSM CHAPTER 9
9.1. SIM900:
Figure.21 Hardware of Sim 900
 Introduction:
This document describes SIM900 hardware interface in great detail. This document
can help user to quickly understand SIM900 interface specifications, electrical and
mechanical details. With the help of this document and other SIM900 application
notes, user guide, users can use SIM900 to design various applications quickly.
44
9.2. SIM900 Overview:
Designed for global market, SIM900 is a quad-band GSM/GPRS module that works
on frequencies GSM 850MHz, EGSM 900MHz, DCS 1800MHz and PCS
1900MHz. SIM900 features GPRS multi-slot class 10/ class 8 (optional) and
supports the GPRS coding schemes CS-1, CS-2, CS-3 and CS-4. With a tiny
configuration of 24*24*3mm, SIM900 can meet almost all the space requirements in
user applications, such as M2M, smart phone, PDA and other mobile devices.
SIM900 has 68 SMT pads, and provides all hardware interfaces between the module
and customers‟boards.
 Serial port and debug port can help user easily develop user‟s
applications.
 Audio channel which includes a microphone input and a receiver
output.
 Programmable general purpose input and output.
 The keypad and SPI display interfaces will give users the flexibility to
develop customized applications.
SIM900 is designed with power saving technique so that the current consumption is
as low as 1.0mA in sleep mode.
SIM900 integrates TCP/IP protocol and extended TCP/IP AT commands which are
very useful for data transfer applications. For details about TCP/IP applications,
please refer to document.
9.3. FEATURES:
 Quad-Band 850/ 900/ 1800/ 1900 MHz
 GPRS multi-slot class 10/8
 GPRS mobile station class B
 Compliant to GSM phase 2/2+
 Class 4 (2 W @850/ 900 MHz)
 Class 1 (1 W @ 1800/1900MHz)
 Weight: 3.4g
 Control via AT commands (GSM 07.07 ,07.05 and SIMCOM enhanced AT
Commands)
45
 Supply voltage range : 3.2 … 4.8V
 Low power consumption: 1.0mA(sleep mode)
 Operation temperature: -40°C to +85 °C
9.4. SPECIFICATIONS:
 GSM modem is a functionally similar to a GSM phone.
 It is controlled using AT commands, like most other modems.
 There are various AT commands for different purposes.
 It internally has a SIM card tray/slot for inserting the SIM card to use a specific
service provides network.
46
PCB DESIGNING & APPLICATION CHAPTER 10
10.1 Introduction of Altium Desidner:
Altium Designer provides a unified electronic product development environment,
catering for all aspects of the electronic development process, including:
 System Design and Capture
 Physical PCB Design
 FPGA Hardware Design
 Embedded Software Development
 Mixed-Signal Circuit Simulation
 Signal Integrity Analysis
 PCB Manufacturing
 FPGA system implementation and debugging (when working with a suitable
FPGA development board, such as an Altium NanoBoard.
All of these design areas are intrinsic parts of a single, cohesive system, built on Altium
Designer‟s Design Explorer (DXP) integration platform. The extent of this unified
system, in terms of the features and functionality available, will depend on the specific
licensing purchased.
Underlying Altium Designer is the DXP integration platform which brings together
Altium Designer‟s various editors and software engines, and provides a consistent user-
interface across all the tools and editors.
The Altium Designer environment is fully customizable, allowing you to set up the
workspace to suit the way you work. A consistent selection and editing paradigm across
different editors allows you to easily and smoothly switch between various design tasks
within the Altium Designer environment.
Altium Designer offers a unique design environment, with all areas of design – from
capture to generation of PCB manufacturing output; from embedded software
development to processing and download of an FPGA design into a physical FPGA
device – brought together in the one environment through the underlying support of the
DXP integration platform. Supporting the display and editing of multiple design
documents, of differing type, this environment is fully customizable, allowing you to
47
tailor the workspace resources – including menus, toolbars and shortcuts – in accordance
with preferred design habits
.
FIGURE.22 SCHEMATIC CIRCUIT DIAGRAM OF THE ALTIUM SHEET
FIGURE 23. PCB CIRCUIT DESIGNNING
48
FIGURE 23 DIFFERENT LAYOUT IN PCB DISIGNNING CIRCUIT IN 3D VIEW
49
WORKING OF PROJECT CHAPTER 11
11.1. Hardware Architecture of Project:
FIG 25.HARDWARE OF PROJECT
11.2. Working:
The main purpose behind this project is Drunk driving detection. Now 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. The main unit of this project is an Alcohol sensor. This
project should be installed inside the vehicle.
50
Now a day‟s most of the peoples use cell phone for communication. Controlling devices
through wireless media becomes very popular. GSM technology is very powerful because
it overcomes the limited range of infrared and radio remote controls. We run the vehicle
by using wireless communication system. In this system Control section acts as
transmitter we are ejecting the control signals, then the vehicle receives acts as receiver
the signals, according to the signals it will give an alarm or buzzer.
11.3. Advantage of Project:
This method of analyzing or detecting the presence of alcohol in breath is relatively a
quick analysis as compared to other techniques. The sensors used in this project are
smaller in size, not so bulky, hence can be carried. The project based on this technology is
self sufficient within itself and thus can be used as a safety system for any vehicle and the
human being driving it by preventing the accidents to occur. The system isn‟t police
dependent. In case if we are drunk, our family members will drive us safely in that case.
Also unauthorized access to the car and rash driving is not possible.
11.4. Disadvantage of Project:
May read all hydrocarbons (organic vapors) and may habitually produce false positive
alcohol readings caused by smoker‟s and car exhaust CO as well as many other
environmental vapors and gases. This senor is partial pressure sensitive and therefore may
change sensitivity with change in altitude and elevation. This sensor may be sensitive to
changes in ambient temperature, humidity and breath-flow patterns and may give false
readings if not adjusted or recalibrated to account for ambient or surrounding air
temperatures. The temperature of the subject is also very important. On the other hand,
products such as mouthwash or breath spray can "fool" breath machines by significantly
raising test result. for example, LISTERINE MOUTHWASH contains 27% alcohol. The
system cannot prevent accidents due to others fault however if any mishap happens the
system sends a message to the family members.
51
CONCLUSION
The project thus gives a system that can detect a certain amount of alcohol present in the
atmosphere inside the car and to a certain range and activates a microcontroller controlled
control system that controls the movement and the alarm can acts as a indicator that
enables a person to judge that person has taken alcohol and needs help or any assistance.
The incorporated proximity sensor thus helps to figure out the range of any obstacle or
front object thus slows down the car speed and if object comes too closer than it stops the
car thus preventing any collision or health hazard of the person driving the car.
The GSM modem sends a message to the close relative or the police in order to take
necessary steps to prevent any accident or necessary aids after accident.
52
REFERENCE
13.1 WEBSITES:
 www.atmel.com
 www.datasheet.com
 www.technovelgy.com
 www.engineersgarage.com
 www.eletroniczone.com
 http://www.alcoholbreathanalyzers.in
13.2 PATENTS & BOOKS:
[1] Zhang Xin-long_Forensic medical discussion of drunken driving and
traffic accidents [J]_Road Traffic Management_2007_12_3_60-
61.l
[2] Zhu Yi-duo The drunk-driving measurement and control system based
on multisensory [J]_Journal of Wuhan Jiao tong Polytechnic_2011_13
_1_78-80
[3] The 8051 Microcontroller And Embedded System Using Assembly
And C By Muhammad Ali Mazidi (2nd
Edition)
53

8 sem final report print copy (1)

  • 1.
    1 Appendix 1 ALCOHOL DETECTIONWITH VEHICLE CONTROLLING A PROJECT REPORT Submitted by BHARGAV L. JHA (Enrollment no.: 100620111019) SHUBHAM R. PATEL (Enrollment no.: 100620111015) In fulfillment for the award of the degree Of BACHELOR OF ENGINEERING in ELECTRONICS & COMMUNICATION GUJARAT INSTITUTE OF TECHNICAL STUDIES, PRANTIJ. Gujarat Technological University, Ahmadabad May, 2014
  • 2.
    2 Appendix 2 GUJARAT INSTITUTEOF TECHNICAL STUDIES ELECTRONICS & COMMUNICATION 2014 CERTIFICATE This is to certify that the dissertation entitled “ALCOHOL DETECTION WITH VEHICLE CONTROLLING” has been carried out by PATEL SHUBHAM R. & JHA BHARGAV L. under my guidance in fulfillment of the degree of Bachelor of Engineering in Electronics & communication (7th Semester) of Gujarat Technological University, Ahmadabad during the academic year 2013-14. Guides:- Prof. Mitesh Prajapati Internal Guide, Lecturer, E.C. Department, G.I.T.S. . Prof. Maulik Darji Head of Department, E.C. Department, G.I.T.S.
  • 3.
    3 ACKNOLEDGEMENT We take thisan opportunity to humbly express our thankfulness to all those concerned with our project. We are greatly indebted to Mr. Mitesh Prajapati of our institute Gujarat Institute Of Technical Studies for providing us such opportunity to learn technical aspects. We particularly wish to acknowledge our deep sense of gratitude to our guide Mr. Mitesh Prajapati for their inspiration, constant encouragement, valuable guidance, affection and support without whose constant supervision, this work would have been not possible. His precious guidance has proved to be a beacon of light that has helped us in our project to reach this presentable form. I also want to acknowledge the guidance provided by other faculty member which proved very useful to as in our project. We wish to express our thanks to all those who Associated with this project report either directly or indirectly for sparing time out of their busy schedule.
  • 4.
    4 ABSTRACT Purpose: The mainpurpose behind this project is drunken driving detection. Principle: Alcohol Detector in Car project is designed for the safety of the people seating inside the car. Keyword: Gas sensor, GSM, ignition lock, buzzer, LCD, Controller. Introduction: The main purpose behind this project is drunken driving detection. Now 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. The main unit of this project is an Alcohol ssensor. This project should be installed inside the vehicle. Now a day’s most of the peoples use cell phone for communication. Controlling devices through wireless media becomes very popular. GSM technology is very powerful because it overcomes the limited range of infrared and radio remote controls. We run the vehicle by using wireless communication system. In this system Control section acts as transmitter we are ejecting the control signals, then the vehicle receives acts as receiver the signals, according to the signals it will give an alarm or buzzer.
  • 5.
    5 Appendix 3 LIST OFTABLES Table No. Table Descriptions Page No. Table 1 Specification of Alcohol Gas Sensor 32 Table 2 Pin outs of Alcohol Gas Sensor 33
  • 6.
    6 Appendix 4 LIST OFFIGURES NO. FIGURE NAME Page no: 1 Block diagram of system 13 2 PIN diagram of ATmega32 controller 17 3 ATmega32 controller 17 4 Block diagram of ATmega32 18 5 16x2 LCD with pin function 24 6 PIN diagram of 16x2 LCD 25 7 Circuit diagram of LCD interfacing of ATmega32 27 8 Alcohol gas sensor MQ-3 29 9 Resistance ratio and abscissa in alcohol concentration 30 10 Sensitivity of Alcohol gas sensor 31 11 Buzzer 34 12 Circuit of buzzer 35 13 Relay 36 14 Relay Driver Circuit 37 15 Power supply 38 16 Voltage regulator 39 17 Push Switch 39 18 Hardware of motor driving circuit 40 19 Diagram of Courtesy of motor 41 20 ADC Processing 42 21 Sim900 43 22 Schematic layout of altium sheet 47 23 PCB circuit designing 47 24 Different layout in PCB Design circuit in 3D view 48 25 Hardware of the project 49
  • 7.
    7 Appendix5 LIST OF ABBREVIATION SymbolName Abbreviation RF Radio frequency LCD Liquid crystal display LED Light emitting diode AC Alternating current DC Direct current MCU Microcontroller unit RAM Random access memory CPU Central processing unit RST Reset ALE Address latch enable GND Ground V Volt Hz Hertz KHz Kilo hertz MHz Mega hertz
  • 8.
    8 Appendix6 TABLE OF CONTENT SR.NO.CONTENTS PAGE NO. Title Page I Certificate Page II Acknowledgements III Abstract IV List of Tables V List of Figures VI Chapter 1 INTRODUCTION 11 1.1 Introduction 11 1.2 Problem Statement. 11 1.3 Contribution of Project 12 1.4 Planning of working 12 Chapter 2 OVERVIEW OF SYSTEM 13 2.1 Block diagram of system 13 2.2 Process of Block diagram 13 2.3 Detail of Component 14 2.4 Features 16 Chapter 3 ATmega32 MICROCONTROLLER 17 3.1 Pin configuration 17 3.2 Block diagram of Atmega32 controller 18 3.3 PIN description 20 3.4 History of Atmega32 controller 21
  • 9.
    9 3.5 Advantages ofAtmega32 controller 23 3.6 Disadvantages of Atmega32 controller 23 3.7 Application of Atmega32 controller 23 Chapter 4 LCD 24 4.1 16x2 LCD module 24 4.2 Features 24 4.3 Advantages of LCD over LED 25 4.4 PIN diagram of 16x2 LCD Module 25 4.5 PIN description 26 4.6 How to write on LCD 26 4.7 Using on LCD in 4 and 8 mode 26 4.8 Circuit diagram of LCD interfacing with Atmega32 27 Chapter 5 ALCOHOL SENSOR 29 5.1 Alcohol gas sensor 29 5.2 Application of Alcohol sensor 30 5.3 Feature ofAlcohol sensor 30 5.4 Sensitivity ofAlcohol sensor 32 5.5 Specification table 32 5.6 warm up time 32 5.7 Using the sensor 32 5.8 Testing the sensor 32 5.9 Pin outs 33 Chapter 6 BUZZER 34 6.1 Introduction of Buzzer 34 6.2 Specification 34 6.3 Advantages of buzzer 35
  • 10.
    10 6.4 Disadvantages ofbuzzer 35 Chapter 7 RELAY 36 7.1 Introduction of relay 36 7.2 Relay Driver circuit 37 7.3 Advantages of Relay 37 Chapter 8 SYSTEM COMPONENTS 38 8.1 Power supply 38 8.2 Voltage regulator 38 8.3 Push Switch 39 8.4 L293D motor circuit 40 8.6 ADC 42 Chapter 9 GSM 43 9.1 SIM900 43 9.2 SIM900 Overview 44 9.3 FEATURES 44 9.4 SPECIFICATIONS 45 Chapter 10 PCB DESIGNING & APPLICATION 46 10.1 Introduction of Altium Designer 46 Chapter 11 WORKING OF PROJECT 49 11.1 Hardware of project 49 11.2 Working 49 CONCLUSION 51 REFERENCES 52
  • 11.
    11 INTRODUCTION CHAPTER 1 1.1.INTRODUCTION : The main aim of this embedded application is to detect the alcohol drunken people. We are developing an embedded kit which will be placed in a vehicle. Now, the vehicle will be under the control of the kit .If any drunken person enter in to the vehicle it gives a buzzer sound immediately , and now the car will be under the control of the hardware used. We run the vehicle by using wireless communication i.e. from Control section (acts as transmitter) we are ejecting the control signals, then the vehicle receives (acts as receiver) the signals, according to the signals it will give a alarm or buzzer. It aims at designing and executing the vehicle controlling using RF. By using the RF communication, whenever alcohol is detected using the alcohol detector, the micro controller sends the information to the encoder and the encoder encodes the values and is received by the RF Transmitter. RF Receiver receives the information from the RF Transmitter and decoder decodes the serial input and sends the output to the micro controller and according to the information received by the micro controller the robot will move in that particular direction. The robot movement is driven with the help of L293D as driver IC. 1.2. PROBLEM STATEMENT : A government-auto industry program that is trying to develop a device to detect drunken drivers, which would be installed in all new vehicles, is on track to get a six-fold increase in funding. The device, which would automatically sniff the driver‟s breath or use a light beam to test the alcohol content of tissue, would prevent drunken operators from starting the vehicle. There is no plan for the device to be mandatory. Those working on the project hope consumers will accept the alcohol interlock voluntarily because of the safety advantages.
  • 12.
    12 In 2008, almost12,000 people died in “alcohol-impaired” crashes, according to federal records. In a statement Mr. Udall said “drunk driving is a completely preventable tragedy that destroys thousands of lives each year in the United States.”Those who favor the devices say when they are in all vehicles they could save 8,000 to 9,000 lives a year by stopping drunks before they get on the road. “I think it is equivalent to the next seat belt It could make a huge difference in highway safety,” 1.3 CONTRIBUTION OF PROJECT: In order to achieve our objective, we have contributed ourselves by designing circuit of Alcohol detection and vehicle controlling system by using Alcohol sensor. We have used microcontroller Atmega32, LCD, gas sensor, GSM, buzzer, Motor and connecters. 1.4PLANNING OF WORKING:
  • 13.
    13 OVERVIEW OF SYSTEMCHAPTER 2 2.1 BLOCK DIAGRAM: Figure 1: Block diagram of system 2.2. PROCESS OF BLOCK DIAGRAM:  In this project, If any drunken person enter in to the vehicle it gives a buzzer sound immediately, and now the car will be under the control of the hardware used.  We run the vehicle by using wireless communication i.e. from Control section (acts as transmitter) we are ejecting the control signals, then the vehicle receives (acts as receiver) the signals, according to the signals it will give an alarm or buzzer.  It aims at designing and executing the vehicle controlling using RF. By using the RF communication, whenever alcohol is detected using the alcohol detector, the ALCOHOL SENSOR LCD BUZZER MICROCONTROL LERATmega32 MOTOR GSM
  • 14.
    14 micro controller sendsthe information to the encoder and the encoder encodes the values and is received by the RF Transmitter.  RF Receiver receives the information from the RF Transmitter and decoder decodes the serial input and sends the output to the micro controller and according to the information received by the micro controller the robot will move in that particular direction. 2.3. DETAILS OF COMPONENTS:  MICROCONTROLLER : Microcontroller is a small computer on a single integrated circuit containing a processor core, memory, and programmable input/output peripherals.  FEATURES:  High performance, Low power 8 –bit Microcontroller  Advanced RISC Architecture 131 Powerful Instruction-most single clock cycle Execution 32*8 General Purpose Working Registers Fully Static Operation  Data and Non-Volatile Program Memory 16/32/64k Bytes Flash Of In-System 512B/1K/2K Bytes of In-System Programmable EEPROM 1/2/4k Bytes Internal SRAM  Software use WinAVR20100110 Protius7.7 Actium PCB Designer  Special microcontroller features
  • 15.
    15 Low power idle,noise reduction and power down modes Power on reset and programmable brown out detection In – system programmable via spy port High precision crystal oscillator for can operations (16 MHz)  LCD: LCD stands for liquid crystal display is a flat panel display, electronic visual display that uses the light modulating properties of liquid crystals. Liquid crystals do not emit light directly. It can be interfaced to microcontroller to show the output.  POWER SUPPLY: It is the electrical power applied to microcontroller. To run the circuit we need electrical power supply.  RELAY: A relay is an electrically operated switch. Many relays use an electromagnet to operate a switching mechanism mechanically, but other operating principles are also used. Relays are used where it is necessary to control a circuit by a low-power signal (with complete electrical isolation between control and controlled circuits), or where several circuits must be controlled by one signal.  ALCOHOL SENSOR: 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 output based on alcohol concentration.  BUZZER: The buzzer acts as an alarm in the circuit which is used to keep the driver in a conscious state when he or she has consumed alcohol the buzzer used here is a piezo circuit that produces a sharp sound when provided with a suitable amount of voltage. When a voltage is being applied across the poles the metal plate vibrates due to the electromagnetic effect. Thus the vibration of metal plate causes a sound.
  • 16.
    16  GSM: Sitcom presentsan ultra compact and reliable wireless module-SIM900. This is a complete Quad-band GSM/GPRS module in a SMT type and designed with a very powerful single-chip processor integrating AMR926EJ-S core, allowing you to benefit from small dimensions and cost-effective solutions. Featuring an industry-standard interface, the SIM900 delivers GSM/GPRS 850/900/1800/1900MHz performance for voice, SMS, Data, and Fax in a small form factor and with low power consumption. With a tiny configuration of 24mm x 24mm x 3 mm, SIM900 can fit almost all the space requirements in your M2M applications, especially for slim and compact demands of design. 2.4. FEATURES: 1. Quad-Band 850/ 900/ 1800/ 1900 MHz 2. GPRS multi-slot class 10/8 3. GPRS mobile station class B 4. Compliant to GSM phase 2/2+ 5. Class 4 (2 W @850/ 900 MHz) 6. Class 1 (1 W @ 1800/1900MHz) 7. Weight: 3.4g 8. Control via AT commands (GSM 07.07 ,07.05 and SIMCOM enhanced AT Commands) 9. Supply voltage range: 3.2 … 4.8V 10. Low power consumption: 1.0mA (sleep mode) 11. Operation temperature: -40°C to +85 °C
  • 17.
    17 Atmega32 MICROCONTROLLER CHAPTER3 3.1. PIN CONFIGURATION: Figure 2: Pin Diagram of Atmega32 controller Atmega32 CONTROLLER: Figure 3: Atmega32 Controller
  • 18.
    18 3.2. BLOCK DIAGRAMOF Atmega32 CONTROLLER: Figure 4: Block Diagram of Atmega32 Controller The AVR core combines a rich instruction set with 32 general purpose working registers. All the 32 registers are directly connected to the Arithmetic Logic Unit (ALU), allowing two independent registers to be accessed in one single instruction executed in one clock cycle. The resulting architecture is more code efficient while achieving throughputs up to
  • 19.
    19 ten times fasterthan conventional CISC microcontrollers. The Atmega32 provides the following features: 32K bytes of In-System Programmable Flash Program memory with Read-While-Write capabilities, 1024 bytes EEPROM, 2K byte SRAM, 32 general purpose I/O lines, 32general purpose working registers, a JTAG interface for Boundary-scan, On-chip Debugging support and programming, three flexible Timer/Counters with compare modes, Internal and External Interrupts, a serial programmable USART, a byte oriented Two-wire Serial Interface, an 8-channel, 10-bit ADC with optional differential input stage with programmable gain (TQFP package only), a programmable Watchdog Timer with Internal Oscillator, an SPI serial port, and six software selectable power saving modes. The Idle mode stops the CPU while allowing the USART, Two-wire interface, A/D Converter, SRAM; Timer/Counters, SPI port, and interrupt system to continue functioning. The Power-down mode saves the register con- tents but freezes the Oscillator, disabling all other chip functions until the next External Interrupt or Hardware Reset. In Power-save mode, the Asynchronous Timer continues to run, allowing the user to maintain a timer base while the rest of the device is sleeping. The ADC Noise Reduction mode stops the CPU and all I/O modules except Asynchrony-nous Timer and ADC, to minimize switching noise during ADC conversions. In Standby mode, the crystal/resonator Oscillator is running while the rest of the device is sleeping. This allows very fast start-up combined with low-power consumption. In Extended Standby mode, both the main Oscillator and the Asynchronous Timer continue to run. The device is manufactured using Atmel‟s high density nonvolatile memory technology. The On-chip ISP Flash allows the program memory to be reprogrammed in-system through an SPI serial interface, by a conventional nonvolatile memory programmer, or by an On-chip Boot program running on the AVR core. The boot program can use any interface to download the application program in the Application Flash memory. Software in the Boot Flash section will continue to run while the Application Flash section is updated, providing true Read-While-Write operation. By combining an 8-bit RISC CPU with In-System Self-Programmable Flash on a monolithic chip, the Atmel Atmega32 is a powerful microcontroller that provides a highly-flexible and cost-effective solution to many embedded control applications. The Atmega32 AVR is supported with a full suite of program and system development tools including: C compilers, macro assemblers, program debugger/simulators, in-circuit emulators, and evaluation kits.
  • 20.
    20 3.3. PIN DISCRIPTION: VCC: Digital supply voltage.  GND: Ground.  Port A (PA7.PA0): Port A serves as the analog inputs to the A/D Converter. Port A also serves as an 8-bit bi-directional I/O port, if the A/D Converter is not used. Port pins can provide internal pull-up resistors (selected for each bit). The Port A output buffers have symmetrical drive characteristics with both high sink and source capability. When pins PA0 to PA7 are used as inputs and are externally pulled low, they will source current if the internal pull-up resistors are activated. The Port A pins are tri-stated when a reset condition becomes active, even if the clock is not running.  Port B (PB7.PB0): Port B is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for each bit). The Port B output buffers have symmetrical drive characteristics with both high sink and source capability. As inputs, Port B pins that are externally pulled low will source current if the pull-up resistors are activated. The Port B pins are tri-stated when a reset condition becomes active, even if the clock is not running.  Port C (PC7.PC0): Port C is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for each bit). The Port C output buffers have symmetrical drive characteristics with both high sink and source capability. As inputs, Port C pins that are externally pulled low will source current if the pull-up resistors are activated. The Port C pins are tri-stated when a reset condition becomes active, even if the clock is not running. If the JTAG interface is enabled, the pull-up resistors on pins PC5 (TDI), PC3 (TMS) and PC2(TCK) will be Activated even if a reset occurs. The TD0 pin is tri-stated unless TAP states that shift out data are entered.  Port D (PD7..PD0): Port D is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for each bit). The Port D output buffers have symmetrical drive characteristics with both high sink and source capability. As inputs, Port D pins that are externally pulled low will source current if the pull- up resistors are activated. The Port D pins are tri-stated when a reset condition becomes active, even if the clock is not running.
  • 21.
    21  RESET: ResetInput. A low level on this pin for longer than the minimum pulse length will generate a reset, even if the clock is not running. Shorter pulses are not guaranteed to generate a reset.  XTAL1: Input to the inverting Oscillator amplifier and input to the internal clock operating circuit.  XTAL2: Output from the inverting Oscillator amplifier.  AVCC: AVCC is the supply voltage pin for Port A and the A/D Converter. It should be externally connected to VCC, even if the ADC is not used. If the ADC is used, it should be connected to VCC through a low-pass filter.  AREF: AREF is the analog reference pin for the A/D Converter. 3.4. HISTORY OF Atmega32 MICROCONTROLLER: Basic families: AVRs are generally classified into six broad groups:  Tiny AVR : 0.5–16 kB program memory 6–32-pin package Limited peripheral set  Mega AVR 4–512 kb program memory 28–100-pin package Extended instruction set (multiply instructions and instructions for handling larger program memories) Extensive peripheral set
  • 22.
    22  XMEGA 16–384 kBprogram memory 44–64–100-pin package (A4, A3, A1) Extended performance features, such as DMA, “Event System”, and cryptography support. Extensive peripheral set with ADCs.  Application-specific AVR Mega AVRs with special features not found on the other members of the AVR family, such as LCD controller, USB controller, advanced PWM, CAN, etc.  FPSLIC (AVR with FPGA) FPGA 5K to 40K gates SRAM for the AVR program code, unlike all other AVRs AVR core can run at up to 50 MHz  32-bit AVRs Main article: AVR32 In 2006 Atmel released microcontrollers based on the new, 32-bit, AVR32 architecture. They include SIMD and DSP instructions, along with other audio and video processing features. This 32-bit family of devices is intended to compete with the ARM based processors. The instruction set is similar to other RISC cores, but it is not compatible with the original AVR or any of the various ARM cores.
  • 23.
    23 3.5. ADVANTAGE ofAtmega32:  Cost: At the moment, the very lowest-price microcontroller available from any manufacturer is the $0.54 Atmel AVR Attiny11 6 MHz FLASH (same price for 8 pin DIP and 8 pin SOIC)(price in singles from Digikey as of 2004-07-06).  Speed: Not only are most AVRs capable of 20MHz (even really cheap ones like the Attiny25/45/85 and Atmega48), but they actually run at near 20 MIPS; the PIC chips I‟m aware of at a higher price (for example, PIC16F88) only run at 5 MHz with a 20 MHz oscillator frequency. In addition, with the better addressing modes and registers of the AVRs, most operation can be done in only one instruction, where it often takes more than one instruction to do the same thing on a PIC.  Peripherals: Many Atmel AVR µcontrollers, like many Microchip PIC µcontrollers, have a built-in 10 bit ADC. Some have LCD or USB drivers. 3.6. DISADVANTAGE OF Atmega32:  Single source: only available from Atmel.  Power: Atmel AVRs have fairly low power, but the TI MSP430 series has the lowest power of any microcontroller.  Speed: near 20MIPS is great, but the SX chips regularly run at near 50MIPS and can run at 75 or even 100 (in rare cases) 3.7. APPLICATION OF Atmega32 CONTROLER:  Industrial automation  Lighting  Smart energy  Mobile Electronics  Automotive  Building Automation  Home Appliances  Home Entertainment
  • 24.
    24 LCD CHAPTER 4 4.1.16 X 2 LCD MODULES: Figure 5: 16X2 LCD with PIN function A Liquid Crystal Display (LCD) is a thin, flat display device made up of any number of color or monochrome pixels arrayed in front of a light of a light source or reflector. Each pixel consists of a column of liquid crystal molecules suspended between two transparent electrodes, and two polarizing filters, the axes of polarity of which are perpendicular to each other. Without the liquid crystal between them, light passing through one would be blocked by the other. The liquid crystal twists the polarization of light entering one filter to allow it to pass through the other. Many microcontroller devices use smart LCD to output visual information, LCD displays are inexpensive, easy to use, and it is even possible to produce a readout using the 8x80 pixels of the displays. They have a standard ASCII set of characters and mathematical symbols. 4.2. FEATURES:  5 x 8 dots with cursor  Built-in controller (KS 0066 or Equivalent)  + 5V power supply (Also available for + 3V)
  • 25.
    25  1/16 dutycy  B/L to be driven by pin 1, pin 2 or pin 15, pin 16 orA.K (LED) 4.3. ADVANTAGE OF LCD OVER LED:  The declining prices of LCD‟s.  The ability to display numbers, characters, and graphics. This is in contrast to LED‟s which are limited to numbers and a few characters.  Incorporation of a refreshing controller in to the LCD, thereby relieving the CPU of the task of refreshing the LCD. In contrast, the LED must be refreshed by the CPU to keep displaying the data.  Ease of programming for characters and graphics. 4.4. PIN DIAGRAM OF 16x2 CHARACTER LCD: Figure 6: Pin Diagram of 16x2 LCD A 16x2 LCD means it can display 16 characters per line and there are 2 such lines. In this LCD each character is displayed in 5x7 pixel matrix. This LCD has two registers:  Command/Instruction Register: Stores the command instructions given to the LCD. A command is an instruction given to LCD to do a predefined task like initializing, clearing the screen, setting the cursor position, controlling display etc.
  • 26.
    26  Data Register:Stores the data to be displayed on the LCD. The data is the ASCII value of the character to be displayed on the LCD. 4.5. PIN DISCRIPTION:  EN: Line is called “Enable.” This control line is used to tell the LCD that you are sending it data. To send data to the LCD bring EN high (1) and wait for the minimum amount of time required by the LCD datasheet (this varies from LCD to LCD), and end by bringing it low (0) again.  RS: Line is the “Register Select” line. When RS is low (0), the data is to be treated as a command or special instruction (such as clear screen, position cursor, etc.). When RS is high (1), the data being sent is text data which should be displayed on the screen. For example, to display the letter “T” on the screen you would set RS high.  RW: Line is the “Read/Write” control line. When RW is low (0), the information on the data bus is being written to the LCD. When RW is high (1), the program is effectively querying (or reading) the LCD. Only one instruction (“Get LCD status”) is a read command.  Vcc, Vss, VEE: While Vcc and Vss provide +5v and ground, respectively, VEE is used for controlling LCD contrast.  D0 – D7: The 8 – bit data pins, D0 – D7, are used to send information to the LCD or read the contents of the LCD‟s internal registers. 4.6. How to write on LCD: We also used RS (RESISTOR SELECT) =0 to check busy flag bit to see that LCD is ready to receive information. The busy flag is D7 and can be read when R/W =1 and RS =0 as follows: If R/W (READ/WRITE) =1 RS=0. When D7=1(Busy flag) =1 the LCD is busy taking care of internal operation and we will not any new information. When D7=0 the LCD is ready to receive the new information. Note: It is recommended to check before writing any data to the LCD. 4.7. Using an LCD in 4 and 8 bit Mode: In 8-bit mode, you will be needing 8 pins for sending or reading a whole byte of data at
  • 27.
    27 once, and 3control lines: enable (EN), register select (RS), and read/write (RW). Basic procedure is to prepare all other lines, and then pulse the enable line high for a short while in which LCD reads your command (when RW is low) or writes data (when RW is high). For control messages, RS line is low, and for writing letters, RS line is high. The 4 bit mode of HD44780 compatible LCDs can be used. In this mode only the upper 4 data lines are used and the control lines stay the same, which makes a total of 7 lines for the LCD. However, the code size and execution time increase, as each data or control byte has to be sent to the LCD in 2 nibbles. The basic principles of using LCDs are the same as in 8-bit mode. The commands are the same and the busy flag should be checked before any operation. 4.8. Circuit Diagram for LCD interfacing with Atmega32: Figure 7: Circuit Diagram for LCD interfacing with Atmega32
  • 28.
    28 There are threecontrol signals called R/W, DI/RS and En. By making RS/DI signal 0 you can send different commands to display. These commands are used to initialize LCD, to display pattern, to shift cursor or screen etc.AT89S52 can be divided in to 4 ports, and each port consists of 8 pins. All the data lines of LCD are connected with port P1. i.e., data lines D0-D1 are connected to portP1 i.e., to pin numbers 1 to 8 through a SIL, SIL is a few ohms of resistance connected to withstand the large voltages and currents.
  • 29.
    29 ALCOHOL SENSOR CHAPTER5 5.1. ALCOHOL GAS SENSOR MQ-3: A sensor is a technological device that detects / senses a signal, physical condition and chemical compounds. It is also defined as any device that converts a signal from one form to another. Sensors are mostly electrical or electronic. 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. Figure 8: Alcohol Gas Sensor MQ-3 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 output based on alcohol concentration.
  • 30.
    30 5.2. APPLICATION:  Itis used as part of the breathalyzers or breath testers for the detection of ethanol in the human breath.  They are suitable for alcohol checker, Breath analyzer.  Vehicle alcohol detector  Portable alcohol detector  Breath Analyzer  Blood Alcohol Concentration Checker  Alcohol Gas Sensor 5.3. FEATURES:  High sensitivity to alcohol and small sensitivity to Benzine  Fast response and High sensitivity  Stable and long life  Simple drive circuit of 5V DC with analog output  Operation Temperature: -10 to 70 degrees C 5.4. SENSITIVITY: Figure 9: resistance ratio and abscissa is alcohol concentration
  • 31.
    31 Figure 10: Sensitivityof Alcohol Gas Sensor 5.4.1. Typical Sensitivity Characteristics of sensor for several gases in their  Temp: 20 deg C  Humidity: 65%  Oxygen concentration: 21%  RL = 10K Ohm  Ro = Sensor resistance at 0.4mg/L of  Alcohol in clean air  Rs = Sensor resistance at various  concentrations of gases
  • 32.
    32 5.5. SPECIFICATION: Parameter ValueUnit Target Gas Alcohol Detection Range 0.05mg/L—10mg/L PPM (part per millions) Output Voltage Range 0 to 5 VDC Working Voltage 5 VDC Current Consumption ≤180 mA Warm up Time 10 Minutes Calibrated Gas 0.4 mg/L Alcohol Response Time ≤10s Seconds Resume Time ≤30s Seconds Standard Working Condition Temperature:-10 to 65 deg C. Humidity: ≤95%RH Storage Condition Temperature: -20-70 deg C Hum: ≤ 70%RH Table 1: Specification of Alcohol Gas Sensor 5.6. Warm up Time: The sensor needs 10 minutes of warm up time after first power is applied. After 10 minutes you can take its readings. During warm up time the output analog voltage would go up from 4.5V to 0.5V in variation down gradually. During this warm up time the sensor reading should be ignored. 5.7. Using the Sensor: The sensor needs 5V to operate, Give regulated +5V DC supply, the sensor will take around 180mA supply. The sensor will heat a little bit since it has internal heater that heats the sensing element. 5.8. Testing the sensor: Measure the output voltage through multi-meter between A.OUT and Ground pins or Use a Microcontroller to measure the voltage output. Best way to check the sensor is take a bottle of aftershave liquid and open the cap. Take the sensor near the bottle output. You will see increase in thereadings.
  • 33.
    33 5.9. PIN OUTS: Sr.Pin Details 1 GND Power Supply Ground 2 A.OUT Analog Voltage Out 3 +5V Supply voltage DC +5V regulated Table 2: Pin outs of Alcohol Gas Sensor
  • 34.
    34 BUZEER CHAPTER 6 6.1.INTRODUCTION OF BUZZER: Figure 11: Buzzer The buzzer acts as an alarm in the circuit which is used to keep the driver in a conscious state when he or she has consumed alcohol the buzzer used here is a piezo circuit that produces a sharp sound when provided with a suitable amount of voltage. When a voltage is being applied across the poles the metal plate vibrates due to the electromagnetic effect. Thus the vibration of metal plate causes a sound. 6.2. SPESIFICATION:  Rated Voltage: A piezo buzzer is driven by square waves (V p-p).  Operating Voltage: For normal operating. But it is not guaranteed to make the minimum SPL under the rated voltage.  Consumption Current: The current is stably consumed under the regular operation. However, it normally takes three times of current at the moment of starting to work.  Capacitance: A piezo buzzer can make higher SPL with higher capacitance, but it consumes more electricity.  Sound Output: The sound output is measured by decibel meter. Applying rated voltage and square waves, and the distance of 10 cm.
  • 35.
    35  Rated Frequency:A buzzer can make sound on any frequencies, but we suggest that the highest and the most stable SPL come from the rated frequency.  Operating Temp.: Keep working well between -30~ and +70~. Figure 12: Circuit of Buzzer Hear, R=VDC*100(ohm) If VDC=5V R= 5*100 R=500 ohm 6.3. ADVANTAGE:  Electrically operated device that is good for drawing attention to a condition that requires attention. 6.4. DISADVANTAGE:  Annoying sound to those that don‟t know its significance.  Requires training to know what the buzzer means, and how to repair the condition without just shutting off the buzzer.  Could trigger a fire in an explosive atmosphere.  Most likely device to receive “emotional outbursts” like misguided forklift strikes, stray bullets, and attacks by roving wire cutters.
  • 36.
    36 RELAY CHAPTER 7 7.1.RELAY: A relay is switch worked by electromagnet .it is useful if we want a small current in one circuit to control another circuit containing a device such as lamp or electric motor which requires a large current or if we wish several differential switch contacts to be operated simultaneously. There are two types of relays 1. Normally closed 2. Normally opened We are using normally opened type relay. When controller output from the PC is high, transistor will be in ON state, so relay is energized in the reverse condition relay is dennergized. Figure 13: Relay A relay is an electrically operated switch. Current flowing through the coil of the relay creates a magnetic field, which attracts a lever and changes the switch contacts. The coil current can be on or off so relays have two switches positions and they are double throw (changeover) switches. Relays allow one circuit to switch a second circuit, which can be completely separate from the first. For example a low voltage battery circuit can use a relay to switch a 230V AC
  • 37.
    37 mains circuit. Thereis no electrical connection inside the relay between the two circuits; the link is magnetic and mechanical. 7.2. RELAY DRIVER CIRCUIT: Figure 14: Relay Driver Circuit Relays are components which allow a low-power circuit to switch a relatively high current on and off, or to control signals that must be electrically isolated from the controlling circuit itself. Relay for this type of application, but are unsure about the details of doing so. It is a quick rundown. To make a relay operate, you have to pass a suitable .pull-in and holding. Current (DC) through its energizing coil. And generally relay coils are designed to operate from a particular supply voltage. Often 12V or 5V, in the case of many of the small relays used for electronics work. In each case the coil has A resistance which will draw the right pull-in and holding currents when it‟s connected to that supply voltage. So the basic idea is to choose a relay with a coil designed to operate from the supply voltage. 7.3. ADVANTAGES OF RELAY:  Relays can switch AC and DC, transistors can only switch DC.  Relays can switch high voltages, transistors cannot.  Relays are a better choice for switching large currents (> 5A)
  • 38.
    38 SYSTEM COMPONENTS CHAPTER8 8.1. POWER SUPPLY: Figure 15: Power Supply The Power supply from any filter capacitors, we need to reduce 240V from transformer to 15V, but this 15V is AC which is converted into DC by bridge, this 15V DC is reduce to 5V which is the simply job of the IC 7805. Usually we add filter capacitors, when there is a lot of disturbance like in motor controllers, or AC to DC power supplies. 8.2. VOLTAGE REGULATOR: Voltage regulator Ics are available with fixed (typically 5, 12 and 15V) or variable output voltages. They are also rated by the maximum current they can pass. Negative voltage regulators are available, mainly for use in dual supplies. Most regulators include some automatic protection from excessive current („overload protection‟) and overheating („thermal protection‟).
  • 39.
    39 Figure 16: VoltageRegulator Many of the fixed voltage regulator Ics has 3 leads and look like power transistors, such as the 7805 +5V 1A regulator. The regulators are mainly classified for low voltage and for high voltage. Further they can also be classified as:  Positive regulator: Input pin Output pin Ground pin It regulates the positive voltage.  Negative regulator: Ground pin Input pin Output pin It regulates the negative voltage. 8.3. PUSH SWITCH: Figure 17: PUSH SWITCH A switch is an electrical component that can break an electrical circuit, interrupting the current or diverting it from one conductor to another. Here we use PUSH SWITCH. A push switch is a momentary or non-latching switch which causes a temporary change in
  • 40.
    40 the state ofan electrical circuit only while the switch is physically actuated. An automatic mechanism (i.e. a spring) returns the switch to its default position immediately afterwards, restoring the initial circuit condition. There are two types:  A push to make switch allows electricity to flow between its two contacts when held in. When the button is released, the circuit is broken. Symbol of Push to make switch electronic  A push to break switch does the opposite, i.e. when the button is not pressed, electricity Can flow, but when it is pressed the circuit is broken. Symbol of Push to break switch electronic 8.4. L293D Motor Driving Circuit : Figure.18 hardware of L293D motor driving circuit
  • 41.
    41  Introduction ofL293D Motor Driving Circuit. The L293D motor driver is available for providing User with ease and user friendly interfacing for embedded application. L293D motor driver is mounted on a good quality, single sided non-PTH PCB. The pins of L293D motor driver IC are connected to connectors for easy access to the driver IC‟s pin functions. The L293D is a Dual Full Bridge driver that can drive up to 1Amp per bridge with supply voltage up to 24V. It can drive two DC motors, relays, solenoids, etc. The device is TTL compatible. Two H bridges of L293D can be connected in parallel to increase its current capacity to 2 Amp.  Features: 1) Easily compatible with any of the system 2) Easy interfacing through FRC (Flat Ribbon Cable) 3) External Power supply pin for Motors supported 4) Onboard PWM (Pulse Width Modulation) selection switch 5) 2pin Terminal Block (Phoenix Connectors) for easy Motors Connection 6) Onboard H-Bridge base Motor Driver IC (L293D)  Motor: In small motors, an alternative design is often used which feature a coreless armature winding. This design depend upon the coil wire itself for structural integrity. As a result, the armature is hollow and the permanent magnate can be mounted inside the rotor coil. Coreless DC motor have much lower armature induction then iron core motors of comparable size, extending brush and commutator life. Figure.19 Diagram courtesy of Micro Motor In any electric motor, operation is based on simple electromagnetism. A current-carrying conductor generates a magnetic field; when this is then placed in an external magnetic
  • 42.
    42 field, it willexperience a force proportional to the current in the conductor, and to the strength of the external magnetic field. As you are well aware of from playing with magnets as a kid, opposite (North and South) polarities attract, while like polarities (North and North, South and South) repel. The internal configuration of a DC motor is designed to harness the magnetic interaction between a current-carrying conductor and an external magnetic field to generate rotational motion. 8.6. ADC: Figure.20 ADC PROCESSING An electronic integrated circuit which transforms a signal from analog (continuous) to digital (discrete) form. Analog signals are directly measurable quantities. Digital signals only have two states. For digital computer, we refer to binary states, 0 and 1.
  • 43.
    43 GSM CHAPTER 9 9.1.SIM900: Figure.21 Hardware of Sim 900  Introduction: This document describes SIM900 hardware interface in great detail. This document can help user to quickly understand SIM900 interface specifications, electrical and mechanical details. With the help of this document and other SIM900 application notes, user guide, users can use SIM900 to design various applications quickly.
  • 44.
    44 9.2. SIM900 Overview: Designedfor global market, SIM900 is a quad-band GSM/GPRS module that works on frequencies GSM 850MHz, EGSM 900MHz, DCS 1800MHz and PCS 1900MHz. SIM900 features GPRS multi-slot class 10/ class 8 (optional) and supports the GPRS coding schemes CS-1, CS-2, CS-3 and CS-4. With a tiny configuration of 24*24*3mm, SIM900 can meet almost all the space requirements in user applications, such as M2M, smart phone, PDA and other mobile devices. SIM900 has 68 SMT pads, and provides all hardware interfaces between the module and customers‟boards.  Serial port and debug port can help user easily develop user‟s applications.  Audio channel which includes a microphone input and a receiver output.  Programmable general purpose input and output.  The keypad and SPI display interfaces will give users the flexibility to develop customized applications. SIM900 is designed with power saving technique so that the current consumption is as low as 1.0mA in sleep mode. SIM900 integrates TCP/IP protocol and extended TCP/IP AT commands which are very useful for data transfer applications. For details about TCP/IP applications, please refer to document. 9.3. FEATURES:  Quad-Band 850/ 900/ 1800/ 1900 MHz  GPRS multi-slot class 10/8  GPRS mobile station class B  Compliant to GSM phase 2/2+  Class 4 (2 W @850/ 900 MHz)  Class 1 (1 W @ 1800/1900MHz)  Weight: 3.4g  Control via AT commands (GSM 07.07 ,07.05 and SIMCOM enhanced AT Commands)
  • 45.
    45  Supply voltagerange : 3.2 … 4.8V  Low power consumption: 1.0mA(sleep mode)  Operation temperature: -40°C to +85 °C 9.4. SPECIFICATIONS:  GSM modem is a functionally similar to a GSM phone.  It is controlled using AT commands, like most other modems.  There are various AT commands for different purposes.  It internally has a SIM card tray/slot for inserting the SIM card to use a specific service provides network.
  • 46.
    46 PCB DESIGNING &APPLICATION CHAPTER 10 10.1 Introduction of Altium Desidner: Altium Designer provides a unified electronic product development environment, catering for all aspects of the electronic development process, including:  System Design and Capture  Physical PCB Design  FPGA Hardware Design  Embedded Software Development  Mixed-Signal Circuit Simulation  Signal Integrity Analysis  PCB Manufacturing  FPGA system implementation and debugging (when working with a suitable FPGA development board, such as an Altium NanoBoard. All of these design areas are intrinsic parts of a single, cohesive system, built on Altium Designer‟s Design Explorer (DXP) integration platform. The extent of this unified system, in terms of the features and functionality available, will depend on the specific licensing purchased. Underlying Altium Designer is the DXP integration platform which brings together Altium Designer‟s various editors and software engines, and provides a consistent user- interface across all the tools and editors. The Altium Designer environment is fully customizable, allowing you to set up the workspace to suit the way you work. A consistent selection and editing paradigm across different editors allows you to easily and smoothly switch between various design tasks within the Altium Designer environment. Altium Designer offers a unique design environment, with all areas of design – from capture to generation of PCB manufacturing output; from embedded software development to processing and download of an FPGA design into a physical FPGA device – brought together in the one environment through the underlying support of the DXP integration platform. Supporting the display and editing of multiple design documents, of differing type, this environment is fully customizable, allowing you to
  • 47.
    47 tailor the workspaceresources – including menus, toolbars and shortcuts – in accordance with preferred design habits . FIGURE.22 SCHEMATIC CIRCUIT DIAGRAM OF THE ALTIUM SHEET FIGURE 23. PCB CIRCUIT DESIGNNING
  • 48.
    48 FIGURE 23 DIFFERENTLAYOUT IN PCB DISIGNNING CIRCUIT IN 3D VIEW
  • 49.
    49 WORKING OF PROJECTCHAPTER 11 11.1. Hardware Architecture of Project: FIG 25.HARDWARE OF PROJECT 11.2. Working: The main purpose behind this project is Drunk driving detection. Now 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. The main unit of this project is an Alcohol sensor. This project should be installed inside the vehicle.
  • 50.
    50 Now a day‟smost of the peoples use cell phone for communication. Controlling devices through wireless media becomes very popular. GSM technology is very powerful because it overcomes the limited range of infrared and radio remote controls. We run the vehicle by using wireless communication system. In this system Control section acts as transmitter we are ejecting the control signals, then the vehicle receives acts as receiver the signals, according to the signals it will give an alarm or buzzer. 11.3. Advantage of Project: This method of analyzing or detecting the presence of alcohol in breath is relatively a quick analysis as compared to other techniques. The sensors used in this project are smaller in size, not so bulky, hence can be carried. The project based on this technology is self sufficient within itself and thus can be used as a safety system for any vehicle and the human being driving it by preventing the accidents to occur. The system isn‟t police dependent. In case if we are drunk, our family members will drive us safely in that case. Also unauthorized access to the car and rash driving is not possible. 11.4. Disadvantage of Project: May read all hydrocarbons (organic vapors) and may habitually produce false positive alcohol readings caused by smoker‟s and car exhaust CO as well as many other environmental vapors and gases. This senor is partial pressure sensitive and therefore may change sensitivity with change in altitude and elevation. This sensor may be sensitive to changes in ambient temperature, humidity and breath-flow patterns and may give false readings if not adjusted or recalibrated to account for ambient or surrounding air temperatures. The temperature of the subject is also very important. On the other hand, products such as mouthwash or breath spray can "fool" breath machines by significantly raising test result. for example, LISTERINE MOUTHWASH contains 27% alcohol. The system cannot prevent accidents due to others fault however if any mishap happens the system sends a message to the family members.
  • 51.
    51 CONCLUSION The project thusgives a system that can detect a certain amount of alcohol present in the atmosphere inside the car and to a certain range and activates a microcontroller controlled control system that controls the movement and the alarm can acts as a indicator that enables a person to judge that person has taken alcohol and needs help or any assistance. The incorporated proximity sensor thus helps to figure out the range of any obstacle or front object thus slows down the car speed and if object comes too closer than it stops the car thus preventing any collision or health hazard of the person driving the car. The GSM modem sends a message to the close relative or the police in order to take necessary steps to prevent any accident or necessary aids after accident.
  • 52.
    52 REFERENCE 13.1 WEBSITES:  www.atmel.com www.datasheet.com  www.technovelgy.com  www.engineersgarage.com  www.eletroniczone.com  http://www.alcoholbreathanalyzers.in 13.2 PATENTS & BOOKS: [1] Zhang Xin-long_Forensic medical discussion of drunken driving and traffic accidents [J]_Road Traffic Management_2007_12_3_60- 61.l [2] Zhu Yi-duo The drunk-driving measurement and control system based on multisensory [J]_Journal of Wuhan Jiao tong Polytechnic_2011_13 _1_78-80 [3] The 8051 Microcontroller And Embedded System Using Assembly And C By Muhammad Ali Mazidi (2nd Edition)
  • 53.