Professional Documents
Culture Documents
CONTENTS
TITLE
ABSTRACT
CHAPTER 1: INTRODUCTION
CHAPTER 2: BLOCK AND CIRCUIT DIAGRAM
CHAPTER 3: DISCRIPTION OF BLOCK DIAGRAM
3.1.SENSOR (TGS813)
3.2.OP AMP(LN324)
3.3.DISCRIPTION
3.4.RF TECHNOLOGY
3.5.LCD DISPLAY
3.6.MICRO CONTROLER
3.7.RELAY
CHAPTER 4: SENSOR
4.1.TGS813 SENSOR
4.2.BASIC MEASURING CIRCUIT WITH
TGS SENSOR
CHAPTER 5: MICRO CONTROLER
5.1.MICRO CONTROLLER VERSUS
MICRO PROCESSOR
5.2.FEATURES OF AT89C51
5.3.FLASH MEMORY
5.4.PIN CONFIGURATION
5.5.BLOCK DIAGRAM
5.6.PIN DISCRIPTION OF AT89C2051
5.7.8051 OSCILLATOR AND CLOCK
5.8.SPECIAL FUNCTION REGISTER
MEMORY
5.9.PSW(PROGRAM STATUS
WORD;0D0h)
5.10.SBUF(SERIAL BUFFER,99h)
5.11.INTRUPTS
PAGE NO
1
3
7
8
8
10
11
11
13
14
15
15
16
17
17
18
18
19
20
20
23
23
25
26
26
CHAPTER 6: DISCRIPTION OF RF
COMMUNICATION SYSTEM
6.1.HOW RF WIRELESS CONNECTIVITY
WORK
6.2.RF FUNDAMENTAL
6.3.RF RECEIVER OUTPUT AND IF
RECEIVER OUTPUT
6.4.TRANSMITTER MODULE
6.5.RECEIVER MODULE
CHAPTER 7: DISCRIPTION ABOUT LCD PANELS
7.1.SCHMATIC
7.2.CIRCUIT DISCRIPTION
CHAPTER 8: RELAY
SOFTWARE DETAILES
FLOW CHARTS
APLLICATION AND ADVANTAGES
RESULT
CONCLUSION
FUTURE SCOPE
REFERENCE
APPENDIX
28
28
29
29
31
31
35
36
36
37
39
40
42
43
44
44
45
46
LIST OF FIGURES
NAME
1.BLOCK DIAGRAM OF TRANSMITTER
2.BLOCK DIAGRAM OF RECEIVER
3.CIRCUIT DIAGRAM TRANSMITTER
4.CIRCUIT DIAGRAM OF RECEIVER
5.LM324 PIN DIAGRAM
6.BASIC MEASURING CIRCUIT WITH TGS
SENSOR
7.AT89C2051 PIN DIAGRAM
8.BLOCK DIAGRAM OF AT89C2051
9.8051 OSCILLATOR AND CIRCUIT
10.RF FUNDAMENTAL
11.WIRELESS LINK
12.RF TRANSMITTER MODULE PIN
13.RF RECEIVER MODULE
14.LCD SCHEMATIC
15.RESULT OF TRANSMITTE AND
RECEIVER
3
4
5
6
9
16
19
20
28
29
31
32
34
36
43
ABSTRACT
As everybody knows that the most of road accidents are taking place due to the
drunken drivers, especially this problem is severe in high ways and it is very difficult to
trace the drunken drivers. These days our patrolling police at high ways and traffic police
in cities are checking the drivers through a hand held portable alcohol sensors, but it is
very painful activity and also consumes lot of time to check each and every vehicle.
There by the present technology implemented here is innovative by which the drunken
driver can be caught very easily and the vehicle itself will be stopped while trying to
drive by drinking. This technology offers great ease to the police such that they need not
stop each and every vehicle for hunting the alcoholic driver.
The purpose of this project work is to avoid drink and driving of the vehicles. For
this, an alcohol sensor is placed in the vehicle that senses the smell of alcohol content.
Whenever the driver/person who consumed alcohol tries to start the vehicle, the vehicle
will not be started avoiding the drunken driving and immediately the alarm will be
energized automatically indicating drunken person is trying to drive the vehicle. And if
the alcohol is being consumed while driving, the vehicle immediately stops and doesnt
move any further again acknowledging by activating the alarm.
To prove the concept practically, each and every vehicle must be installed with an
Alcohol sensor inside the vehicle at some feasible point like dashboard, steering, etc. The
alcohol sensor is interfaced with an Op-Amp, which is constructed like a voltage
comparator. Whenever the alcohol sensor detects any alcoholic gases, the output of the
Op-Amp (comparator) is triggered (gives a logic HIGH signal). The triggered output of
the comparator is fed to the micro controller.
CHAPTER 1
INTRODUCTION
The concept described in this project report is aimed to catch the drunken driver,
as the concept is critical sophisticated technology must be used to detect exact vehicle
that is driven by drunken driver. To achieve the goal accurately, suitable sensors must be
used. But here since it is a prototype module, basic concept is proven with universal
sensor which can detect all sorts of toxic gases, petroleum products, smoke, etc, in
addition to the alcoholic vapors. The sensor used here is named as TGS813. Since it can
detect all sorts of toxic vapors and it is available easily every where, it is said to be
universal sensor, and this sensor is used here to detect the alcoholic vapors. Presently this
kind of sensors can be used for goods transport vehicles, because these vehicles will not
carry passengers. When this sensor used in cars, it is difficult to detect the drunken person
because of the drunken passengers. Hence it is recommended to use this technology in
trucks only, because the truck contain separate cabin for the driver and his assistant.
One advantage of using this sensor is that it can not detect little far vapors,
because it is not so sensitive. It is said to be advantage because it should not detect other
drunken persons those who are little away from the driving wheel. This indicates that the
sensor must be installed over the dashboard and that point must be very close to the
driving wheel. If this kind of arrangement is made in the cabin, the system can detect
only drunken driver. As described above, the sensor is not so sensitive, during demo, the
sensor must be exposed to the alcohol vapor. For this purpose pour little alcohol (brandy
or whiskey) in to a plate and place the sensor little above the plate with a gap of 2 inches
approximately. Depending up on the alcohol vapor concentration in the air, the
conductivity of the sensor will be varied and based on this conductivity its output in the
form of voltage levels will be varied automatically. These variations are monitored
through op-amp and a high signal will be generated whenever the sensor detects vapors
in the air.
Page 1
Page 2
Page 3
Page 4
Page 5
Page 6
Page 7
CHAPTER 3
DESCRIPTION OF BLOCK THE DIAGRAM
The block diagram and circuit diagram shown in the next chapter consists data
transmitter and data receiver. The data transmitting unit contains four major devices; they
are 1) TGS813 used as alcohol sensor, 2) 89C2051 microcontroller unit, 3) LM 324 Opamp Chip, 4) Relay, 5) DC Motor and 4) RF transmitter. Similarly the data receiving unit
contains three major units; they are 1) RF receiver, 2) Microcontroller unit, and 3) LCD
and alarm. As the over all system contains two microcontroller units, the function of
microcontrollers differs to each other, two different software programs are prepared to
function as data transmitter and data receiver. The data receiver function is to decode the
data and display the same through an LCD interfaced with 89C2051 controller through its
output. It is also the function of data receiving unit to activate the alarm whenever it
receives data from the transmitter.
The source of information is the sensor, whenever this sensor is activated by
alcohol vapor, op-amp output will become high and this high signal is fed to the
microcontroller. This op-amp configured as voltage comparator, generates logic high
signal for the controller. Based on this signal the microcontroller generates a digital code
and it will be transmitted. More over the vehicle movement is stopped by stopping the
DC motor through the relay. In the receiver, the controller is programmed to decode the
received information and display the same through LCD. Here this microcontroller is
performing the function of decoder. The information gathered from receiver will be
decoded and will be displaying the data in the LCD. The received information after
demodulating, replica in the form of digital code will be obtained from the receiver; this
data will be decoded for display purpose. As the process begins with Alcohol sensor, the
following is the description of this sensor, later function of individual blocks description
is also provided.
Page 8
Page 9
The below is the figure of LM 324 quad operational device showing the function
of each pin
Page 10
The LM324 contains four independent high gain operational amplifiers with
internal frequency compensation. The four op-amps operate over a wide voltage range
from a single Power supply. Also use a split power supply. The device has low power
supply current drain, regardless of the power supply voltage. The low power drain also
makes the LM324 a good choice for battery operation. The LM324 series are low-cost,
quad operational amplifiers with true differential inputs. They have several distinct
advantages over standard operational amplifier types in single supply applications.
Vishwa Bharathi Institute Of Technology and Sciences
Page 11
3.4.RF TECHNOLOGY
The carrier generator in the transmitting module is designed to produce 433 MHz
approximately; the information produced by the microcontroller according to the
interrupted signal obtained from the sensor in the form of vehicle information in digital
data is super imposed over this carrier and transmitted as a modulated wave. The RF
modules (transmitter & receiver) used in the project work are readymade, as the
transmitter generating very high frequency of 433 MHz and it is very difficult to
construct in normal electronic labs, there by readymade modules are used here.
When the receiver is synchronized with the transmitter it can be said as the
receiver is tuned with the transmitter, if the receiver is tuned perfectly then the
communication link will be established. The transmitting antenna sends out radio waves
in all directions. When radio waves leaving through a conductor of specific size is called
as transmitting antenna, similarly at the receiving end signals are picked up through
another conductor of same length is called as receiving antenna. Here in this project
work, as the range is very less, thin copper wires of 20 cms length each is used as
antenna.
3.4.1.Working of RF communication system
Imagine an RF transmitter wiggling an electron in one location. This wiggling
electron causes a ripple effect, somewhat a kind of dropping a pebble in a pond. The
effect is an electromagnetic (EM) wave that travels out from the initial location resulting
in electrons wiggling in remote locations. An RF receiver can detect this remote electron
wiggling. The RF communication system then utilizes this phenomenon by wiggling
electrons in a specific pattern to represent information. The receiver can make this same
information available at a remote location; communicating with no wires.
In most wireless systems, a designer has two overriding constraints: it must
operate over a certain distance (range) and transfer a certain amount of information
within a time frame (data rate). Then the economics of the system must work out (price)
along with acquiring government agency approvals (regulations and licensing).
Vishwa Bharathi Institute Of Technology and Sciences
Page 12
Pin No.
Pin no. 1
Pin no. 2
Pin no. 3
Pin no. 4
Pin no. 5
Pin no. 6
Pin no. 7
Name
D7
D6
D5
D4
D3
D2
D1
Description
Data bus line 7 (MSB)
Data bus line 6
Data bus line 5
Data bus line 4
Data bus line 3
Data bus line 2
Data bus line 1
Page 13
D0
EN1
Pin no. 10
R/W
Pin no. 11
RS
Pin no. 12
Pin no. 13
Pin no. 14
Pin no. 15
Pin no. 16
VEE
VSS
VCC
EN2
NC
Vcc, Vss, and VEE: While Vcc and Vss provide +5V and ground, respectively; VEE is
used for controlling LCD contrast.
3.6.MICROCONTROLLER
The microcontroller used in the project work belongs to ATMEL family, for this
purpose 89C2051 chip is used. The following is the general and functional description
about microcontrollers.
Microcontrollers are single-chip computers consisting of CPU (central processing
unit), data and program memory, serial and parallel I/O (input/output), timers, external
and internal interrupts, all integrated into a single chip. Microcontrollers are intelligent
electronic devices used to control and monitor devices in the real world. Today
microcontrollers are used in most commercial and industrial equipment. About 40% of
microcontroller applications are in office automation, such as PCs, laser printers, fax
machines, and so forth. About one-third of microcontrollers are found in consumer
Page 14
Page 15
Page 16
Page 17
5.2.Features of AT89C2051
5.2.1.Description
The device is manufactured using Atmels high density nonvolatile memory
technology and is compatible with the industry Standard MCS-51 instruction set and pin
out. By combining a versatile 8-bit CPU with flash on a monolithic chip, the Atmel
AT89C2051 is a powerful microcomputer which provides a highly flexible and cost
effective solution to many embedded control applications.
5.3.Flash Memory
Page 18
Page 19
5.5.Block Diagram
Page 20
5.6.2.GND
Ground.
5.6.3.Port 1
Port 1 is an 8-bit bidirectional I/O port. Port pins P1.2 to P1.7 provides internal
pull-ups. P1.0 and P1.1 requires external pull-ups. P1.0 and P1.1 also serves as the
positive input (AIN0) and negative input (AIN1), respectively, of the on-chip precision
analog comparator. The Port 1 output buffers can sink 20 mA and can drive LED displays
directly. When 1s are written to Port 1 pins, they can be used as inputs. When pins P1.2 to
P1.7 are used as inputs and are externally pulled low, they will source current because of
the internal pull-ups. Port 1 also receives code data during Flash programming and
program verification.
5.6.4.Port 3
Port 3 pins P3.0 to P3.5, P3.7 are seven bidirectional I/O pins with internal pullups. P3.6 is hard-wired as an input to the output of the on-chip comparator and is not
accessible as a general purpose I/O pin. The Port 3 output buffers can sink 20 mA.
When 1s are written to Port 3 pins they are pulled high by the internal pull-ups and can
be used as inputs. As inputs, Port 3 pins that are externally being pulled low will source
current because of the pull-ups. Port 3 also serves the functions of various special
features of the AT89C2051 as listed in the table 11.1 [refer Appendix]. Port 3 also
receives some control signals for Flash programming and programming verification.
Pin Details of AT89C2051 Port3
Page 21
5.6.5.RST
Reset input. All I/O pins are reset to 1s as soon as RST goes high. Holding the
RST pin high for two machine cycles, while the oscillator is running will reset the device.
Each machine cycle takes 12 oscillator or clock cycles.
5.6.6.XTAL1
Input to the inverting oscillator amplifier and input to the internal clock operating
circuit.
5.6.7.XTAL2
Output from the inverting oscillator amplifier.
A Micro controller consists of a powerful CPU tightly coupled with memory,
various I/O interfaces such as serial port, parallel port timer or counter, interrupt
controller, data acquisition interfaces-Analog to Digital converter, Digital to Analog
converter, integrated on to a single silicon chip. If a system is developed with a
microprocessor, the designer has to go for external memory such as RAM, ROM,
EPROM and peripherals.
But controller is provided all these facilities on a single chip. Development of a
Micro controller reduces PCB size and cost of design. One of the major differences
between a Microprocessor and a Micro controller is that a controller often deals with bits
not bytes as in the real world application.
Page 22
Page 23
5.8.2.Data pointer
The SFRs DPL and DPH work together work together to represent a 16-bit value
called the data pointer. The data pointer is used in operations regarding external RAM
and some instructions code memory. It is a 16-bit SFR and also an addressable SFR.
5.8.3.Program counter
The program counter is a 16 bit register, which contains the 2 byte address, which
tells the 8051 where the next instruction to execute to be found in memory. When the
8051 is initialized PC starts at 0000h. And is incremented each time an instruction is
executes. It is not addressable SFR.
PCON REGISTER
Page 24
TCON REGISTERS
TMOD
Page 25
PSW registers
5.10.SBUF (Serial Buffer, 99h)
SBUF is used to hold data in serial communication. It is physically two registers.
One is writing only and is used to hold data to be transmitted out of 8051 via TXD. The
other is read only and holds received data from external sources via RXD. Both mutually
exclusive registers use address 99h.
5.11.INTERRUPTS
Interrupts are hardware signals that are used to determine
conditions that exist in external and internal circuits. Any interrupt can
cause the 8051 to perform a hardware call to an interrupt handling
subroutine that is located at a predetermined absolute address in the
program memory.
Five interrupts are provided in the 8051. Three of these are generated
automatically by the internal operations: Timer flag 0, Timer Flag 1, and the serial port
interrupt (RI or TI) Two interrupts are triggered by external signals provided by the
circuitry that is connected to the pins INTO 0 and INTO1. The interrupts maybe enable or
disabled, given priority or otherwise controlled by altering the bits in the Interrupt
Enabled (IE) register, Interrupt Priority (IP) register, and the Timer Control (TCON)
register. . These interrupts are mask able i.e. they can be disabled. Reset is a non
Page 26
Interrupt
Address
RESET
0000
0003
000B
0013
001B
SERIAL
0023
Page 27
CHAPTER 6
DESRIPTION ABOUT RF COMMUNICATION SYSTEM
As we know, radio frequencies refer to the frequencies that fall within the
electromagnetic spectrum associated with radio wave propagation. When applied to an
antenna, RF current creates electromagnetic fields that propagate the applied signal
through space. Any RF field has a wavelength that is inversely proportional to the
frequency and this means that the frequency of an RF signal is inversely proportional to
the wavelength of the field.
Page 28
6.2.RF fundamental
The wireless link consists of a transmitter with antenna, a transmission path and
the receiver with antenna. Parameters of interest are the output power of the transmitter
and the sensitivity of the receiver. Below figure illustrates the link principle.
Page 29
6.3.Wireless link
Sensitivity is the minimum received power that results in a satisfactory Bit Error
Rate (BER, usually 110-3) at the received data output (i.e. correct demodulation). The
difference between received signal power and sensitivity is the transmission link margin
also known as headroom. Headroom is reduced by a number of factors such as
transmission path length, antenna efficiency, carrier frequency and physical
characteristics of obstructions in the transmission path. Sensitivity and output power
given in the RF-circuit datasheets are given for the load impedance, which is optimal for
the input LNA and the output power amplifier. This means that the impedance of the
antenna used must be equal to the load stated in the datasheet; otherwise mismatch and
loss of headroom occur. A typical matching network introduces in the order of 1-3 dB of
attenuation.
Radio Frequency (RF) waves are lower in frequency and longer in wavelength
than Infrared. At 300 MHz the wavelength is 1 m (39.37") while Consumer IR
wavelengths are just under 1 millionth of a meter. Most RF remotes use a carrier in the
300-1000 MHz range.
RF receiver only needs to be tuned to the carrier frequency used by the remote.
RF remotes and their receivers are tuned to a fixed frequency. The FCC allows
Page 30
RF Carrier
Page 31
6.5.Transmitter module
A transmitter is an electronic device, which with the aid of an antenna propagates
an electromagnetic signal such as radio, television, or other telecommunications. A
transmitter usually has a power supply, an oscillator, a modulator, and amplifiers for
audio frequency (AF) and radio frequency (RF). The modulator is the device modulates
the signal information onto the carrier frequency, which is then broadcast.
Sometimes a device like cell phone contains both a transmitter and a radio
receiver, with the combined unit referred to as a transceiver. More generally and in
communications and information processing, a "transmitter" is any object or source,
which able to sends information to an observer or receiver. When used in this more
general sense, vocal cords may also be considered an example of a "transmitter".
The transmitter module in Figure 2.5 was a RF transmitter, which used in this
project. The RF transmitter is placed at transmitter board inside the bus. The frequency
range for this types of transmitter is 433 MHz and the modulation mode is ASK or
amplitude shift keying mode. The temperature maximum rating is 230 C. The actual
range for data transmitting is from 100 m to 150 m but its depends on the stability of
power supply.
Page 32
6.6.Receiver module
The receiver in information theory is the receiving end of a communication
channel. It receives decoded messages or information from the sender, who first encoded
them. Sometimes the receiver is modeled so as to include the decoder. Real world
receivers like radio receivers or telephones cannot be expected to receive as much
information as predicted by the theorem. The receiver is designed to work with the
matching transmitter. With the addition of simple antenna the pair may be used to transfer
serial data up to 200 m. The range of the system depends upon several factors, principally
the type of antenna employed and the operating environment. The 200 m quoted range is
Page 33
Page 34
CHAPTER 7
DESCRIPTION ABOUT LCD PANELS
In a typical RGB display, the color filter is integrated into the upper glass colored
microscopically to render each individual pixel either red, green or blue. The areas in
between the colored pixel filter areas are printed black to increase contrast. After a beam
of light passes through the color filter, it passes through yet another polarizer to sharpen
the image and eliminate glare. The image is then available for viewing.
Page 35
7.1.Schematic
7.2.Circuit Description
The 10k Potentiometer controls the contrast of the LCD panel. Nothing fancy
here. As with all the examples, I've left the power supply out. You can use a bench power
supply set to 5v or use a onboard +5 regulator. Remember a few de-coupling capacitors,
especially if you have trouble with the circuit working properly.
Page 36
Page 37
8.1.OPERATION
The relays used in this project work are electromagnetic relays.
The
Page 38
In this position, there is a small air-gap in the magnetic path. Hence, more
power is needed to pull in the armature than that needed to keep it held in the attracted
position.
In this project relay is used to control the DC motor. When the voltage obtained
from the gas sensor is greater than the reference voltage value set in the controller
programming, the controller deactivates the relay by which the DC motor will be stopped
and also energizes the alarm. Simultaneously the information is also transmitted through
the RF transmitter. Details about the LCD and other major components are provided in
the further chapters.
Page 39
SOFTWARE DETAILS
KEIL SOFTWARE
Page 40
FLOW CHART
START
SENSO
R
OP-AMP
OP-AMP
MICRO
CONTROLLER
RELAY
MICRO
CONTROLLER
DC-MOTOR
A
STOP
Page 41
RELAY
(ON)
RF-TRANSMITTER
DC-MOTOR
(OFF)
RF-RECEIVER
MICRO
CONTROLLER
ALARM
LCD
STOP
Page 42
ADVANTAGES:
1. By this method we can avoid accidents.
2. The drunken and driver can be caught very easily.
3. one way of avoid to drinking.
Page 43
TRANSMITTER
RECEIVER
Page 44
CONCLUSION
As the technology advances, particularly in the field of world-wide wireless
networks, people are expecting improved quality service for various other applications in
addition to the personal communications. Here in this project work RF technology is used
to transmit the drunken driving vehicle information to the remote monitoring unit where
concern authority is monitoring the system to catch the drunken driver. In this regard
other wireless networks like GSM modules, Zigbee modules, etc. can be used to increase
the range. But here importance is not given for the range; moreover it is also not required
in this concept. The concept is to catch the drunken driver through short range
communication system such that whenever the vehicle came near to the monitoring
authority, vehicle is supposed to be seized. When this kind of system is used at check
posts at high ways, as all the vehicles are stopped for checking, drunken driving vehicle
can be detected very easily. For this kind of applications short range communication
networks helps the authority to locate the vehicle very easily.
FUTURE SCOPE
Page 45
Books
(1) Electronic Circuit guide book Sensors By JOSEPH J.CARR
(2) Op-Amps Hand Book
(3) Relays and their applications
- By: MALVIND
- By: M.C.SHARMA
By SIMON HAYKIN
By MICHAEL A. MILLER.
By: S. P. Sharma
Page 46
Page 47
Page 48
SCON,#50h
TMOD,#20h
TH1,#0E8H
TR1
com:
mov
clr
setb
ret
p1,a
rs
en
Rata:
mov p1,a
setb
rs
setb en
clr
en
ret
ddelay:MOV R4,#90
Zz21z: MOV R5,#90
Zz11z: MOVR6,#90
DJNZ R6,$
DJNZ R5,Zz11z
DJNZ R4,Zz21z
RET
delay:
mov
r2,#20h
ll7B:
mov
r3,#22h
djnz
r3,$
djnz
r2,ll7B
ret
WELCOME:
mov
dptr,#0500h
mov
r6,#12h
ll8:
movc
a,@a+dptr
lcall
rata
lcall
delay
inc
dptr
djnz
r6,ll8
RET
;welcome
Page 49
dptr,#0600h
r6,#12h
movc
lcall
lcall
inc
djnz
RET
0500h
db
0600h
db
a,@a+dptr
rata
delay
dptr
r6,ll86
;welcome
ll86:
Org
org
_ _ _ WELCOME_ _ _
ALCHOL DRNK IDNT
END
Page 50