Vehicle Main
Vehicle Main
Vehicle Main
IDENTIFICATION
G. SRIHARI
D. LAKSHMI PARVATHI
N.HARI NARAYANA
PROJECT REPORT
SUBMITTED IN PARTIAL FULFILLMENT
OF THE REQUIREMENTS FOR THE DEGREE OF
BACHELOR OF TECHNOLOGY
IN
ELECTRONICS AND COMMUNICATION ENGINEERING
BY
G. SRIHARI (07265A0409)
D. LAKSHMI PARVATHI (07265A0407)
N.HARI NARAYANA (07265A0410)
CERTIFICATE
Date:
This is to certify that the project work entitled “Vehicle Registration Using
Smart Card Identification” is a bonafide work carried out by
G. SRIHARI (07265A0409)
D. LAKSHMI PARVATHI (07265A0407)
N.HARI NARAYANA (07265A0410)
The results embodied in this report have not been submitted to any other
University or Institution for the award of any degree or diploma.
-------------------------- --------------------------
Mr A.Veerabhadra Rao, Asst Professor Dr. E Nagbhooshanam
Faculty Advisor/Liaison Professor & Head
ACKNOWLEDGEMENT
We express our deep sense of gratitude to our Guide Mr.Ravi kiran ,NSTL,
Hyderabad, for his invaluable guidance and encouragement in carrying out our
Project.
Finally, we thank all the people who have directly or indirectly help us
through the course of our Project.
G.Srihari
D.Lakshmi parvathi
N.Hari Narayana
(ii)
ABSTRACT
From the past days man is inventing various things to lead a Comfortable &
luxurious life. Not only inventing newer things but also he is continuously attempting
to implement new technologies into that field. In this attempt he got success in finding
out a computer, which can be undoubtedly called, as his fantasy.
CHAPTER 1. OVERVIEW
1.1 Introduction 1
1.2 Aim of the project 2
1.3 Methodology 2
1.4 Significance and applications 2
1.5 Organization of work 2
REFERENCES 77
(iv.b)
LIST OF FIGURES
LIST OF TABLES
EMBEDDED SYSTEMS
From the past days man is inventing various things to lead a Comfortable
& luxurious life. Not only inventing newer things but also he is continuously
attempting to implement new technologies into that field. In this attempt he got
success in finding out a computer, which can be undoubtedly called, as his
fantasy..
Here, through this project avoids the entry of unauthorized person or vehicle
into the apartment. If an unauthorized person wants to enter into the apartment he
has to get the permission from the concerned person in that apartment
1.3 Methodology
Currently security guards used to give the permission to enter into the
apartment for authorized person/vehicle, and stop each vehicle for checking which has
been done manually. This is time consuming and also delays movement of vehicles.
This can be avoided if a system is developed which automates the manual process of
checking the vehicle details. This system can give very reliable solution.
2. Details about 8051 microcontroller used in this project are given in chapter.
4. Details about circuit diagram and schematic diagram are given in chapter.
5. Details about software components and source code are given in chaper
Micro-controllers are "embedded" inside some other device so that they can
control the features or actions of the product. Another name for a micro-controller,
therefore, is "embedded controller". Micro-controllers are dedicated to one task and
run one specific program. The program is stored in ROM (read-only memory) and
generally does not change. Micro-controllers are often low-power devices. A battery-
operated Microcontroller might consume 50 milli watts. A micro-controller has a
dedicated input device and often (but not always) has a small LED or LCD display for
output. A micro-controller also takes input from the device it is controlling and
controls the device by sending signals to different components in the device
Microprocessor has following instructions to perform:
1. Reading instructions or data from program memory ROM.
2. Intrepreting the instruction and executing it.
3. Microprocessor Program is a collection of instructions stored in nonvolatile
memory.
4. Read Data from I/O device
5. Process the input read, as per the instructions read in program memory.
6. Read or write data to Data memory.
7. Write data to I/O device and output the result of processing to O/P device.
2.2 NECESSITY OF MICROCONTROLLERS
Costly: The microprocessor system had to satisfy the data and program
requirements so, sufficient RAM and ROM are used to satisfy most applications .The
peripheral control equipment also had to be satisfied. Therefore, almost all-peripheral
chips were used in the design. Because of these additional peripherals cost will be
comparatively high.
8085 chip needs: An Address latch for separating address from multiplex address
and data.32-KB RAM and 32-KB ROM to be able to satisfy most applications. As
also
Timer / Counter, Parallel programmable port, Serial port, Interrupt controller are
needed for its efficient applications.
In comparison a typical Micro controller 8051 chip has all that the 8051 board
has except a reduced memory as follows.
4K bytes of ROM as compared to 32-KB, 128 Bytes of RAM as compared to 32-KB.
Bulky: On comparing a board full of chips (Microprocessors) with one chip with all
components in it (Micro controller).
Description
The AT89S51 is a low-power, high-performance CMOS 8-bit microcontroller with
4K bytes of in-system programmable Flash memory. The device is manufactured
using Atmel’s high-density nonvolatile memory technology and is compatible with
the industry- standard 80C51 instruction set and pinout. The on-chip Flash allows the
program memory to be reprogrammed in-system or by a conventional nonvolatile
memory programmer. By combining a versatile 8-bit CPU with in-system
programmable Flash on a monolithic chip, the Atmel AT89S51 is a powerful
microcontroller which provides a highly-flexible and cost-effective solution to many
embedded control applications.
The 8051 have three general types of memory. They are on-chip
memory, external Code memory and external Ram. On-Chip memory refers to
physically existing memory on the micro controller itself. External code memory is
the code memory that resides off chip. This is often in the form of an external
EPROM. External RAM is the Ram that resides off chip. This often is in the form of
standard static RAM or flash RAM.
Code memory
Code memory is the memory that holds the actual 8051 programs that is to be
run. This memory is limited to 64K. Code memory may be found on-chip or off-chip.
It is possible to have 4K of code memory on-chip and 60K off chip memory
simultaneously. If only off-chip memory is available then there can be 64K of off chip
ROM. This is controlled by pin provided as EA
b) Internal RAM
The 8051 have a bank of 128 of internal RAM. The internal RAM is found on-
chip. So it is the fastest Ram available. And also it is most flexible in terms of reading
and writing. Internal Ram is volatile, so when 8051 is reset, this memory is cleared.
128 bytes of internal memory are subdivided. The first 32 bytes are divided into 4
register banks. Each bank contains 8 registers. Internal RAM also contains 128 bits,
which are addressed from 20h to 2Fh. These bits are bit addressed i.e. each individual
bit of a byte can be addressed by the user. They are numbered 00h to 7Fh. The user
may make use of these variables with commands such as SETB and CLR.
2.5 Pin configuration of microcontroller
a) Accumulator (0E0h)
As its name suggests, it is used to accumulate the results of large no of
instructions. It can hold 8 bit values.
B) B register (0F0h)
The B register is very similar to accumulator. It may hold 8-bit value. The b
register is only used by MUL AB and DIV AB instructions. In MUL AB the higher
byte of the product gets stored in B register. In div AB the quotient gets stored in B
with the remainder in A.
C) Stack pointer (81h)
The stack pointer holds 8-bit value. This is used to indicate where the next
value to be removed from the stack should be taken from. When a value is to be
pushed onto the stack, the 8051 first store the value of SP and then store the value at
the resulting memory location. When a value is to be popped from the stack, the 8051
returns the value from the memory location indicated by SP and then decrements the
value of SP.
d) 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.
e) 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.
I/O ports:
One major feature of a microcontroller is the versatility built into the
input/output (I/O) circuits that connect the 8051 to the outside world. The main
constraint that limits numerous functions is the number of pins available in the 8051
circuit. The DIP had 40 pins and the success of the design depends on the flexibility
incorporated into use of these pins. For this reason, 24 of the pins may each used for
one of the two entirely different functions which depend, first, on what is physically
connected to it and, then, on what software programs are used to “program” the pins.
PORT 0
Port 0 pins may serve as inputs, outputs, or, when used together, as a bi
directional low-order address and data bus for external memory. To configure a pin as
input, 1 must be written into the corresponding port 0 latch by the program. When
used for interfacing with the external memory, the lower byte of address is first sent
via PORT0, latched using Address latch enable (ALE) pulse and then the bus is
turned around to become the data bus for external memory.
PORT 1
Port 1 is exclusively used for input/output operations. PORT 1 pins have no
dual function. When a pin is to be configured as input, 1 is to be written into the
corresponding Port 1 latch.
PORT 2
Port 2 maybe used as an input/output port. It may also be used to supply a
high –order address byte in conjunction with Port 0 low-order byte to address external
memory. Port 2 pins are momentarily changed by the address control signals when
supplying the high byte a 16-bit address. Port 2 latches remain stable when external
memory is addressed, as they do not have to be turned around (set to 1) for data input
as in the case for Port 0.
PORT 3
Port 3 may be used to input /output port. The input and output functions can
be programmed under the control of the P3 latches or under the control of various
special function registers. Unlike Port 0 and Port 2, which can have external
addressing functions and change all eight-port bits when in alternate use, each pin of
port 3 maybe individually programmed to be used as I/O or as one of the alternate
functions?
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 maskable interrupt which has the highest priority. It is generated when a high is
applied to the reset pin. Upon reset, the registers are loaded with the default values.
Each interrupt source causes the program to do store the address in PC onto
the stack and causes a hardware call to one of the dedicated addresses in the program
memory. The appropriate memory locations for each for each interrupt are as follows:
Table 2.2 shows the memory location of interrupt
Interrupt Address
RESET 0000
IE0 (External interrupt 0) 0003
TF0 (Timer 0 interrupt) 000B
IE1 (External interrupt 1) 0013
TF1 (Timer 1 interrupt) 001B
SERIAL 0023
Oscillator Characteristics:
The heart of the 8051 circuitry that generates the clock pulses by which all the
internal all internal operations are synchronized. Pins XTAL1 And XTAL2 is
provided for connecting a resonant network to form an oscillator. Typically a quartz
crystal and capacitors are employed. The crystal frequency is the basic internal clock
frequency of the microcontroller. The manufacturers make 8051 designs that run at
specific minimum and maximum frequencies typically 1 to 16MHz
.
Fig 2.3 shows the oscillator and timing signal
3. Hardware Components
3.1 Introduction :
1. LCD
2. SERIAL COMMUNICATION
3. MAX 232 DUAL DRIVER\RECEIVER
4. PC AT KEYBOARD
5. LATCH(74HC573)
6. SMART CARD
7. STEPPER MOTOR
8. PHOTO SENSOR
9. LED
10. POWER SUPPLY
Introduction to LCD:
In recent years the LCD is finding widespread use replacing LED s (seven-
segment LED or other multi segment LED s). This is due to the following
reasons:
1. The declining prices of LCD s.
2. The ability to display numbers, characters and graphics. This is in
contract to LED s, which are limited to numbers and a few characters.
3. Incorporation of a refreshing controller into the LCD, there by relieving the
CPU of the task of refreshing the LCD. In the contrast, the LED must be
refreshed by the CPU to keep displaying the data.
4. Ease of programming for characters and graphics.
Fig 3.1 shows the front panel of lcd display
USES:
The LCD s used exclusively in watches, calculators and measuring
instruments is the simple seven-segment displays, having a limited amount of
numeric data. The recent advances in technology have resulted in better
legibility, more information displaying capability and a wider temperature range.
These have resulted in the LCD s being extensively used in telecommunications
and entertainment electronics. The LCD s has even started replacing the cathode
ray tubes (CRTs) used for the display of text and graphics, and also in small TV
applications.
Specifications
2 Return home
4 Decrement cursor
6 Increment cursor
5 Shift display right
LCD INTERFACING
To send any command from table 2 to the LCD, make pin RS=0. For data, make
RS=1.Then place a high to low pulse on the E pin to enable the internal latch of
the LCD.
Data bits: a measurement of the actual data bits in a transmission. When the
computer sends a packet of information, the amount of actual data may not be a full 8
bits. Standard values for the data packets are 5, 7, and 8 bits. Which setting choosen
depends on what information transferred? For example, standard ASCII has values
from 0 to 127 (7 bits). Extended ASCII uses 0 to 255 (8 bits). If the data being
transferred is simple text (standard ASCII), then sending 7 bits of data per packet is
sufficient for communication. A packet refers to a single byte transfer, including
start/stop bits, data bits, and parity. Since the number of actual bits depends on the
protocol selected, the term packet is used to cover all instances.
Stop bits: used to signal the end of communication for a single packet. Typical
values are 1, 1.5, and 2 bits. Since the data is clocked across the lines and each device
has its own clock, it is possible for the two devices to become slightly out of sync.
Therefore, the stop bits not only indicate the end of transmission but also give the
computers some room for error in the clock speeds. The more bits that are used for
stop bits, the greater the lenience in synchronizing the different clocks, but the slower
the data transmission rate.
WHAT IS RS –232C?
RS-232 (ANSI/EIA-232 Standard) is the serial connection found on IBM-
compatible PCs. It is used for many purposes, such as connecting a mouse, printer, or
modem, as well as industrial instrumentation. Because of improvements in line
drivers and cables, applications often increase the performance of RS-232 beyond the
distance and speed listed in the standard. RS-232 is limited to point-to-point
connections between PC serial ports and devices. RS-232 hardware can be used for
serial communication up to distances of 50 feet .
Pin Functions:
Data: TxD on pin 3, RxD on pin 2
Handshake: RTS on pin 7, CTS on pin 8, DSR on pin 6,
CD on pin 1, DTR on pin 4
Common: Common pin 5(ground)
Other: RI on pin 9
The method used by RS-232 for communication allows for a simple connection of
three lines: Tx, Rx, and Ground. The three essential signals for 2 way RS-232
Communications are these:
TXD: carries data from DTE to the DCE.
RXD: carries data from DCE to the DTE
SG: signal ground
Here in our project DTE is the micro controller at the remote station and PC at
the base station, DCE is the modem at both the stations. However the data to be
transmitted, both sides have to be clocking the data at the same baud rate. Even
though this method is sufficient for most applications, it is limited in being able to
respond to problems such as the receiver getting overloaded. This is where serial
handshaking can help. This method uses actual hardware lines. There are two pairs of
hand shaking signals DTR/DSR and RTS/CTS.each pair has uses defined by the
standard. There are several ways to describe the state of RS-232 and other control
signals. A signal with a valid positive voltage may be described as true to indicate that
it is in the active state for example when DTR is true the data terminal is ready. to
bring the signal true the controlling device raises the line. A signal with a valid
negative voltage may be described as false or ff to indicate that it’s inactive state .for
example when DTR is false, the data terminal is not ready. To bring the signal false
the controlling device lowers the line.
The DTR/DSR handshake is intended for providing information about the
status of the phone line or other communications channel connected to the modem.
the terminal raises DTR to request the modem to connect to the communication
channel. In response the modem raises DSR to indicate that it is connected .DSR is
false when the modem is not connected to the communication channel or on detecting
a fault. the terminal may also raise DTR in response to RI (ring indicator) to tell the
modem to answer a call.
1.without handshaking: In this situation, only the data lines and signal ground
are directly connected in the modem communication cable. All other pins have no
connection. The three-wire modem cable is often simple but can we use it in all
circumstances? There is a problem, if either of the two devices checks the DSR or CD
inputs. These signals normally define the ability of the other side to communicate. As
they are not connected, their signal level will never go high. This might cause a
problem.
The same holds for the RTS/CTS handshaking sequence. If the software on
both sides is well structured, the RTS output is set high and then a waiting cycle is
started until a ready signal is received on the CTS line. This causes the software to
hang because no physical connection is present to either CTS line to make this
possible. The only type of communication, which is allowed on such a modem line is
data-only traffic on the directly connected RX/TX lines.
2.loop back handshaking: The simple modem cable without handshaking shows
incompatibilities with common software. The main problem with this cable is that
there is a possibility for the software to hang if it checks the modem signal lines in a
proper way. I.e. with this modem cable, good written programs will perform worse
than badly written programs.
To overcome this problem and still be able to use a modem communication
cable with only three lines in it, a fake modem cable layout has been defined. The
modem cable with loop back handshaking resulted from this. The main purpose of
this modem cable is to let well-defined software think there is handshaking available,
with a modem cable, which has no provisions for it.
Consider first the DSR signal (pin 6). This input indicates that the other side is
ready to start communicating. In the layout, the line is linked back to the DTR output
(pin 4). This means, that the software doesn't see the ready signal of the other device,
but its own.
The same holds for the CD input (pin 1). The assumption is, that if software
has been written to check the DSR line to test communication availability, it will
probably also set the DTR output to indicate its own state. This is true for at least 99%
of all serial communication software. This implies that at least 99% of all serial
communication software is capable of faking its own DSR check with this modem
cable. The same trick is used with the CTS input. In the original use, RTS is set, and
then CTS is checked before starting the communication. By setting the RTS output
(pin 7) the CTS input on the same connector (pin 8) is receiving clearance
immediately. There is no possibility of a software hang-up because of dangling RTS
requests.
The modem cable with loop back handshaking is often advised as the best low
cost available modem cable. The simple modem cable without handshaking has the
disadvantage that it does not permit proper written software to communicate with it.
Software, which is aware of the lack of handshaking signals, can however use it
without problems.
The connection that is implemented in the project is the modem cable with
loop back connections since the project main focus is on transmitting, receiving and
not on the acknowledgements.
FEATURES:
Operates from a single 5V Power Supply with 1.0uF Charge-Pump
Capacitors
Operates up to 120 k bit/s
Two Drivers and Two Receivers
±30 V Input Levels
Low Supply Current . . . 8 mA Typical
Upgrade with Improved ESD (15kV HBM) and 0.1uF Charge-Pump
Capacitors is available With the MAX202.
Applications-- TIA/EIA-232-F, Battery-Powered Systems, Terminals,
Modems, and Computers
DESCRIPTION:
The MAX232 is a dual driver/receiver that includes a
capacitive voltage generator to supply TIA/EIA-232-F voltage levels from a
single 5V supply. Each receiver converts TIA/EIA-232-F inputs to 5V
TTL/CMOS levels. These receivers have a typical threshold of 1.3V, a typical
hysteresis of 0.5 V, and can accept up to 30V inputs. Each driver converts
TTL/CMOS input levels into TIA/EIA-232-F levels.
FUNCTION TABLE
3.5. PC AT Keyboard
Features
• Interfacing Standard PC AT Keyboard• Requires Only Two I/O Pins. One of
them must be an External Interrupt Pin
• No Extra Hardware Required
• Complete Example in C, Implementing a Keyboard to Serial Converter
Introduction
Most microcontrollers requires some kind of a human interface. This design note
describes one way of doing this using a standard PC AT Keyboard
The data line must be set up to the right level by the host before the trailing
edge of the clock pulse. After the 10th bit, the keyboard checks for a high level on the
data line (the stop bit), and if it is high, it forces it low. This tells the host that the data
is received by the keyboard.
Scan Codes
The AT keyboard has a scan code associated with each key. When a key is pressed,
this code is transmitted. If a key is held down for a while, it starts repeating. The
repeat rate is typically 10 per second. When a key is released, a “break” code ($F0) is
transmitted followed by the key scancode. For most of the keys, the scan code is one
byte. Some keys like the Home, Insert and Delete keys have an extended scan code,
from two to five bytes.
The Software
The code supplied with this application note is a simple keyboard to RS-232 interface.
The scan codes received from the keyboard are translated into appropriate ASCII
characters and transmitted by the UART. The source code is written in C, and is
easily modified and adaptable to all microconrollers with SRAM.
The algorithm
Keyboard reception is handled by the interrupt function
INT0_interrupt. The reception will operate independent of the rest of the program.
The algorithm is quite simple: Store the value of the data line at the leading edge of
the clock pulse. This is easily handled if the clock line is connected to the INT0 or
INT1 pin. The interrupt function will be executed at every edge of the clock cycle,
and data will be stored at the falling edge. After all bits are received, the data can be
decoded. This is done by calling the decode function. For character keys,
this function will store an ASCII character in a buffer. It will take into account if the
shift key is held down when a key is pressed. Other keys like function keys,
navigation keys (arrow keys, page up/down keys etc.) and modifier keys like Ctrl and
Alt are ignored. The mapping from scan codes to ascii characters are handled with
table look-ups, one table for shifted characters
and one for un-shifted.
Truth table
Q A2 Q A1 Q
1 1 0 0 1
0 0 1 1 0
Fig 3.8 shows the basic memory cell and the truth tale
A small electronic device about the size of a credit card that contains electronic
memory, and possibly an embedded integrated circuit (IC). Smart cards containing an
IC are sometimes called Integrated Circuit Cards (ICCs).
Smart cards are used for a variety of purposes, including:
1 Storing a patient's medical records
2 Storing digital cash
3 Generating network IDs (similar to a token)
To use a smart card, either to pull information from it or add data to it, you need a
smart card reader, a small device into which you insert the smart card.
Contact Cards The most common type of smart card. Electrical contacts located on
the outside of the card connect to a card reader when the card is inserted.
Increased levels of processing power, flexibility and memory add cost. Single
function cards are often the most cost-effective solution. Choose the right type of
smart card for your application by evaluating cost versus functionality and determine
your required level of security. All of these variables should be weighted against the
expected lifecycle of the card. On average the cards typically comprise only 10 to 15
percent of the total system cost with the infrastructure, issuance, training and
advertising making up the other 85 percent. The following chart demonstrates some
general rules of thumb;
Memory Cards
Memory cards have no sophisticated processing power and cannot manage
files dynamically. All memory cards communicate to readers through synchronous
protocols. In all memory cards you read and write to a fixed address on the card.
There are three primary types of memory cards: 1). Straight, 2). Protected, and 3).
Stored Value.
These motors are also called stepping motors or step motors. This
name is used because this motor rotates trough a fixed angular step in response
to each input current pulse received by its controller. In the recent years, there
has been wide demand of stepping motors because of the explosive growth of
the computer industry. This popularity is due to the fact that they can be
directly controlled by computers, microprocessors and programmable
controllers.
Unipolar Motors
Winding 1a 1100110011001100110011001
Winding 1b 0011001100110011001100110
Winding 2a 0110011001100110011001100
Winding 2b 1001100110011001100110011
time --->
3.9. Photo Sensor
The IR range falls between the visible portion of the spectrum and
radio waves. IR wavelengths are usually expressed in microns, with the lR
spectrum extending from 0.7 to 1000microns.
Using advanced optic systems and detectors, non-contact IR
thermometers can focus on nearly any portion or portions of the0.7-14 micron
band. Because every object (with the exception of a blackbody) emits an
optimum amount of IR energy at a specific point along the IR band, each
process may require unique sensor models with specific optics and detector
types.
For example, a sensor with a narrow spectral range center data 3.43
microns is optimized for measuring the surface temperature of polyethylene and
related materials. A sensor set up for 5 microns is used to measure glass surfaces.
A micron sensor is used for metals and foils. The broader spectral ranges are
used to measure lower temperature surfaces, such as paper, board, poly, and foil
composites.
The intensity of an object's emitted IR energy increases or decreases in
proportion to its temperature. It is the emitted energy, measured as the target's
emissivity that indicates an object's temperature.
When the sensor is not perfect, various deviations can occur, including gain
error, long term drift, and noise. These and other deviations can be classified as
systematic, or random, errors. Systematic deviations may be compensated for by
means of some kind of calibration strategy. Noise is an example of a random
error that can be reduced by signal processing, such as filtering, usually at the
expense of the dynamic behavior of the sensor.
PRINCIPlE:
This system safely detects all objects that have sufficient reflection. For objects
with a very bad degree of reflection (matt black rough surfaces) the use of
diffuse reflection sensors for short ranges or with background suppression is
recommended.
For diffuse reflection sensors with sensitivity setting the sensitivity should
always be set to maximum independent of the required range in order to achieve
the highest possible operational safety. Only in the case of interfering
backgrounds (walls, machine parts) could it be necessary to reduce the range.
Short-range diffuse type sensors are diffuse reflection sensors which have been
specifically designed for short ranges. Light and dark objects are almost equally
detectable within the set sensing ranging.
Fig 3.16 shows the diffuse reflection sensor with background suppression
3.10. Power Supply
Description
A variable regulated power supply, also called a variable bench power supply,
is one where you can continuously adjust the output voltage to your requirements.
Varying the output of the power supply is the recommended way to test a project after
having double checked parts placement against circuit drawings and the parts
placement guide.
This type of regulation is ideal for having a simple variable bench power
supply. Actually this is quite important because one of the first projects a hobbyist
should undertake is the construction of a variable regulated power supply. While a
dedicated supply is quite handy e.g. 5V or 12V, it's much handier to have a variable
supply on hand, especially for testing.
Most digital logic circuits and processors need a 5 volt power supply. To use
these parts we need to build a regulated 5 volt source. Usually you start with an
unregulated power supply ranging from 9 volts to 24 volts DC To make a 5 volt
power supply, we use a LM7805 voltage regulator IC (Integrated Circuit). The IC is
shown below.
Block Diagram:
Circuit Features:
Brief description of operation: Gives out well regulated +5V output, output
current capability of 100 mA Circuit protection: Built-in overheating protection shuts
down output when regulator IC gets too hot Circuit complexity: Very simple and
easy to build Circuit performance: Very stable +5V output voltage, reliable operation
Availability of components: Easy to get, uses only very common basic components
Design testing: Based on datasheet example circuit, I have used this circuit
successfully as part of many electronics projects Applications: Part of electronics
devices, small laboratory power supply Power supply voltage: Unregulated DC 8-
18V power supply Power supply current: Needed output current + 5 mA Component
costs: Few dollars for the electronics components + the input transformer cost.
FILTER CIRCUIT:
A filter circuit is a device which removes the ac component of rectifier
output but allows the dc component to the load.
The most commonly used filter circuits are capacitor filter, choke input
filter and capacitor input filter or pi-filter. We used capacitor filter here.
R e c tif ie r O /P C RL
C a p a c ito r F ilte r
HEAT SINK:
More often transistors gets heated when the circuit is ON for long time.
In order to avoid heating up of transistors we use heat sinks.
4. BLOCK AND SCHEMATIC DIAGRAM
Microcontrollers:
This smart card reader is used to detect the information from the smart card ..
the reader will generates the electromagnetic waves . When the smart card is
detected the information will be passed to microcontroller through serial
communication
Switching unit
Max232:
AT keyboard:
The code supplied with this application note is a simple keyboard to RS-232
interface. The scan codes received from the keyboard are translated into appropriate
ASCII characters and transmitted by the UART. The source code is written in C,
and is easily modified and adaptable to all microcontrollers with SRAM.
4.2 Schematic Diagram
Microcontroller:
The microcontroller AT89S51 with Pull up resistors at Port0 and crystal
oscillator of 11.0592 MHz crystal in conjunction with couple of capacitors of is
placed at 18th & 19th pins of 89S51 to make it work (execute) properly.
Reflection Sensors:
These reflection sensors are arranged in such a manner to detect the Vehicles.
These sensors are connected to the P2.0 port of the microcontroller.
LCD module:
This module is used to display the status of the devices.
This module consists of 8 data lines D0 – D7, which are connected to the
8 pins of port1 (P0). Additionally this module is having 3 control lines namely
RS, RW and EN, which are connected to the port3 higher pins P3.5, P3.6 and
P3.7 respectively. And the supply connections are given from the Power supply
output 7805 to the VCC and VSS. And same configuration with be setup at
receiver end also.
Max 232
This module is used for switching between two I/O pins of Max 232 and the Tx
and Rx pins
Of microcontroller i.e. P3.0 and P3.1
These two I/O will be control by the microcontroller pin P2.5 and
P2.6 which used as a control signal for switching unit
ATKEY Board
This module is used to enter the data in to microcontroller. For that keyboard
is connect to P3.2 and P3.4. Where P3.4 is used to generate clock frequency and
P3.2 is used to send ASCII value data
Devices:
The device stepper motor is connected to the port pins P0.0 to P0.4 of the
microcontroller through latch 47HC573 and ULN2903 driver. Latch is used to
enable the stepper motor and ULN2903 driver is used to drive the stepper motor.
Opto couples are used to isolate the ground between two power supply
Key pad
Four switches are used as a keypad. Keypad is used at the receiver side to give
a response to the transmitter side which is connected to the port P1.0 to P1.3 of
microcontroller at receiver side
5. SOFTWARE COMPONENT
5.1 Introduction of Keil Software
The keil software development tools are designed to solve the complex
problems facing embedded software developers. When starting a new project, simply
select the microcontroller you the device database and the µvision IDE sets all
compiler, assembler, linker, and memory options for you. Numerous example
programs are included to help you get started with the most popular embedded avr
devices.
#include <stdio.H>
#include <AT89X52.H>
#include "headerFile.h"
#include <string.h>
volatile unsigned char pFlag=0;
extern volatile unsigned char fst,sFlag;
extern volatile unsigned char fFlag;
int main(void)
{
unsigned char opt;
BUZZER = 0;
DISABLE
STEP_LE = 1;
STEPPORT = (STEPPORT && 0x0F)|| 0x00;
STEP_LE = 0;
lcdInit();
serInit();
putStrL("Vehicle Registration Using Smartcard",0x01);
delay(1500);
while(1)
{
if(VEHICLEINT == 0)
{
putStrL("Vehicle Identified at Main Gate",0x01);
delay(1500);
putStrL("Processing! Please Wait.....................",0x01);
delay(1500);
chk_ID();
if(sFlag == 1)
{
putStrL("Request Granted!You may go now!",0x01);
openGate();
delay(1000);
}
else
{
putStrL("ID Check Failed!Select Option",0x01);
delay(1500);
putStrL("1.Authorised 2.Unauthorised",0x01);
delay(1500);
keyboard_Init();
opt = getAtkey();
if(opt == '1')
aProcess();
else if(opt == '2')
uProcess();
else
{
putStrL("Oooops!Transaction Cancelled!",0x01);
delay(1500);
}
}
}
putStrL("VRS Welcomes U!!Plz Cooperate Us!",0x01);
delay(1500);
putStrL("Plz Follow Instructions!",0x01);
delay(1500);
}
}
/*...........................Authorised Processing...................................................*/
void aProcess(void)
{
unsigned char *psw,chance;
chance = 3;
while(chance--)
{
keyboard_Init();
putStrL("Enter Password:",0x01);
putComL(0xC0);
delay(100);
psw = getData();
disable_kb();
putStrL(psw,0x01);
delay(1000);
chkPsw(psw);
if(pFlag == 1)
{
pFlag = 0;
putStrL("Password Accepted!",0x01);
delay(1000);
putStrL("Request Granted!You may go now!",0x01);
openGate();
delay(1000);
break;
}
else if(fFlag == 0)
{
putStrL("Password Rejected",0x01);
delay(1000);
continue;
}
else
{
fFlag = 0;
putStrL("Oooops!Transaction Cancelled",0x01);
delay(1000);
continue;
}
}
}
/*...........................Unauthorised Processing...................................................*/
void uProcess(void)
{
unsigned char *no,*name,*from,sResp;
DISABLE
delay(100);
SLAVE
putStrL("Plz Provide UR Info For Permission",0x01);
delay(1000);
keyboard_Init();
putStrL("Flat No:",0x01);
putComL(0xC0);
delay(1000);
no = getData();
putStrL("Name:",0x01);
putComL(0xC0);
delay(1000);
name = getData();
putStrL("From:",0x01);
putComL(0xC0);
delay(1000);
from = getData();
disable_kb();
putStrL("Transmitting to Slave.....",0x01);
delay(1000);
putStrS(no);
putCharS(0x0D);
delay(1000);
putStrS(name);
putCharS(0x0D);
delay(1000);
putStrS(from);
putCharS(0x0D);
putStrL("Waiting for Slave Response.........!",0x01);
delay(500);
sResp = getCharS();
sResp = getCharS();
putComL(0x01);
putCharL(sResp);
delay(1000);
if(sResp == 'Y')
{
putStrL("Request Granted!You may go now!",0x01);
openGate();
delay(1500);
}
else if(sResp == 'N')
{
putStrL("Sorry!!Request Rejected!",0x01);
delay(1500);
}
}
/*.........................................PSW Check....................................................*/
void chkPsw(unsigned char *val)
{
unsigned char *user = "4321";
putStrL("Verifying Password.........",0x01);
delay(1000);
if(strcmp(val,user)==0)
pFlag = 1;
}
void openGate(void)
{
sendStepper('F',0x05); //sendStepper(Forward/Backward,No.of Rotations)
delay(1000);
sendStepper('B',0x05);
}
void sendStepper(unsigned char udFlag,unsigned char stepCount)
{
code unsigned char upTable[5] = {0x10,0x20,0x40,0x80};
code unsigned char downTable[5] = {0x80,0x40,0x20,0x10};
unsigned char i,j,temp;
STEP_LE = 1;
for(i=0;i<=stepCount;i++)
{
for(j=0;j<4;j++)
{
temp = (STEPPORT & 0x0F);
if(udFlag == 'F')
STEPPORT = temp | upTable[j];
else
STEPPORT = temp | downTable[j];
delay(130);
}
}
STEPPORT = (STEPPORT & 0x0F) | 0x00;
STEP_LE = 0;
}
/*.........................................delay....................................................*/
void delay(unsigned int del)
{
unsigned int i,j;
for(i=0;i<=del;i++)
for(j=0;j<=109;j++);
}
/*.........................................beep....................................................*/
void beep(unsigned int dur)
{
BUZZER = 1;
delay(dur);
BUZZER = 0;
}
/*.........................................Transmitting to PC....................................................*/
/*
void send2pc(unsigned char *pcStr)
{
PC
putStrS(pcStr);
putCharS(0x0D);
putCharS(0x0A);
SMART
}
*/
SLAVE PROGRAM
Main Program Coding
#include <AT89X52.H>
#include <stdio.h>
#include "driver.h"
volatile unsigned char kFlag;
volatile unsigned char sFlag=0,i=0;
unsigned char no[8],name[8],from[8];
unsigned char keypad = 0;
extern unsigned char ptr[20];
int main(void)
{
unsigned char key=0,count=5,ynFlag=0;
BUZZER = 0;
lcdInit();
serInit();
ser_int();
keyInit();
putStrL("VEHICLE REGISTRATION USING SMARTCARD",0x01);
delay(1000);
while(1)
{ while(sFlag==0);
sFlag = 0;
putStrL("Visitor Waiting at Main Gate!",0x01);
BUZZER = 1;
delay(800);
BUZZER = 0;
In this project, the receiver is controlled with the help of the serial
communication cable(RS-232). This project is enhanced with some wireless
technology. We can control the receiver through wireless remote by arranging
the circuitry with keypad and control through the remote.
6.2 Conclusion
Integrating features of all the hardware components used have developed it.
Presence of every module has been reasoned out and placed carefully thus
contributing to the best working of the unit.
Secondly, using highly advanced IC’s and with the help of growing technology
the project has been successfully implemented.
Electronic Components
-D.V.Prasad
Wireless Communications
Theodore S. Rappaport