You are on page 1of 62

Project 2011 Based Attendance System

RFID

ACKNOWLEDGEMENT

We should like to express our heartfelt gratitude to Mrs. C.G. Anitha, Principal of our polytechnic for providing the best facility and atmosphere for this Project work. We greatly thankful to Mrs. Suhara .K.M, Head of Department of Electronics for all necessary help extended by her in the fulfillment of this Project. We acknowledge our Project guide Mr.Devarajan.M.K, Mr. Sureshkumar.K.B, Mrs.sussamma Mathew, Mrs. Padmaja Detha, Lucturers in Electronics Engineering for the guidance and help they have always given us. Finally we thank all our colleagues for their heartfelt co-operation and tremendous support they have given to us during the collection of materials and also during our Project.

Department of Electronics

1

Govt.Polytechnic

College,Nattakom

Project 2011 Based Attendance System

RFID

CONTENTS

1.INTRODUCTION 2.BLOCK DIAGRAM DESCRIPTION 3.EXPLANATION 4.CIRCUIT DIAGRAM 5.FLOW CHART 6.PROGRAM 7.PCB LAYOUT 8.PCB FABRICTION 9. MERITS AND DEMERITS 10.FUTURE ENHANCEMENT 11.CONCLUSION 12REFERENCE

Department of Electronics

2

Govt.Polytechnic

College,Nattakom

Project 2011 Based Attendance System

RFID

CHAPTER 1 INTRODUCTION

Traditionally the attendance at an establishment is usually done in a book register. It is time consuming. It is very difficult to verify the attendance over long periods. This method is very time consuming and very difficult to verify the attendance over a week or above. Keeping attendance registers is space consuming. Here chances of doing malpractice in marking attendance are high. RFID based attendance system uses RFID tags for each person. A person marks the attendance by swiping the tag near RFID reader module. The attendance is temporarily saved in the EEPROM. At any time the circuit can be connected to a computer and the attendance is moved from EEPROM to a text file in computer. It has following advantages. (1) Simplicity and reliability, (2) Saving attendance in a computer allows easy verification and longer record keeping. It works on radio frequency transmitters and receivers. Each person is given a RF ID card which is having a unique code. When it is swiped on a RF ID card reader, it reads the code and is stored. The attendance is temporarily saved in the EEPROM. At any time the circuit can be connected to a computer and the attendance is moved from EEPROM to a text file in computer. The advantage of this system is simplicity and reliability. Saving attendance in a computer allows easy verification and longer record keeping.

Department of Electronics

3

Govt.Polytechnic

College,Nattakom

This LF reader module with an internal or an external antenna facilitates communication with Read-Only Department of Electronics 4 Govt.1 Block Diagram Figure 2.1 Basic block diagram 2.Project 2011 Based Attendance System RFID CHAPTER 2 BLOCK DIAGRAM AND EXPLANATION 2. It is designed to work on the industry standard carrier frequency of 125 kHz.2 EXPLANATION RFID READER The DT125R series RFID Proximity OEM Reader Module has a builtin antenna in minimized form factor.Polytechnic College.Nattakom .

Immobilizers. Data Transmission is in ASCII Standard. Time and Attendance. Excellent read performance without an external circuit.Polytechnic College.The AUTOMATIC DATA COLLECTION Technology used in th RFID reader. No repeat reads.2 Power supply Department of Electronics 5 Govt. and other RFID enabled applications. needs +5V to become a reader.2. The Manchester encoded data is decoded to ASCII standard. Asset Management. Data read from the tag is Manchester encoded. Compact size and cost-effective very efficient module for portable readers.Nattakom . Plug-and-Play.Project 2011 Based Attendance System RFID transponders type UNIQUE or TK5530 via the air interface. Features • • • • • • Selectable UART or Wigand26. The LF DT125R module is best suited for applications in Access Control. LED/Beeper indicates tag reading operation. ASCII data format is shown below: 2. Handheld Readers. The tag data is sent to the host systems via the wired communication interface with a protocol selected from the module pinout. Decoded data is sent to the UART serial interface for wired communication with the host systems.

The source of dc power is used to establish the dc operating points for the passive and active electronic devices incorporated in the system. For many applications in electronics unregulated power supply is not good because of the following reasons. In addition to performing such energy transfer they are also capable of delivering a different value of ac current or voltage at their output terminals than the value applied to other input terminal. and a filter constitutes an ordinary dc supply.Nattakom . They do so utilizing the principle of electromagnetic induction. (1) Transformer Transformers are devices which are designed to transfer electrical energy from one electrical circuit to another. The combination of a transformer. Variations in temperature. Department of Electronics 6 Govt. In this circuit step down transformer is used. also called an unregulated power supply. a rectifier. Variations in the ac supply main.2 Block diagram of power supply Almost all electronic devices used in electronic circuits need a dc source of power supply to operate . Transformer can provide isolation.Project 2011 Based Attendance System RFID Block diagram of Power Supply TRANSFORMER BRIDGE RECTIFIER FILTER TRANSFORMER Regulated output VOLTAGE REGULATOR Figuer 2. • • • Poor regulation.Polytechnic College.

3 MICROCONTROLLER AT89C52 Department of Electronics 7 Govt.3 Power supply circuit 2.Polytechnic College. These regulators eliminate the distribution problems associated with single point regulation. When the upper end of the transformer secondary winding is positive. (3) Voltage Regulator (7805) Fixed three-terminal linear regulators are commonly available to generate fixed voltage of plus 3V. enters the load at positive terminal leaves the load at negative terminal. 12V or 15V when the load is less than about 7 amperes. diodes D1 and D3 are forward biased and current flows through the arm AB.2. 9V. a 7805 is a +5V regulator. say during first half cycle of the input supply. the last two digits of the device numbers are the output voltages. and plus or minus 5V.Nattakom . Often.Project 2011 Based Attendance System RFID (2) Bridge rectifier In the bridge circuit 4 diodes are connected I the form of a Wheatstone bridge. 7812. e. During the negative half cycle. the diodes D2 and D4 are forward biased so the current is not allowed to flow in arms AD and BC. In both cases the direction of flow of current through load resistance is same. Figure 2.g. The “78” series (7805. etc) regulate positive voltages.

and interrupt system to continue functioning. the Atmel AT89C52 is a powerful microcomputer which provides a highly-flexible and costeffective solution to many embedded control applications. serial port. and clock circuitry. 32 I/O lines. It has an endurance of 1000 write and erase cycles. It has a 256 x 8-bit Internal RAM. By combining a versatile 8-bit CPU with Flash on a monolithic chip. 256 bytes of RAM. timer/counters. It is having 32 programmable I/O lines. In addition. The AT89C52 is a low-power. three 16-bit timer/counters. The Idle Mode stops the CPU while allowing the RAM. a six-vector two-level interrupt architecture. The onchip Flash allows the program memory to be reprogrammed in-system or by a conventional nonvolatile memory programmer.Project 2011 Based Attendance System RFID It has 8K Bytes of In-System Programmable (ISP) Flash Memory. high-performance CMOS 8-bit microcomputer with 8K bytes of Flash programmable and erasable read only memory (PEROM). There are three 16bit Timers or Counters. The device is manufactured using Atmel’s highdensity nonvolatile memory technology and is compatible with the industry-standard 80C51 and 80C52 instruction set and pinout. on-chip oscillator.Nattakom . Department of Electronics 8 Govt. It has low-power Idle and Power-down modes. the AT89C52 is designed with static logic for operation down to zero frequency and supports two software selectable power saving modes. There are eight interrupt sources. It consists of a full duplex UART serial channel. The 8KB internal flash type ROM is used for storing user program. a full-duplex serial port.Polytechnic College. The AT89C52 provides the following standard features: 8K bytes of Flash.

is used as a general register to accumulate the results of a large number of instructions. It can hold an Department of Electronics 9 Govt. as its name suggests.Polytechnic College.Nattakom .Project 2011 Based Attendance System RFID ARCHITECTURE OF AT89C52 Figure 2.4 89C52 Architecture The Accumulator The Accumulator.

etc. The user should always initialize the DPS bit to the appropriate value before accessing the respective Data Pointer Register. The "R" registers The "R" registers are a set of eight registers that are named R0. R1. The Accumulator alone would not be very useful if it were not for these "R" registers. The "B" Register The "B" register is very similar to the Accumulator in the sense that it may hold an 8-bit (1-byte) value. Bit DPS = 0 in SFR AUXR1 selects DP0 and DPS = 1 selects DP1.Project 2011 Based Attendance System RFID 8-bit (1-byte) value and is the most versatile register the 8052 has due to the sheer number of instructions that make use of the accumulator. Aside from the MUL and DIV instructions. Department of Electronics 10 Govt. or "helper". The "R" registers are also used to temporarily store values. two banks of 16-bit Data Pointer Registers are provided: DP0 at SFR address locations 82H-83H and DP1 at 84H-85H.Polytechnic College. if you want to quickly and easily multiply or divide A by another number. The "R" registers as very important auxiliary.Nattakom . The "B" register is only used by two 8052 instructions: MUL AB and DIV AB. Thus. up to and including R7. Dual Data Pointer Registers To facilitate accessing both internal and external data memory. you may store the other number in "B" and make use of these two instructions. the "B" register is often used as yet another temporary storage register much like a ninth "R" register. registers.

Department of Electronics 11 Govt. RET.Project 2011 Based Attendance System RFID The Program Counter (PC) The Program Counter (PC) is a 2-byte address which tells the 8052 where the next instruction to execute is found in memory. When the 8052 is initialized PC always starts at 0000h and is incremented each time an instruction is executed. and unoccupied addresses may not be implemented on the chip. Note that not all of the addresses are occupied. If you immediately push a value onto the stack. When the 8052 is initialized SP will be initialized to 07h. This order of operation is important. LCALL. Read accesses to these addresses will in general return random data. the value will be stored in Internal RAM address 08h. may hold an 8-bit value.Polytechnic College.Nattakom . the reset or inactive values of the new bits will always be 0. like all registers except DPTR and PC. and write accesses will have an indeterminate effect. SFRs A map of the on-chip memory area is called the Special Function Register (SFR) space. In that case.) there is no way to read the value of PC. The Stack Pointer is used to indicate where the next value to be removed from the stack should be taken from. since they may be used in future products to invoke new features. POP. ACALL. The Stack Pointer (SP) The Stack Pointer. SP is modified directly by the 8052 by six instructions: PUSH. etc. and RETI. It is also interesting to note that while you may change the value of PC (by executing a jump instruction. User software should not write 1s to these unlisted locations.

a program from built in FLASH is to be executed first (to the last location). The ALU automatically changes some of register’s bits.Polytechnic College. which is usually used in regulation of the program performing. Internal code memory is limited to 8K. Flash RAM is also another popular method of storing a program. Data Memory (RAM) The AT89S52 implements 256 bytes of on-chip RAM. Auxiliary Carry. Program Memory Code memory is the memory that holds the actual 8052 program that is to be run. P0 and P2 are not available to the user because they are used for data and address transmission. Code may also be stored completely off-chip in an external ROM or. EA=1 In this case. internal program memory is completely ignored. two register bank select bits. Afterwards. In this case. The upper 128 bytes occupy a parallel address space to the Special Function Department of Electronics 12 Govt. more commonly.Nattakom . the pins ALE and PSEN are used too. the execution is continued by reading additional memory. an external EPROM. Besides. This register contains: Carry bit. The Program Status Word (PSW) contains several status bits that reflect the current state of the CPU. In 89S52 the internal code memory is a Flash memory. In both cases. The microcontroller handle external memory depends on the pin EA logic state: EA=0. Overflow flag.Project 2011 Based Attendance System RFID PSW Register (Program Status Word) This is one of the most important SFRs. and user-definable status flag. only a program stored in external memory is to be executed. parity bit.

Polytechnic College.Nattakom . As their names tell. It is a duplex port. Besides. the address mode used in the instruction specifies whether the CPU accesses the upper 128 bytes of RAM or the SFR space. This means that the upper 128 bytes have the same addresses as the SFR space but are physically separate from SFR space. When an instruction accesses an internal location above address 7FH. their main purpose is to measure time and count external events. T1 and T2.Project 2011 Based Attendance System RFID Registers.Input/output ports 4 ports within a total of 32 input-output lines are available to the user for connection to peripheral environment T2CON – Timer/Counter 2 Control Register Department of Electronics 13 Govt. Note that stack operations are examples of indirect addressing. they can be used for generating clock pulses used in serial communication. Instructions that use indirect addressing access the upper 128 bytes of RAM. UART (Universal Asynchronous Receiver and Transmitter) The UART in the AT89S52 operates the same way as the UART in the AT89C51 and AT89C52. P0. Instructions which use direct addressing access the SFR space. P3 .e. which means that it can transmit and receive data simultaneously. Baud Rate. i. Counters and Timers The 8052 microcontrollers have 3 timers/counters called T0. so the upper 128 bytes of data RAM are available as stack space. P2. P1. Also known as a serial port.

TCLK.Timer 2 external flag set when either a capture or reload is caused by a negative transition on T2EX and EXEN2 = 1. TCLK = 0 causes Timer 1 overflows to be used for the transmit clock. causes the serial port to use Timer 2 overflow pulses for its receive clock in serial port modes 1 and 3.Capture/Reload select.Timer 2 overflow flag set by a Timer 2 overflow and must be cleared by software. CP/RL2 = 0. CP/RL2.Nattakom . EXF2 = 1 will cause the CPU to vector to the Timer 2 interrupt routine.Project 2011 Based Attendance System RFID TF2. EXF2 does not cause an interrupt in up/down counter mode (DCEN = 1). allows a capture or reload to occur as a result of a negative transition on T2EX if Timer 2 is not being used to clock the serial port. When set.Timer 2 external enable.Timer or counter select for Timer 2. RCLK. IE (Interrupt Enable Register) Department of Electronics 14 Govt. C/T2 = 0 for timer function. TR2. When set.Start/Stop control for Timer 2.Polytechnic College. When set. C/T2 = 1 for external event counter (falling edge triggered). C/T2. EXF2 must be cleared by software. causes the serial port to use Timer 2 overflow pulses for its transmit clock in serial port modes 1 and 3. EXEN2. TF2 will not be set when either RCLK = 1 or TCLK = 1. TR2 = 1 starts the timer. causes automatic reloads to occur when Timer 2 overflows or negative transitions occur at T2EX when EXEN2 = 1. EXEN2 = 0 causes Timer 2 to ignore events at T2EX. EXF2. When Timer 2 interrupt is enabled.Transmit clock enable. CP/RL2 = 1 causes captures to occur on negative transitions at T2EX if EXEN2 = 1.Receive clock enable. RCLK = 0 causes Timer 1 overflow to be used for the receive clock.

ET0 -Timer 0 interrupt enable bit. The WDT is defaulted to disable from exiting reset. WATCH DOG TIMER The WDT is intended as a recovery method in situations where the CPU may be subjected to software upsets.Polytechnic College. it will drive an output RESET HIGH pulse at the RST pin.Timer 1 interrupt enable bit.Timer 2 interrupt enable bit.4 REAL TIME CLOCK (DS12887) It is totally nonvolatile with over 10 years of operation in the absence of power. If EA = 1. ET2 .Serial Port interrupt enable bit.Project 2011 Based Attendance System RFID EA .2. When the WDT is enabled. EX0 . 2. no interrupt is acknowledged. each interrupt source is individually enabled or disabled by setting or clearing its enable bit. it will increment every machine cycle while the oscillator is running. Department of Electronics 15 Govt. It has a self-contained subsystem that includes lithium. The WDT consists of a 14-bit counter and the Watchdog Timer Reset (WDTRST) SFR. When WDT overflows. To enable the WDT.External interrupt 0 enable bit. There is no way to disable the WDT except through reset (either hardware reset or WDT overflow reset).Nattakom .Disables all interrupts. The WDT timeout period is dependent on the external clock frequency. If EA = 0. a user must write 01EH and 0E1H in sequence to the WDTRST register (SFR location 0A6H). ES .External interrupt 1 enable bit. EX1 . ET1 .

6 LCD MODULE Department of Electronics 16 Govt. the write protection feature is enabled. SCL is the serial clock input. Data retention is 100 years. The Write Protect (WP) pin allows normal read/write operations when connected to ground (GND).15 bytes of clock and control registers. hours. and support circuitry. When the Write Protect pin is connected to VCC. month. date. Figure 2.2.Polytechnic College.5 Pin diagram of EEPROM 2. It is highly reliable. It has 16byte page write modes. minutes. calendar. It also has binary or BCD representation of time. and alarm. It has a 2-wire serial interface. day of the week. Daylight savings time option is also present in it. and year with leap year compensation valid up to 2100. The memory is internally organized as 1024 x 8 (8K). 2. There is 3 address inputs A0-A2. Endurance is 1 Million Write Cycles. It counts seconds. It is interfaced with software as 128 RAM locations. It has 12 or 24 hour clock with AM and PM in 12 hour mode.Project 2011 Based Attendance System RFID quartz. It is guided on the basis of Bi-directional Data Transfer Protocol. ie.5 EEPROM The EEPROM used is 24C08. SDA is the serial data.2.Nattakom . and 113 bytes of general purpose RAM. There is a write protect pin for hardware data protection.

characters and graphics. limited to displaying only numbers to few characters. • The ability to display numbers. This is in contrast to LEDs. pin 2 or pin 15. pin 16 LCD pin descriptions These are the 16 pins and they are given below along with their basic functions and symbols used to represent them. PIN NUM BER 1 2 3 4 5 6 7 8 9 Department of Electronics SYMBOL FUNCTION Vss Vdd Vo RS R/W E DB0 DB1 DB2 17 GND + 3Vor + 5V Contrast Adjustment H/L Register Select Signal H/L Read/Write Signal H ->L Enable Signal H/L Data Bus Line H/L Data Bus Line H/L Data Bus Line Govt. Features • + 5V power supply (Also available for + 3V) • 1/16 duty cycle • To be driven by pin 1.Polytechnic College.6 LCD Display In recent years the LCD is finding widespread use replacing LEDs.Nattakom .Project 2011 Based Attendance System RFID Figure 2. This is due to the following reasons: • The declining price of the LCDs.

as follows: if R/W = 1. R/W. allowing user to send data to be displayed on the LCD.RS = Department of Electronics 18 Govt.2V for LED/Negative Voltage Output K Power Supply for B/L (OV) Table 2. else if zero implies write. To display letters and numbers. Data lines The 8-bit data pins.Nattakom .Project 2011 Based Attendance System RFID 10 11 12 13 14 15 16 DB3 DB4 DB5 DB6 DB7 A/Vee H/L Data Bus Line H/L Data Bus Line H/L Data Bus Line H/L Data Bus Line H/L Data Bus Line + 4. Vss is the ground pin and the Vee or Vo is used for controlling LCD contrast. If RS=0. a . Read/Write R/W input allows the user to write the information to the LCD or read information from it.z.D7. If RS=1. E. When data is supplies to data pins. Vee The Vcc or Vdd pin is used to provide supply of +5V. DO .1 Lcd pin discription Vcc.Polytechnic College. we send ASCII codes for the letters A . 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 information The busy flag is D7 and can be read when R/W = 1 and RS = 0. are used to send information to the LCD or read the contents of the LCD's internal registers. the data register is selected. This pulse must be a minimum of 450ns wide. If this pin is set high then read will be selected. and numbers 0 .Z.9 to these pins while making RS = 1. Register Select There are 2 very important types of register inside the LCD. the command code register is selected. The RS pin is used for their selection as follows. Enable This pin is used by the LCD to latch information presented to its data pins. DO . RS. Vss. a high to low pulse must be applied to this pin in order for the LCD to latch in the data present in the data pins.D7.

It operates from a single 5-V power supply with 1.2. These encoders also have on-chip pull-up devices which permit switches with up to 50 kW on resistance to be used.0µF Charge-Pump Capacitors. No diodes in the switch array are needed to eliminate ghost switches. this twokey roll-over is provided between any two switches. The 3-STATE outputs provide for easy expansion and bus operation and are LPTTL compatible. Department of Electronics 19 Govt. The Data available will return high to indicate acceptance of the new key after a normal debounce period. The Data available output returns to a low level when the entered key is released.1µF Charge-Pump capacitor is available with the MAX202. even if another key is depressed. It can operate up to 120 kbit/s. It works at low supply current 8 mA typical.8 KEYPAD ENCODER The MM74C922 and MM74C923 CMOS key encoders provide all the necessary logic to fully encode an array of SPST switches.7 MAX 232 It meets or Exceeds TIA/EIA-232-F and ITU. When D7 = 1 (busy flag = 1 ) .Nattakom . An internal register remembers the last key pressed even after the key is released. The keyboard scan can be implemented by either an external clock or external capacitor.2. the LCD is busy taking care of internal operations and will not accept any new information.Project 2011 Based Attendance System RFID O. It has two drivers and two receivers and 30-V input levels.Polytechnic College. 2. ESD Protection Exceeds JESD 22. 2. 2000-V Human-Body Model A114A. Upgrade with improved ESD (15-kV HBM) and 0. The internal debounce circuit needs only a single external capacitor and can be defeated by omitting the capacitor.

7 74C922 Encoder Features • • • • • 50 kW maximum switch on resistance On or off chip clock On-chip row pull-up devices Keybounce elimination with single capacitor Last key register at outputs Department of Electronics 20 Govt.Nattakom .Project 2011 Based Attendance System RFID Figure 2.Polytechnic College.

1 Circuit Diagram Figure 3.Project 2011 Based Attendance System RFID CHAPTER 3 CIRCUIT DIAGRAM 3.Nattakom .1 Circuit diagram Department of Electronics 21 Govt.Polytechnic College.

Project 2011 Based Attendance System

RFID

3.2 Working
Microcontroller reads time from real time chip DS12887. Whenever a RFID tag is brought near RFID module, it sends the card number in ASCII fomat to the microcontroller. The microcontroller compares this number with those numbers in the EEPROM. If match is found, it first check whether it is a master card, then it displays menu for master card. If not, it displays the ID number and then sends the time and date details along with ID number to EEPROM for marking daily attendance. If no matches found, the microcontroller displays ‘Card Not Programmed’ in LCD. Master card menu consists of set time, add, edit, delete, transfer. The various options are selected using the keypad keys- up, down, enter, cancel. Keypad encoder converts the key pressed into corresponding hex file. The output from RFID is given as the serial input. The card ID number is 8 bytes long and two extra bytes serve as start and stop bits. Set time: It is used to edit the time of RTC. The time is entered using the keypad. Add: It is used to add a new tag and store the new tag number and ID number to EEPROM. Edit: It is used to edit the card ID number. The new ID number is entered through keypad. Delete: It is used to delete a card from record. Transfer: This option is used to transfer the marked attendance stored in EEPROM to the computer. MAX232 is used to convert the TTL voltage to RS232 compatible voltage. Real time clock is used to provide the date, month, and year details for marking the attendance.

Department of Electronics

22

Govt.Polytechnic

College,Nattakom

Project 2011 Based Attendance System

RFID

CHAPTER 4 PROGRAM FLOW CHART

Department of Electronics

23

Govt.Polytechnic

College,Nattakom

Project 2011 Based Attendance System

RFID

Department of Electronics

24

Govt.Polytechnic

College,Nattakom

Nattakom .Polytechnic College.Project 2011 Based Attendance System RFID Department of Electronics 25 Govt.

min.sec. code unsigned char msg13[]={"ENTER THE.Nattakom .0XA4.w.MENU"}.0XA7}.laddr.PORT DECLARATION ---------------------------------------------------// sfr ldata = 0xA0.l2addr. //---------------------------------. code unsigned char msg2[]={"DETECTED CARD-NO"}.h> //----------------------." ADD". code unsigned char msg1[]={"CARD NOT-PROGRAMMED"}. code unsigned char msg12[]={"SHOW CARD-TO EDIT"}. code unsigned char msg7[]={"ENTER MINUTES -'00~59'"}. code unsigned char msg10[]={"ENTER YEAR -'00~99'"}. //---------------------------------. unsigned char dwaddr[]={0xA0. code unsigned char *msg4[]={"SET TIME".ndel=0.r. sbit EN = P1^5. code unsigned char msg14[]={"CARD ADDED"}.data1[8].h> #include<aBsacc.0XA2. Department of Electronics 26 Govt.0XA6}. sbit IN = P1^6. unsigned char code1.ID NO"}. code unsigned char msg3[]={"MASTER CARD. sbit sda = P3^5. code unsigned char msg16[]={"RECORD -MEMORY FULL"}. code unsigned char msg6[]={"ENTER HOUR -0~24"}.Project 2011 Based Attendance System RFID CHAPTER 5 PROGRAM #include<reg52. code unsigned char msg15[]={"CARD EDITED"}.choice=0.GLOBAL VARIABLES ----------------------------------------------------// unsigned char hr. code unsigned char msg5[]={"SHOW CARD-TO DELETE"}.yr. code unsigned char msg11[]={"SHOW CARD-TO ADD"}.0XA3. code unsigned char msg8[]={"ENTER DAY -'01~31'"}.0XA5.draddr[]={0XA1.day. sbit sclk = P3^4. unsigned char nadd=0."DELETE". code unsigned char msg9[]={"ENTER MONTH -'01~12'"}."EDIT".mnt.nedit=0.addr."TRANSFER"}.Polytechnic College. sbit RS = P1^4.DISPLAY MESSAGES ----------------------------------------------------// code unsigned char msg0[]={"ATTENDANCE-SYSTEM"}.

void sendcode(unsigned char). void transmit(). unsigned char input(unsigned char). void added(). void send_byte_s_eeprom(unsigned char). void lcddata( unsigned char)."}. void nop(void). unsigned char checkcard(). void senddetails(). //-----------------------------------. void display(unsigned char []). void start_s_eeprom(). unsigned char hexbcd(unsigned char). void send_to_mem(unsigned char. void edited().j. void serial(unsigned char). if(TI ==1) T1=0. //----------------------------------.. code unsigned char msg18[]={"DELETE DATA?"}. void del(). void stop_s_eeprom(). void settime().SERIAL INTERRUPT ----------------------------------------------// void serialintr() interrupt 4 { unsigned char num. unsigned char get_byte_s_eeprom(). void lcdinit().Polytechnic College. code unsigned char msg19[]={"DATA DELETED"}. static int l=0. unsigned char get_from_mem(unsigned char).FUNCTION PROTOTYPE -------------------------------------------------// void msdelay(unsigned int).Nattakom . void hexascii(unsigned char). void prog(). else { num=SBUF. unsigned char). void sendadd(unsigned char). Department of Electronics 27 Govt. void lcdcmd( unsigned char). void bcdascii(unsigned char).Project 2011 Based Attendance System RFID code unsigned char msg17[]={"SENDING DATA.

else { j=checkcard(). l++.Nattakom . SCON=0x50. } } //-------------------------------------Main Program------------------------------------------------------void main() { msdelay(80). Department of Electronics 28 Govt. else if(j==1) { if(nedit==1) edited(). else if(ndel==1) del(). TMOD=0x20.Polytechnic College. TH1= -3. } RI=0. hexascii(code1). } else if(num==0x0D) if(l==8) { if(nadd==1) added(). lcdcmd(0x01). else { senddetails(). display(msg2).Project 2011 Based Attendance System RFID if(num!=0x0D && num!=0x0A) { data1[l]=num. TR1=1. } } else prog(). } l=0. if(j==0) display(msg1).

min=XBYTE[2]. sec=XBYTE[0]. display(msg0). } void lcdcmd( unsigned char value) Department of Electronics 29 Govt.Project 2011 Based Attendance System RFID IE=0x90. day=XBYTE[7]. l2addr=get_from_mem(0XFF). r=0. j<1275. msdelay(4). lcddata(':'). j++). lcddata('-'). yr=XBYTE[9]. r=1. lcddata('2').j. for(i=0. bcdascii(day).Nattakom . lcddata('-'). lcddata('0'). bcdascii(hr). bcdascii(yr). lcdcmd(0x01). w=get_from_mem(0xFE). msdelay(4). msdelay(4). lcdinit(). while(1) { hr=XBYTE[4]. i++) for(j=0. bcdascii(mnt). lcddata(':'). mnt=XBYTE[8]. i<td. lcdcmd(0xC0). w=0. bcdascii(min). } } //-----------------------------Function Definition------------------------------------------------void msdelay(unsigned int td) { unsigned int i.Polytechnic College. lcdcmd(0x80). laddr=get_from_mem(0xFD). bcdascii(sec).

msdelay(60). EN=0. i++. } void lcddata( unsigned char value) { ldata=value. RS=1. lcdcmd(0x01). } void display(unsigned char msg[]) { short int i=0. EN=1. msdelay(60). while(msg[i]!='\0') { if(msg[i]=='-') lcdcmd(0xC0). msdelay(1). msdelay(1). } void lcdinit() { lcdcmd(0x38). lcdcmd(0x80). RS=0. lcdcmd(0x80). else lcddata(msg[i]).Polytechnic College. lcdcmd(0x06).Nattakom .Project 2011 Based Attendance System RFID { ldata=value. lcdcmd(0x01). } } void bcdascii(unsigned char num) { unsigned char x. Department of Electronics 30 Govt.y. lcdcmd(0x0E). x=num&0x0F. EN=1. EN=0.

} else { serial(x). n[1]=num/10.Project 2011 Based Attendance System RFID x=x|0x30. n[1]=n[1]<<4. } else { serial(y). z=z|0x30. y=num&0xF0. y=y|0x30. num=n[1] | n[0]. z=val%10. Department of Electronics 31 Govt. serial(z). } } void hexascii(unsigned char val) { unsigned char x. x=val/100.y. y=y|0x30.Polytechnic College. serial(x). n[0]=num%10. lcddata(y). if(choice==0) { lcddata(y). serial(y). if(choice==0) { lcddata(x). val=val%100. lcddata(x). y=y>>4.z. x=x|0x30. } } unsigned char hexbcd(unsigned char num) { unsigned char n[2]. lcddata(z). y=val/10.Nattakom .

for(addr=0x00. r=0.i++) { if(i!=8) data2[i]=get_from_mem(taddr++). for(i=0. break. } else addr=taddr. } w=temp1. } for(j=0.j. if(flag==0) { if(addr==0x00) a=2. r=temp2. } void nop(void) { } unsigned char checkcard() { unsigned char a=0. else code1=get_from_mem(taddr++).j++) if(data1[j]!=data2[j]) flag=1.num=0.n1. taddr=addr.Nattakom .j<8.Polytechnic College. unsigned char i. Department of Electronics 32 Govt. return a. temp1=w.i<9.) { flag=0.flag=0. } unsigned char input(unsigned char c) { unsigned char count=1.c1[]={1.100}.temp2.temp1.data2[8].taddr. temp2=r. w=0.Project 2011 Based Attendance System RFID return num. else a=1.addr<=laddr.10.

if(c==1) break. count++. if(inp==0x0C) { if(k==0) Department of Electronics 33 Govt. } else if(count==2) { num=num+n1*c1[(c-2)]. count++. } } } if(c==1) return n1. } else { num=num+n1. inp=input(1). n1=P1. } void prog() { unsigned char k=0. display(msg3). n1=n1&0x0F. else if(n1<0x0A) { if(count==1) { num=n1*c1[(c-1)].inp. while(IN==1).Project 2011 Based Attendance System RFID while(count<=c) { while(IN==0). else return num. display(msg4[k]).Polytechnic College. count++.Nattakom . do { display(msg4[k]).

} }while(inp!=0x0F). case 4: display(msg17). display(msg6). hr=hexbcd(hr).Polytechnic College. nadd=1. min=hexbcd(min). XBYTE[11]=0x83. else if(inp==0x0E) { switch(k) { case 0: settime(). break. XBYTE[10]=0x20. } void settime() { msdelay(80). } break. display(msg7).Nattakom . else k--. case 2: display(msg12). Department of Electronics 34 Govt. break. break.Project 2011 Based Attendance System RFID k=4. } else if(inp==0x0F) break. ndel=1. hr=input(2). nedit=1. if(k>4) k=0. min=input(2). break. transmit(). case 3: display(msg5). } else if(inp==0x0D) { k++. break. case 1: display(msg11).

stop_s_eeprom(). nadd=0.caddr. } void added() { unsigned char i=0. for(i=0. display(msg10). Department of Electronics // page write 35 Govt. XBYTE[0]=0x00. display("Adding"). day=input(2). msdelay(4). } send_to_mem(taddr+8. XBYTE[4]=hr. k=input(3). msdelay(4).k. taddr=laddr.Polytechnic College. } void edited() { unsigned char k.k). stop_s_eeprom(). XBYTE[8]=mnt.laddr). display(msg13). yr=hexbcd(yr). send_to_mem(0xFD. laddr=laddr+0x09. display(msg14). caddr=addr+0x08.taddr. XBYTE[9]=yr.i++) { send_to_mem(taddr+i. display(msg13). msdelay(4). mnt=input(2). XBYTE[7]=day. display(msg9).i<8. mnt=hexbcd(mnt).data1[i]).Project 2011 Based Attendance System RFID display(msg8). XBYTE[11]=0x03. yr=input(2). XBYTE[2]=min. k=input(3). day=hexbcd(day).Nattakom . stop_s_eeprom().

send_byte_s_eeprom(hr). msdelay(4). msdelay(4).i++) send_byte_s_eeprom(0xFF).0xFF). } void del() { unsigned char i=0.taddr.Nattakom . send_byte_s_eeprom(dwaddr[w]). send_to_mem(taddr. display(msg19). send_byte_s_eeprom(mnt).0xFF). if(w==4) l2addr=0xFC. send_to_mem(taddr+7. send_byte_s_eeprom(day).Project 2011 Based Attendance System RFID display("Editing"). send_byte_s_eeprom(code1).Polytechnic College. send_to_mem(caddr. nedit=0. send_byte_s_eeprom(0xFF). ndel=0. } void senddetails() { if(w<4) { start_s_eeprom(). stop_s_eeprom(). send_byte_s_eeprom(min). Department of Electronics // page write 36 Govt. stop_s_eeprom().i<7. stop_s_eeprom(). for(i=1.k). send_byte_s_eeprom(yr). if(l2addr==0xFC) { w+=1. l2addr+=7. msdelay(4). send_byte_s_eeprom(l2addr). display(msg15). taddr=addr. msdelay(4). stop_s_eeprom().

Nattakom . stop_s_eeprom(). addr2=0x00. } serial('#'). if(w==temp) if(addr2>=l2addr) break. stop_s_eeprom().Polytechnic College. temp=w. msdelay(4). if(i==0) hexascii(num). r=1.temp.addr2=0x00. choice=1. for(i=0. r+=1.Project 2011 Based Attendance System RFID else l2addr=0x00. w=1. Department of Electronics 37 Govt. } send_to_mem(0xFE. do { serial('@'). } else display(msg16).l2addr).num. } }while(w<=temp). send_to_mem(0xFF. else bcdascii(num).i++) { num=get_from_mem(addr2++).w). msdelay(4). msdelay(4).i<7. if(temp==4) temp--. } void transmit() { unsigned char i. if(addr2==0xFC) { w+=1.

w=1. } void send_to_mem(unsigned char s_address.Polytechnic College. send_byte_s_eeprom(s_address). // stop_s_eeprom(). send_byte_s_eeprom(draddr[r]). TI=0. display(msg18). } void send_byte_s_eeprom(unsigned char s_byte) { unsigned char temp = s_byte. send_byte_s_eeprom(s_data). //----------------dummy over---------------------------------------------------start_s_eeprom(). send_byte_s_eeprom(0XA0). stop_s_eeprom(). while(TI==0).Project 2011 Based Attendance System RFID choice=0. i = get_byte_s_eeprom(). if(input(1)==0x0E) { l2addr=0x00.unsigned char s_data) { start_s_eeprom(). } unsigned char get_from_mem(unsigned char s_address) { unsigned char i = 0. } } void serial(unsigned char n) { SBUF=n. return(i). //-------dummy write seq----+ word address-----------------------------------start_s_eeprom().Nattakom . send_byte_s_eeprom(dwaddr[w]). Department of Electronics 38 Govt. r=1. display(msg19). send_byte_s_eeprom(s_address).

i--) { j=i-1. sclk = 1. nop(). sclk = 0. temp = s_byte. nop(). nop().Project 2011 Based Attendance System RFID unsigned char i. nop(). } Department of Electronics 39 Govt. nop(). nop().j. sclk =0. i >0 . i--) { j=i-1. nop().j. } unsigned char get_byte_s_eeprom() { unsigned char temp. sclk = 1. i. nop(). temp = temp & 0X01. nop(). sclk = 0. temp_h. temp = 0. else sda = 1.Polytechnic College. if(temp == 0) sda = 0. nop(). for(i = 8. temp_h = 1. sda = 1. temp = temp >> j. i > 0 . } sda = 1. sclk = 1. nop(). if(sda == 1) temp = temp | temp_h<<j . for(i = 8 .Nattakom .

Nattakom .Polytechnic College. nop(). nop(). sda = 1. nop(). sclk = 0. sclk nop(). Department of Electronics 40 Govt. nop(). nop(). nop(). nop(). } void stop_s_eeprom() { sda = 0. nop(). sclk = 1. nop(). sda = 0.Project 2011 Based Attendance System RFID sclk = 0. nop(). } = 1. } void start_s_eeprom() { sda = 1. return(temp). nop().

PCB Drawing: Making of PCB drawing involves placement of components. Fabricating PCB from the drawing The traditional method of drawing with complete placement of parts. The making of PCB essentially involves two steps: 1. track size and spacing and prevention of overcrowding of components at a particular area.Nattakom . optimum area each component should occupy shape and size of pads for the components. taking a photographic negative of the drawing. developing the image of the negative formed on photo sensitized copper plate and dissolving the excess copper by etching is a standard practice being followed by large scale operations. We should keep in mind that quality of soldering affects the quality of the output. For anchoring leads of component 1mm diameter holes and for fixing PCB holding screws to the 3mm holes diameter can be made. a sketch of PCB is made. the cost saving method presented here may be adopted. However for small-scale operations. PCB Making: The making of PCB is as much as art on a technique particularly so when they are to fabricated in very small numbers. Preparing PCB drawing 2. The procedure for fabricating the PCB for setting up the circuit of any multipurpose project is described below.Project 2011 Based Attendance System RFID FABRICATION OF PCB Making a Printed Circuit Board is the first step towards building electronic equipment by any electronic industry. There are several ways of drawing PCB patterns and making the final boards.Polytechnic College. where large numbers of copies are not required. With these details the sketch of the PCB is made. Following these hints. locating holes. PCB Fabrication: Department of Electronics 41 Govt.

a direct photographic transfer of the PCB drawing from a negative image of the drawing to a photo sensitized copper clad sheet is carried out. The copper from the unexposed area is later etched away. 1mm. Stirring the solution helps in speedy etching. The pads are drilled with proper drill sizes of 0. screen printing method is used to transfer the PCB drawing image to the copper clad sheet. For large quantity production.9mm. The dissolution of unwanted copper would take about 45min. 3mm etc for the leads and mounting holes. For a small number of PCB. The PCB can then be washed and dried.Nattakom .Project 2011 Based Attendance System RFID The fabrication of the PCB starts by transferring the PCB drawing onto a copper clad sheet.Polytechnic College. The paint on the pattern can be removed by rubbing with a rag soaked in thinner. The copper clad sheet is placed in the solution with its copper side upwards in a plastic tray. Department of Electronics 42 Govt. If etching takes longer. turpentine or acetone. the solution may be heated again and the process is repeated. For etching the copper clad sheet 20-30grms of ferric chloride 75ml of water heated to about 60degree Celsius may be used .

• • • Disadvantages • • • • Identity theft. Promiscuity of tags.Nattakom . No need to connect this system to a P. Space consumption can be reduced to a greater extent. Non-contact and non-line-of-sight. Very little power available to digital portion of the IC.C always. limited functionality. System affected by metal interference. Easy to verify the attendances over a long period of time.Project 2011 Based Attendance System RFID CHAPTER 6 MERITS AND DEMERITS Advantages • • • Unauthorized attendance can be avoided. Lack of standards and protocols Department of Electronics 43 Govt.Polytechnic College.

without connecting to the system. Many multitudes of labour can be done associating low cost hardware . the range can be increased. By using active tags or using high frequency RFID readers.Polytechnic College. Power loss graceful recovery of tags can be implemented. Improved memory storage can make it possible to mark the attendances of a large group of people.Project 2011 Based Attendance System RFID CHAPTER 7 FUTURE ENHANCEMENT Protocols may be rolled out which make tags obstinate to power interruption and fault induction. Research works could be conducted on smart cards and other embedded systems.Nattakom . Department of Electronics 44 Govt.

Polytechnic College.Project 2011 Based Attendance System RFID Department of Electronics 45 Govt.Nattakom .

Nattakom .Project 2011 Based Attendance System RFID APPENDIX Department of Electronics 46 Govt.Polytechnic College.

high-performance CMOS 8-bit microcomputer with 8K bytes of Flash programmable and erasable read only memory (PEROM). The device is manufactured using Atmel’s high-density nonvolatile memory technology and is compatible with the industry-standard 80C51 and 80C52 instruction set and pinout. Department of Electronics 47 Govt. The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional nonvolatile memory programmer.Nattakom .Polytechnic College.000 Write/Erase Cycles • Fully Static Operation: 0 Hz to 24 MHz • Three-level Program Memory Lock • 256 x 8-bit Internal RAM • 32 Programmable I/O Lines • Three 16-bit Timer/Counters • Eight Interrupt Sources • Programmable Serial Channel • Low-power Idle and Power-down Modes Description The AT89C52 is a low-power.Project 2011 Based Attendance System RFID AT89C52 Features • Compatible with MCS-51™ Products • 8K Bytes of In-System Reprogrammable Flash Memory • Endurance: 1.

..... 15.......6V DC Output Current......................................0V to +7............................................................Nattakom .............0V Maximum Operating Voltage ................0 mA DC CHARACTERISTICS Department of Electronics 48 Govt...............Project 2011 Based Attendance System RFID Absolute Maximum Ratings Operating Temperature............Polytechnic College....... -65°C to +150°C Voltage on Any Pin with Respect to Ground ... 6..... -55°C to +125°C Storage Temperature ......-1.

Nattakom . The Data Available will return high to indicate acceptance of the new key after a normal debounce period. The Data Available output returns to a low level when the entered key is released. These encoders also have on-chip pullup devices which permit switches with up to 50 kX on resistance to be used. this two-key rollover Department of Electronics 49 Govt. The keyboard scan can be implemented by either an external clock or external capacitor.Project 2011 Based Attendance System RFID External Program and Data Memory Characteristics 74C922. No diodes in the switch array are needed to eliminate ghost switches. even if another key is depressed. A Data Available output goes to a high level when a valid keyboard entry has been made.Polytechnic College.16 KEY ENCODER These CMOS key encoders provide all the necessary logic to fully encode an array of SPST switches. The internal debounce circuit needs only a single external capacitor and can be defeated by omitting the capacitor.

Project 2011 Based Attendance System RFID is provided between any two switches. Features • • • • • • • • • 50 kX maximum switch on resistance On or off chip clock On-chip row pull-up devices 2 key roll-over Keybounce elimination with single capacitor Last key register at outputs TRI-STATE outpust LPTTL compatible Wide supply range 3V to 15V Low power consumption Department of Electronics 50 Govt. An internal register remembers the last key pressed even after the key is released.Nattakom .Polytechnic College. The TRI-STATEÉ outputs provide for easy expansion and bus operation and are LPTTL compatible.

Project 2011 Based Attendance System RFID DC Electrical characteristics Department of Electronics 51 Govt.Polytechnic College.Nattakom .

Nattakom .Polytechnic College.Project 2011 Based Attendance System RFID Department of Electronics 52 Govt.

....0 mA • Department of Electronics 53 Govt.. 2...... 5V) Compatibility • Write Protect Pin for Hardware Data Protection • 8-byte Page (1K..............-1.... 6....Polytechnic College.......... 5-lead SOT23... 512 x 8 (4K)......... 8-lead TSSOP and 8-ball dBGA2™ Packages Absolute Maximum Ratings Operating Temperature.. 1024 x 8 (8K ) or 2048 x 8 (16K) • 2-wire Serial Interface • Schmitt Trigger........... Filtered Inputs for Noise Suppression • Bi-directional Data Transfer Protocol • 100 kHz (1... -65° C to +150°C Voltage on Any Pin with Respect to Ground .5V) • Internally Organized 128 x 8 (1K).. 8-lead JEDEC SOIC.... 2K)....... 5......8 (VCC = 1.Nattakom ... 8-lead MAP..... 16K) Write Modes • Partial Page Writes are Allowed • Self-timed Write Cycle (5 ms max) • High-reliability – Endurance: 1 Million Write Cycles – Data Retention: 100 Years • Automotive Grade.....8V to 5.. -55° C to +125°C Storage Temperature ...7V to 5...7 (VCC = 2..5V........................ 16-byte Page (4K.5V) – 1..... 8K.8V) and 400 kHz (2.... Extended Temperature and Lead-free/Halogen-free Devices Available • 8-lead PDIP...0V to +7...7V.............25V DC Output Current....... 256 x 8 (2K).....Project 2011 Based Attendance System RFID EEPROM 24C08 Features • Low-voltage and Standard-voltage Operation –2...0V Maximum Operating Voltage .

Department of Electronics 54 Govt. quartz.Project 2011 Based Attendance System RFID Real time clock DS12887 FEATURES • Drop-in replacement for IBM AT computer clock/calendar • Pin compatible with the MC146818B and DS1287 • Totally nonvolatile with over 10 years of operation in the absence of power • Self-contained subsystem includes lithium. and support circuitry.Nattakom .Polytechnic College.

date. hours.Polytechnic College. days. month. and alarm 12– or 24–hour clock with AM and PM in 12–hour mode Daylight Savings Time option Selectable between Motorola and Intel bus timing Multiplex bus for pin efficiency Interfaced with software as 128 RAM locations 15 bytes of clock and control registers 113 bytes of general purpose RAM Programmable square wave output signal Bus–compatible interrupt signals (IRQ) Three interrupts are separately software maskable and testable Time–of–day alarm once/second to once/day Periodic rates from 122 ms to 500 ms End of clock update cycle Century register Department of Electronics 55 Govt. and year with leap year compensation valid up to 2100 Binary or BCD representation of time.Project 2011 Based Attendance System RFID • • • • • • • • • • • • • • • • Counts seconds. day of the week. calendar.Nattakom . minutes.

Polytechnic College.Project 2011 Based Attendance System RFID • Department of Electronics 56 Govt.Nattakom .

Nattakom .Polytechnic College.Project 2011 Based Attendance System RFID RFID READER • Features • Selectable UART or Wigand26 Department of Electronics 57 Govt.

Pin description Department of Electronics 58 Govt.Polytechnic College.Project 2011 Based Attendance System RFID • • • • • • Plug-and-Play. needs +5V to become a reader No repeat reads LED/Beeper indicates tag reading operation Excellent read performance without an external circuit Compact size and cost-effective A very efficient module for portable readers.Nattakom .

Polytechnic College. Some of the common applications for this module are: • Access control • Handheld readers • Asset management • Time and Attendance • Immobilizers LCD DISPLAY Absolute Maximum Ratings Department of Electronics 59 Govt.Project 2011 Based Attendance System RFID Applications of LF DT125R Series Applications of the RFID OEM LF DT125R Reader Module are limited by the imagination of the designer because of the compact form factor and low power consumption.Nattakom .

Project 2011 Based Attendance System RFID Electrical Characteristics PIN Description • Department of Electronics 60 Govt.Nattakom .Polytechnic College.

Polytechnic College.Nattakom . It is a simple method and is reliable.Project 2011 Based Attendance System RFID CHAPTER 8 CONCLUSION The project RFID based attendance system has been completed and working has been observed. Department of Electronics 61 Govt. The ID number and related details are sent to the computer . RFID tag shown over the reader identifies the person and the code can be entered by the use of keypad. Saving attendance in a computer allows easy verification and longer record keeping. RFID module comprising of a RFID Reader and a RF Tag avails an easy implementation option and is a far less tedious bid.

A. Kenneth J Ayala.Polytechnic College.cornell. Pearson Education. www.B.K. Muhammad Ali Mazzidi.Sawhney 3. The 8051 Microcontroller and Embedded Systems (Second Edition) by Muhhammad Ali Mazidi. Rolin D McKinlay 2.Nattakom .electronics4u. J. www.Project 2011 Based Attendance System RFID REFERENCES 1.datasheet4u.com 8.com Department of Electronics 62 Govt. programming and applications”. “The 8051 Microcontroller Architecture.com 6. Gupta .com 7.dallas. 4. Janice Gillispie Mazidi. www. Electric and Electronics Measurement and Instrumentation (Fourth edition). “The 8051 Microcontroller”. “Electronic Devices And Circuits” 5. www.