staff attendance using rfid module

Upload: anand-cool

Post on 04-Apr-2018

224 views

Category:

Documents


1 download

TRANSCRIPT

  • 7/30/2019 Staff Attendance using RFID module

    1/44

    Anurag Engineering College

    Department of ECE 1

    1. INTRODUCTION

    In the present scenario the two major problems faced by organizations are time

    consuming manual attendance and wastage of electrical power. Our project is going to solve

    these problems by using RFID technology.

    The aim of this project is to take the attendance of staff members in a college very

    easily by using their ID cards. We are going to give RFID cards for each and every staff

    member. Whenever person with RFID card has reached the RFID reader then details of staff

    members will be displayed on a LCD and will be recorded. Radio Frequency Identification

    (RFID) is an automatic identification method, relying on storing and remotely retrieving data

    using devices called RFID tags or transponders. So the RFID is a wireless identification.Normally the RFID system comprises of two main parts: RFID Reader and RFID Tag.

    RFID Reader is an integrated or passive network which is used to interrogate

    information from RFID tag (RFID tags contain antennas to enable them to receive and

    respond to radio-frequency queries from an RFID transceiver). The RFID Reader may consist

    of antenna, filters, modulator, demodulator, coupler and a micro processor.

    RFID tags are categorized as either active or passive. Active RFID tags are

    powered by an internal battery and are typically read/write, i.e., tag data can be rewritten

    and/or modified. An active tag's memory size varies according to application requirements;

    some systems operate with up to 1MB of memory. Passive RFID tags operate without a

    separate external power source and obtain operating power generated from the reader. This

    project uses passive tags. Read-only tags are typically passive and are programmed with a

    unique set of data (usually 32 to 128 bits) that cannot be modified.

    The significant advantage of all types of RFID systems is the non contact, non-

    line-of-sight nature of the technology. Tags can be read through a variety of substances such

    as snow, fog, ice, paint, crusted grime. The RF transmitter present in the RFID tag

    continuously transmits the ID number containing in the tag. This ID number will be written

    by the user initially. The RFID reader will be present with the user. Whenever the user wishes

    to know the details of particular product, he has to bring the product near the RFID reader.

    The signal strength at the receiver end increases when the object, along with the tag, is

    brought near the read.Thus the reader reads the tag information and passes the data to the

    controlling unit. The microcontroller displays the information related to that object on the

    LCD.

  • 7/30/2019 Staff Attendance using RFID module

    2/44

    Anurag Engineering College

    Department of ECE 2

    1.1 Objective of the project

    The project aims to make thing easy in colleges and companies etc using RFID

    technology. The project uses the RFID technology and Embedded Systems to design this

    application. The main objective of this project is to design a system which fixes a tag for

    every object and when the user wants to know the details of the object, he has to bring this

    object near the RFID reader, so that the reader reads the tag information and displays the

    entire information of the object on the LCD.

    This project is a device that collects data from the tag and codes the data into a

    format that can be understood by the controlling section. This system also collects

    information from the master device and implements commands that are directed by the

    master.

    The objective of the project is to develop a microcontroller based display system. It

    consists of a RFID reader, microcontroller, the interfacing unit to allow the communication

    between the microcontroller and RFID module, switch and the LCD.

    1.2Back ground of the projectThe software application and the hardware implementation help the microcontroller

    read the data from the RFID tag fixed to the object and display the details of the object on the

    LCD. The system is totally designed using RFID and embedded systems technology.

    The Controlling unit has an application program to allow the microcontroller interface

    with the RFID reader, allows the RFID reader to read the data from the tag, pass the data to

    the microcontroller and the controller displays the information of the object, by taking the

    details of the object from the EEPROM, on the LCD. EEPROM is used to store the details of

    the object with an unique code. Thus, the user can find the objects in a more easy way and the

    details associated to it. The performance of the design is maintained by controlling unit.

    1.3 Introduction to RFID technology

    In recent years, radio frequency identification technology has moved from obscurity

    into mainstream applications that help speed the handling of manufactured goods and

    materials. RFID enables identification from a distance and unlike earlier bar-code

    technology; it does so without requiring a line of sight. RFID tags support a larger set of

  • 7/30/2019 Staff Attendance using RFID module

    3/44

    Anurag Engineering College

    Department of ECE 3

    unique IDs than bar codes and can incorporate additional data such as manufacturer, product

    type and even measure environmental factors such as temperature. Furthermore, RFID

    systems can discern many different tags located in the same general area without human

    assistance.

    Fig.1.1: Three different RFID tags they come in all shapes and sizes.

    Definition of RFID technology:

    Radio frequency identification (RFID) is a general term that is used to describe a

    system that transmits the identity (in the form of a unique serial number) of an object

    wirelessly using radio waves. RFID technologies are grouped under the more generic

    Automatic Identification (Auto ID) technologies.

    RFIDTags:

    Tags also sometimes are called transponders. RFID tags can come in many forms

    and sizes. Some can be as small as a grain of rice. Data is stored in the IC and transmitted

    through the antenna to a reader. The two commonly used RFID Transponders [2] are Active

    (that do contain an internal battery power source that powers the tags chip) and Passive (that

    do not have an internal power source, but are externally powered typical from the reader)

    RFID Transponders.

  • 7/30/2019 Staff Attendance using RFID module

    4/44

    Anurag Engineering College

    Department of ECE 4

    RFID Reader:

    A reader (now more typically referred to as an RFID interrogator) is basically a radio

    frequency (RF) transmitter and receiver, controlled by a microprocessor or digital signal

    processor. The reader, using an attached antenna, captures data from tags, then passes the

    data to a computer for processing. The reader decodes the data encoded in the tag(s)

    integrated circuit (silicon chip) and the data is passed to the host computer for processing.

    Working of RFID:

    Information is sent to and read from RFID tags by a reader using radio waves. Inpassive systems, which are the most common, an RFID reader transmits an energy field that

    wakes up the tag and provides the power for the tag to respond to the reader. Data collected

    from tags is then passed through communication interfaces (cable or wireless) to host

    computer systems in the same manner that data scanned from bar code labels is captured and

    passed to computer systems for interpretation, storage, and action.

  • 7/30/2019 Staff Attendance using RFID module

    5/44

    Anurag Engineering College

    Department of ECE 5

    2. LITERATURE SURVEY

    During the research, we have encountered various type of automatic attendance system

    depending on different technologies like barcode and biometric. Details of such systems are

    follows:

    2.1 Existing Systems

    Attendance Recording System manufactured by Fortuna Impex Pvt. Ltd.

    This system is using Bar Code technology for attendance recording. It combines a

    proximity bar code reader, touch pad for inputting a PIN, and fingerprint reader, to give

    businesses a fool proof method for preventing unauthorized personnel from entering

    restricted areas. This system is using serial signals generated by bar code, PIN, and

    fingerprint readings that are easily transmitted to one centrally located computer, which can

    be used to control the entire system. The problem arises if a large number of card readers are

    combined to form a more complex entry system. One option is to design a system that uses

    several PCs, with one PC located near each device. However, the cost of purchasing so many

    PCs can be prohibitive.

    Employee Attendance System manufactured by Selvam Systems Pvt. Ltd.

    This system is using RFID for attendance monitoring. This System assigns a unique

    card number for each employee. An employee places the RFID card within 5cm distance

    from the RFID Reader. The RFID Reader writes down the time, date and type of

    departure/arrival. The type of arrival/departure is indicated on the LCD display. The display

    also indicates the current time. The Interface software which is available with this system is

    responsible for attendance record processing and it produces attendance reports in the

    customer preferred format. Attendance processing (Interface) software can also be integrated

    with the payroll software for salary calculation and employee tracking. Manual entry is also

    possible.

  • 7/30/2019 Staff Attendance using RFID module

    6/44

    Anurag Engineering College

    Department of ECE 6

    2.2 Difference between barcode & RFID reader

    Barcode Reader RFID Reader

    Counterfeiting is easy. Counterfeiting is difficult.Scanner needs to see the barcode to read it. Scanner not required. No need to bring the

    tag near the reader.

    Can read only one tag at a time. Can read multiple tags at a time. Relatively

    expensive compared to barcode.

    Cannot be reused. Can be reused within the premises.

    The barcode labels that triggered a revolution in identification systems long time ago

    are inadequate in an increasing number of cases. They are cheap but the stumbling block is

    their low storage capacity and the fact that they cannot be reprogrammed.

    A feasible solution was putting the data on silicon chips. The ideal situation is

    contactless transfer of data between the data carrying device and its reader. The power

    required to operate the electronic data carrying device would also be transferred from the

    reader using contactless technology. These procedures give RFID its name.

    In a not so distant future, RFID enabled stores will monitor the consumption in real

    time. Shelf will signal the inventory when it needs more stuff and inventory will pull supplies

    from the manufacturer based on its level of stock.

  • 7/30/2019 Staff Attendance using RFID module

    7/44

    Anurag Engineering College

    Department of ECE 7

    3. PROPOSED MODEL

    It discusses the design and working of the design with the help of block diagram and

    circuit diagram and explanation of circuit diagram in detail. It explains the features, timer

    programming, serial communication, interrupts of AT89S52 microcontroller. It also explains

    the various modules used in this project.

    Hardware implementation deals in drawing the schematic on the plane paper

    according to the application, testing the schematic design over the breadboard using the

    various ICs to find if the design meets the objective, carrying out the PCB layout of the

    schematic tested on breadboard, finally preparing the board and testing the designed

    hardware.

    3.1 Block diagram of the project &description

    The block diagram of the design is as shown in Fig 3.1. It consists of power supply

    unit, microcontroller, RFID module, Serial communication unit, switch, EEPROM and LCD.

    The brief description of each unit is explained as follows.

    Fig 3.1: Block diagram for Inventory management system using RFID

  • 7/30/2019 Staff Attendance using RFID module

    8/44

    Anurag Engineering College

    Department of ECE 8

    Schematic diagram of the project:

    Fig 3.2: Schematic diagram

  • 7/30/2019 Staff Attendance using RFID module

    9/44

    Anurag Engineering College

    Department of ECE 9

    3.2 Power supply

    The input to the circuit is applied from the regulated power supply. The a.c. input

    i.e., 230V from the mains supply is step down by the transformer to 12V and is fed to a

    rectifier. The output obtained from the rectifier is a pulsating d.c voltage. So in order to get a

    pure d.c voltage, the output voltage from the rectifier is fed to a filter to remove any a.c

    components present even after rectification. Now, this voltage is given to a voltage regulator

    to obtain a pure constant dc voltage.

    Fig 3.3: Components of regulated power supply

    Transformer:

    Usually, DC voltages are required to operate various electronic equipment and these

    voltages are 5V, 9V or 12V. But these voltages cannot be obtained directly. Thus the a.c

    input available at the mains supply i.e., 230V is to be brought down to the required voltage

    level. This is done by a transformer. Thus, a step down transformer is employed to decrease

    the voltage to a required level.

    Rectifier:

    The output from the transformer is fed to the rectifier. It converts A.C. into pulsating

    D.C. The rectifier may be a half wave or a full wave rectifier. In this project, a bridge rectifier

    is used because of its merits like good stability and full wave rectification.

  • 7/30/2019 Staff Attendance using RFID module

    10/44

    Anurag Engineering College

    Department of ECE 10

    Filter:

    Capacitive filter is used in this project. It removes the ripples from the output of

    rectifier and smoothens the D.C. Output received from this filter is constant until the mains

    voltage and load is maintained constant. However, if either of the two is varied, D.C. voltage

    received at this point changes. Therefore a regulator is applied at the output stage.

    Voltage regulator:

    As the name itself implies, it regulates the input applied to it. A voltage regulator is

    an electrical regulator designed to automatically maintain a constant voltage level. In this

    project, power supply of 5V and 12V are required. In order to obtain these voltage levels,

    7805 and 7812 voltage regulators are to be used. The first number 78 represents positive

    supply and the numbers 05, 12 represent the required output voltage levels.

    3.3 RFID Technology

    RFID principles

    Many types of RFID exist, but at the highest level, we can divide RFID devices

    into two classes:

    Activeand passive.

    Fig 3.4: Active and Passive tags

    Active tags require a power source i.e., they are either connected to a powered

    infrastructure or use energy stored in an integrated battery. In the latter case, a tags lifetime

    is limited by the stored energy, balanced against the number of read operations the device

    must undergo. However, batteries make the cost, size, and lifetime of active tags impractical

    for the retail trade.

    http://2.bp.blogspot.com/_1YUZv5rd5AE/SIG4zGjyhRI/AAAAAAAABck/n8mckBAJe68/s1600-h/RFID-tags.bmp
  • 7/30/2019 Staff Attendance using RFID module

    11/44

    Anurag Engineering College

    Department of ECE 11

    Passive RFID is of interest because the tags dont require batteries or maintenance.

    The tags also have an indefinite operational life and are small enough to fit into a practical

    adhesive label. A passive tag consists of three parts: an antenna, a semiconductor chip

    attached to the antenna and some form of encapsulation. The tag reader is responsible for

    powering and communicating with a tag. The tag antenna captures energy and transfers the

    tags ID (the tags chip coordinates this process). The encapsulation maintains the tags

    integrity and protects the antenna and chip from environmental conditions or reagents.

    RFID Technology and Architecture:

    Before RFID can be understood completely, it is essential to understand how Radio

    Frequency communication occurs. RF (Radio Frequency) communication occurs by the

    transference of data over electromagnetic waves. By generating a specific electromagnetic

    wave at the source, its effect can be noticed at the receiver far from the source, which then

    identifies it and thus the information.

    In an RFID system, the RFID tag which contains the tagged data of the object

    generates a signal containing the respective information which is read by the RFID reader,

    which then may pass this information to a processor for processing the obtained information

    for that particular application.

    Thus, an RFID System can be visualized as the sum of the following three components:

    RFID tag or transponder RFID reader or transceiver Data processing subsystem

    Fig 3.5: RFID Module

  • 7/30/2019 Staff Attendance using RFID module

    12/44

    Anurag Engineering College

    Department of ECE 12

    An RFID tag is composed of an antenna, a wireless transducer and an encapsulating

    material. These tags can be either active or passive. While the active tags have on-chip

    power, passive tags use the power induced by the magnetic field of the RFID reader.

    An RFID reader consists of an antenna, transceiver and decoder, which sends periodic signals

    to inquire about any tag in vicinity. On receiving any signal from a tag it passes on that

    information to the data processor. The data processing subsystem provides the means of

    processing and storing the data.

    RFID Frequencies:

    Much like tuning in to the favourite radio station, RFID tags and readers must be

    tuned into the same frequency to enable communications. RFID systems can use a variety of

    frequencies to communicate, but because radio waves work and act differently at different

    frequencies, a frequency for a specific RFID system is often dependant on its

    application. High frequency RFID systems (850 MHz to 950 MHz and 2.4 GHz to 2.5 GHz)

    offer transmission ranges of more than 90 feet, although wavelengths in the 2.4 GHz range

    are absorbed by water, which includes the human body and therefore has limitations.

    RFID Design Approach:

    Two fundamentally different RFID design approaches exist for transferring powerfrom the reader to the tag: magnetic induction and electromagnetic (EM) wave capture. These

    two designs take advantage of the EM properties associated with an RF antennathe near

    field and the far field. Both can transfer enough power to a remote tag to sustain its

    operationtypically between 10 _W and 1 mW, depending on the tag type.

    Near-field RFID:

    Faradays principle of magnetic induction is the basis of near-field coupling between

    a reader and tag. A reader passes a large alternating current through a reading coil, resulting

    in an alternating magnetic field in its locality. If you place a tag that incorporates a smaller

    coil (see figure 3) in this field, an alternating voltage will appear across it. If this voltage is

    rectified and coupled to a capacitor, a reservoir of charge accumulates, which you can then

    use to power the tag chip.

    Because any current drawn from the tag coil will give rise to its own small magnetic

    fieldwhich will oppose the readers fieldthe reader coil can detect this as a small increase

    in current flowing through it. This current is proportional to the load applied to the tags coil

    (hence load modulation).

  • 7/30/2019 Staff Attendance using RFID module

    13/44

    Anurag Engineering College

    Department of ECE 13

    Thus, if the tags electronics applies a load to its own antenna coil and varies it over

    time, a signal can be encoded as tiny variations in the magnetic field strength representing the

    tags ID. The reader can then recover this signal by monitoring the change in current through

    the reader coil. A further limitation is the energy available for induction as a function of

    distance from the reader coil. The magnetic field drops off at a factor of 1/r3, where ris the

    separation of the tag and reader, along a center line perpendicular to the coils plane. These

    design pressures have led to new passive RFID designs based on far-field communication.

    The range for which we can use magnetic induction approximates to c/2f, where c is

    a constant (the speed of light) and f is the frequency. Thus, as the frequency of operation

    increases, the distance over which near-field coupling can operate decreases. A further

    limitation is the energy available for induction as a function of distance from the reader coil.

    The magnetic field drops off at a factor of 1/r3, where r is the separation of the tag and

    reader, along a center line perpendicular to the coils plane. These design pressures have led

    to new passive RFID designs based on far-field communication.

    Fig 3.6: Near field communication of RFID

    RFID Module and Principle of working:

    RFID Reader Module, are also called as interrogators. They convert radio waves

    returned from the RFID tag into a form that can be passed on to Controllers, which can make

  • 7/30/2019 Staff Attendance using RFID module

    14/44

    Anurag Engineering College

    Department of ECE 14

    use of it. RFID tags and readers have to be tuned to the same frequency in order to

    communicate. RFID systems use many different frequencies, but the most common and

    widely used & supported by our Reader is 125 KHz.

    Fig 3.7: RFID Module inner view

    An RFID system consists of two separate components: a tag and a reader. Tags are

    analogous to barcode labels and come in different shapes and sizes. The tag contains an

    antenna connected to a small microchip containing up to two kilobytes of data. The reader or

    scanner functions similarly to a barcode scanner. However, while a barcode scanner uses a

    laser beam to scan the barcode, an RFID scanner uses electromagnetic waves. To transmit

    these waves, the scanner uses an antenna that transmits a signal communicating with the tags

    antenna. The tags antenna receives data from the scanner and transmits its particular chip

    information to the scanner.

    The data on the chip is usually stored in one of two types of memory. The most

    common is Read-Only Memory (ROM), as its name suggests, read-only memory cannot be

    altered once programmed onto the chip during the manufacturing process. The second type of

    memory is Read/Write Memory, though it is also programmed during the manufacturing

    process, it can later be altered by certain devices.

    Features of RFID:

    Reading collocated tagsOne commercial objective of RFID systems is to read and charge for all tagged

    goods in a standard supermarket shopping cart as it is pushed through an instrumented

    checkout aisle. Such a system would speed up the checkout process and reduce operational

    costs.

    Enabling a distributed memory revolutionAnother distinguishing feature of modern RFID is that tags can contain far

    more information than a simple ID. They can incorporate additional read only or read-write

    memory, which a reader can then further interact with. Read-only memory might containadditional product details that dont need to be read every time a tag is interrogated but are

  • 7/30/2019 Staff Attendance using RFID module

    15/44

    Anurag Engineering College

    Department of ECE 15

    available when required. For example, the tag memory might contain a batch code, so if some

    products are found to be faulty, the code can help find other items with the same defects.

    Tag memory can also be used to enable tags to store self-describing information.

    Although a tags unique ID can be used to recover its records in an online database,

    communication with the database might not always be possible. For example, if a package is

    misdirected during transportation, the receiving organization might not be able to determine

    its correct destination. Additional destination information written into the tag would obviate

    the need and cost of a fully networked tracking system.

    RFID that incorporates sensingOne of the most intriguing aspects of modern RFID tags is that they can convey

    information that extends beyond data stored in an internal memory and include data that

    onboard sensors created Dynamically.

    Commercial versions of RFID technology can already ensure that critical

    environmental parameters havent been exceeded. For example, ifa package is dropped on

    the floor, the impact might have damaged the enclosed product. A passive force sensor can

    supply a single bit of information that can be returned along with an RFID tags ID, alerting

    the system about the problem.

    Applications of RFID:

    Security and Access ControlRFID has long been used as an electronic key to control who has access to office

    buildings or areas within office buildings. The first access control systems used low-

    frequency RFID tags. Recently, vendors have introduced 13.56 MHz systems that offer

    longer read range. The advantage of RFID is it is convenient (an employee can hold up a

    badge to unlock a door, rather than looking for a key or swiping a magnetic stripe card) and

    because there is no contact between the card and reader, there is less wear and tear, and

    therefore less maintenance.

    As RFID technology evolves and becomes less expensive and more robust, it's likely

    that companies and RFID vendors will develop many new applications to solve common and

    unique business problems.

  • 7/30/2019 Staff Attendance using RFID module

    16/44

    Anurag Engineering College

    Department of ECE 16

    People TrackingPeople tracking system are used just as asset tracking system. Hospitals and jails are most

    general tracking required places. Hospital uses RFID tags for tracking their special patients.

    In emergency patient and other essential equipment can easily track. It will be mainly very

    useful in mental care hospitals where doctors can track each and every activity of the patient.

    Hospitals also use these RFID tags for locating and tracking all the activities of the newly

    born babies.

    The best use of the people tracking system will be in jails. It becomes an easy tracking

    system to track their inmates. Many jails of different US states like Michigan, California, and

    Arizona are already using RFID-tracking systems to keep a close eye on jail inmates.

    HealthcarePatient safety is a big challenge of healthcare vertical. Reducing medication errors,

    meeting new standards, staff shortages, and reducing costs are the plus points of use of RFID

    solutions. RFID wristbands containing patient records and medication history address several

    of these concerns.

    Transportation paymentsGovernments use RFID applications for traffic management, while automotive

    companies use various RFID tracking solutions for product management. Many of these

    solutions may work together in the future, though privacy regulations prevent many

    initiatives from moving forward at the same pace that technology allows.

    Promotion trackingManufacturers of products sold through retailers promote their products by

    offering discounts for a limited period on products sold to retailers with the expectation that

    the retailers will pass on the savings to their customers. However, retailers typically engage

    inforward buying, purchasing more product during the discount period than they intend to

    sell during the promotion period. Some retailers engage in a form of arbitrage, reselling

    discounted product to other retailers, a practice known as diverting.

    3.4 Microcontroller

    Microcontrollers are widely used in embedded systems products.Microcontroller is a programmable device. A microcontroller has a CPU in addition to a

  • 7/30/2019 Staff Attendance using RFID module

    17/44

    Anurag Engineering College

    Department of ECE 17

    fixed amount of RAM, ROM, I/O ports and a timer embedded all on a single chip. The fixed

    amount of on-chip ROM, RAM and number of I/O ports in microcontrollers makes them

    ideal for many applications in which cost and space are critical.

    The Intel 8051 is Harvard architecture, single chip microcontroller (C) which was

    developed by Intel in 1980 for use in embedded systems. It was popular in the 1980s and

    early 1990s, but today it has largely been superseded by a vast range of enhanced devices

    with 8051-compatible processor cores that are manufactured by more than 20 independent

    manufacturers including Atmel, Infineon Technologies and Maxim Integrated Products.

    8051 is an 8-bit processor, meaning that the CPU can work on only 8 bits of data at

    a time. Data larger than 8 bits has to be broken into 8-bit pieces to be processed by the CPU.

    8051 is available in different memory types such as UV-EPROM, Flash and NV-RAM.

    Features of AT89S52:

    RAM is 256 bytes. 8K Bytes of Re-programmable Flash Memory. 4.0V to 5.5V Operating Range. Fully Static Operation: 0 Hz to 33 MHzs Three-level Program Memory Lock. 256 x 8-bit Internal RAM. 32 Programmable I/O Lines. Three 16-bit Timer/Counters. Eight Interrupt Sources. Watchdog timer. Dual data pointer. Fast programming time. Flexible ISP programming (byte and page mode).

    Description:

    The AT89s52 is a low-voltage, high-performance CMOS 8-bit microcomputer with

    8K bytes of Flash programmable memory. The device is manufactured using Atmels high

  • 7/30/2019 Staff Attendance using RFID module

    18/44

    Anurag Engineering College

    Department of ECE 18

    density nonvolatile memory technology and is compatible with the industry-standard MCS-

    51 instruction set. The on chip flash allows the program memory to be reprogrammed in

    system or by a conventional non volatile memory programmer. By combining a versatile 8-

    bit CPU with Flash on a monolithic chip, the Atmel AT89s52 is a powerful microcomputer,

    which provides a highly flexible and cost-effective solution to many embedded control

    applications.

    In addition, the AT89s52 is designed with static logic for operation down to zero

    frequency and supports two software selectable power saving modes. The Idle Mode stops

    the CPU while allowing the RAM, timer/counters, serial port and interrupt system to continue

    functioning. The power-down mode saves the RAM contents but freezes the oscillator

    disabling all other chip functions until the next hardware reset.

    Pin description:

    Vcc: Pin 40 provides supply voltage to the chip. The voltage source is +5V.

    GND: Pin 20 is the ground.

    Port 0:

    Port 0 is an 8-bit open drain bidirectional I/O port. As an output port, each pin can

    sink eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as high

    impedance inputs. Port 0 can also be configured to be the multiplexed low-order address/data

    bus during accesses to external program and data memory. In this mode, P0 has internal pull-

    ups.

    Port 0 also receives the code bytes during Flash programming and outputs the code

    bytes during Program verification. External pull-ups are required during program verification.

  • 7/30/2019 Staff Attendance using RFID module

    19/44

    Anurag Engineering College

    Department of ECE 19

    Fig 3.8: pin diagram of 89S52

    Port 1:

    Port 1 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 1 output buffers can

    sink/source four TTL inputs. When 1s are written to Port 1 pins, they are pulled high by the

    internal pull-ups and can be used as inputs. As inputs, Port 1 pins that are externally being

    pulled low will source current (IIL) because of the internal pull-ups. In addition, P1.0 and

    P1.1 can be configured to be the timer/counter 2 external count input (P1.0/T2) and the

    timer/counter 2 trigger input (P1.1/T2EX), respectively, as shown in the following table. Port

    1 also receives the low-order address bytes during Flash programmingand verification.

    Table 3.1: port1 pin description

  • 7/30/2019 Staff Attendance using RFID module

    20/44

    Anurag Engineering College

    Department of ECE 20

    Port 2:

    Port 2 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 2 output

    buffers can sink/source four TTL inputs. When 1s are written to Port 2 pins, they are pulled

    high by the internal pull-ups and can be used as inputs. As inputs, Port 2 pins that are

    externally being pulled low will source current (IIL) because of the internal pull-ups.

    Port 2 emits the high-order address byte during fetches from external program

    memory and during accesses to external data memory that uses 16-bit addresses (MOVX @

    DPTR). In this application, Port 2 uses strong internal pull-ups when emitting 1s. During

    accesses to external data memory that uses 8-bit addresses (MOVX @ RI), Port 2 emits the

    contents of the P2 Special Function Register. The port also receives the high-order address

    bits and some control signals during Flash programming and verification.

    Port 3:

    Port 3 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 3 output

    buffers can sink/source four TTL inputs. When 1s are written to Port 3 pins, they are pulled

    high by the internal pull-ups and can be used as inputs. As inputs, Port 3 pins that are

    externally being pulled low will source current (IIL) because of the pull-ups. Port 3 receives

    some control signals for Flash programming and verification.

    Port 3 also serves the functions of various special features of the AT89S52, as shown

    in the following table.

    Table 3.2: Port3 pin description

    RST:

    Reset input A high on this pin for two machine cycles while the oscillator is running resets

    the device. This pin drives high for 98 oscillator periods after the Watchdog times out. The

    DISRTO bit in SFR AUXR (address 8EH) can be used to disable this feature. In the defaultstate of bit DISRTO, the RESET HIGH out feature is enabled.

  • 7/30/2019 Staff Attendance using RFID module

    21/44

    Anurag Engineering College

    Department of ECE 21

    ALE/PROG:

    Address Latch Enable (ALE) is an output pulse for latching the low byte of the

    address during accesses to external memory. This pin is also the program pulse input (PROG)

    during Flash programming.

    In normal operation, ALE is emitted at a constant rate of 1/6 the oscillator frequency

    and may be used for external timing or clocking purposes. Note, however, that one ALE

    pulse is skipped during each access to external data memory.

    If desired, ALE operation can be disabled by setting bit 0 of SFR location 8EH. With

    the bit set, ALE is active only during a MOVX or MOVC instruction. Otherwise, the pin is

    weakly pulled high. Setting the ALE-disable bit has no effect if the microcontroller is in

    external execution mode.

    Program Store Enable (PSEN) is the read strobe to external program memory.

    When the AT89S52 is executing code from external program memory, PSEN is activated

    twice each machine cycle, except that two PSEN activations are skipped during each access

    to external data memory.

    EA/VPP:

    External Access Enable EA must be strapped to GND in order to enable the device

    to fetch code from external program memory locations starting at 0000H up to FFFFH. Note,

    however, that if lock bit 1 is programmed, EA will be internally latched on reset.

    EA should be strapped to VCC for internal program executions. This pin also receives

    the 12-volt programming enable voltage (VPP) during Flash programming.

    XTAL1:

    Input to the inverting oscillator amplifier and input to the internal clock operating circuit.

    XTAL2:

    Output from the inverting oscillator amplifier.

  • 7/30/2019 Staff Attendance using RFID module

    22/44

    Anurag Engineering College

    Department of ECE 22

    Fig 3.9: Oscillator connections

    Special Function Registers:

    A map of the on-chip memory area called the Special Function Register (SFR) space

    is shown in the following table.

    It should be noted that not all of the addresses are occupied and unoccupied addresses

    may not be implemented on the chip. Read accesses to these addresses will in general return

    random data, and write accesses will have an indeterminate effect.

    User software should not write 1s to these unlisted locations, since they may be used

    in future products to invoke new features. In that case, the reset or inactive values of the newbits will always be 0.

    Timer 2 Registers:

    Control and status bits are contained in registers T2CON and T2MOD for Timer 2.

    The register pair (RCAP2H, RCAP2L) is the Capture/Reload register for Timer 2 in 16-bit

    capture mode or 16-bit auto-reload mode.

    Interrupt Registers:

    The individual interrupt enable bits are in the IE register. Two priorities can be set for

    each of the six interrupt sources in the IP register.

  • 7/30/2019 Staff Attendance using RFID module

    23/44

    Anurag Engineering College

    Department of ECE 23

    Table 3.3: Interrupt Register

    Timers:

    The 8051 has two timers: Timer 0 and Timer 1. They can be used either as timers to

    generate a time delay or as counters to count events happening outside the microcontroller.

    Both Timer 0 and Timer 1 are 16-bit wide. Since the 8051 has an 8-bit architecture,

    each 16-bit timer is accessed as two separate registers of low byte and high byte.

    Lower byte register of Timer 0 is TL0 and higher byte is TH0. Similarly lower byte

    register of Timer1 is TL1 and higher byte register is TH1.

  • 7/30/2019 Staff Attendance using RFID module

    24/44

    Anurag Engineering College

    Department of ECE 24

    TMOD (timer mode) register:

    Both timers 0 and 1 use the same register TMOD to set the various operation modes.

    TMOD is an 8-bit register in which the lower 4 bits are set aside for Timer 0 and the upper 4

    bits for Timer 1. In each case, the lower 2 bits are used to set the timer mode and the upper 2

    bits to specify the operation.

    GATE:

    Every timer has a means of starting and stopping. Some timers do this by software,

    some by hardware and some have both software and hardware controls. The timers in the

    8051 have both. The start and stop of the timer are controlled by the way of software by the

    TR (timer start) bits TR0 and TR1. These instructions start and stop the timers as long as

    GATE=0 in the TMOD register. The hardware way of starting and stopping the timer by an

    external source is achieved by making GATE=1 in the TMOD register.

    C/T:

    Timer or counter selected. Cleared for timer operation and set for counter operation.

    Mode Selection:

    M1 M0 Mode Operating Mode

    0 0 0 13-bit timer mode

    8-bit timer/counter THx with TLx as 5-bit prescaler

    0 1 1 16-bit timer mode

    16-bit timer/counters THx and TLx are cascaded

    1 0 2 8-bit auto reload timer/counter

    THx holds a value that is to be reloaded into TLx each time

    it overflows

    1 1 3 Split timer mode

    The mode used here to generate a time delay is MODE 2.

  • 7/30/2019 Staff Attendance using RFID module

    25/44

    Anurag Engineering College

    Department of ECE 25

    Timer 1:

    Timer 1 is identical to timer 0, except for mode 3, which is a hold-count mode. The

    following comments help to understand the differences:

    Timer 1 functions as either a timer or event counter in three modes of operation. Timer 1s

    mode 3 is a hold-count mode.

    Timer 1 is controlled by the four high-order bits of the TMOD register and bits 2, 3, 6 and 7

    of the TCON register. The TMOD register selects the method of timer gating (GATE1), timer

    or counter operation (C/T1#) and mode of operation (M11 and M01). The TCON register

    provides timer 1 control functions: overflow flag (TF1), run control bit (TR1), interrupt flag

    (IE1) and interrupt type control bit (IT1).

    Timer 1 can serve as the baud rate generator for the serial port. Mode 2 is best suited for this

    purpose.

    For normal timer operation (GATE1 = 0), setting TR1 allows TL1 to be incremented by the

    selected input. Setting GATE1 and TR1 allows external pin INT1# to control timer operation.

    Timer 1 overflow (count rolls over from all 1s to all 0s) sets the TF1 flag generating an

    interrupt request.

    When timer 0 is in mode 3, it uses timer 1s overflow flag (TF1) and run control bit (TR1).

    For this situation, use timer 1 only for applications that do not require an interrupt (such as a

    baud rate generator for the serial port) and switch timer 1 in and out of mode 3 to turn it off

    and on.

    It is important to stop timer/counter before changing modes.

    Mode 2 (8-bit Timer with Auto Reload):

    Mode 2 configures Timer 1 as an 8-bit timer (TL1) with automatic reload from the

    TH1 register on overflow. TL1 overflow sets the TF1 flag in the TCON register and reloads

    TL1 with the contents of TH1, which is preset by software. The reload leaves TH1

    unchanged.

  • 7/30/2019 Staff Attendance using RFID module

    26/44

    Anurag Engineering College

    Department of ECE 26

    Fig 3.10: Timer in mode2

    SCON (serial control) register:

    The SCON register is an 8-bit register used to program the start bit, stop bit and data

    bits of data framing.

    SM0 SCON.7 Serial port mode specifier

    SM1 SCON.6 Serial port mode specifier

    SM2 SCON.5 Used for multiprocessor communication

    REN SCON.4 Set/cleared by software to enable/disable reception

    TB8 SCON.3 Not widely used

    RB8 SCON.2 Not widely used

    TI SCON.1 Transmit interrupt flag. Set by hardware at the

    beginning of the stop bit in mode 1. Must be

    cleared by software.

    RI SCON.0 Receive interrupt flag. Set by hardware at the

    beginning of the stop bit in mode 1. Must be

    cleared by software.

  • 7/30/2019 Staff Attendance using RFID module

    27/44

    Anurag Engineering College

    Department of ECE 27

    SM0 SM1

    0 0 Serial Mode 0

    0 1 Serial Mode 1, 8-bit data, 1 stop bit, 1 start bit

    1 0 Serial Mode 2

    1 1 Serial Mode 3

    Of the four serial modes, only mode 1 is widely used. In the SCON register, when serial

    mode 1 is chosen, the data framing is 8 bits, 1 stop bit and 1 start bit, which makes it

    compatible with the COM port of IBM/ compatible PCs. And the most important is serial

    mode 1 allows the baud rate to be variable and is set by Timer 1 of the 8051. In serial mode

    1, for each character a total of 10 bits are transferred, where the first bit is the start bit,

    followed by 8 bits of data and finally 1 stop bit.

    Interrupts:

    The AT89S52 has a total of six interrupt vectors: two external interrupts (INT0 and

    INT1), three timer interrupts (Timers 0, 1, and 2) and the serial port interrupt. These

    interrupts are all shown in the below figure.

    Each of these interrupt sources can be individually enabled or disabled by setting or

    clearing a bit in Special Function Register IE. IE also contains a global disable bit, EA, which

    disables all interrupts at once. The below table shows that bit position IE.6 is unimplemented.

    User software should not write a 1 to this bit position, since it may be used in future AT89

    products.

    Timer 2 interrupt is generated by the logical OR of bits TF2 and EXF2 in register

    T2CON. Neither of these flags is cleared by hardware when the service routine is vectored to.

    In fact, the service routine may have to determine whether it was TF2 or EXF2 that generated

    the interrupt, and that bit will have to be cleared in software.

    The Timer 0 and Timer 1 flags, TF0 and TF1, are set at S5P2 of the cycle in which

    the timers overflow. The values are then polled by the circuitry in the next cycle. However,

    the Timer 2 flag, TF2, is set at S2P2 and is polled in the same cycle in which the timer

    overflows.

  • 7/30/2019 Staff Attendance using RFID module

    28/44

    Anurag Engineering College

    Department of ECE 28

    Table 3.4: Interrupt Enable Register

    3.5. LCD (LIQUID CRYSTAL DISPLAY)

    LCD stands for Liquid Crystal Display. LCD is finding wide spread use replacing LEDs

    (seven segment LEDs or other multi segment LEDs) because of the following reasons:

    1. The declining prices of LCDs.2. The ability to display numbers, characters and graphics. This is in contrast to LEDs,

    which are limited to numbers and a few characters.

    3. Incorporation of a refreshing controller into the LCD, thereby relieving the CPU ofthe task of refreshing the LCD. In contrast, the LED must be refreshed by the CPU to

    keep displaying the data.

    4. Ease of programming for characters and graphics.These components are specialized for being used with the microcontrollers, which

    means that they cannot be activated by standard IC circuits. They are used for writing

    different messages on a miniature LCD.

  • 7/30/2019 Staff Attendance using RFID module

    29/44

    Anurag Engineering College

    Department of ECE 29

    Fig 3.11: LCD Display

    Automatic shifting message on display (shift left and right), appearance of the pointer,

    backlight etc. are considered as useful characteristics.

    Pins Functions:

    There are pins along one side of the small printed board used for connection to the

    microcontroller. There are total of 14 pins marked with numbers (16 in case the background

    light is built in). Their function is described in the table below:

    Function Pin

    Number

    Name Logic

    State

    Description

    Ground 1 Vss - 0V

    Power supply 2 Vdd - +5VContrast 3 Vee - 0Vdd

    Control of

    operating

    4 RS 0

    1

    D0 D7 are interpreted as

    commands

    D0D7 are interpreted as data

    5 R/W 0

    1

    Write data (from controller to

    LCD)

    Read data (from LCD to

    controller)

    6 E 0

    1

    From 1to 0

    Access to LCD disabled

    Normal operating

    Data/commands are transferredto LCD

    Data /

    commands

    7 D0 0/1 Bit 0 LSB

    8 D1 0/1 Bit 1

    9 D2 0/1 Bit 2

    10 D3 0/1 Bit 3

    11 D4 0/1 Bit 4

    12 D5 0/1 Bit 5

    13 D6 0/1 Bit 6

    14 D7 0/1 Bit 7 MSB

    Table 3.5: LCD Display

  • 7/30/2019 Staff Attendance using RFID module

    30/44

    Anurag Engineering College

    Department of ECE 30

    LCD screen:

    LCD screen consists of two lines with 16 characters each. Each character consists of

    5x7 dot matrix. Contrast on display depends on the power supply voltage and whether

    messages are displayed in one or two lines. For that reason, variable voltage 0-Vdd is applied

    on pin marked as Vee. Trimmer potentiometer is usually used for that purpose. Some

    versions of displays have built in backlight (blue or green diodes). When used during

    operating, a resistor for current limitation should be used (like with any LE diode).

    3.6 RS232 CABLE

    To allow compatibility among data communication equipment, an interfacing

    standard called RS232 is used. Since the standard was set long before the advent of the TTL

    logic family, its input and output voltage levels are not TTL compatible. For this reason, to

    connect any RS232 to a microcontroller system, voltage converters such as MAX232 are

    used to convert the TTL logic levels to the RS232 voltage levels and vice versa.

    The RS232 connector was originally developed to use 25 pins. In this DB25

    connector pin out provisions were made for a secondary serial RS232 communication

    channel. In practice, only one serial communication channel with accompanying handshaking

    is present. Only very few computers have been manufactured where both serial RS232

    channels are implemented. Examples of this are the Sun SPARCstation 10 and 20 models and

    the Dec Alpha Multia.

    Fig 3.12:RS232 Cable

  • 7/30/2019 Staff Attendance using RFID module

    31/44

    Anurag Engineering College

    Department of ECE 31

    3.7 MAX232 IC

    Max232 IC is a specialized circuit which makes standard voltages as required by

    RS232 standards. This IC provides best noise rejection and very reliable against dischargesand short circuits. MAX232 IC chips are commonly referred to as line drivers.

    To ensure data transfer between PC and microcontroller, the baud rate and voltage

    levels of Microcontroller and PC should be the same. The voltage levels of microcontroller

    are logic1 and logic 0 i.e., logic 1 is +5V and logic 0 is 0V. But for PC, RS232 voltage levels

    are considered and they are: logic 1 is taken as -3V to -25V and logic 0 as +3V to +25V. So,

    in order to equal these voltage levels, MAX232 IC is used. Thus this IC converts RS232

    voltage levels to microcontroller voltage levels and vice versa.

    Fig 3.13: MAX232

  • 7/30/2019 Staff Attendance using RFID module

    32/44

    Anurag Engineering College

    Department of ECE 32

    5. CONCLUSION

    The implementation of staff attendance system using RFID module using

    microcontroller is done successfully. The communication is properly done without any

    interference between different modules in the design. Design is done to meet all the

    specifications and requirements. Software tools like Keil uvision Simulator, Proload to dump

    the source code into the microcontroller, Orcad Lite for the schematic diagram have been

    used to develop the software code before realizing the hardware. The performance of the

    system is more efficient. The reader reads the tag information when the object along with the

    tag is brought near it and passes the data to the controlling unit. Reading the information sent

    by the reader and displaying it on the LCD is the main job of the microcontroller. The

    mechanism is controlled by the microcontroller.

    Circuit is implemented in Orcad and implemented on the microcontroller

    board. The performance has been verified both in software simulator and hardware design.

    The total circuit is completely verified functionally. It can be concluded that the design

    implemented in the present work provide portability, flexibility and the data transmission is

    also done with low power consumption.

  • 7/30/2019 Staff Attendance using RFID module

    33/44

    Anurag Engineering College

    Department of ECE 33

    6. FUTURE SCOPE

    RFID is said by many in the industry to be the frontrunner technology for

    automatic identification and data collection. The biggest, as of yet unproven, benefit would

    ultimately be in the consumer goods supply chain where an RFID tag attached to a consumer

    product could be tracked from manufacturing to the retail store right to the consumer's home.

    Many see RFID as a technology in its infancy with an untapped potential. While we may talk

    of its existence and the amazing ways in which this technology can be put to use, until there

    are more standards set within the industry and the cost of RFID technology comes down we

    won't see RFID systems reaching near their full potential anytime soon.

  • 7/30/2019 Staff Attendance using RFID module

    34/44

    Anurag Engineering College

    Department of ECE 34

    REFERENCES

    Mohammad Ali Mazidi, The 8051 Microcontroller And Embedded SystemsUsing Assembly And C, Second Edition.

    KENNETH J.AYALA, 8051 Microcontroller Architecture, programming andapplications.

    http://www.8051projects.net/keil-c-programming-tutorial/introduction.php. http://www.atmel.com/dyn/resources/prod_documents/doc1919.pdf http://www.kpsec.freeuk.com/components/relay.htm

  • 7/30/2019 Staff Attendance using RFID module

    35/44

    Anurag Engineering College

    Department of ECE 35

    APPENDIX

    A.Software implementationSoftware tools required:

    Keil v3, Proload are the two software tools used to program microcontroller. The

    working of each software tool is explained below in detail.

    Programming Microcontroller:

    A compiler for a high level language helps to reduce production time. To program the

    AT89S52 microcontroller the Keil v3 is used. The programming is done strictly in the

    embedded C language. Keil v3 is a suite of executable, open source software development

    tools for the microcontrollers hosted on the Windows platform.

    The compilation of the C program converts it into machine language file (.hex). This

    is the only language the microcontroller will understand, because it contains the original

    program code converted into a hexadecimal format. During this step there are some warnings

    about eventual errors in the program.

    Keil compiler:

    Keil compiler is software used where the machine language code is written and

    compiled. After compilation, the machine source code is converted into hex code which is to

    be dumped into the microcontroller for further processing. Keil compiler also supports C

    language code.

  • 7/30/2019 Staff Attendance using RFID module

    36/44

    Anurag Engineering College

    Department of ECE 36

    Fig 4.1: Compilation of source code

    Proload:

    Proload is software which accepts only hex files. Once the machine code is converted

    into hex code, that hex code has to be dumped into the microcontroller and this is done by the

    Proload. Proload is a programmer which itself contains a microcontroller in it other than the

    one which is to be programmed. This microcontroller has a program in it written in such a

    way that it accepts the hex file from the Keil compiler and dumps this hex file into the

    microcontroller which is to be programmed. As the Proload programmer kit requires power

    supply to be operated, this power supply is given from the power supply circuit designed

    above. It should be noted that this programmer kit contains a power supply section in the

    board itself but in order to switch on that power supply, a source is required. Thus this is

    accomplished from the power supply board.

  • 7/30/2019 Staff Attendance using RFID module

    37/44

    Anurag Engineering College

    Department of ECE 37

    Fig 4.2:Atmel8051 device programmer

  • 7/30/2019 Staff Attendance using RFID module

    38/44

    Anurag Engineering College

    Department of ECE 38

    B.Sample code

    #include

    #include"lcddisplay.h"

    #include

    sbit sw = P2^2;

    sbit buz = P2^7;

    code unsigned char card1[]="300022C431E7";

    code unsigned char card2[]="300022A140F3";

    code unsigned char card3[]="300022939415";

    unsigned char modem[15],j=0;

    /*serial interrupt function***/

    void serintr(void) interrupt 4

    {

    if(RI==1)

    {

    modem[j]=SBUF;

    j=j+1;

    RI=0;

    }

  • 7/30/2019 Staff Attendance using RFID module

    39/44

    Anurag Engineering College

    Department of ECE 39

    }

    void main()

    {

    unsigned char count=0,pswd=0,c1=0,c2=0,c3=0;

    delay(50);

    lcd_init();

    TMOD=0x20; // select timer 1 in mode2

    TH1=0xFD; // load the timer for generating 9600 baud rate

    SCON=0x50; // select the serial communication 8bit data 1 start and 1 stop bit mode

    TR1=1; // start the timer

    EA=1; //enable global interrupt

    ES=1; //enable serial interrupt

    start:

    lcdcmd(0x1);

    msgdisplay("WELCOME");

    lcdcmd(0x01); //clear the lcd

    msgdisplay("SHOW THE CARD");

    while(j==0) //check any cardv is detected or not

    {

    if(sw==0) //if switch is pressed then duisplay the obsenties

    {

    lcdcmd(0x01);

    if((c1)&&(c2)&&(c3))

  • 7/30/2019 Staff Attendance using RFID module

    40/44

    Anurag Engineering College

    Department of ECE 40

    {

    msgdisplay("No absenties..");

    while(1);

    }

    msgdisplay("absenties..");

    lcdcmd(0xc0);

    if(c1==0)

    {

    msgdisplay("Raj ");

    }

    if(c2==0)

    {

    msgdisplay("Sai ");

    }

    if(c3==0)

    {

    msgdisplay("Ram ");

    }

    while(1);

    }

    }

    while(1)

    {

  • 7/30/2019 Staff Attendance using RFID module

    41/44

    Anurag Engineering College

    Department of ECE 41

    if(!strcmp(modem,card1)) //check the carddata with all existance data

    {

    lcdcmd(1);//clear the lcd

    msgdisplay("Welcome Mr Raj");

    buz=0; //buzzer on

    delay(1000);

    buz=1; //buzzer off

    c1=1; //update the attandance

    goto start;

    }

    if(!strcmp(modem,card2))

    {

    lcdcmd(1);

    msgdisplay("Welcome Mr Sai");

    buz=0;

    delay(1000);

    buz=1;

    c2=1;

    goto start;

    }

    if(!strcmp(modem,card3))

    {

    lcdcmd(1);

  • 7/30/2019 Staff Attendance using RFID module

    42/44

    Anurag Engineering College

    Department of ECE 42

    msgdisplay("Welcome Mr Ram");

    buz=0;

    delay(1000);

    buz=1;

    c3=1;

    goto start;

    }

    else //if not matched then unauthorised

    {

    buz=0;

    lcdcmd(1);

    msgdisplay("Unauthorised!!");

    delay(2000);

    buz=1;

    goto start;

    }

    }

    }

  • 7/30/2019 Staff Attendance using RFID module

    43/44

    Anurag Engineering College

    Department of ECE 43

  • 7/30/2019 Staff Attendance using RFID module

    44/44

    Anurag Engineering College