Professional Documents
Culture Documents
PROJECT REPORT
Submitted by
RAKESH.D (070107618037)
SANGEETHKUMAR.G (070107618038)
SHIVABHARATH.A (070107618046)
SUBRAMANI.V (080407618065)
of
BACHELOR OF ENGINEERING
IN
OCTOBER 2010
ANNA UNIVERSITY OF TECHNOLOGY 641047
BONAFIDE CERTIFICATE
SIGNATURE SIGNATURE
II
ACKNOWLEDGEMENT
III
TABLE OF CONTENTS
1. INTRODUCTION 1
1.1 objectives 1
2. SYSTEM ANALYSIS 2
3. SYSTEM SPECIFICATIONS 3
4. PROJECT DESCRIPTION 4
4.1 Block Diagram 4
5. MICROCONTROLLER 11
5.1 Introduction 11
5.6.4 USART 24
5. SOFTWARE DESCRIPTION 27
7. REFERENCES 32
V
ABSTRACT
VI
LIST OF FIGURES
4.3 IR Sensor 8
VII
LIST OF TABLES
VIII
IX
LIST OF ABBREVIATIONS
1. RF - Radio Frequency
2. ID - Identification
3. RFID - Radio Frequency Identification
4. UART - Universal Asynchronous Receiver/Transmitter
5. IDE - Integrated Development Environment
6. EEPROM - Electrically Erasable Programmable Read-Only Memory
7. IR SENSOR - Infrared Sensor
INTRODUCTION
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 project is designed to store up to 50 card IDs but it is easily
scalable up to 65000 card IDs but for that it requires external memory. 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. The RFID Reader may consist of antenna, filters, modulator,
demodulator, coupler and a micro processor.
1.1 OBJECTIVE
The aim of the project is to design a system that have a small coverage area
and can be use for authentication or identification purposes. “AUTOMATED
ATTENDANCE USING RFID” is to maintain the attendance at real-time that can be
monitored on PC. The objectives of this project is to develop a portable RFID Based
Attendance System that is able to:
1
CHAPTER 2
SYSTEM ANALYSIS
2.1.1 DRAWBACKS
i. Require line of sight to be read
ii. Can only be read individually
iii. Cannot be read if damaged or dirty
iv. Can only identify the type of item
v. Cannot be updated
vi. Most barcode scanners require a human to operate (labour intensive)
2
CHAPTER 3
SYSTEM SPECIFICATION
3.1HARDWARE REQUIREMENTS
The electronic hardware parts can be further divided into three parts which is
input, control system and output. The RFID reader and tag are the devices used as the input.
Other than that, IR slots are act as input. The control system was developed using
ATMEGA 8515 microcontroller. Meanwhile, the 2x16 LCD display and buzzer are chosen as
output of the electronic hardware parts.
A Passive Infrared sensor is also used in the hardware part. It is usually
infrared radiation that is invisible to the human eye but it can identified human, passes in
front of an infrared source
3
CHAPTER 4
PROJECT DESCRIPTION
4.1BLOCK DIAGRAM
USART
RS232
MAX232
RFID
READER
4
4.1.1 COMPONENTS OF SYSTEM
The figure below shows the basic block diagram of the AUTOMATED
ATTENDANCE USING RFID. It contains the following blocks:
1. RFID reader
2. RFID tags
3. Infrared sensors
4. LCD display
5. Microcontroller
6. Power supply unit
RFID READER
5
FIGURE 4.2 PIN DIAGRAM OF RFID READER
RFID TAGS
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 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.
WORKING OF RFID
Information is sent to and read from RFID tags by a reader using radio waves.
In passive 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
ATMEGA 8515 in the same manner that data scanned from bar code labels is captured and
passed to computer systems for interpretation, storage, and action.
6
FREQUENCIES OF RFID
RFID deployments tend to use unlicensed frequencies for their cost benefits.
There are four commonly used frequencies:
Frequency Description Operating Benefits Drawbacks
Band Range
INFRARED SENSOR
7
FIGURE 4.3 IR SENSORS
An IR emitting body moving across the front of a sensor will expose first one,
then both and then the other sensor element. The output signal waveform from an analog
sensor shows that for motion in one direction, first a positive, then zero and then a negative
transition results. Motion in the other direction will produce first a negative, then zero and
then a positive transition.
LCD DISPLAY
The display support 2X16 characters, which means, the LCD can support 2
lines on the display and each line can display up to 16 characters which is relevant as the only
essential output to be displayed is the student’s name and ID. Besides LCD Display, the
output is displayed on LCD. The diagram of LCD display is shown in Figure 4.4 and the
detailed connections of the LCD is shown in table 4.2
EEPROM
9
There are six SFRs used to read and write this memory:
1. EECON1
2. EECON2
3. EEDATA
4. EEDATH
5. EEADR
6. EEADRH
When interfacing to the data memory block, EEDATA holds the 8-bit data for
read/write and EEADR holds the address of the EEPROM location being accessed.
These devices have 128 or 256 bytes of data EEPROM (depending on the device), with an
address range from 00h to FFh.
On devices with 128 bytes, addresses from 80h to FFh are unimplemented and
will wraparound to the beginning of data EEPROM memory. When writing to
unimplemented locations, the on-chip charge pump will be turned off. When interfacing the
program memory block, the EEDATA and EEDATH registers form a two-byte word that
holds the 14-bit data for read/write and the EEADR and EEADRH registers form a two-byte
word that holds the 13-bit address of the program memory location being accessed.
10
CHAPTER 5
MICROCONTROLLER
5.1 INTRODUCTION
The new ATMega8515 Controller is the ideal solution for use as a standard
controller in many applications. The small compact size combined with easy program updates
and modifications make it ideal for use in machinery and control systems, such as alarms,
card readers, real-time monitoring applications and much more. This board is ideal as the
brains of your robot or at the centre of your home-monitoring system. Save time and money,
by simply building your ancillary boards and monitoring circuits around this inexpensive and
easy to use controller.
11
4. Peripheral Features
a. – One 8-bit Timer/Counter with Separate Prescaler and Compare Mode
b. One 16-bit Timer/Counter with Separate Prescaler, Compare Mode, and
Capture Mode
c. Three PWM Channels
d. Programmable Serial USART
e. Master/Slave SPI Serial Interface
f. Programmable Watchdog Timer with Separate On-chip Oscillator
g. On-chip Analog Comparator
7. Operating Voltages
a. 2.7 - 5.5V for ATmega8515L
b. 4.5 - 5.5V for ATmega8515
8. Speed Grades
a. 0 - 8 MHz for ATmega8515L
b. 0 - 16 MHz for ATmega8515
12
5.3 PIN CONFIGURATION OF ATMEGA 8515
PIN DESCRIPTION
GND Ground.
13
Port A (PA7...PA0) Port A is an 8-bit bi-directional I/O port with internal pull-up
resistors (selected for each bit). The Port A output buffers have
symmetrical drive characteristics with both high sink and
source capability. When pins PA0 to PA7 are used as inputs
and are externally pulled low, they will source current if the
internal pull-up resistors are activated. The PortA pins are tri-
stated when a reset condition becomes active, even if the clock
is not running.
Port B (PB7...PB0) Port B is an 8-bit bi-directional I/O port with internal pull-up
resistors (selected for each bit). The Port B output buffers have
symmetrical drive characteristics with both high sink and source
capability. As inputs, Port B pins that are externally pulled low
will source current if the pull-up resistors are activated. The
Port B pins are tri-stated when a reset condition becomes active,
even if the clock is not running.
Port C (PC7..PC0) Port C is an 8-bit bi-directional I/O port with internal pull-up
resistors (selected for each bit). The Port C output buffers have
symmetrical drive characteristics with both high sink and
source capability. As inputs, Port C pins that are externally
pulled low will source current if the pull-up resistors are
activated.
14
Port D (PD7...PD0) Port D is an 8-bit bi-directional I/O port with internal pull-up
resistors (selected for each bit). The Port D output buffers have
symmetrical drive characteristics with both high sink and
source capability. As inputs, Port D pins that are externally
pulled low will source current if the pull-up resistors are
activated. The Port D pins are tri-stated when a reset condition
becomes active, even if the clock is not running.
Port E(PE2...PE0) Port E is a 3-bit bi-directional I/O port with internal pull-up
resistors (selected for each bit). The Port E output buffers have
symmetrical drive characteristics with both high sink and
source capability. As inputs, Port E pins that are externally
pulled low will source current if the pull-up resistors are
activated. The Port E pins are tri-stated when a reset condition
becomes active, even if the clock is not running.
RESET Reset input. A low level on this pin for longer than the
minimum pulse length will generate a reset, even if the clock is
not running. Shorter pulses are not guaranteed to generate a
reset.
15
5.4 ARCHITECTURE OF ATMEGA8515
BLOCK DIAGRAM
16
The AVR core combines a rich instruction set with 32 general purpose
working registers. All the 32 registers are directly connected to the Arithmetic Logic Unit
(ALU), allowing two independent registers to be accessed in one single instruction executed
in one clock cycle. The resulting architecture is more code efficient while achieving
throughputs up to ten times faster than conventional CISC microcontrollers.
The Idle mode stops the CPU while allowing the SRAM, Timer/Counters, SPI
port, and Interrupt system to continue functioning. The Power-down mode saves the Register
contents but freezes the Oscillator, disabling all other chip functions until the next interrupt or
hardware reset. In Standby mode, the crystal/resonator Oscillator is running while the rest of
the device is sleeping. This allows very fast start-up combined with low-power consumption.
The device is manufactured using Atmel’s high density non-volatile memory technology.
The On-chip ISP Flash allows the Program memory to be reprogrammed In-
System through an SPI serial interface, by a conventional non-volatile memory programmer,
or by an On-chip Boot program running on the AVR core. The boot program can use any
interface to download the application program in the Application Flash memory. Software in
the Boot Flash section will continue to run while the Application Flash section is updated,
providing true Read-While-Write operation.
18
The fast-access Register File contains 32 x 8-bit general purpose working
registers with a single clock cycle access time. This allows single-cycle Arithmetic Logic
Unit (ALU) operation. In a typical ALU operation, two operands are output from the Register
File, the operation is executed, and the result is stored back in the Register File – in one clock
cycle.
Six of the 32 registers can be used as three 16-bit indirect address register
pointers for Data Space addressing – enabling efficient address calculations. One of these
address pointers can also be used as an address pointer for look up tables in Flash Program
memory. These added function registers are the 16-bit X-, Y-, and Z-register, described later
in this section.
The ALU supports arithmetic and logic operations between registers or
between a constant and a register. Single register operations can also be executed in the ALU.
After an arithmetic operation, the Status Register is updated to reflect information about the
result of the operation.
Program flow is provided by conditional and unconditional jump and call
instructions, able to directly address the whole address space. Most AVR instructions have a
single 16-bit word format. Every Program memory address contains a 16- or 32-bit
instruction.
Program Flash memory space is divided in two sections, the Boot Program
section and the Application Program section. Both sections have dedicated Lock bits for write
and read/write protection. The SPM instruction that writes into the Application Flash memory
section must reside in the Boot Program section.
During interrupts and subroutine calls, the return address Program Counter
(PC) is stored on the Stack. The Stack is effectively allocated in the general data SRAM, and
consequently the Stack size is only limited by the total SRAM size and the usage of the
SRAM. All user programs must initialize the SP in the reset routine (before subroutines or
interrupts are executed). The Stack Pointer SP is read/write accessible in the I/O space. The
data SRAM can easily be accessed through the five different addressing modes supported in
the AVR architecture.
19
The memory spaces in the AVR architecture are all linear and regular memory
maps. A flexible interrupt module has its Control Registers in the I/O space with an
additional Global Interrupt Enable bit in the Status Register. All interrupts have a separate
interrupt vector in the Interrupt Vector table. The interrupts have priority in accordance with
their Interrupt Vector position. The lower the Interrupt Vector address, the higher the priority.
The I/O memory space contains 64 addresses for CPU peripheral functions as
Control Registers, SPI, and other I/O functions. The I/O Memory can be accessed directly, or
as the Data Space locations following those of the Register File.\
Serial communication requires that you specify the following four parameters:
• The baud rate of the transmission
• The number of data bits encoding a character
• The number of data bits encoding a character
• The sense of the optional parity bit
• The number of stop bits
20
Pin Description Pin Description Pin Description
21
With synchronous communication, a clock or trigger signal must be present
which indicates the beginning of each transfer. The absence of a clock signal makes an
asynchronous communication channel cheaper to operate. Less lines are necessary in the
cable. A disadvantage is, that the receiver can start at the wrong moment receiving the
information. Resynchronization is then needed which costs time. All data received in the
resynchronization period is lost. Another disadvantage is that extra bits are needed in the data
stream to indicate the start and end of useful information. These extra bits take up bandwidth.
Data bits are sent with a predefined frequency, the baud rate. Both the
transmitter and receiver must be programmed to use the same bit frequency. After the first bit
is received, the receiver calculates at which moments the other data bits will be received. It
will check the line voltage levels at those moments.
With RS232, the line voltage level can have two states. The on state is also
known as mark, the off state as space. No other line states are possible. When the line is idle,
it is kept in the mark state.
START BIT
DATA BITS
Directly following the start bit, the data bits are sent. A bit value 1 causes the
line to go in mark state, the bit value 0is represented by a space. The least significant bit is
always the first bit sent.
22
PARITY BIT
For error detecting purposes, it is possible to add an extra bit to the data word
automatically. The transmitter calculates the value of the bit depending on the information
sent. The receiver performs the same calculation and checks if the actual parity bit value
corresponds to the calculated value.
STOP BITS
Suppose that the receiver has missed the start bit because of noise on the
transmission line. It started on the first following data bit with a space value. This causes
garbled date to reach the receiver. A mechanism must be present to resynchronize the
communication. To do this, framing is introduced.
The period of time lying between the start and stop bits is a constant defined
by the baud rate and number of data and parity bits. The start bit has always space value, the
stop bit always mark value. If the receiver detects a value other than mark when the stop bit
should be present on the line, it knows that there is a synchronization failure. This causes a
framing error condition in the receiving UART. The device then tries to resynchronize on
new incoming bits.
For desynchronizing, the receiver scans the incoming data for valid start and
stop bit pairs. This works, as long as there is enough variation in the bit patterns of the data
words.
The stop bit identifying the end of a data frame can have different lengths.
Actually, it is not a real bit but a minimum period of time the line must be idle (mark state) at
the end of each word. On PC's this period can have three lengths: the time equal
to 1, 1.5 or 2 bits. 1.5 bits is only used with data words of 5 bits length and 2 only for longer
words. A stop bit length of 1 bit is possible for all data word sizes.
23
5.6.3 RS-232 PHYSICAL PROPERTIES
5.6.4 USART
FEATURES
The Universal Synchronous and Asynchronous serial Receiver and Transmitter
is a highly flexible serial communication device.
The main features are:
• Full Duplex Operation (Independent Serial Receive and Transmit Registers)
• Asynchronous or Synchronous Operation
• Master or Slave Clocked Synchronous Operation
• High Resolution Baud Rate Generator
• Supports Serial Frames with 5, 6, 7, 8, or 9 Data Bits and 1 or 2 Stop Bits
• Odd or Even Parity Generation and Parity Check Supported by Hardware
• Data Over Run Detection
• Framing Error Detection
• Noise Filtering Includes False Start Bit Detection and Digital Low Pass Filter
• Three Separate Interrupts on TX Complete, TX Data Register Empty and RX
Complete
• Multi-processor Communication Mode
• Double Speed Asynchronous Communication Mode
24
USART BLOCK DIAGRAM
25
The dashed boxes in the block diagram separate the three main parts of the
USART (listed from the top): Clock Generator, Transmitter and Receiver. Control registers
are shared by all units. The clock generation logic consists of synchronization logic for
external clock input used by synchronous slave operation, and the baud rate generator.
The XCK (Transfer Clock) pin is only used by Synchronous Transfer mode.
The Transmitter consists of a single write buffer, a serial Shift Register, Parity Generator and
control logic for handling different serial frame formats. The write buffer allows a continuous
transfer of data without any delay between frames.
The Receiver is the most complex part of the USART module due to its clock
and data recovery units. The recovery units are used for asynchronous data reception. In
addition to the recovery units, the Receiver includes a Parity Checker, control logic, a Shift
Register and a two level receive buffer (UDR). The Receiver supports the same frame
formats as the Transmitter, and can detect frame error, data overrun and parity errors.
26
CHAPTER – 6
SOFTWARE DESCRIPTION
Atmel offers both 8-bit and 32-bit AVR flash microcontrollers. AVR combines
the most code-efficient architecture for c and assembly programming with the ability to tune
system parameters throughout the entire life cycle of your key products. No other
microcontrollers deliver more computing performance at lower power consumption.
Combined with industry leading development tools and design support, you get to market
faster. And once there, you can easily and cost-effectively refine and improve your product
offering.
AVR studio 4 is an integrated development environment (IDE). just like any other
IDE, AVR studio 4 is project based. a project is like an environment for a particular program
that is being written. it keeps track of what files are open, compilation instructions, as well as
the current graphical user interface (GUI) selections.
When the program is in run mode, hitting the pause key will halt the simulation and
put it into line-by-line mode. Also, if a break point was set in the code, the simulation will
automatically pause at the break point and put the simulation into line-by-line mode.
27
When running in line-by-line mode, several new buttons will be activated. These allow
you to navigate through the program.
a. Step into (f11) – steps into the code. Normal operation will run program line-
by-line, but will step into routine calls such as the rcall command.
b. Step over (f10) – steps over routine calls. Normal operation will run program
line-by-line, but will treat routine calls as a single instruction and not jump to the
routine instructions.
c. Step out (shift+f11) – steps out of routine calls. This will temporarily put the
simulation into run mode for the remainder of the routine and will pause at the
next instruction after the routine call.
d. run to cursor (ctrl+f10) – runs simulation until cursor is reached. the cursor is
the blinking line indicating where to type. Place the cursor by putting the mouse
over the instruction we want to stop at and hit the run to cursor icon.
After experimenting around with these four commands, we will be able to navigate through
the code with ease.
6.3WORKSPACE WINDOW
The workspace window holds valuable information about the project and the
simulation. There are three areas of the workspace windows signified by tabs at the bottom;
project, I/O, and info.
The project window contains all the information related to the project such as files
and file structuring. From here, files can be created, destroyed, rearranged, or organized. You
can also use this window to select which file appears in the editor window.
The I/O window contains all the registers associated with the simulated chip. By
default, this window should automatically be displayed when simulation is run in line-by-line
mode. I/O window in workspace shows an example of what the I/O window looks like during
the lab 1 simulation.
28
By expanding this window, additional information is available such as bits and
address of the registers. it is in this window where you can simulate input on the ports. The
node labelled I/O atmega128 contains all the special registers associated with the chip.
By expanding the I/O atmega8515 node, you have access to the ports and
can simulate input or interrupts through them.
The info window displays information about the current chip that is being
simulated. This information contains names and addresses of registers and external pins. it is
a good point of reference when programming for the chip.
The main area of the memory window contains three sets of information;
the address of the line in the blue, the data of the memory in hexadecimal format, and the
ASCII equivalent of that data. The pull down menu on the top left allows you to select the
various memory banks available for the atmega8515. To edit the memory, just place the
cursor in the hexadecimal data area and type in the new data.
29
6.5 DEBUGGING STRATEGIES
Debugging code can be the most time consuming process in programming.
here are some tips and strategies that can help with this process:
B. Pick a format and stick with it. The format is how you lay out your code. a single
programming format will make reading the code a lot easier.
C. Before writing any actual code, write it out in pseudo-code and convince yourself that
it works.
D. Break the code down into small routines and function calls. Small sections of code are
much easier to debug than one huge section of code.
E. Wait loops should be commented out during debugging. The simulator is much
slower than the actual chip and extensive wait loops take up a lot of time.
F. Use breakpoints to halt the simulation at the area known to be buggy. Proper use of
breakpoints can save a lot of time and frustration.
G. Carefully monitor the i/o window and memory windows throughout the simulation.
These windows will indicate any problem.
I. The atmega85c35 has certain memory ranges; so make sure that when manipulating
data
30
CHAPTER 7
7.1 CONCLUSION
The objective of this project that is “AUTOMATED ATTENDANCE USING RFID” was
to design a system based on RFID technology that will not only change the hectic manual
attendance procedure but also automate user’s office. The final design of the project
accomplished the idea of multinode environment which is responsible for automatic
attendance and office automation according to the personalized profile of the RFID card
holder. The design also deals with the issues (reliable data transfer) of multinode
environment. This project facilitates the users in numerous ways like time saving in
attendance procedure, security, employees’ attendance management and many more.
With the coming availability of low cost, short range radios along with advances in
wireless networking, it is expected that wireless ad hoc sensor networks will become
commonly deployed. This project can be improvised by using external memory because the
project design has a capability of handling 65000 card IDs which is large enough for any
organization but the limitation lies in the microcontroller storage capacity. This limitation can
be overcome by the use of NVRAM with the reader node which will not only make the design
scalable but also flexible. NVRAM not only provide us extra memory but also enable us to
add cards IDs on the run time
31
CHAPTER 8
REFERENCE
INTERNET
BOOKS
1. Mohammad Ali Mazidi, “The 8051 Microcontroller and Embedded Systems
UsingAssembly and C”, Second Edition, p 28
32