final report on smart card with finger print technology
DESCRIPTION
This Paper Is On Using a single card as a remedy to all the cards you use in your day to day life.This Is More Secured With Finger Print Recognisation TechnologyTRANSCRIPT
1
CHAPTER - 1
1. INTRODUCTION
1.1 EMBEDDED SYSTEMS
Embedded systems are electronic devices that incorporate microprocessors with in
their implementations. The main purposes of the microprocessors are to simplify the system
design and provide flexibility. Having a microprocessor in the device helps in removing the
bugs, making modifications, or adding new features are only matter of rewriting the software
that controls the device. Or in other words embedded computer systems are electronic
systems that include a microcomputer to perform a specific dedicated application. The
computer is hidden inside these products. Embedded systems are ubiquitous. Every week
millions of tiny computer chips come pouring out of factories finding their way into our
everyday products.
Embedded systems are self-contained programs that are embedded within a piece of
hardware. Whereas a regular computer has many different applications and software that can
be applied to various tasks, embedded systems are usually set to a specific task that cannot be
altered without physically manipulating the circuitry. Another way to think of an embedded
system is as a computer system that is created with optimal efficiency, thereby allowing it to
complete specific functions as quickly as possible.
Embedded systems designers usually have a significant grasp of hardware
technologies. They use specific programming languages and software to develop embedded
systems and manipulate the equipment. When searching online, companies offer embedded
systems development kits and other embedded systems tools for use by engineers and
businesses.
Embedded systems technologies are usually fairly expensive due to the necessary
development time and built in efficiencies, but they are also highly valued in specific
industries. Smaller businesses may wish to hire a consultant to determine what sort of
embedded systems will add value to their organization.
1.1.1 CHARACTERISTICS:
Two major areas of differences are cost and power consumption. Since many
embedded systems are produced in tens of thousands to millions of units range, reducing cost
2
is a major concern. Embedded systems often use a (relatively) slow processor and small
memory size to minimize costs.
The slowness is not just clock speed. The whole architecture of the computer is often
intentionally simplified to lower costs. For example, embedded systems often use peripherals
controlled by synchronous serial interfaces, which are ten to hundreds of times slower than
comparable peripherals used in PCs. Programs on an embedded system often run with real-
time constraints with limited hardware resources: often there is no disk drive, operating
system, keyboard or screen. A flash drive may replace rotating media, and a small keypad
and LCD screen may be used instead of a PC's keyboard and screen.
Firmware is the name for software that is embedded in hardware devices, e.g. in one
or more ROM/Flash memory IC chips. Embedded systems are routinely expected to maintain
100% reliability while running continuously for long periods, sometimes measured in years.
Firmware is usually developed and tested too much harsher requirements than is general-
purpose software, which can usually be easily restarted if a problem occurs.
1.1.2PLATFORM:
There are many different CPU architectures used in embedded designs. This in
contrast to the desktop computer market which is limited to just a few competing
architectures mainly the Intel/AMD x86 and the Apple/Motorola/IBM Power PC’s which are
used in the Apple Macintosh. One common configuration for embedded systems is the
system on a chip, an application-specific integrated circuit, for which the CPU was purchased
as intellectual property to add to the IC's design.
1.1.3 TOOLS:
Like a typical computer programmer, embedded system designers use compilers,
assemblers and debuggers to develop an embedded system. Those software tools can come
from several sources:
Software companies that specialize in the embedded market Ported from the GNU
software development tools. Sometimes, development tools for a personal computer can be
used if the embedded processor is a close relative to a common PC processor. Embedded
system designers also use a few software tools rarely used by typical computer programmers.
Some designers keep a utility program to turn data files into code, so that they can include
any kind of data in a program. Most designers also have utility programs to add a checksum
or CRC to a program, so it can check its program data before executing it.
3
1.1.4 OPERATING SYSTEM:
They often have no operating system, or a specialized embedded operating system
(often a real-time operating system), or the programmer is assigned to port one of these to the
new system.
1.1.5 DEBUGGING:
Debugging is usually performed with an in-circuit emulator, or some type of debugger
that can interrupt the micro controller’s internal microcode. The microcode interrupt lets the
debugger operate in hardware in which only the CPU works. The CPU-based debugger can
be used to test and debug the electronics of the computer from the viewpoint of the CPU.
Developers should insist on debugging which shows the high-level language, with
breakpoints and single stepping, because these features are widely available. Also, developers
should write and use simple logging facilities to debug sequences of real-time events. PC or
mainframe programmers first encountering this sort of programming often become confused
about design priorities and acceptable methods. Mentoring, code-reviews and ego less
programming are recommended.
1.1.6 DESIGN OF EMBEDDED SYSTEMS:
The electronics usually uses either a microprocessor or a microcontroller. Some large
or old systems use general-purpose mainframes computers or minicomputers.
START-UP:
All embedded systems have start-up code. Usually it disables interrupts, sets up the
electronics, tests the computer (RAM, CPU and software), and then starts the application
code. Many embedded systems recover from short-term power failures by restarting (without
recent self-tests). Restart times under a tenth of a second are common.
Many designers have found one of more hardware plus software-controlled LED’s
useful to indicate errors during development (and in some instances, after product release, to
produce troubleshooting diagnostics). A common scheme is to have the electronics turn off
the LED(s) at reset, whereupon the software turns it on at the first opportunity, to prove that
the hardware and start-up software have performed their job so far. After that, the software
blinks the LED(s) or sets up light patterns during normal operation, to indicate program
execution progress and/or errors. This serves to reassure most technicians/engineers and some
users.
4
1.1.7 THE CONTROL LOOP:
In this design, the software has a loop. The loop calls subroutines. Each subroutine
manages a part of the hardware or software. Interrupts generally set flags, or update counters
that are read by the rest of the software. A simple API disables and enables interrupts. Done
right, it handles nested calls in nested subroutines, and restores the preceding interrupt state in
the outermost enable. This is one of the simplest methods of creating an exocrine.
Typically, there's some sort of subroutine in the loop to manage a list of software
timers, using a periodic real time interrupt. When a timer expires, an associated subroutine is
run, or flag is set. Any expected hardware event should be backed-up with a software timer.
Hardware events fail about once in a trillion times.
State machines may be implemented with a function-pointer per state-machine (in
C++, C or assembly, anyway). A change of state stores a different function into the pointer.
The function pointer is executed every time the loop runs.
Many designers recommend reading each IO device once per loop, and storing the
result so the logic acts on consistent values. Many designers prefer to design their state
machines to check only one or two things per state. Usually this is a hardware event, and a
software timer. Designers recommend that hierarchical state machines should run the lower-
level state machines before the higher, so the higher run with accurate information.
Complex functions like internal combustion controls are often handled with multi-
dimensional tables. Instead of complex calculations, the code looks up the values. The
software can interpolate between entries, to keep the tables small and cheap.
One major disadvantage of this system is that it does not guarantee a time to respond
to any particular hardware event. Careful coding can easily assure that nothing disables
interrupts for long. Thus interrupt code can run at very precise timings. Another major
weakness of this system is that it can become complex to add new features. Algorithms that
take a long time to run must be carefully broken down so only a little piece gets done each
time through the main loop.
This system's strength is its simplicity, and on small pieces of software the loop is
usually so fast that nobody cares that it is not predictable. Another advantage is that this
system guarantees that the software will run. There is no mysterious operating system to
blame for bad behavior.
5
1.1.8 USER INTERFACES:
Interface designers at PARC, Apple Computer, Boeing and HP minimize the number
of types of user actions. For example, use two buttons (the absolute minimum) to control a
menu system (just to be clear, one button should be "next menu entry" the other button
should be "select this menu entry"). A touch-screen or screen-edge buttons also minimize the
types of user actions.
Another basic trick is to minimize and simplify the type of output. Designs should
consider using a status light for each interface plug, or failure condition, to tell what failed. A
cheap variation is to have two light bars with a printed matrix of errors that they select- the
user can glue on the labels for the language that she speaks.
For example, Boeing's standard test interface is a button and some lights. When you
press the button, all the lights turn on. When you release the button, the lights with failures
stay on. The labels are in Basic English.
Designers use colors. Red defines the users can get hurt- think of blood. Yellow
defines something might be wrong. Green defines everything's OK.
Another essential trick is to make any modes absolutely clear on the user's display. If
an interface has modes, they must be reversible in an obvious way. Most designers prefer the
display to respond to the user. The display should change immediately after a user action. If
the machine is going to do anything, it should start within 7 seconds, or give progress reports.
One of the most successful general-purpose screen-based interfaces is the two menu
buttons and a line of text in the user's native language. It's used in pagers, medium-priced
printers, network switches, and other medium-priced situations that require complex behavior
from users. When there's text, there are languages. The default language should be the one
most widely understood.
1.2 MICROCONTROLLERS
Microcontrollers as the name suggests are small controllers. They are like single chip
computers that are often embedded into other systems to function as processing/controlling
unit. For example the remote control you are using probably has microcontrollers inside that
do decoding and other controlling functions. They are also used in automobiles, washing
machines, microwave ovens, toys ... etc, where automation is needed.
Micro-controllers are useful to the extent that they communicate with other devices,
such as sensors, motors, switches, keypads, displays, memory and even other micro-
6
controllers. Many interface methods have been developed over the years to solve the complex
problem of balancing circuit design criteria such as features, cost, size, weight, power
consumption, reliability, availability, manufacturability. Many microcontroller designs
typically mix multiple interfacing methods. In a very simplistic form, a micro-controller
system can be viewed as a system that reads from (monitors) inputs, performs processing and
writes to (controls) outputs.
Embedded system means the processor is embedded into the required application. An
embedded product uses a microprocessor or microcontroller to do one task only. In an
embedded system, there is only one application software that is typically burned into ROM.
Example: printer, keyboard, video game player
Microprocessor - A single chip that contains the CPU or most of the computer
Microcontroller - A single chip used to control other devices
Microcontroller differs from a microprocessor in many ways. First and the most
important is its functionality. In order for a microprocessor to be used, other components such
as memory, or components for receiving and sending data must be added to it. In short that
means that microprocessor is the very heart of the computer. On the other hand,
microcontroller is designed to be all of that in one. No other external components are needed
for its application because all necessary peripherals are already built into it. Thus, we save the
time and space needed to construct devices.
1.2.1 MICROPROCESSOR VS MICROCONTROLLER:
Microprocessor:
CPU is stand-alone, RAM, ROM, I/O, timer are separate
Designer can decide on the amount of ROM, RAM and I/O ports.
expensive
versatility general-purpose
Microcontroller:
CPU, RAM, ROM, I/O and timer are all on a single chip
7
fix amount of on-chip ROM, RAM, I/O ports
for applications in which cost, power and space are critical
single-purpose
1.3 SMART CARD
A smart card, chip card, or integrated circuit card (ICC), is any pocket-sized card with
embedded integrated circuits which can process data. This implies that it can receive input
which is processed — by way of the ICC applications — and delivered as an output.
Even the name Smart Card captures the imagination; however such a term is ambiguous
and is used in many different ways. ISO uses the term, Integrated Circuit Card (ICC) to
encompass all those devices where an integrated circuit is contained within an ISO 1
identification card piece of plastic.
The card is 85.6mm x 53.98mm x 0.76mm and is the same as the ubiquitous bank card
with its magnetic stripe that is used as the payment instrument for numerous financial
schemes.
Fig: 1.3.1 SMART CARD
Magnetic stripe technology remains in wide use in the United States. However, the data
on the stripe can easily be read, written, deleted or changed with off-the-shelf equipment.
Therefore, the stripe is really not the best place to store sensitive information. To protect the
consumer, businesses in the U.S. have invested in extensive online mainframe-based
computer networks for verification and processing. In Europe, such an infrastructure did not
develop -- instead, the card carries the intelligence.
The microprocessor on the smart card is there for security. The host computer and card
reader actually "talk" to the microprocessor. The microprocessor enforces access to the data
8
on the card. If the host computer read and wrote the smart card's random access memory
(RAM), it would be no different than a diskette.
Smarts cards may have up to 8 kilobytes of RAM, 346 kilobytes of ROM, 256 kilobytes
of programmable ROM, and a 16-bit microprocessor. The smart card uses a serial interface
and receives its power from external sources like a card reader. The processor uses a limited
instruction set for applications such as cryptography.
The most common smart card applications are:
Credit cards
Electronic cash
Computer security systems
Wireless communication
Loyalty systems (like frequent flyer points)
Banking
Satellite TV
Government identification
Smart cards can be used with a smart-card reader attachment to a personal computer to
authenticate a user. Web browsers also can use smart card technology to supplement Secure
Sockets Layer (SSL) for improved security of Internet transactions. Visa's Smart Card FAQ
shows how online purchases work using a smart card and a PC equipped with a smart-card
reader. Smart-card readers can also be found in mobile phones and vending machines.
The different types of smart cards classified according to the applications are as follows:
MEMORY-BASED SMART CARDS:
The memory-based smart cards are used for applications in which the function of the
card is fixed. These cards need a card reader to manipulate the data on the card. Memory-
based smart cards communicate to the reader using some synchronous protocols. Memory-
based smart cards have no processing power and cannot manage the data stored in them.
These cards are widely used as prepaid phone cards.
Memory based smart cards contain only non-volatile memory storage components,
and perhaps some specific security logic.
MICROPROCESSOR-BASED SMART CARDS:
The microprocessor-based smart cards have greater memory storage as compared to those
cards without microprocessor. The security of data on the microprocessor cards is greater
than any other storage device because it has the microprocessor embedded in the plastic card
along with the memory. The microprocessor-based smart cards available today have an eight
9
bit processor and 512 bytes random access memory (RAM) and 16 KB read-only memory.
Some of the microprocessor-based smart cards use cryptography for securing a digital
identity. The microprocessor-based smart cards have a card operating system (COS) that
manages the data on the card. The card operating system makes it possible to make the smart
cards multi-functional.
Microprocessor cards contain volatile memory and microprocessor components. The
card is made of plastic, generally PVC, but sometimes ABS. The card may embed a hologram
to avoid counterfeiting. Using smart cards is also a form of strong security authentication for
single sign-on within large companies and organizations.
Smart cards are classified according to the way in which the data on them is read and
written. Integrated Circuit Cards come in these forms:
CONTACT SMART CARD:
The contact smart cards are named so because they come in contact with the reader.
These smart cards are the size of a credit card. A metallic chip is embedded inside the plastic
card with a microprocessor and a memory or only with a memory. The contact smart cards
are widely used in network security, access control, e-commerce, and electronic cash and as
health cards.
It is easy to identify because of its gold connector plate. Although the ISO Standard
(7816-2) defined eight contacts, only 6 are actually used to communicate with the outside
World.
The Contact Card is the most commonly seen ICC to date largely because of its use in
France and now other parts of Europe as a telephone prepayment card.. Most contact cards
contain a simple integrated circuit although various experiments have taken place using two
chips. The chip itself varies considerably between different manufacturers and for a whole
gambit of applications. Let us consider first the purpose for the 6 contacts used by the ICC.
Fig: 1.3.2 SMART CARD CONTACTS
10
Vcc is the supply voltage that drives the chips and is generally 5 volts. It should be
noted however that in the future we are likely to see a move towards 3 volts taking advantage
of advanced semiconductor technology and allowing much lower current levels to be
consumed by the integrated circuit. Vss is the substrate or ground reference voltage against
which the Vcc potential is measured. Reset is the signal line that is used to initiate the state of
the integrated circuit after power on. This is in itself an integral and complex process that we
shall describe later in more detail.
The clock signal is used drive the logic of the IC and is also used as the reference for
the serial communications link. There are two commonly used clock speeds 3.57 MHZ and
4.92 MHZ. The lower speed is most commonly used to date in Europe but this may change in
the future. One may be tempted to ask why these strange frequencies were chosen, why not
just a straight 5 MHZ. The reason lies in the availability of cheap crystals to form the clock
oscillator circuits. Both of these frequencies are used in the television world for the colour
sub carrier frequency. The PAL system operates using 4.92 MHZ whilst the 3.57 MHZ is
used by the American NTSC standard. The Vpp connector is used for the high voltage signal
that is necessary to program the EPROM memory. Last, but by no means least is the serial
input/output (SIO) connector. This is the signal line by which the chip receives commands
and interchanges data with the outside world.
CONTACT LESS SMART CARD:
As the name suggests, the contact less cards do not directly come in contact with the
card. These cards have an antenna built in the card. The antenna of the contact less cards is
used to communicate to the card reader for reading and writing data on the card. The working
of these cards is based on radio frequency identification technology. These cards are used as
parking cards, student identification and electronics passports.
The Contact less card may contain its own battery, particularly in the case of a "Super
Smart Card" which has an integrated keyboard and LCD display. In general however the
operating power is supplied to the contact less card electronics by an inductive loop using
low frequency electronic magnetic radiation. The communications signal may be transmitted
in a similar way or can use capacitive coupling or even an optical connection.
1.3.1 COMBINATION SMART CARDS:
The combination smart cards are a combination of the contact smart cards and contact
less smart card. These cards can be read and written with contact or without contact with the
11
reader. The antenna of the card is used or the contact pads are used to manipulate data on the
smart card.
1.3.2 PROXIMITY CARDS:
The proximity cards are contact less cards and they have an antenna embedded in the
card. However, the proximity cards are read-only cards and the information on these cards
cannot be manipulated. The proximity cards also use the radio frequency identification
(RFID) technology. The applications of these cards include access control, identification and
security.
1.3.3 HYBRID CARDS:
The hybrid cards have more than two technologies embedded inside a single smart
card. These cards use any two of the above mentioned types of the smart cards in a single
chip. Some applications of smart card require more than two technologies like the proximity
card.
The smart card technology of embedding different functions along with the basic ones
is progressing rapidly. There are many benefits of smart cards that are making the use of
smart cards very popular. These were the types of smart cards that are used nowadays.
Here we are using contact based smart card. We have previously discussed the position
and definition of the IC connector and have identified 8 contacts, of which 6 are currently
defined,
VCC Power supply
GND Ground or reference voltage
CLK Clock
VPP Programming voltage
RST Reset signal
I/O Serial Input/output
1.3.4 POWER SUPPLY (VCC):
The power supply to the IC is defined to be between 4.75 volts and 5.25 volts with a
maximum current consumption of 200mA. Both of these parameters have problems. Newer
chip fabrication technologies are moving sub micron, 0.8um is already commercially
available and 0.5um is not that far away. These chips may operate with a supply voltage of 3
volts which results in lower current consumption. Most card acceptor devices (CAD) operate
12
at 5 volts as specified in the ISO standard. Whilst a 3 volt IC may be designed to operate
between 3 volts and 5 volts, running a 5 volt IC at 3 volts is a non starter.
A current consumption of 200mA is far too high for modern electronic equipment
particularly when the equipment is portable and driven by a battery power supply. Most IC
cards have a power consumption of between 10mA and 20mA (at 3.58MHz). ETSI in the
development of their standards have adopted a far more rigorous specification of 20mA
maximum for normal use and a 10mA maximum for use in portable equipment. They further
defined the concept of sleep mode (not covered by ISO 7816-3) where the IC chip can reside
in a latent mode preserving volatile memory contents with a maximum power consumption of
200uA.
CLOCK SIGNAL:
Although the integrated circuit could contain its own clock circuit for driving the
internal logic, in practice most IC chips are supplied with an external clock by the interface
device. It should be noted that the speed of the serial communications on the I/O line is
effectively defined by the frequency of this clock. The ISO standard aligns with the use of
two widely used external clock frequencies, 3.579545 MHz and 4.9152 MHz. The former
frequency is the more widely used (being based on the NTSC colour sub carrier frequency)
and results in a clock divider of 372 in order to produce a 9600 bit per second (not exact but
within tolerance) serial communication speed. The latter frequency has a simple divisor of
512 in order to achieve a 9600 bit per second communication speed. The standard defines the
situation after reset whilst allowing the frequency to be selectively changed by means of
protocol type selection.
PROGRAMMING VOLTAGE VPP:
This signal is designed to provide the high voltage required to enable writing to the
non volatile memory. The more popular IC's use EEPROM memory where the high voltage is
generated by a charge pump on chip. However the EPROM memory type needs the high
voltage (usually 12.5V or 21V) to be externally provided on the IC connector. There have
been problems in the past with terminals supplying the wrong programming voltage with
somewhat drastic effects. Because of this and the significant advantages of having a
rewriteable memory the EEPROM memory is by far the most popular for IC card
applications, hence the role of VPP is rapidly diminishing.
THE RESET SIGNAL:
13
The reset signal is asserted by the interface device and is used to start up the program
contained in the IC ROM. The ISO standard defines three reset modes, internal reset, active
low reset and synchronous high active reset. Most microprocessor ICs operate using the
active low reset mode were the IC transfers control to the entry address for the program when
the reset signal returns to the high voltage level. The synchronous mode of operation is more
commonly met with the memory card ICs as used for telephone applications. The sequence of
operations for activating and deactivating the IC is defined in order to minimize the
likelihood of damage to the IC. In particular the inadvertent corruption of the non-volatile
memory (EPROM or EEPROM) must be avoided. The activation sequence for the interface
device is defined as follows,
Take RST low
Apply VCC
Put I/O in receive mode
Put VPP in idle mode
Apply clock
Take RST high (active low reset)
The IC deactivation sequence for the interface device is as follows,
Take RST low
Take clock low
Deactivate VPP
Put I/O in the low state
Deactivate VCC
SERIAL INPUT/OUTPUT (I/O):
The ISO standard defines a single line for the interchange of data between the IC and
the interface device. This means that the line must change direction depending on whether the
IC is transmitting or receiving. In practice this cannot be instantaneous and the expression
'line turnaround time' is commonly encountered in the modem world. The transmission
protocol must take account of this need to turn the line around.
1.4 LIQUID CRYSTAL DISPLAY
A liquid crystal display (LCD) is a thin, flat panel used for electronically displaying
information such as text, images, and moving pictures. Its uses include monitors for
14
computers, televisions, instrument panels, and other devices ranging from aircraft cockpit
displays, to every-day consumer devices such as video players, gaming devices, clocks,
watches, calculators, and telephones. Among its major features are its lightweight
construction, its portability, and its ability to be produced in much larger screen sizes than are
practical for the construction of cathode ray tube (CRT) display technology. Its low electrical
power consumption enables it to be used in battery-powered electronic equipment. It is an
electronically-modulated optical device made up of any number of pixels filled with liquid
crystals and arrayed in front of a light source (backlight) or reflector to produce images in
color or monochrome. The earliest discovery leading to the development of LCD technology,
the discovery of liquid crystals, dates from 1888. By 2008, worldwide sales of televisions
with LCD screens had surpassed the sale of CRT units.
PIN DESCRIPTION:
Fig: 4.4.1 PIN DESCRIPTION
PIN DESCRIPTION:
PIN SYMBOL I/O DESCRIPTION
1 VSS -- Ground
2 VCC -- +5V power supply
3 VEE -- Power supply to control contrast
4 RS I RS=0 to select command register
RS=1 to select data register
5 R/W I R/W=0 for write
R/W=1 for read
15
6 EN I/O Enable
7 DB0 I/O The 8-bit data bus
8 DB1 I/O The 8-bit data bus
9 DB2 I/O The 8-bit data bus
10 DB3 I/O The 8-bit data bus
11 DB4 I/O The 8-bit data bus
12 DB5 I/O The 8-bit data bus
13 DB6 I/O The 8-bit data bus
14 DB7 I/O The 8-bit data bus
VCC, VSS and VEE:
While VCC and VSS provide +5V and ground respectively, VEE is used for
controlling LCD contrast.
RS (REGISTER SELECT):
There are two important registers inside the LCD. 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 that is sent is a 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 (READ/WRITE):
The 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.
All others are write commands, so RW will almost be low.
EN (ENABLE):
The 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, your program should first set this line high
(1) and then set the other two control lines and/or put data on the data bus. When the other
lines are completely ready, bring EN low (0) again. The 1-0 transition tells the 44780 to take
the data currently found on the other control lines and on the data bus and to treat it as a
command.
D0-D7 (DATA LINES):
16
The 8-bit data pins, D0-D7 are used to send information to the LCD or read the
content of the LCD’s internal registers.
To display letters and numbers, we send ASCII codes for the letters A-Z, a-z and
numbers 0-9 to these pins while making RS=1.
There are also instruction command codes that can be sent to the LCD to clear the
display or force the cursor to the home position or blink the cursor.
We also use RS=0 to check the busy flag bit to see if the LCD is ready to receive the
information. The busy flag is D7 and can be read when R/W = 1 and RS=0, as follows: if
R/W = 1, RS = 0. When D7=1 (busy flag = 1), the LCD is busy taking care of internal
operations and will not accept any new information. When D7 = 0, the LCD is ready to
receive new information.
Note: it is recommended to check the flag before writing any data to LCD.
LCD COMMAND CODES:
CODE (HEX) COMMAND TO LCD INSTRUCTION REGISTER
1 CLEAR DISPLAY SCREEN
2 RETURN HOME
4 DECREMENT CURSOR(SHIFT CURSOR TO LEFT)
6 INCREMENT CURSOR(SHIFT CURSOR TO RIGHT)
5 SHIFT DISPLAY RIGHT
7 SHIFT DISPLAY LEFT
8 DISPLAY OFF,CURSOR OFF
A DISPLAY OFF,CURSOR ON
C DISPLAY ON,CURSOR OFF
E DISPLAY ON CURSOR BLINKING
F DISPLAY ON CURSOR BLINKING
10 SHIFT CURSOR POSITION TO LEFT
14 SHIFT CURSOR POSITION TO RIGHT
18 SHIFT THE ENTIRE DISPLAY TO THE LEFT
1C SHIFT THE ENTIRE DISPLAY TO THE RIGHT
80 FORCE CURSOR TO BEGINNING OF 1ST LINE
C0 FORCE CURSOR TO BEGINNING OF 2ND LINE
38 2 LINES AND 5x7 MATRIX
17
ADVANTAGES:
LCD interfacing with 8051 is a real-world application. In recent years the LCD is
finding widespread use replacing LED’s (seven segment LED’s or other multi segment
LED’s).
This is due to following reasons:
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. An intelligent LCD displays two lines, 20
characters per line, which is interfaced to the 8051.
Incorporation of a refreshing controller into the LCD, thereby relieving the CPU to keep
displaying the data.
Ease of programming for characters and graphics.
1.5 LIGHT EMITTING DIODE
A light-emitting diode (LED) is a semiconductor diode that emits incoherent narrow
spectrum light when electrically biased in the forward direction of the pn-junction, as in the
common LED circuit. This effect is a form of electroluminescence.
Fig: 4.5.1 LIGHT EMITTING DIODE
18
Like a normal diode, the LED consists of a chip of semi-conducting material
impregnated, or doped, with impurities to create a p-n junction. As in other diodes, current
flows easily from the p-side, or anode, to the n-side, or cathode, but not in the reverse
direction. Charge-carriers—electrons and holes—flow into the junction from electrodes with
different voltages. When an electron meets a hole, it falls into a lower energy level, and
releases energy in the form of a photon.
Fig: 1.5.2 P-N JUCTION
The wavelength of the light emitted, and therefore its color, depends on the band gap
energy of the materials forming the p-n junction. In silicon or germanium diodes, the
electrons and holes recombine by a non-radiative transition which produces no optical
emission, because these are indirect band gap materials. The materials used for the LED have
a direct band gap with energies corresponding to near-infrared, visible or near-ultraviolet
light.
LED development began with infrared and red devices made with gallium arsenide.
Advances in materials science have made possible the production of devices with ever-
shorter wavelengths, producing light in a variety of colors.
LEDs are usually built on an n-type substrate, with an electrode attached to the p-type
layer deposited on its surface. P-type substrates, while less common, occur as well. Many
commercial LEDs, especially GaN/InGaN, also use sapphire substrate.
Most materials used for LED production have very high refractive indices. This
means that much light will be reflected back in to the material at the material/air surface
interface. Therefore Light extraction in LEDs is an important aspect of LED production,
subject to much research and development.
Solid state devices such as LEDs are subject to very limited wear and tear if operated
at low currents and at low temperatures. Many of the LEDs produced in the 1970s and 1980s
19
are still in service today. Typical lifetimes quoted are 25,000 to 100,000 hours but heat and
current settings can extend or shorten this time significantly.
Conventional LEDs are made from a variety of inorganic semiconductor materials;
the following table shows the available colors with wavelength range and voltage drop.
Color Wavelength (nm) Voltage (V)
Infrared λ > 760 ΔV < 1.9
Red 610 < λ < 760 1.63 < ΔV < 2.03
Orange 590 < λ < 610 2.03 < ΔV < 2.10
Yellow 570 < λ < 590 2.10 < ΔV < 2.18
Green 500 < λ < 570 1.9 < ΔV < 4.0
Blue 450 < λ < 500 2.48 < ΔV < 3.7
Violet 400 < λ < 450 2.76 < ΔV < 4.0
Purple multiple types 2.48 < ΔV < 3.7
Ultraviolet λ < 400 3.1 < ΔV < 4.4
White Broad spectrum ΔV = 3.5
ADVANTAGES OF LEDS:
LED’s have many advantages over other technologies like lasers. As compared to laser
diodes or IR sources
LED’s are conventional incandescent lamps. For one thing, they don't have a filament that
will burn out, so they last much longer. Additionally, their small plastic bulb makes them a
lot more durable. They also fit more easily into modern electronic circuits.
The main advantage is efficiency. In conventional incandescent bulbs, the light-production
process involves generating a lot of heat (the filament must be warmed). Unless you're using
the lamp as a heater, because a huge portion of the available electricity isn't going toward
producing visible light.
LED’s generate very little heat. A much higher percentage of the electrical power is going
directly for generating light, which cuts down the electricity demands considerably.
LED’s offer advantages such as low cost and long service life. Moreover LED’s have very
low power consumption and are easy to maintain.
DISADVANTAGES OF LEDS:
LED’s performance largely depends on the ambient temperature of the operating
environment.
20
LED’s must be supplied with the correct current.
LED’s do not approximate a "point source" of light, so cannot be used in applications
needing a highly collimated beam.
But the disadvantages are quite negligible as the negative properties of LED’s do not apply
and the advantages far exceed the limitations.
1.6 Keil IDE
Software’s used are:
Keil µvision software for c programmingµVision3 adds many new features to the Editor like
Text Templates, Quick Function Navigation, and Syntax Coloring with brace high lighting
Configuration Wizard for dialog based startup and debugger setup. µVision3 is fully
compatible to µVision2 and can be used in parallel with µVision2.
What is µVision3?
µVision3 is an IDE (Integrated Development Environment) that helps you write, compile,
and debug embedded programs. It encapsulates the following components:
A project manager.
A make facility.
Tool configuration.
Editor.
A powerful debugger.
To help you get started, several example programs (located in the \C51\Examples,
\C251\Examples, \C166\Examples, and \ARM\...\Examples) are provided.
HELLO is a simple program that prints the string "Hello World" using the Serial Interface.
MEASURE is a data acquisition system for analog and digital systems.
TRAFFIC is a traffic light controller with the RTX Tiny operating system.
SIEVE is the SIEVE Benchmark.
DHRY is the Dhrystone Benchmark.
WHETS is the Single-Precision Whetstone Benchmark.
Additional example programs not listed here are provided for each device architecture.
BUILDING AN APPLICATION IN µvision
To build (compile, assemble, and link) an application in µVision2, you must:
Select Project -(forexample,166\EXAMPLES\HELLO\HELLO.UV2).
Select Project - Rebuild all target files or Build target.
21
µVision2 compiles, assembles, and links the files in your project.
Creating Your Own Application in µVision2
To create a new project in µVision2, you must:
Select Project - New Project.
Select a directory and enter the name of the project file.
Select Project - Select Device and select an 8051, 251, or C16x/ST10 device from the Device
Database™.
Create source files to add to the project.
Select Project - Targets, Groups, Files. Add/Files, select Source Group1, and add the source
files to the project.
Select Project - Options and set the tool options. Note when you select the target device from
the Device Database™ all special options are set automatically. You typically only need to
configure the memory map of your target hardware. Default memory model settings are
optimal for most applications.
Select Project - Rebuild all target files or Build target.
Debugging an Application in µVision2
To debug an application created using µVision2, you must:
Select Debug - Start/Stop Debug Session.
Use the Step toolbar buttons to single-step through your program. You may enter G, main in
the Output Window to execute to the main C function.
Open the Serial Window using the Serial #1 button on the toolbar.
Debug your program using standard options like Step, Go, Break, and so on.
Starting µVision2 and creating a Project
µVision2 is a standard Windows application and started by clicking on the program icon. To
create a new project file select from the µVision2
Menu-Project – New Project…. This opens a standard Windows dialog that asks you for the
new project file name.
It is suggested that use a separate folder for each project. You can simply use the icon Create
New Folder in this dialog to get a new empty folder. Then select this folder and enter the file
name for the new project, i.e. Project1.
µVision2 creates a new project file with the name PROJECT1.UV2 which contains
a default target and file group name. You can see these names in the Project
Window – Files.
22
Now use from the menu Project – Select Device for Target and select a CPU for your
project. The Select Device dialog box shows the µVision2 device database. Just select the
microcontroller you use. We are using for our examples the Philips 80C51RD+ CPU. This
selection sets necessary tool options for the 80C51RD+ device and simplifies in this way the
tool Configuration- Building Projects and Creating a HEX Files. Typical, the tool settings
under Options – Target are all you need to start a new application. You may translate all
source files and line the application with a click on the Build Target toolbar icon. When you
build an application with syntax errors, µVision2 will display errors and warning messages in
the Output
Window – Build page. A double click on a message line opens the source file on the
correct location in a µVision2 editor window. Once you have successfully generated your
application you can start debugging.
µVision2 simulates up to 16 Mbytes of memory from which areas can be mapped for read,
write, or code execution access. The µVision2 simulator traps and reports illegal memory
accesses. In addition to memory mapping, the simulator also provides support for the
integrated peripherals of the various 8051 derivatives. The on-chip peripherals of the CPU
you have selected are configured from the Device Database selection
Information about selecting a device. You may select and display the on-chip peripheral
components using the Debug menu. You can also change the aspects of each peripheral using
the controls in the dialog boxes.
Start Debugging:
You start the debug mode of µVision2 with the Debug – Start/Stop Debug Session
command. Depending on the Options for Target – Debug Configuration, µVision2 will load
the application program and run the startup code µVision2 saves the editor screen layout and
restores the screen layout of the last debug session. If the program execution stops, µVision2
opens an editor window with the source text or shows CPU instructions in the disassembly
window. The next executable statement is marked with a yellow arrow. During debugging,
most editor features are still available.
For example, you can use the find command or correct program errors. Program source text
of your application is shown in the same windows. The µVision2 debug mode differs from
the edit mode in the following aspects:
23
The “Debug Menu and Debug Commands” described below are available. The additional
debug windows are discussed in the following.
The project structure or tool parameters cannot be modified. All build Commands are
disabled.
Disassembly Window:
The Disassembly window shows your target program as mixed source and assembly
program or just assembly code. A trace history of previously executed instructions may be
displayed with Debug – View Trace Records. To enable the trace history, set Debug –
Enable/Disable Trace Recording:
If you select the Disassembly Window as the active window all program step commands
work on CPU instruction level rather than program source lines. You can select a text line
and set or modify code breakpoints using toolbar buttons or the context menu commands.
You may use the dialog Debug – Inline Assembly… to modify the CPU instructions.
That allows you to correct mistakes or to make temporary changes to the target program you
are debugging.
SOURCE CODE:
Click on the Keil uVision Icon on Desktop
The following fig will appear
Click on the Project menu from the title bar
Then Click on New Project
24
Save the Project by typing suitable project name with no extension in u r own folder sited in
either C:\ or D:\
Then Click on Save button above.
Select the component for u r project. i.e. Atmel……
Click on the + Symbol beside of Atmel
Select AT89C51 as shown below
25
Then Click on “OK”
The Following fig will appear
Then Click either YES or NO………mostly “NO”
Now your project is ready to USE
Now double click on the Target1, you would get another option “Source group 1” as shown
in next page.
26
Click on the file option from menu bar and select “new”
The next screen will be as shown in next page, and just maximize it by double clicking on its
blue boarder.
27
Now start writing program in either in “C” or “ASM”
For a program written in Assembly, then save it with extension “. asm” and for “C” based
program save it with extension “ .C”
Now right click on Source group 1 and click on “Add files to Group Source”
Now you will get another window, on which by default “C” files will appear.
28
Now select as per your file extension given while saving the file
Click only one time on option “ADD”
Now Press function key F7 to compile. Any error will appear if so happen.
If the file contains no error, then press Control+F5 simultaneously.
The new window is as follows
Then Click “OK”
Now Click on the Peripherals from menu bar, and check your required port as shown in fig
below
29
Drag the port a side and click in the program file.
30
CHAPTER - 2
COMPONENT DESCRIPTION
2.1 MICRO CONTROLLER (AT89S52)
At the core of the 8051-BASIC is an 8051 microcontroller, a member of the 8051
microcontroller family. Intel Corporation introduced the 8051 in 1980. Since that time, 8051-
family chips have been used as the base of thousands of products. Many other companies,
including Philips, Siemens, Dallas Semiconductor, OKI, Fujitsu, and Harris- Matra now also
make 8051-family chips. Some companies have expanded the 8051 family by offering
compatible chips with additional features
Table 5.1 summarizes the differences among popular 8051-family chips. The 8051 is
an enhanced 8051, with an extra timer and more RAM and ROM. The 8031 and 8032 are
identical to the 8051 and 8051, except that the ROM area is unused, and program code must
be stored in an external EPROM or other memory chip.
Table 2.1 comparisons between different microcontrollers
Chip Program memory
Type kilobytes
RAM
(Kilobytes)
Timers
8051 ROM 4 128 2
8052 ROM 8 256 3
8031 None - 128 2
8032 None - 256 3
8751 EPROM 4 128 2
8752 8 256 3
The 8051 is an 8-bit microcontroller originally developed by Intel in the late 1970s. It
includes an instruction set of 255 operation codes (opcodes), 32 input/output lines, three user-
controllable timers, an integrated and automatic serial port, and 256 bytes of on-chip RAM.
The 8051 is similar but has only two timers and 128 bytes of on-chip RAM.
The 8051 was designed such that control of the MCU and input/output between the
MCU and external devices is accomplished primarily using Special Function Registers . Each
SFR has an address between 128 and 255. Additional functions can be added to new
31
derivative MCUs by adding additional SFRs while remaining compatible with the original
8051. This allows the developer to use the same software development tools with any device
that is “8051-compatible.”
Over time, other semiconductor firms adopted the "8051 core" for their microcontrollers,
using the same instruction set and underlying SFRs. This allowed the 8051 architecture to
become an industry-wide standard. Now, more than 20 years later, dozens of semiconductor
companies produce hundreds of microcontrollers that are based on the original 8051 core.
The additional features that each semiconductor- firm offers in their MCUs are accessed by
utilizing new SFRs in addition to the standard 8051 SFRs that are found in all 8051-
compatible MCUs.
Pin diagram description of 8051 microcontroller
Figure 2.1 Pin diagram of 8051 microcontroller
Pi
n
Symbol Input/
Outpu
t
8051
Function
8051-BASIC
Additions
Symbol
Function
1 P1.0
T2
I/O Port 1, bit 0;
Timer 2
external input
2 P1.1
T2(EX)
I/O Port 1, bit 1;
Timer 2
external
reload/captur
e
3 P1.2 I/O Port 1, bit 2 PWM Pulse-
32
width-
modulated
output
4 P1.3 I/O Port 1, bit 3 ALE DIS
Address
latch disable
5 P1.4 I/O Port 1, bit 4 PGM PLS
Program
pulse
6 P1.5 I/O Port 1, bit 5 PGM EN
Programmin
g voltage
enable
7 P1.6 I/O Port 1, bit 6 DMA ACK
DMA
acknowledge
8 P1.7 I/O Port 1, bit 7 LPT Line
printer out
9 Reset Input Reset system
10 P3.0
RXD
I/O Port 3, bit 0
Serial receive
SER IN
Serial port in
11 P 3.1
TXD
I/O Port 3, bit 1
Serial
transmit
SER OUT
Serial port
out
12 P3.2
INT0
I/O Port 3, bit 2
External
interrupt 0
DMA
REQ
DMA
request
13 P3.3
INT1
I/O Port 3, bit 3
External
interrupt 1
14 P3.4
T0
I/O Port 3, bit 4
Timer 0
33
external input
15 P3.5
T1
I/O Port 3, bit 5
Timer 1
external input
16 P3.6
WR
I/O Port 3, bit 6
Write strobe
for external
memory
17 P3.7
RD
I/O Port 3, bit 7
Read strobe
for external
memory
18 XTAL
1
Input Inverting
oscillator amplifier
(crystal)
19 XTAL
2
Outpu
t
Inverting
oscillator
amplifier
(crystal)
20 VSS Input Circuit
ground
21 P2.0
A8
I/O Port 2, bit 0
Address bit 8
22 P2.1
A9
I/O Port 2, bit 1
Address bit 9
23 P2.2
A10
I/O Port 2, bit 2
Address bit
10
24 P2.3
A11
I/O Port 2, bit 3
Address bit
11
25 P2.4
A12
I/O Port 2, bit 4
Address bit
34
12
26 P2.5
A13
I/O Port 2, bit 5
Address bit
13
27 P2.6
A14
I/O Port 2, bit 5
Address bit
14
28 P2.7
A15
I/O Port 2, bit 6
Address bit
15
29 PSEN Outpu
t
Program
store enable
Read strobe
for external
program
memory
30 ALE Outpu
t
Address latch
enable
31 EA Input External
access enable
for
program
memory
32 P0.7
AD7
I/O Port 0, bit 7
Address/data
bit 7
33 P0.6
AD6
I/O Port 0, bit 6
Address/data
bit 6
34 P0.5
AD5
I/O Port 0, bit 5
Address/data
bit 5
35 P0.4 I/O Port 0, bit 4
35
AD4 Address/data
bit 4
36 P0.3
AD3
I/O Port 0, bit 3
Address/data
bit 3
37 P0.2
AD2
I/O Port 0, bit 2
Address/data
bit 2
38 P0.1
AD1
I/O Port 0, bit 1
Address/data
bit 1
39 P0.0
AD0
I/O Port 0, bit 0
Address/data
bit 0
40 VCC Input Supply
voltage
Table 2.2 Pin functions of 8051 microcontroller
Figure 2.2 Hardware Architecture of 8051 microcontroller
CPU:
The CPU, or central processing unit, executes program instructions. Types of
instructions include arithmetic (addition, subtraction), logic (AND, OR, NOT), data transfer
36
(move), and program branching (jump) operations. An external crystal provides a timing
reference for clocking the CPU.
ROM:
ROM (read-only memory) is the read-only memory that is programmed into the chip
in the manufacturing process. In the 8051-BASIC, the ROM contains the BASIC-52
interpreter program that the 8051 executes on boot-up. As far as the hardware is concerned,
this is the only difference between the ordinary 8051 and the 8051-BASIC.
RAM:
RAM (random-access memory) is where programs store information for temporary use.
Unlike ROM, the CPU can write to RAM as well as read it. Any information stored in RAM
is lost when power is removed from the chip. The 8051 has 256 bytes of RAM. BASIC-52
uses much of this for its own operations, with a few bytes available to users.
I/O Ports:
I/O (Input/output) Ports enable the 8051 to read and write to external memory and other
components. The 8051 has four 8-bit I/O ports (Ports 0-3). As the name suggests, the ports
can act as inputs (to be read) or outputs (to be written to). Many of the port bits have optional,
alternate functions relating to accessing external memory, using the on-chip timer/counters,
detecting external interrupts, and handling serial communications. BASIC-52 assigns
alternate functions to the remaining port bits. Some of these functions are required by
BASIC-52, while others are optional. If you don’t use an alternate function, you can use the
bit for any control, monitoring, or other purpose in your application
Accessing external memory:
The largest alternate use of the ports has to do with accessing external memory.
Although the 8051 is a single-chip computer, a complete 8051-BASIC system requires
additional components. It must have external RAM in addition to the 8051’s internal RAM,
and most systems also have EPROM, EEPROM, or battery-backed RAM for permanent
storage of BASIC-52 programs.Accessing this external memory uses all of Ports 0 and 2, plus
bits 6 and 7 of Port 3, to hold data, addresses, and control signals for reading and writing to
external memory. Data here refers to a byte to be read or written, and may be any type of
information, including program code. The address defines the location in memory to be read
or written.
During a memory access, Port 0’s eight pins (AD0-AD7) first hold the lower byte of
the address, followed by the data to be read or written. This method of carrying both
37
addresses and data on the same signal lines is called a multiplexed address/data bus. It’s a
popular arrangement that many devices use, since it requires fewer pins on the chip,
compared to giving each data and address line its own pin.
Port is eight lines hold the higher byte of the address to be read or written to. These lines
make up the high address bus (A8-A15). Together, the 16 address lines can access 64
kilobytes (65,536 bytes) of memory, from 00000000 00000000 to 11111111 11111111 in
binary, or 0000h to FFFFh in hexadecimal. Besides pins to hold the data and addresses, the
8051 must also provide control signals to initiate the read and write operations. Control
signals include WR (write), RD (read), PSEN (program store enable), and ALE (address latch
enable). Some of the address lines may also function as control signals that help to select a
chip during a memory access.
Code and data memory:
To understand the operation of the control signals, you need to know a little about
how the 8051 distinguishes between two types of memory: data and code, or program,
memory. By using different control signals for each type of memory, the 8051 can access two
separate 64K areas of memory, with each addressed from 0000h to FFFFh, and each using
the same data and address lines.
The 8051 accesses code memory when it executes an assembly-language program or
subroutine. Code memory is read-only; you can’t write to it. The only instructions that access
code memory are read operations. Code memory is intended for programs or subroutines that
have been previously programmed into ROM or EPROM. The 8051 strobes, or pulses, PSEN
when it accesses external code memory. Accesses to internal code memory (the BASIC-52
interpreter in ROM) do not use PSEN or any external control signals
If you don’t need all of the available memory space, you can combine code and data
memory in a single area. With combined memory, WR controls write operations, and PSEN
and RD are logically AND ed to create a read signal that is active when either PSEN or RD is
low.
Combined data/code memory is handy if you want the flexibility to store either
BASIC or assembly-language programs in the same chip, or if you want to be able to upload
assembly-language routines into RAM for testing.
ALE is the final control signal for accessing external memory. It controls an external
latch that stores the lower address byte during memory accesses. When the 8051 reads or
38
writes to external memory, it places the lower address byte on AD0-AD7 and strobes ALE,
which causes the external latch to save the lower address byte for the rest of the read or write
cycle. After a short delay, the 8051 replaces the address on AD0-AD7 with the data to be
written or read.
Timers and Counters:
The 8051 has three 16-bit timer/counters, which make it easy to generate periodic
signals or count signal transitions. BASIC-52 assigns optional functions for each of the
timer/counters. Timer 0 controls a real-time clock that increments every 5 milliseconds. You
can use this clock to time events that occur at regular intervals, or as the base for clock or
calendar functions. Timer 1 has several uses in BASIC-52, including controlling a pulse-
width-modulated output (PWM) (a series of pulses of programmable width and number);
writing to a line printer or other serial peripheral (LPT); and generating pulses for EPROM
programming (PGM PULSE). Timer 2 generates a baud rate for serial communications at
SER IN and SEROUT. These are all typical applications for timer/counters in microcontroller
circuits.
If you don’t use the optional timer functions, you can program the timers for other
applications. In addition to timing functions, where the timer increments at a defined rate,
you can use the timers for event counting, where the timer increments on an external trigger
and measures the time between triggers. If you use the timers for event counting, T2, T2
(EX), T0, and T1 detect transitions to be counted.
The serial port:
The 8051’s serial port automatically takes care of many of the details of serial
communications. On the transmit side, the serial port translates bytes to be sent into serial
data, including adding start and stop bits and writing the data in a timed sequence to SER
OUT. On the receive side, the serial port accepts serial data at SER IN and sets a flag to
indicate that a byte has been received. BASIC-52 uses the serial port for communicating with
a host computer.
External interrupts:
39
INT0 and INT1 are external interrupt inputs, which detect logic levels or transitions
that interrupt the CPU and cause it to branch to a predefined program location. BASIC-52
uses INT0 for its optional direct-memory-access (DMA) function.
Programming functions.
BASIC-52’s programming commands use three additional port bits (ALEDIS, PGM
PULSE, and PGM EN) to control programming voltages and timing for storing BASIC-52
programs in EPROM or other non volatile memory
Additional Control Inputs
Two additional control inputs need to be mentioned. A logic high on RESET resets
the chip and causes it to begin executing the program that begins at 0 in code memory. In the
8051-BASIC chip, this program is the BASIC-52 interpreter. EA (external memory access)
determines whether the chip will access internal or external code memory in the area from 0
to 1FFFh. In BASIC-52 systems, EA is tied high so that the chip runs the BASIC interpreter
in internal ROM on boot-up.
Power Supply Connections
Finally , the chip has two pins for connecting to a +5-volt DC power supply (VCC)
and ground (VSS).That finishes our tour of the 8051-BASIC chip. We’re now ready to put
together a working system.
2.2 SR-90 CONTACT BASED SMART CARD READER
Smart Card Readers are also known as card programmers (because they can write to a
card), card terminals, card acceptance device (CAD) or an interface device (IFD). There is a
slight difference between the card reader and the terminal. The term 'reader' is generally used
to describe a unit that interfaces with a PC for the majority of its processing requirements. In
contrast, a 'terminal' is a self-contained processing device.
Smart cards are portable data cards that must communicate with another device to
gain access to a display device or a network. Cards can be plugged into a reader, commonly
referred to as a card terminal, or they can operate using radio frequencies (RF).
40
When the smart card and the card reader come into contact, each identifies itself to
the other by sending and receiving information. If the messages exchanged do not match, no
further processing takes place. So, unlike ordinary bank cards, smart cards can defend
themselves against unauthorized users and uses in innovative security measures.
COMMUNICATING WITH A SMART CARD READER:
The reader provides a path for your application to send and receive commands from
the card. There are many types of readers available, such as serial, PC Card, and standard
keyboard models. Unfortunately, the ISO group was unable to provide a standard for
communicating with the readers so there is no one-size-fits-all approach to smart card
communication.
Each manufacturer provides a different protocol for communication with the reader.
First you have to communicate with the reader.
Second, the reader communicates with the card, acting as the intermediary before sending the
data to the card.
Third, communication with a smart card is based on the APDU format. The card will process
the data and return it to the reader, which will then return the data to its originating source.
The following classes are used for communicating with the reader:
ISO command classes for communicating with 7816 protocol
Classes for communicating with the reader
Classes for converting data to a manufacturer-specific format
An application for testing and using the cards for an intended and specific purpose
Readers come in many forms, factors and capabilities. The easiest way to describe a
reader is by the method of its interface to a PC. Smart card readers are available that interface
to RS232 serial ports, USB ports, PCMCIA slots, floppy disk slots, parallel ports, infrared
IRDA ports and keyboards and keyboard wedge readers. Card readers are used to read data
from - and write data to - the smart card. Readers can easily be integrated into a PC utilizing
Windows 98/Me, 2000, or XP platforms. However, some computer systems already come
equipped with a built-in smart card reader. Some card readers come with advanced security
features such as secure PIN entry, secure display and an integrated fingerprint scanners for
the next-generation of multi-layer security and three-factor authentication.
Another difference in reader types is on-board intelligence and capabilities. An
extensive price and performance difference exists between an industrial strength reader that
41
supports a wide variety of card protocols and the less expensive win-card reader that only
works with microprocessor cards and performs all processing of the data in the PC.
The options in terminal choices are just as varied. Most units have their own operating
systems and development tools. They typically support other functions such as magnetic-
stripe reading, modem functions and transaction printing.
To process a smart card the computer has to be equipped with a smart card reader
possessing the following mandatory features:
Smart Card Interface Standard - ISO 7816 is an international standard that describes the
interface requirements for contact-type smart cards. These standards have multiple parts. For
instance, part 1, 2 and 3 are applicable to card readers. Part 1 defines the physical
characteristics of the card. Part 2 defines dimension and location of smart card chip contacts.
Part 3 defines the electronic signals and transmission protocols of the card. Card readers may
be referred to as conforming to ISO 7816 1/2/3, or in its simplified term, ISO 7816.
Driver - This refers to the software used by the operating system (OS) of a PC for managing a
smart card and applicable card reader. To read a smart ID card, the driver of the card reader
must be PC/SC compliant which is supported by most card reader products currently
available. It should be noted that different OS would require different drivers. In acquiring
card readers, the compatibility between the driver and the OS has to be determined and
ensured.
DESIRABLE FEATURES IN A SMART CARD READER:
Card Contact Types refers to how the contact between a card reader and a smart card
is physically made. There are two primary types of contact: landing contact and friction
contact (also known as sliding or wiping). For card readers featuring friction contact, the
contact part is fixed. The contact wipes on the card surface and the chip when a card is
inserted. For card readers featuring the landing type, the contact part is movable. The contact
"lands" on the chip after a card is wholly inserted. In general, card readers of the landing type
provide better protection to the card than that of the friction type.
Smart card readers are also used as smart card programmers to configure and
personalize integrated circuit cards. These programmers not only read data, but also put data
into the card memory. This means that not only CPU based smart cards, but also simple
memory cards can be programmed using a smart card reader. Of course the card reader must
42
support the appropriate protocol such as the asynchronous T=0, T=1 or synchronous I2C
protocols.
It won't take long before smart card readers become an integral part of every
computer - and, subsequently, the lives of computer users. Computer systems with keyboards
that have smart card reader/writer integration are also available.
Smart card readers are also accessible in the form of USB dongle. USB dongles are
frequently used with GSM phones, which contain a SIM smart card. Additionally, phone
numbers can be edited on a PC using the USB smart card dongle.
PIN DESCRIPTION OF SMART CARD:
VCC: Power supply input
RST: Either used it (reset signal supplied from the interface device) or in combination with
an internal reset control circuit (optional use by the card). If internal reset is implemented, the
voltage supply on Vcc is mandatory.
CLK: Clocking or timing signal (optional use by the card).
GND: Ground (reference voltage).
VPP: Programming voltage input (deprecated / optional use by the card).
I/O: Input or Output for serial data to the integrated circuit inside the card.
NOTE - The use of the two remaining contacts will be defined in the appropriate application
standards.
COMMAND SET FOR SLE4428 – 1KB MEMORY:
Steps Command Comd to SR90 Prompt from SR90 Reader
1. Set Device Type #0206! #83! (Positive Ack)
#8A! (Invalid Device Type set )
2. Send Card Status #01! #80! (Card Present)
#81! (Card Absent)
3. ATR #03! #8892231091!
4. Read Data #10AAAANN! #87AAAANNNNDDD…D!
( DDD = Data )
#86! (Invalid Command)
43
#82! (No Device Type set )
#8D! (Memory Over Flow)
5. Write Data #11AAAANNFFFF
DD..D! #82! (No Device Type set )
#83! (Positive Ack)
#89! (Invalid Security Code)
#86! (Invalid Command)
#85! (Invalid Parameters
#8D! (Memory Over Flow)
#90!(Already Protected)
6. Protect Data #12AAAANNFFFF
DD! #83! (Positive Ack)
#82! (No Device Type)
#89! (Invalid Security Code)
#86! (Invalid Command)
#85! (Invalid Parameters
#8D! (Memory Over Flow)
7. Communication Protocol: Baud Rate : 9,600 bps
Parity : None
Stop Bit :1
Start Bit :0
Data :8 bits
Note: Please give correct security code while writing your cards other wise they will
damage. This card will allow 8 times of writing false security code later it won’t accept to
write the card but you can read.
AAAA = Address location of the chip in Hex
NN = Number of bytes to read or to write
FFFF = Security Code
DD = Data to read / write or protect in BCD format
44
2.3 MAX232:
FEATURES:
Operates From a Single 5-V Power Supply With 1.0-_F Charge-Pump Capacitors
Operates Up To 120 kbit/s
Two Drivers and Two Receivers
Low Supply Current . . . 8 mA Typical
ESD Protection Exceeds JESD 22
– 2000-V Human-Body Model (A114-A)
Upgrade With Improved ESD (15-kV HBM) and 0.1-_F Charge-Pump Capacitors is
Available With the MAX202
Applications
– TIA/EIA-232-F, Battery-Powered Systems, Terminals, Modems, and Computers
PIN CONFIGURATION
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 5-V supply. Each receiver converts
TIA/EIA-232-F inputs to 5-V TTL/CMOS levels. These receivers have a typical threshold of
1.3 V, a typical hysteresis of 0.5 V, and can accept +/-30-V inputs. Each driver converts
TTL/CMOS input levels into TIA/EIA-232-F levels.
45
LOGIC DIAGRAM (POSITIVE LOGIC)
MAX232:
The MAX232 is an integrated circuit that converts signals from an RS-232 serial port
to signals suitable for use in TTL compatible digital logic circuits. The MAX232 is a dual
driver/receiver and typically converts the RX, TX, CTS and RTS signals.
The drivers provide RS-232 voltage level outputs (approx. ± 7.5 V) from a single
+ 5 V supply via on-chip charge pumps and external capacitors. This makes it useful for
implementing RS-232 in devices that otherwise do not need any voltages outside the 0 V to
+ 5 V range, as power supply design does not need to be made more complicated just for
driving the RS-232 in this case. The receivers reduce RS-232 inputs (which may be as high as
± 25 V), to standard 5 V TTL levels. These receivers have a typical threshold of 1.3 V, and a
typical hysteresis of 0.5 V.
The later MAX232A is backwards compatible with the original MAX232 but may
operate at higher baud rates and can use smaller external capacitors – 0.1 μF in place of the
1.0 μF capacitors used with the original device.
RS232:
In telecommunications, RS-232 (Recommended Standard 232) is a standard for serial binary
data signals connecting between a DTE (Data Terminal Equipment) and a DCE (Data Circuit-
terminating Equipment). It is commonly used in computer serial ports.
A charge pump is a kind of DC to DC converter that uses capacitors as energy
storage elements to create either a higher or lower voltage power source. Charge pump
circuits are capable of high efficiencies, sometimes as high as 90-95% while being
electrically simple circuits.
Charge pumps use some form of switching device(s) to control the connection of
voltages to the capacitor. For instance, to generate a higher voltage, the first stage involves
46
the capacitor being connected across a voltage and charged up. In the second stage, the
capacitor is disconnected from the original charging voltage and reconnected with its
negative terminal to the original positive charging voltage. Because the capacitor retains the
voltage across it (ignoring leakage effects) the positive terminal voltage is added to the
original, effectively doubling the voltage. The pulsing nature of the higher voltage output is
typically smoothed by the use of an output capacitor.
This is the charge pumping action, which typically operates at tens of kilohertz up to
several megahertz to minimize the amount of capacitance required. The capacitor used as the
charge pump is typically known as the "flying capacitor".
Another way to explain the operation of a charge pump is to consider it as the
combination of a DC to AC converter (the switches) followed by a voltage multiplier.
The voltage is load-dependent; higher loads result in lower average voltages. Charge
pumps can double voltages, triple voltages, halve voltages, invert voltages, fractionally
multiply or scale voltages such as x3/2, x4/3, x2/3, etc. and generate arbitrary voltages,
depending on the controller and circuit topology.
The term 'charge pump' is also used in phase-locked loop (PLL) circuits. This is a
completely different application. In a PLL the phase difference between the reference signal
(often from a crystal oscillator) and the output signal is translated into two signals - UP and
DN. The two signals control switches to steer current into or out of a capacitor, causing the
voltage across the capacitor to increase or decrease. In each cycle, the time during which the
switch is turned on is proportional to the phase difference, hence the charge delivered is
dependent on the phase difference also. The capacitor acts to smooth out abrupt changes on
the voltage and to ensure the PLL's closed-loop stability. The voltage on the capacitor is used
to tune a voltage-controlled oscillator (VCO), generating the desired output signal frequency.
The charge pump in a PLL design is constructed in integrated-circuit (IC) technology,
consisting of pull-up, pull-down transistors and on-chip capacitors and resistors.
2.4 TRANSISTOR AS A SWITCH
The transistor is the fundamental building block of modern electronic devices, and its
presence is ubiquitous in modern electronic systems.
Because a transistor's collector current is proportionally limited by its base current, it
can be used as a sort of current-controlled switch. A relatively small flow of electrons sent
through the base of the transistor has the ability to exert control over a much larger flow of
electrons through the collector.
47
When used as an AC signal amplifier, the transistors Base biasing voltage is applied
so that it operates within its "Active" region and the linear part of the output characteristics
curves are used. However, both the NPN & PNP type bipolar transistors can be made to
operate as an "ON/OFF" type solid state switch for controlling high power devices such as
motors, solenoids or lamps. If the circuit uses the Transistor as a Switch, then the biasing is
arranged to operate in the output characteristics curves seen previously in the areas known as
the "Saturation" and "Cut-off" regions as shown below.
TRANSISTOR CURVES:
The shaded area at the bottom represents the "Cut-off" region. Here the operating
conditions of the transistor are zero input base current (Ib), zero output collector current (Ic)
and maximum collector voltage (Vce) which results in a large depletion layer and no current
flows through the device. The transistor is switched "Fully-OFF". The lighter blue area to the
left represents the "Saturation" region. Here the transistor will be biased so that the maximum
amount of base current is applied, resulting in maximum collector current flow and minimum
collector emitter voltage which results in the depletion layer being as small as possible and
maximum current flows through the device. The transistor is switched "Fully-ON". Then we
can summarize this as:
Cut-off Region: Both junctions are Reverse-biased, Base current is zero or very small
resulting in zero Collector current flowing, the device is switched fully "OFF".
Saturation Region: Both junctions are Forward-biased, Base current is high enough to give a
Collector-Emitter voltage of 0v resulting in maximum Collector current flowing, the device is
switched fully "ON".
48
TRANSISTOR SWITCHING CIRCUIT:
An NPN Transistor as a switch being used to operate a relay is given above. With inductive
loads such as relays or solenoids a flywheel diode is placed across the load to dissipate the
back EMF generated by the inductive load when the transistor switches "OFF" and so protect
the transistor from damage. If the load is of a very high current or voltage nature, such as
motors, heaters etc, then the load current can be controlled via a suitable relay as shown.
The circuit resembles that of the Common Emitter circuit we looked at in the
previous tutorials. The difference this time is that to operate the transistor as a switch the
transistor needs to be turned either fully "OFF" (Cut-off) or fully "ON" (Saturated). An ideal
transistor switch would have an infinite resistance when turned "OFF" resulting in zero
current flow and zero resistance when turned "ON", resulting in maximum current flow. In
practice when turned "OFF", small leakage currents flow through the transistor and when
fully "ON" the device has a low resistance value causing a small saturation voltage (Vce)
across it. In both the Cut-off and Saturation regions the power dissipated by the transistor is
at its minimum.
Transistor switches are used for a wide variety of applications such as interfacing
large current or high voltage devices like motors, relays or lamps to low voltage digital logic
IC's or gates like AND Gates or OR Gates.
49
CHAPTER - 3
BIOMETRICS
3.1 Introduction :
In the realm of computer security, biometrics refers to authentication techniques
that rely on measurable physiological and individual characteristics that can be automatically
verified. In other words, we all have unique personal attributes that can be used for distinctive
identification purposes, including a fingerprint, the pattern of a retina, and voice
characteristics.
Biometrics refers to the automatic identification of a person based on his or her
physiological or behavioral characteristics. This identification method is preferred over
traditional methods involving passwords and PINs (personal identification numbers) for
several reasons, including the person to be identified is required to be physically present at
the point of identification and/or identification based on biometric techniques obviates the
need to remember a password or carry a token. With the increased use of computers as
vehicles of information technology, restricting access to sensitive/personal data is necessary.
By replacing PINs, biometric techniques can potentially prevent unauthorized access to or
fraudulent use of the following:
ATMs
Cellular phones
Smart cards
Desktop PCs
Workstations
Computer networks
Various types of biometric systems are being used for real-time identification. The most
popular are based on face recognition and fingerprint matching; however, other biometric
systems use iris and retinal scans, speech, facial feature comparisons and facial thermograms,
and hand geometry.
3.1.1 Introduction to Fingerprints
The uniqueness and permanence of the fingerprints are very well-know. Archaeological
artifacts prove that fingerprints were already used by the ancient Assyrians and Chinese as a
form of identification of a person. The first scientific studies on fingerprints date from the late
50
sixteen century, but the fundamentals of modern fingerprint identification methods were
provided at the end of nineteenth century. The studies of Sir F. Galton and E. Henry led to
formally accept fingerprints as valid signs of identity by law enforcement agencies.
3.1.2 Fingerprint Recognition :
In the context of the term "identification through fingerprint images", fingerprints are
generally accepted as human fingerprint images. Identification can functionally be split up
into the following three basic tasks:
• Fingerprint scanning,
• Fingerprint classification and
• Fingerprint comparison.
Fingerprints can be acquired as color prints or via sensors which store the ridges on a medium
(glass, paper, sensor surface, etc.). During the classification process, fingerprint images are
optionally allocated to a certain category based on the global orientation of the ridges while
the location of the minutiae is marked as well. The comparison determines whether two
fingerprint images are identical, i.e. whether they belong to the same person (finger).
The complete process of a fingerprint image analysis (comparison of patterns) can be divided
into six steps as shown in the figure.
Figure: Process of fingerprint analysis
51
1. Scanning of a fingerprint image. The quality of the scanned image is the decisive factor for
automatic identification purposes. It is desirable to use a high-definition fingerprint scanner
which is able to tolerate different skin types, damages, dryness, as well as the humidity of the
finger surface.
2. Image quality improvement. By using image quality improvement, an optical improvement of
the structures (ridges) on the scanned image can be achieved.
3. Image processing. It means the preparatory phase for feature extraction and classification
purposes.
4. Feature classification. The fact is that all fingerprints show certain global similarities, which
allow for rough classification into three principal finger classes. However, classification is a
rather difficult process both for algorithm-based decisions as well as for man-made decisions
since some fingerprints cannot be clearly allocated to a concrete finger class. Nowadays,
pattern classification is only used in dactyloscopic systems, e.g. AFIS (Automated
Fingerprint Identification System) of the Federal Office of Criminal Investigation (BKA).
This method is not feasible for access systems.
5. Feature extraction. In this phase, the location of the minutiae (ridge bifurcations and ridge
endings) in the fingerprint is detected and extracted. In practice, scanned fingerprint images
show differing qualities. The algorithm performance is negatively influenced by a poor image
quality.
6. Verification phase. In the verification phase two feature vectors are being compared. The
algorithm performance strongly depends on the quality (significance) of the extracted
minutiae and on the comparison process.
Below, we will describe in more detail the fingerprint scanning, feature classification and
fingerprint comparison processes.
3.1.3 Fingerprint Scanning :
Depending on whether the scanning process is carried out on- or off-line, the fingerprint
image can either be
• a color image, e.g. on paper or
• an image of a life finger obtained through a sensor.
In case of a color print, rolling the finger on a surface generates the image of the ridges, e.g.
on paper after that the finger is moistened with ink. An example of such rolled fingerprint
images can be seen in the figure. By evenly rolling the finger from one side of the nail to the
52
other, all line-related data is reliably recorded in the image. Afterwards, these images can be
scanned or electronically photographed. In dactyloscopy, this method has already been used
for well over 100 years. Thus, since a complete "overall imaging" of the finger is done, in
addition to a higher number of ridges and minutiae, "macro features" (i.e. delta and nucleus)
are recorded as well. Even though they are part of each and every ridge pattern (with the
exception of the "arch" pattern which does not have a delta), they are not always printed.
A disadvantage of this method is a possible distortion, which may occur through pressing and
rolling the finger while taking the fingerprint. Furthermore, a quality feedback is not possible
which may lead to a decrease in the quality of the fingerprints. From the user’s point of view,
this is an unpleasant and slow method. It is also unsuitable for partially automated access
controls.
The term life image of a finger is a comprehensive term for images that are obtained directly
by placing the finger on a suitable sensor. There are a vast number of various methods, which
can be used for scanning ridges. They include:
• Optical sensors.
• Electrical field sensors,
• Polymer TFT sensors (TFT – Thin Film Transistor).
• Thermal sensors.
• Capacitive sensors.
• Contactless 3D-sensors and
• Ultrasound sensors.
A biometric sensor is the hardware component of a biometric system, which initially supplies
biometric measurements. Depending on the biometric method in use, there are different kinds
53
of sensors. Optical sensors use light for obtaining fingerprint images. Electrical field sensors
measure local variations of the electrical field, which is generated on the finger surface relief
upon the emission of a small electrical signal. Polymer TFT sensors measure the light, which
is emitted upon contact when the finger is laid on the polymer substrate. Thermal sensors
register the thermal finger image. In capacitive sensors, the sensor and the finger surfaces
together form a capacitor. The capacity thereof changes based on the skin relief (skin ridges
and grooves). These local changes are measured and thus represent the fingerprint. The
above-mentioned sensors are used in connection with the data-processing module as on-line
systems. They substitute the off-line method in which fingerprints are, for example, taken on
paper before they are digitized later on. Image quality strongly depends on the "contrasts"
that were achieved between the ridges and the adjacent grooves. Since there is a feedback to
image-processing algorithms for on-line methods, it is relatively easy to immediately check
the quality of fingerprint images that were just obtained.
The life image is usually recorded by lightly placing the finger on the surface of the sensor.
Since it is not so user-friendly, the finger's surface is only rolled in the context of AFIS-
systems (as in the dactyloscopic method). Of course, in this case, only such ridges can be
captured that are recorded as a result of being directly in contact with the sensor surface.
Hence, compared to rolled fingerprint images, the life image generates the image of a smaller
section of the finger's surface but, in addition, it might also have smaller distortions of the
image.
Currently, the most frequently used life image technology is the optical method. Upon
placing the finger on the sensor's glass pane (prism), the elevations of the papillary lines are
in contact with the glass; the grooves, on the other hand, are not in contact with it. Basically,
the recording device consists of a light source (LED) and a CCD camera, both of which are
located within the device on the other side of the glass pane. The light of the LED illuminates
54
the glass at a certain angle and the photo-element receives the reflected light. The course of
the beam runs in such a way that the incoming light on the contact ridges is scattered as if on
a mirror surface and then reflected back on the CCD camera. There where the grooves are
behind the glass pane, the light passes through; these spots remain dark. An example for such
a fingerprint image can be seen in the figure shown below.
3.1.4 Pattern Classification :
The global pattern of papillary lines occurring in the central area of the tip of the finger
constitutes a specific configuration, which is sufficient for a rough systematic classification.
For fingerprint classification purposes, only a part of the entire image, called Pattern Area,
is used. The Pattern Area is defined as the inner area, which is limited by two lines, so-called
Type Lines.
55
Two singular points are part of this central area of the fingerprint image:
(a) The delta (several of which may exist; only sample arches do not have deltas)
(b) The nucleus. Delta, which is sometimes also called "outer border”, is usually located at
the fringe of the fingerprint image.
An image of papillary lines is called a delta if it is similar to the Greek capital letter delta. It
is formed by two parting ridges or by a ridge bifurcation and a third ridge that is convex and
coming from another direction. Some examples of a delta configuration are shown in the
figure below.
It is rather hard to define the nucleus of an individual fingerprint due to vast variations in the
curving of the inner lines. Therefore, a specific point is simply chosen as the nucleus as
though it was the center of the corresponding pattern. The following figure shows some
examples of a nucleus configuration.
Another important quantitative factor in classifying images is the number of lines. This means
the number of lines that touch or cross the imaginary connection between the nucleus and the
56
delta. Due to the great complexity of various line configurations, it is often difficult to clearly
determine the number of lines. The following figure shows three simple examples for the
number of lines.
According to the definitions given above, fingerprint categories can be described as follows:
In loops, one or more ridges enter into the central area, they form a curve, touch or cross the
imaginary lines between the delta and the nucleus and return to the same side from which
they came. There are three decisive characteristics for classifying lines as a loop: (a) at least
one suitably curved papillary line, (b) a delta, and (c) a number of lines other than zero.
Depending on the orientation of the line's curve, a differentiation is made between right
(clockwise) and left (anticlockwise) loops. Approximately 60 to 65 % of human fingerprints
belong into this category.
Whorls have at least two deltas. In their nucleus, ridges form a twist. Even though this
definition is very general, it expresses the main characteristic of this category. Whorls can be
split up into further categories: (a) flat whorls, (b) whorls with a medium slant, (c) double
whorls, and (d) random whorls. About 30 to 35 % of all fingerprints belong into this
category.
Arches are a rather special type of fingerprint. Less than 5 % of all fingerprints belong into
this category. Arches can be split up into two categories: (a) flat arches and (b) high arches.
In flat arches, the ridges enter at the side, form moderate and nearly parallel waves in the
center and exit on the opposite side. In high arches, the wave is stronger in the middle. The
route of all lines is no longer parallel and part of the lines seemingly exerts pressure from
below. The following figure shows some examples for individual categories
57
Obviously, due to the vast variation in the spectrum of fingerprints, the classification is
always a big problem both for experts as well as for automatic systems. The allocation into
categories is a very complex task. Dactyloscopy experts need a lot of experience in order to
do their work reliably. The following figure demonstrates examples of fingerprint images,
which are very difficult to classify.
3.1.5 Fingerprint Image Comparison :
Data about the fingerprint category and further global characteristics, such as the number and
position of the centers, deltas, and ridges, does provide enough information for a certain
differentiation of fingerprints. However, the true individuality of fingerprints is determined
by the anatomic characteristics of the ridges (minutiae) and their respective orientation.
Whether they can be recorded in their entirety depends on the conditions when the fingerprint
was taken as well as on its quality. The most frequently occurring minutiae are
• Ridge ending and
• Ridge bifurcation.
Ridge ending defines the end of a line, while ridge bifurcation is defined as a point in the
ridge where the line is separated into two branches. Minutiae are usually stable and robust
with regard to conditions occurring during the scanning process. The below figure shows
some examples. Minutiae can be characterized by their type, by x- and y-coordinates in a
coordinate system, and by their direction.
58
If two fingerprints belong into the same category and have a certain number of identical
minutiae, it is quite safe to say that they come from the same finger.
The general definition for the identicalness of any two fingerprint images consists of four
criteria and says:
• The general pattern configuration has to be identical,
• The minutiae have to be qualitatively identical (qualitative factor),
• The quantitative factor says that a certain number of minutiae must be found
• There has to be a mutual minutiae relationship specifying that corresponding minutiae must
have a mutual relationship. In practice, a large number of complex identification protocols for
fingerprint image comparisons have been proposed. These protocols are derived from the
traditional dactyloscopic methodology and prescribe an exact procedure for trained
specialists.
Even though various protocols differ in the process flow of the comparison procedure and the
definition of the decision, the basic steps remain the same. Typically, comparison is done in
59
an iterative three-phase-process. It is hardest to compare two fingerprints that have similar
feature configurations. If, however, both fingerprints are totally different as far as their
feature configuration is concerned, it is impossible that these images are from the same
finger. In the next step, significant minutiae are examined, the central area is located, and the
minutiae are compared with each other. Afterwards, the decisive comparison of the minutiae
is carried out where all minutiae of the fingerprints are compared with each other. A decision
is made based on identified pairs and their configuration.
Due to variations in fingerprint qualities, not all points are always clear or defined with the
same quality. In such cases, experts use their discretion and experience in deciding whether
images are identical or not. For instance, ridge bifurcations could be identified as ridge
endings if little pressure was exerted in taking the fingerprint. Obviously, the experience of
the experts always plays a certain key role when comparing fingerprints. As an example, the
below figure shows the comparison of 18 such minutiae.
Image of the Fingerprint Identification Procedure
In this section, the individual steps of the application "Fingerprint Image Recognition by
Comparing Minutiae" are documented in pictures.
60
61
CHAPTER - 4
WORKING AND INTERFACING
4.1 SCHEMATIC DIAGRAM :
*
4.2. CIRCUIT DESCRIPTION:
The main intension of this project is to design a Unique Id Card system Design for
Personal Data Transactions. In order to fulfill this application there are few steps that has
been performed i.e.
1) Designing the power supply for the entire circuitry.
2) Selection of microcontroller that suits our application.
3) Selection of smart card.
4) Selection of keypad
62
5) Selection of EEPROM
Complete studies of all the above points are useful to develop this project.
4.2.1 POWER SUPPLY SECTION:
In-order to work with any components basic requirement is power supply. In this
section there is a one required voltage level.
That is
1) 5V DC power supply
Now the aim is to design the power supply section which converts 230V AC in to 5V
DC. Since 230V AC is too high to reduce it to directly 5V DC, therefore we need a step-
down transformer that reduces the line voltage to certain voltage that will help us to convert it
in to a 5V DC. Considering the efficiency factor of the bridge rectifier, we came to a
conclusion to choose a transformer, whose secondary voltage is 3 to 4 V higher than the
required voltage i.e. 5V. For this application 0-9V transformers is used, since it is easily
available in the market.
The output of the transformer is 9V AC; it feed to rectifier that converts AC to
pulsating DC. As we all know that there are 3 kind of rectifiers that is
1) half wave
2) Full wave and
3) Bridge rectifier
Here we short listed to use Bridge rectifier, because half wave rectifier has we less in
efficiency. Even though the efficiency of full wave and bridge rectifier are the same, since
there is no requirement for any negative voltage for our application, we gone with bridge
rectifier.
Since the output voltage of the rectifier is pulsating DC, in order to convert it into pure
DC we use a high value (1000UF/1500UF) of capacitor in parallel that acts as a filter. The
most easy way to regulate this voltage is by using a 7805 voltage regulator, whose output
voltage is constant 5V DC irrespective of any fluctuation in line voltage.
4.2.2 SELECTION OF MICROCONTROLLER:
63
As we know that there so many types of micro controller families that are available in the
market.
Those are
1) 8051 Family
2) AVR microcontroller Family
3) PIC microcontroller Family
4) ARM Family
In this project we are using AVR family micro controller i.e. ATmega8515.
There are minimum five requirements for proper operation of microcontroller.
Those are:
1) power supply section
2) pull-ups for ports
3) Reset circuit
4) Crystal circuit
5) ISP circuit (for program dumping)
4.2.3. SELECTION OF SMART CARD:
A smart card, chip card, or integrated circuit card (ICC), is any pocket-sized card
with embedded integrated circuits which can process data. In my project I am using 1k
memory smart cards for my small application this much size is sufficient. And I selected the
smart card reader which is mostly available in market. And I selected the reader which I can
communicate through serially.
4.3 SELECTION OF KEYPAD:
A keypad is a set of buttons arranged in a block which usually bear digits and other
symbols but not a complete set of alphabetical letters. If it mostly contains numbers then it
can also be called a numeric keypad. Keypads are found on many alphanumeric keyboards
and on other devices such as calculators, combination locks and telephones which require
largely numeric input
4.4 SELECTION OF EEPROM:
EEPROM (also written E2PROM and pronounced "e-e-prom," "double-e prom" or
simply "e-squared") stands for Electrically Erasable Programmable Read-Only Memory and
is a type of non-volatile memory used in computers and other electronic devices to store
small amounts of data that must be saved when power is removed, e.g., calibration tables or
device configuration.
64
When larger amounts of static data are to be stored (such as in USB flash drives) a
specific type of EEPROM such as flash memory is more economical than traditional
EEPROM devices. EEPROM s are realized as arrays of floating-gate transistors.
There are different types of electrical interfaces to EEPROM devices. Main categories
of these interface types are:
Serial bus
Parallel bus
In my application if I use parallel EEPROM I have to use more microcontroller pins which
are unnecessary. That’s why I selected serial I2C based EEPROM.
MICROCONTROLLER CONNECTIONS: To microcontroller all the components like
EEPROM, keypad, smart card and LCD is connected. LCD is connected to PORTA and we
are using 20X4 LCD in 4 bit mode.
EEPROM is connected means SDA of memory is PORT D.4 and SCL is connected
PORTD.5 of the microcontroller. The smart card reader is connected to PD0, PD1 pins and
KEYPAD is connected to PORTC. Here we are using led’s and buzzer for indication
purpose. Red led is connected to PORTB.0, Green led is connected to PORTB.1 and buzzer
is connected to PORTB.3.
DESCRIPTION OF THE PROJECT:
In this project I have 5 modules
1) LCD
2) KEYPAD
3) EEPROM
4) SMART CARD
5) BIOMETRIC MODULE
Using these modules I developed one application. This application is nothing but
UNIQUE ID CARD DESIGN FOR PERSONAL DATA TRANSACTIONS. The main aim
of the project is to develop multiple applications by using single card.
In this application initially system is asking for smartcard. After inserting smartcard,
microcontroller is checking weather card is valid or not. If card is not valid buzzer will ON. If
card is valid one menu is displayed on the LCD. User has to follow the menu with the help of
the keypad. In this we are implementing four different applications. Whenever we are
selecting any option from keypad it is asking one password. We have to enter password from
the keypad. If the password is correct we are entering into selected option. After entering into
selected option user has to follow the instruction.
65
CHAPTER – 5
ADVANTAGES, DISADVANTAGES AND APPLICATION
5.1 ADVANTAGES:
Every citizen of the country is accounted. All the information about that person
can be saved in the smartcard and can be accessed and updated when needed.
If this smart card has more information like health record, travel details (Check at
immigration, airports, and hotels) this will be of great use.
This will really boost the IT infrastructure of the country, for instance every hotel
or every shop should be connected to this system and records of every citizen should
be updated. This can be very helpful in keeping a watch or tracking security issues.
Right now we have many identification systems, like the Voters card, Passport,
Driving license, but once this system is introduced, we should follow one and only
Identification system and this should be the Unique Identification Smart Card. For
every purpose the card should be access, checked and updated.
No need to carry health records if the card has a provision to store health records.
Every prime location should be identified (Like Airports, Railway stations,
Hotels, Universities and the entry should be secured through these smart cards.
Updates from different departments – Suppose the IT department wants to update
you about your returns they can do it from their system and when you read your card
you get the updates.
5.2 DISADVANTAGE:
While smart card technology is designed to keep personal information encrypted and secure, security breaches are still a potential threat.
Physical damage, such as scratches to magnetic strips, can render cards unreadable.
Unusual changes in electrical voltage can likewise erase or change information from smart cards, as can heat or exposure to strong UV rays.
Thieves attempting to access others' cards have exploited these shortcomings.
66
Some attacks on smart cards have involved physical removal of memory processors, which can then be reverse-engineered.
Continuing advances in smart card technology, however, are making newer cards less vulnerable to such attacks.
5.3 APPLICATIONS:
The most common smart card applications are:
Credit cards
Personal identity
Electronic cash
Computer security systems
Wireless communication
Loyalty systems (like frequent flyer points)
Banking
Satellite TV
Government identification
5.4 FUTURE SCOPE:
Introduction of secured hybrid network which can unify banking networks, personal details
like adaar card, driving license, student college id, pan card, voter id card etc..,makes it an
easily carried electronic wallet.
67
CHAPTER-6
CODING
//*************************************************************//
//*** UNIQUE ID CARD DESIGN FOR PERSONAL DATA TRANSACTIONS ****//
//*************************************************************//
#include<reg51.h>
#include<string.h>
#include"20x4lcd.h"
#include"uart.h"
#include "eeprom1.h"
sbit sw = P3^5;
sbit row0 = P2^0;
sbit row1 = P2^1;
sbit row2 = P2^2;
sbit row3 = P2^3;
sbit col0 = P2^4;
sbit col1 = P2^5;
sbit col2 = P2^6;
unsigned char Cnt;
unsigned char key[4][3] = { '1', '2', '3',
'4', '5', '6',
'7', '8', '9',
'*', '0', '#'};
unsigned char ckey,r;
unsigned char keypad();
sbit enrol = P3^6;
sbit identifysw = P3^7;
sbit smartcard = P3^2;
sbit fpmodule = P3^3;
sbit buz = P2^7;
unsigned char i=0,fp[20],smartcarden=0;
unsigned char rec=0x00,dummy=0x0f,id,usernum=0;
unsigned char enroll_finger(void);
68
unsigned char identify_finger(void);
code unsigned char
enroll[12]={0xEF,0X01,0XFF,0XFF,0XFF,0XFF,0X01,0X00,0X03,0X01,0X00,0X05}; //
ok
code unsigned char
generate_ch[13]={0xEF,0X01,0XFF,0XFF,0XFF,0XFF,0X01,0X00,0X04,0x02,0X01,0X00,
0X08};
generate_ch1[13]={0xEF,0X01,0XFF,0XFF,0XFF,0XFF,0X01,0X00,0X04,0x02,0X02,0X0
0,0X09};
code unsigned char un_cmd[12]={0xef,0x01,0xff,0xff,0xff,0xff,
0x01,0x00,0x03,0x05,0x00,0x09 };
code unsigned char
store[12]={0xEF,0X01,0XFF,0XFF,0XFF,0XFF,0X01,0X00,0X06,0X06,0X02,0x00};
code unsigned char
identify[17]={0xef,0x01,0xff,0xff,0xff,0xff,0x01,0x00,0x08,0x1b,0x01,0x00,0x00,0x01,0x0
1,0x00,0x27};
idata unsigned char
buf[50],ch,ch1,j=0,count1=0,count2=0,PA,PB,PC,PD,count,tempdata[10],psw[10],key1;
unsigned int balance,amount;
unsigned char keypad()
{
unsigned char K,c0,c1,c2,r=0;
while(1)
{
row0=0x00;
row1=0x00;
row2=0x00;
row3=0x00;
col0=0x01;
col1=0x01;
col2=0x01;
do
{
c0=col0;
69
c1=col1;
c2=col2;
}while((c0!=0x01)||(c1!=0x01)||(c2!=0x01)); // To check all keys are relesead or not
do
{
c0=col0;
c1=col1;
c2=col2;
}while((c0==0x01)&&(c1==0x1)&&(c2==0x01)); // To check any key is pressed or not
while(1)
{
row0=0x00; // If row0 is pressed
row1=0x01;
row2=0x01;
row3=0x01;
c0=col0;
c1=col1;
c2=col2;
if((c0!=1)||(c1!=1)||(c2!=1))
{
r=0;
break;
}
row0=1;
row1=0;
row2=1;
row3=1;
c0=col0;
c1=col1;
c2=col2;
if((c0!=1)||(c1!=1)||(c2!=1))
{
r=1;
70
break;
}
row0=1;
row1=1;
row2=0;
row3=1;
c0=col0;
c1=col1;
c2=col2;
if((c0!=0x01)||(c1!=0x01)||(c2!=0x01))
{
r=2;
break;
}
row0=1;
row1=1;
row2=1;
row3=0;
c0=col0;
c1=col1;
c2=col2;
if((c0!=1)||(c1!=1)||(c2!=1))
{
r=3;
break;
}
}
if((c0==0)&&(c1==1)&&(c2==1))
{
K=key[r][0];
return K;
}
else
if((c0==1)&&(c1==0)&&(c2==1))
71
{
K=key[r][1];
return K;
}
else
{
K=key[r][2];
return K;
}
}
}
void convert(unsigned int temp1_value)
{
unsigned int value,d1,d2,d3;
value=temp1_value/10;
d3=temp1_value%10;
d1=value/10;
d2=value%10;
lcddata(d1+48);
lcddata(d2+48);
lcddata(d3+48);
}
void serial(void) interrupt 4
{
if(RI)
{
if(smartcarden==1)
{
if((SBUF !=13)&&(SBUF != 10))
{
buf[j] = SBUF;
ch=buf[j];
j++;
}
72
}
else
{
fp[j]= SBUF;
j++;
}
RI = 0;
}
}
void clearfp(void)
{
unsigned char cl=0;
while(cl<20)
{
fp[cl]=' ';
cl++;
}
j=0;
}
void main()
{
UART_init();
delay(50);
buz=1;
lcd_init();
delay(50);
lcdcmd(0x84);
msgdisplay(" WELCOME " );
delay(500);
eeprom_write(0,'1');
delay(200);
eeprom_write(1,'2');
delay(200);
eeprom_write(2,'3');
73
delay(200);
eeprom_write(3,'*');
delay(200);
eeprom_write(10,'4');
delay(200);
eeprom_write(11,'5');
delay(200);
` eeprom_write(12,'6');
delay(200);
eeprom_write(13,'*');
delay(200);
eeprom_write(20,'7');
delay(200);
eeprom_write(21,'8');
delay(200);
eeprom_write(22,'9');
delay(200);
eeprom_write(23,'*');
delay(200);*/
start:
TH1=-6;
smartcard=1;
fpmodule=0;
smartcarden=0;
EA =1;
ES =1;
back:
delay(100);
lcdcmd(0x01);
msgdisplay("SMART CARD BASE" );
lcdcmd(0xC0);
msgdisplay("MULTIPURPOSE CARD" );
delay(1000);
usernum=0;
74
while(1)
{
if(enrol == 0) //checking for enrolling
{
while(enrol == 0);
lcdcmd(1);
msgdisplay("Enrolling");
enroll_finger();
goto back;
}
if(identifysw == 0) //identify
{
while(identifysw == 0);
lcdcmd(1);
msgdisplay("Identification");
if(!identify_finger())
goto back;
else
goto start1;
//goto again;
}
}
start1:
lcdcmd(0x01);
msgdisplay("INSERT CARD" );
//delay(500);
TH1=-3;
fpmodule=1;
smartcard=0;
smartcarden=1;
delay(500);
j=0;
while(j==0)
{
75
if(sw == 0)
{
lcdcmd(1);
msgdisplay("1 -> USER1");
lcdcmd(0xc0);
msgdisplay("2 -> USER2");
lcdcmd(0x94);
msgdisplay("3 -> POLLING OFFICER");
while(sw == 0);
ckey = keypad();
delay(300);
if(ckey == '*')
{
lcdcmd(1);
msgdisplay("1 -> USER1");
lcdcmd(0xc0);
msgdisplay("2 -> USER2");
lcdcmd(0x94);
msgdisplay("3 -> POLLING OFFICER");
lcdcmd(0x8c);
for(i=0;eeprom_read(i)!='*';i++)
lcddata(eeprom_read(i));
lcdcmd(0xcc);
for(i=10;eeprom_read(i)!='*';i++)
lcddata(eeprom_read(i));
lcdcmd(0xd4);
for(i=20;eeprom_read(i)!='*';i++)
lcddata(eeprom_read(i));
delay(2500);
goto start;
}
key1 = ckey;
zc:
lcdcmd(1);
76
msgdisplay("ENTER OLD PASSWORD:");
delay(200);
lcdcmd(0xc0);
i=0;
while(1)
{
zy:
ckey = keypad();
if(ckey == '#')
{
tempdata[i] = '\0';
break;
}
else
if(ckey == '*')
{
if(i == 0)
goto zy;
i=i-1;
lcdcmd(0x10);
lcddata(' ');
lcdcmd(0x10);
}
else
{
tempdata[i] = ckey;
i=i+1;
lcddata('*');
delay(300);
}
}
/************ USER1 ***************/
77
if(key1 == '1')
{
j=0;
for(i=0;eeprom_read(i) != '*';i++)
{
psw[j] = eeprom_read(i);
j++;
delay(200);
}
psw[j] = '\0';
delay(300);
if(!(strcmp(psw,tempdata)))
goto new;
else
goto xz;
}
/************ USER2 ***************/
if(key1 == '2')
{
j=0;
for(i=10;eeprom_read(i) != '*';i++)
{
psw[j] = eeprom_read(i);
j++;
delay(200);
}
psw[j] = '\0';
delay(300);
if(!(strcmp(psw,tempdata)))
goto new;
else
goto xz;
78
}
/************ POLLING OFFICER ***************/
if(key1 == '3')
{
j=0;
for(i=20;eeprom_read(i) != '*';i++)
{
psw[j] = eeprom_read(i);
j++;
delay(200);
}
psw[j] = '\0';
delay(300);
if(!(strcmp(psw,tempdata)))
goto new;
else
goto xz;
}
else
goto zc;
new:
lcdcmd(0x94);
msgdisplay("ENTER NEW PASSWORD:");
delay(200);
lcdcmd(0xd4);
i=0;
while(1)
{
zy1:
ckey = keypad();
if(ckey == '#')
{
psw[i] = '\0';
79
break;
}
else
if(ckey == '*')
{
if(i == 0)
goto zy1;
i=i-1;
lcdcmd(0x10);
lcddata(' ');
lcdcmd(0x10);
}
else
{
psw[i] = ckey;
i=i+1;
lcddata('*');
delay(300);
}
}
/************ USER1 ***************/
if(key1 == '1')
{
for(i=0;psw[i] != '\0';i++)
{
eeprom_write(i,psw[i]);
delay(300);
}
eeprom_write(i,'*');
delay(300);
lcdcmd(0xd4);
msgdisplay("PSWD CHANGED");
80
delay(1000);
goto start;
}
/************ USER2 ***************/
else
if(key1 == '2')
{
i=10;
for(j=0;psw[j] != '\0';j++)
{
eeprom_write(i,psw[j]);
delay(300);
i++;
}
eeprom_write(i,'*');
delay(300);
lcdcmd(0xd4);
msgdisplay("PSWD CHANGED");
delay(1000);
goto start;
}
/************ POLLING OFFICER ***************/
else
if(key1 == '3')
{
i=20;
for(j=0;psw[j] != '\0';j++)
{
eeprom_write(i,psw[j]);
delay(300);
i++;
}
eeprom_write(i,'*');
81
delay(300);
lcdcmd(0xd4);
msgdisplay("PSWD CHANGED");
delay(1000);
goto start;
}
else
goto start;
xz:
buz=0;
lcdcmd(0x94);
msgdisplay("WRONG PASSWORD");
delay(1500);
buz=1;
goto start;
}
}
delay(1000);
buf[j]='\0';
j=0;
lcdcmd(0x01);
msgdisplay("Card Testing..");
delay(100);
if(!strcmp(buf,"Enter password:"))
{
delay(500);
lcdcmd(0xC0);
//lcddata('1');
j=0;
send_to_modem("EES"); //ENTER SECURITY CODE
ch_send_to_modem(13);
ch_send_to_modem(10);
while(j==0);
delay(500);
82
lcdcmd(0x01);
msgdisplay("CARD ACCEPTED..");
delay(500);
j=0;
send_to_modem("READ 50 1"); //READING THE DATA
ch_send_to_modem(13);
ch_send_to_modem(10);
delay(200);
ch1=ch;
/*************** USER1 *************/
if((ch1 == 'A')&&(usernum==1))
{
count = 1;
count1=count1+1;
lcdcmd(1);
msgdisplay("CARD AUTHORIZED");
delay(800);
lcdcmd(0xc0);
msgdisplay("ENTER PASSWORD:");
delay(200);
lcdcmd(0x94);
i=0;
while(1)
{
ckey = keypad();
delay(200);
if(ckey == '#')
{
tempdata[i]='\0';
break;
}
else if(ckey == '*')
{
83
lcdcmd(0x10);
i--;
psw[i] = ckey;
}
else
{
tempdata[i] = ckey;
lcddata('*');
//lcddata(ckey);
i++;
}
}
j=0;
for(i=0;eeprom_read(i) != '*';i++)
{
psw[j] = eeprom_read(i);
j++;
}
psw[j]='\0';
if(strcmp(tempdata,psw))
{
count1--;
buz=0;
lcdcmd(0x01);
msgdisplay("WRONG PSWD: ");
delay(1500);
buz=1;
goto end;
}
}
/*************** USER2 *************/
else
if((ch1 == 'B')&&(usernum==2))
84
{
count = 2;
count2=count2+1;
lcdcmd(1);
msgdisplay("CARD AUTHORIZED");
delay(800);
lcdcmd(0xc0);
msgdisplay("ENTER PASSWORD:");
delay(200);
lcdcmd(0x94);
i=0;
while(1)
{
ckey = keypad();
delay(200);
if(ckey == '#')
{
tempdata[i]='\0';
break;
}
else if(ckey == '*')
{
lcdcmd(0x10);
i--;
psw[i] = ckey;
}
else
{
tempdata[i] = ckey;
lcddata('*');
//lcddata(ckey);
i++;
}
}
85
j=0;
for(i=10;eeprom_read(i) != '*';i++)
{
psw[j] = eeprom_read(i);
j++;
}
psw[j]='\0';
if(strcmp(tempdata,psw))
{
count2--;
buz=0;
lcdcmd(0x01);
msgdisplay("WRONG PSWD: ");
delay(1500);
buz=1;
goto end;
}
}
/*************** POLLING OFFICER *************/
else
if((ch1 == 'C')&&(usernum==3))
{
lcdcmd(1);
msgdisplay("WELCOME TO");
delay(800);
lcdcmd(0xc0);
msgdisplay("POLLING OFFICER:");
lcdcmd(0x94);
msgdisplay("ENTER PASSWORD:");
delay(200);
lcdcmd(0xD4);
i=0;
while(1)
{
86
ckey = keypad();
delay(200);
if(ckey == '#')
{
tempdata[i]='\0';
break;
}
else if(ckey == '*')
{
lcdcmd(0x10);
i--;
psw[i] = ckey;
}
else
{
tempdata[i] = ckey;
lcddata('*');
//lcddata(ckey);
i++;
}
}
j=0;
for(i=20;eeprom_read(i) != '*';i++)
{
psw[j] = eeprom_read(i);
j++;
}
psw[j]='\0';
if(strcmp(tempdata,psw))
{
count2--;
buz=0;
lcdcmd(0x01);
msgdisplay("WRONG PSWD: ");
87
delay(1500);
buz=1;
goto end;
}
lcdcmd(1);
msgdisplay("PA PB PC");
lcdcmd(0xd4);
convert(PA);
lcdcmd(0xda);
convert(PB);
lcdcmd(0xe0);
convert(PC);
delay(2500);
PA=PB=PC=0;
goto end;
}
else
{
buz=0;
lcdcmd(1);
msgdisplay("CARD ");
lcdcmd(0xc0);
msgdisplay(" UNAUTHORIZED");
delay(1500);
buz=1;
goto end;
}
lcdcmd(1);
lcdcmd(0x80);
msgdisplay("1: POLLING UR VOTE ");
lcdcmd(0XC0);
msgdisplay("2: BANKING TRANS");
lcdcmd(0XD0);
msgdisplay("ACTN");
88
lcdcmd(0X94);
msgdisplay("3: PERSONEL INFORMAT");
ckey = keypad();
//lcddata(ckey);
delay(300);
if(ckey == '1')
goto voting;
else
if(ckey == '2')
goto banking;
else
if(ckey == '3')
goto personal;
else
{
buz=0;
lcdcmd(1);
msgdisplay("WRONG TASK");
delay(1000);
buz=1;
goto end;
}
}
else
{
buz=0;
lcdcmd(0x01);
msgdisplay("Card Error");
lcdcmd(0xc0);
msgdisplay("Re Insert Card");
j=0;
while(j==0);
buz=1;
delay(1000);
89
goto start;
}
voting:
if(count == 1)
{
lcdcmd(1);
msgdisplay("WELCOME USER1:");
delay(500);
}
if(count == 2)
{
lcdcmd(1);
msgdisplay("WELCOME USER2:");
delay(500);
}
if(count1 >= 2)
{
buz=0;
count1 = 0;
lcdcmd(1);
msgdisplay("NO PERMISSION");
lcdcmd(0xc0);
msgdisplay("FOR SECOND TIME");
delay(1500);
buz=1;
goto end;
}
if(count2 >= 2)
{
buz=0;
count2 = 0;
lcdcmd(1);
msgdisplay("NO PERMISSION");
lcdcmd(0xc0);
90
msgdisplay("FOR SECOND TIME");
delay(1500);
buz=1;
goto end;
}
lcdcmd(0xc0);
msgdisplay("PLZ POLL UR VOTE");
//delay(500);
ckey=keypad();
//lcddata(ckey);
//delay(300);
if(ckey == '1')
{
PA++;
lcdcmd(0x94);
msgdisplay("VOTE FOR PARTY A");
delay(1000);
goto end;
}
else
if(ckey == '2')
{
PB++;
lcdcmd(0x94);
msgdisplay("VOTE FOR PARTY B");
delay(1000);
goto end;
}
else
if(ckey == '3')
{
PC++;
lcdcmd(0x94);
msgdisplay("VOTE FOR PARTY C");
91
delay(1000);
goto end;
}
else
goto end;
banking:
if(count1 > 0)
count1=count1-1;
if(count2>0)
count2=count2-1;
if(count == 1)
{
lcdcmd(1);
msgdisplay("WELCOME USER1:");
}
if(count == 2)
{
lcdcmd(1);
msgdisplay("WELCOME USER2:");
}
delay(500);
lcdcmd(1);
msgdisplay("1:WITH DRAWL");
lcdcmd(0xc0);
msgdisplay("2:MINI STATEMENT");
lcdcmd(0x94);
msgdisplay("3:DEPOSIT AMOUNT");
lcdcmd(0xd4);
msgdisplay("SELECT TASK:");
delay(500);
ckey=keypad();
//lcddata(ckey);
92
delay(300);
if(ckey=='2')
{
j=0;
send_to_modem("READ 40 1"); //READING THE DATA
ch_send_to_modem(13);
ch_send_to_modem(10);
while(j==0);
lcdcmd(0x01);
msgdisplay("Avl Balance");
lcddata(' ');
balance=buf[0]*10;
lcdcmd(0xc3);
convert(balance);
msgdisplay("/-");
delay(1000);
goto end;
}
else
if(ckey=='1')
{
j=0;
send_to_modem("READ 40 1"); //READING THE DATA
ch_send_to_modem(13);
ch_send_to_modem(10);
while(j==0);
lcdcmd(0x01);
msgdisplay("Avl Balance");
lcddata(' ');
balance=buf[0]*10;
if(balance==10)
{
buz=0;
delay(1000);
93
lcdcmd(0x01);
msgdisplay("N0 Balance..");
lcdcmd(0xC0);
msgdisplay("PLS RECHARGE");
delay(1000);
buz=1;
goto end;
}
convert(balance);
j=0;
lcdcmd(0xC0);
msgdisplay("ENTER AMOUNT:");
i=0;
amount=0;
while(1)
{
tempdata[i]=keypad();
if((tempdata[i]=='#')||(tempdata[i]=='*'))
{
tempdata[i]='\0';
break;
}
lcddata(tempdata[i]);
amount=amount*10+tempdata[i]-48;
delay(100);
i=i+1;
}
delay(1000);
if(amount<=balance)
{
balance=balance-amount;
balance=balance/10;
if(balance==0)
balance=1;
94
j=0;
send_to_modem("WRITE 40 "); //READING THE DATA
ch_send_to_modem(balance);
ch_send_to_modem(13);
ch_send_to_modem(10);
while(j==0);
delay(1000);
goto end;
}
Else
{
buz=0;
lcdcmd(0x01);
msgdisplay("INSUFFICEINT BAL");
delay(1000);
buz=1;
buz=1;
goto end;
}
}
else
if(ckey=='3')
{
lcdcmd(0x01);
msgdisplay("AMOUNT DEPOSIT");
lcdcmd(0xC0);
msgdisplay("IN UR ACCOUNT");
delay(500);
j=0;
send_to_modem("WRITE 40 "); //READING THE DATA
ch_send_to_modem(80);
ch_send_to_modem(13);
ch_send_to_modem(10);
while(j==0);
95
delay(1000);
goto end;
}
else
{
buz=0;
lcdcmd(0x01);
msgdisplay("WRONG ");
lcdcmd(0xc0);
msgdisplay(" TRANSACTION ");
delay(1500);
buz=1;
goto end;
}
personal:
if(count1 > 0)
count1=count1-1;
if(count2>0)
count2=count2-1;
if(count == 1)
{
lcdcmd(1);
msgdisplay("READING...");
j=0;
send_to_modem("READ 70 25"); //READING THE DATA
ch_send_to_modem(13);
ch_send_to_modem(10);
delay(1500);
buf[j]='\0';
j=0;
/*lcdcmd(1);
msgdisplay(buf);
delay(1500); */
Cnt=0;
96
lcdcmd(1);
/* for(i=0;buf[i] != '\0';i++)
{
if(buf[i] == ' ')
{
Cnt= Cnt+1;
if(Cnt == 1)
lcdcmd(0xc0);
if(Cnt == 2)
lcdcmd(0x94);
if(Cnt == 3)
lcdcmd(0xd4);
i++;
}
lcddata(buf[i]);
} */
delay(2500);
lcdcmd(1);
msgdisplay("K.Srikanth");
lcdcmd(0xc0);
msgdisplay("Reg. no:11099C054");
lcdcmd(0x94);
msgdisplay("B.E, ECE IV year");
lcdcmd(0xd4);
msgdisplay("SCSVMV UNIVERSITY");
delay(1500);
goto end;
}
if(count == 2)
{
lcdcmd(1);
msgdisplay("READING...");
j=0;
97
send_to_modem("READ 70 26"); //READING THE DATA
ch_send_to_modem(13);
ch_send_to_modem(10);
delay(1500);
buf[j]='\0';
j=0;
/*lcdcmd(1);
msgdisplay(buf);
delay(1500); */
Cnt=0;
lcdcmd(1);
/*
for(i=0;buf[i] != '\0';i++)
{
if(buf[i] == ' ')
{
Cnt= Cnt+1;
if(Cnt == 1)
lcdcmd(0xc0);
if(Cnt == 2)
lcdcmd(0x94);
if(Cnt == 3)
lcdcmd(0xd4);
i++;
}
lcddata(buf[i]);
} */
delay(2500);
msgdisplay("CH.Uday Kiran");
lcdcmd(0xc0);
msgdisplay("Reg. no:11099C021");
lcdcmd(0x94);
msgdisplay("B.E, ECE IV year");
lcdcmd(0xd4);
98
msgdisplay("SCSVMV UNIVERSITY");
delay(1500);
goto end;
}
end:
lcdcmd(0x01);
j=0;
msgdisplay("PLZ REMOVE CARD");
buz=1;
while(j==0);
delay(2000);
lcdcmd(0xc0);
msgdisplay("THANK YOU!!!");
delay(1000);
goto start;
}
unsigned char enroll_finger(void)
{
i=0;
clearfp();
while(i<12)
{
ch_send_to_modem(enroll[i]);
i++;
}
j=0;
fp[9]=0x01;
while(j==0);
delay(200);
if(fp[9]==0x00)
{
}
99
else
{
lcdcmd(0xc0);
msgdisplay("ENROLL FAILED");
buz = 0;
delay(800);
buz =1;
//goto end;
return 0;
}
clearfp();
j=0;
i=0;
while(i<13)
{
ch_send_to_modem(generate_ch[i]);
i++;
}
j=0;
fp[9]=0x01;
while(j==0);
delay(200);
if(fp[9]==0x00)
{
}
else
{
lcdcmd(0xc0);
msgdisplay("ENROLL FAILED");
buz = 0;
delay(500);
buz =1;
delay(200);
delay(200);
100
//goto end;
return 0;
}
i=0;
clearfp();
while(i<12)
{
ch_send_to_modem(enroll[i]);
i++;
}
j=0;
fp[9]=0x01;
while(j==0);
delay(200);
if(fp[9]==0x00)
{
}
else
{
lcdcmd(0xc0);
msgdisplay("ENROLL FAILED");
buz = 0;
delay(500);
buz =1;
delay(200);
delay(200);
//goto end;
return 0;
}
clearfp();
j=0;
i=0;
while(i<13)
101
{
ch_send_to_modem(generate_ch1[i]);
i++;
}
j=0;
fp[9]=0x01;
while(j==0);
delay(200);
if(fp[9]==0x00)
{
}
else
{
lcdcmd(0xc0);
msgdisplay("ENROLL FAILED");
buz = 0;
delay(500);
buz =1;
delay(200);
delay(200);
//goto end;
return 0;
}
clearfp();
j=0;
i=0;
while(i<12)
{
ch_send_to_modem(un_cmd[i]);
i++;
}
j=0;
fp[9]=0x01;
while(j==0);
102
delay(200);
if(fp[9]==0x00)
{
}
else
{
lcdcmd(0xc0);
msgdisplay("ENROLL FAILED");
buz = 0;
delay(500);
buz =1;
delay(200);
delay(200);
//goto end;
return 0;
}
clearfp();
j=0;
i=0;
while(i<12)
{
ch_send_to_modem(store[i]);
i++;
}
ch_send_to_modem(rec);
ch_send_to_modem(0x00);
ch_send_to_modem(dummy);
j=0;
fp[9]=0x01;
while(j==0);
delay(200);
if(fp[9]==0x00)
{
lcdcmd(0x01);
103
msgdisplay("successfully ");
lcdcmd(0xc0);
msgdisplay("Enrolled ");
delay(200);
if(rec==0)
msgdisplay("User1");
if(rec==1)
msgdisplay("User2");
if(rec==2)
{
lcdcmd(0x94);
msgdisplay("Polling officer");
}
buz=0;
delay(100);
buz=1;
rec++;
dummy++;
delay(200);
delay(200);
//goto end;
return 1;
}
else
{
lcdcmd(0xc0);
msgdisplay("ENROLL FAILED");
delay(200);
buz = 0;
delay(500);
buz =1;
delay(200);
delay(200);
104
//goto end;
//goto end;
return 0;
}
//end:
//delay(10);
}
unsigned char identify_finger(void)
{
i=0;
clearfp();
while(i<12)
{
ch_send_to_modem(enroll[i]);
i++;
}
j=0;
fp[9]=0x01;
while(j==0);
delay(200);
if(fp[9]==0x00)
{
}
else
{
lcdcmd(0xc0);
msgdisplay("UnAuthorized....");
delay(200);
buz = 0;
delay(500);
buz =1;
ES=0;
//goto
return 0;
105
}
clearfp();
j=0;
i=0;
while(i<13)
{
ch_send_to_modem(generate_ch[i]);
i++;
}
j=0;
fp[9]=0x01;
while(j==0);
delay(200);
if(fp[9]==0x00)
{
}
else
{
lcdcmd(0xc0);
msgdisplay("UnAuthorized....");
delay(200);
buz = 0;
delay(500);
buz =1;
ES=0;
//goto end;
return 0;
}
clearfp();
i=0;
j=0;
while(i<17)
{
ch_send_to_modem(identify[i]);
106
i++;
}
j=0;
while(j==0);
delay(200);
if(fp[9]==0x00)
{
lcdcmd(0x01);
msgdisplay("Successfully ");
lcdcmd(0xc0);
msgdisplay("Identified User:");
usernum=fp[11]+1;;
lcddata(fp[11]+49);
buz=0;
delay(100);
buz=1;
delay(200);
delay(200);
//goto end;
return 1;
}
else
{
lcdcmd(0xc0);
msgdisplay("UnAuthorized....");
delay(200);
buz = 0;
delay(500);
buz =1;
ES=0;
delay(200);
//goto end;
return 0;
}
107
//end:
//delay(10);
}
CONCLUSION:
Finally we would like to aim at:
108
Increasing Security.
Excluding Sophisticated communication systems.
Reduction of cyber crime.
Minimizing cards usage.
Smart card are now being deployed that recognize this vulnerability and are making a
significance impact in promoting social inclusion.With this new methodology we
wish to eradicate cyber crime and our vision is to multiplex ‘n’ number of cards such
as credit/ATM cards, pan card, passport, driving licence etc into a single unique card.
References:
“ATMEL 8051 micro controller primer “ by Steven F.Barret & Daniel J.Pack.
IETE (The Institute of Electronics And Telecommunication and Communication
Engineers),
Hyderabad.
Guidance Under P.Shyam Sundar Sir, (RESEARCH & DEVELOPMENT Dept),
OSMANIA University.
“ Embedded Systems “ by Raj Kamal
microcontroller and c compiler design PDF retrieved 2012-09-19
Maxim max 232 DATASHEET PDF
BUZZER- Wikipedia
Electronic components – Resistors inspectors technical guide
How stuff works.com – how capacitors work
‘The life and times of LED- a 100 year history’ the optoelectronics research centre.
8051 Core overview – Open cores .retrieved 2012 -9- 19