Rfid Based Security System With Password & Door Mechanism
Rfid Based Security System With Password & Door Mechanism
Rfid Based Security System With Password & Door Mechanism
A Project Report submitted in partial fulfillment of the requirement for the award of the degree of
BACHELOR OF ENGINEERING
in
Submitted by:
VIPUL GARG
RO LL NO. ECE-228-2K7
Guided by:
Mr. DEVENDER SAINI
LECTURER
VARUN JOSHI
RO LL NO. ECE-219-2K7
VINAY KUMAR
RO LL NO. ECE-225-2K7
VISHAL AGGARWAL
RO LL NO. ECE-229-2K7
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING GURGAON INSTITUTE OF TECHNOLOGY & MANAGEMENT GURGAON, HARYANA Affiliated to M. D. University, Rohtak, HARYANA May 2011
Acknowledgement
It gives me great pleasure & satisfaction to present major project report entitled RFiD Based Security System with Password & Door Mechanism . The completion of any task is not only the reward to the person actively involved in accomplishing it, but also the person involved in inspiring & guiding. I am highly indebted to my supervisor Mr. Devender Saini for his invaluable support and guidance throughout the work. I extend my heartful thanks to Dr. Ashok Kumar Raghava, Director Gurgaon Institute of Technology and Management (GITM), Gurgaon for providing this opportunity to carry out the project. I extend my heartful thanks to Associate Professor, Alok K Kushwaha, HOD of Electronics and Communication Engineering Deptt. for his support without which the work would have never been realized. Last but not the least; I would like to thank all friends who directly or indirectly helped me in completion of work.
Students Name ---- Roll. No---Vipul Garg Vinay Kumar Varun Jos hi Vishal Agga rwal (07-ECE-228) (07-ECE-225) (07-ECE-219) (07-ECE-229)
DECLARATION
We hereby certify that the major project entitled RFID BASED SECURITY SYSTEM WITH PASSWORD & DOOR MECHANISM, by Vipul Garg (07-ECE-228), Varun Joshi (07ECE-219), Vishal Aggarwal (07-ECE-229), Vinay Kumar (07-ECE-225) in partial fulfillment of requirements for the award of degree of B.Tech. (Electronics and Communication Engineering) submitted in the Department of Electronics and Communication Engineering at GURGAON INSTITUTE OF TECHONOLOGY AND MANAGEMENT, GURGAON under Maharshi Dayanand Unive rsity Rohtak is an authentic record of our own work carried out under the supe rvision of Mr. Devender Saini, Lecturer, Electronics & Communication Deptt. The matter presented has not been submitted by me in any other University / Institute for the award of B.Tech. Degree.
Varun Joshi
Student Name (07-ECE-219) (univ. roll no.)
Vinay Kumar
Student Name (07-ECE-225) (univ. roll no.)
Vipul Garg
Student Name (07-ECE-228) (univ. roll no.)
Vishal Aggarwal
Student Name (07-ECE-229) (univ. roll no.)
This is to certify that the above statement made by the candidate is correct to the best of my knowledge
CONTENTS
Acknowledgement Declaration Introduction Block Diagram Relay Circuit Components Used Working of Circuit RFID EAS Comparison of RFID With Bar-Coding Chip less RFID Overview of EAS Technology Overview of RFID Technology Program Code
ii iii 1 3 4 6 7 14 22 24 28 30
33 36
INTRODUCTION
This project aimed to develop a wireless system to detect and allow only the authorized persons. The system was based on Radio Frequency Identification (RFID) technology and consists of a passive RFID tag. The passive micro transponder tag collects power from the 125 KHz magnetic field generated by the base station, gathers information about the Tag ID and sends this information to the base station. The base station receives, decodes and checks the information available in its Database and Manchester code was used to send that information. The system performed as desired with a 10cm diameter antenna attached to the transponder. The Base Station is built by using the Popular 8051 family Microcontroller. It gets the tag ID and if the tag ID is stored in its memory then the microcontroller will allow the person. 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 use of it. RFID tags and readers have to be tuned to the same frequency in order
Page 1
to communicate. RFID systems use many different frequencies, but the most common and widely used Reader frequency is 125 KHz. If the code is a match, then we authorized or unauthorized the card with predefined password. If the person is authorized then door is open and if the person is un-authorized then door is close. Administrator authorize or un-authorized the card as per their rules. We use this concept in paid gym, paid class room or any paid centre.
Page 2
BLOCK DIAGRAM
Page 3
controlling the two relays. As the signal from controller is connected to opto-coupler. Optocoupler connect first relay via transistor and, other two relay work as H bridge logic. Switch connected to first relay is of the door open and close switch
Page 4
COMPONENTS USED
Step down transformer 220 volt ac to 9-0-9 ac Diode IN 4007 (2) Capacitor 1000mfd (2), 27pf (2), 10mfd (1) IC 7805 (1) 89S52 (8051 MICRO-CONTROLLER) RF Reader (125 kHz) serial interface LCD 2by 16 (alphanumeric LCD) Push to on switch (9) Resistor 470 ohm (1), 10k (1), 4k7(1). Variable resistor 4.7k oh (1) L.E.D (1) CD Loader (for door open) (1) Crystal Oscillator (12 MHz) (1) P.C.B RF CARD
Page 6
Output of the diode is pulsating dc. So to convert the pulsating dc into smooth dc we use electrolytic capacitor. Electrolytic capacitor converts the pulsating dc into smooth dc. This DC is further
Page 7
regulated by the IC 7805 regulator. IC 7805 regulator provide a regulated 5 volt dc to the microcontroller circuit and LCD circuit. Pin no 40 of the controller is connected to the positive supply. Pin no 20 is connected to the ground. Pin no 9 is connected to external resistor capacitor to provide an automatic reset option when power is on.
RESET CIRCUITRY:
Pin no 9 of the controller is connected to the reset circuit. On the circuit we connect one resistor and capacitor circuit to provide a reset option when power is on As soon as you give the power supply the 8051 doesnt start. You need to restart for the microcontroller to start. Restarting the microcontroller is nothing but giving a Logic 1 to the reset pin at least for the 2 clock pulses. So it is good to go for a small circuit which can provide the 2 clock pulses as soon as the
microcontroller is powered.
Page 8
This is not a big circuit we are just using a capacitor to charge the microcontroller and again discharging via resistor.
CRYSTALS:
Pin no 18 and 19 is connected to external crystal oscillator to provide a clock to the circuit. Crystals provide the synchronization of the internal function and to the peripherals. Whenever ever we are using crystals we need
Page 9
to put the capacitor behind it to make it free from noises. It is good to go for a 33pf capacitor.
We can also use resonators instead of costly crystal which are low cost and external capacitor can be avoided. But the frequency of the resonators varies a lot. And it is strictly not advised when used for communications projects.
The speed with which a microcontroller executes instructions is determined by what is known as the crystal speed. A crystal is a component connected externally to the microcontroller. The crystal has different values, and some of the used values are 6MHZ, 10MHZ, and 11.059 MHz etc.
Page 10
Thus a 10MHZ crystal would pulse at the rate of 10,000,000 times per second. The time is calculated using the formula No of cycles per second = Crystal frequency in HZ / 12. For a 10MHZ crystal the number of cycles would be, 10,000,000/12=833333.33333 cycles. This means that in one second, the microcontroller would execute 833333.33333 cycles.
Pin no 1 to pin no 8 is PORT 1 and Pin no 10 to 17 is PORT 3. Pin no 18 and 19 of the IC is connected to the external crystal to provide an external clock to run the internal CPU of controller. Pin no 20 is ground pin. Pin no 21 to 28 is PORT 2 pins. Pin no 29, 30, 31 is not use in
Page 11
this project. We use these pin when we require an extra memory for the project. If we internal memory of the 89s51 (which is 4k rom) then we connect pin no 31 to the positive supply. RF reader is connected to the Receiver pin of the controller. AS we place the card on the reader then reader sense the signal and immediate provide a signal to the controller in serial mode. Data receive by the Controller inside and we save that data in variables. Now we immediate display this data on the LCD screen. Data from the controller is connected to the pin no 1 of the microcontroller directly. As the data is received on the controller, controller gets the data serially and save this data into variables. Convert the variable data into ASCII code and display the same code on the LCD screen. Here we use 2 by 16 LCD to display the ASCII code. Now when data is to be display on the LCD then first of all we register this data for authorized and for unauthorized option. As we enter the 3 digit password then circuit is activate. When
button. If we press authorized button then door is open and when we press un-authorized button then door is closed. Now microcontroller saves this data in the ram memory. As we again show the RF card to the door then now controller get the data and compare with the ram content. If the data is to be match then door is open now and shut off automatically after some tie For the door open circuit we use relay coil for open and close. IN this project we use three relay coils for door open operation. It is also possible to record the the help of pc data logger. swipe time of the RF card with
For the pc interface we use MAX 232 IC with the microcontroller to transfer the detail to the pc via serial port. For this purpose we use IC MAX232 to transfer the data from controller to INTERFACE WITH THE microcontroller.
Page 13
RFID, which is an acronym for Radio Frequency Identification, is not a new technology. It was first used in the late 1960's, but it has only become more widespread with advances in technology. RFID Systems consist of a transponder, also known as a tag, which is basically a microchip connected to an antenna. The tag is mounted to an item, such as a pallet of goods in a warehouse, and a device called a reader communicates with the tag via radio waves. Depending on the type of tag that is used, the reader can receive detailed information or it can receive data as simple as an identification number. RFID is similar to barcode systems in which data, such as a price, is accessed when the barcode is read. The main difference is that the barcode must come in direct contact to an optical scanner/reader and the RFID tag can transmit to the reader via radio waves and does not have to be in direct contact. An RFID reader can receive data from as many as 1,000 tags per second. The radio signals can go through many non-metallic substances such as rain, fog, snows, dirt and grime, painted surfaces, etc. This gives RFID tags a distinct advantage over optically read items, such as barcodes, which would be useless under similar conditions. It is predicted that RFID use will continue to increase. It is unlikely to ever be as cost-effective as bar-coding, but it will become dominant in areas where bar-coding and other optically read technologies are not effective.
Page 14
The basic types of RFID tags can be classified as read/write and read only. The data stored on read/write tags can be edited, added to, or completely rewritten, but only if the tag is within the range of the reader. The data stored on a read only tag can be read, but cannot be edited in any way. Read/write tags are much more expensive than read only tags, so they are not used for tracking most commodity items. RFID tags are further categorized as:
Active tags, which contain a battery that powers the microchip and allows it to transmit a signal to the reader. Semi-active (or semi-passive) tags, which contain a battery to run the circuitry of the chip, but must draw power from the magnetic field created by the reader in order to communicate with the reader. Passive tags, which rely solely on the magnetic field created by the radio waves sent out by the reader to create a current that, can be received by the antenna within the passive tag.
RFID CONSTRUCTION
RFID Tag Components: RFID tags consist of a microchip connected to an antenna, which is constructed of a small coil of wires. The assembly is usually covered with a protective layer (such as a laminated card), which is determined by the type of application. The RFID tag can be a passive tag or an active tag. The RFID tag is also known as an inlay.
Page 15
An antenna is attached to a microchip. The antenna allows the chip to transmit information to a reader, which also has an antenna. The reader is the device that actually sends out the radio waves to create a magnetic field. A passive RFID tag draws its power from this magnetic field, which powers the circuits in the microchip allowing it to transmit data back to the reader. Reader transmits to a computer system. The computer passes data onto a network. Software determines how the data received should be used.
Microchip The most expensive read/write, active RFID transponders may have microchips with a memory capacity of up to one megabyte (1,000,000 characters). Most tags are inexpensive, passive transponders that can store only 32 to 128 bits (characters) of information or less, so an identification number is basically the only data that the read-only tag will contain. When the number is read, detailed information stored in a database in a computer can be accessed. This is similar to a barcode system in which data, such as a price, is accessed when the barcode is read. The main difference is that the barcode must come in direct contact to an optical scanner/reader and the RFID tag can transmit to the reader via radio waves and does not have to be in direct contact. Antenna The antenna allows the chip to receive and relay information, such as an ID number of an individual product. Some antennas are constructed of metal and are etched or stamped from metal, such as copper. Other types of antennas are printed. Advances in technology are allowing printed antennas to achieve the functionality of traditional materials and printed antennas are less
Page 16
expensive. One of the most popular methods of printing antennae is with the use of silver conductive inks printed on plastics substrates or paper. Testing of RFID antennae is usually performed with ohmmeters, milliohm meters, RF network analyzers, impedance-measuring equipment, and others.
Some are the size of a pencil lead or are less than a halfinch in length and can be inserted under the skin of animals and livestock. Screw-shaped tags are used to identify specific trees. Rectangular RFID tags found in some products are used as an anti-theft device. Large, heavy duty tags that are several inches in length, width, and depth are used to track large containers or large vehicles such as trucks or rail cars.
Page 17
RADIO FREQUENCIES
RFID tags operate under different radio frequencies, depending on the application. The FCC of the US government determines the limits on power output of RFID systems as well as the different radio frequencies that can be used. Low, high, and ultra-high (UHF) frequencies are used with RFID transponders.
Low and high frequency tags are less expensive than UHF and are best used for merchandise tracking, animal and livestock identification, and security access. Tags with UHF frequencies use more power than low and high frequency tags, but they have a greater range and the data transfer rate is faster. They are best suited for applications in which the tag and the reader have a more direct path with one another. Rail car tracking and automated toll booths are some of the uses.
The communication range between the RFID tag and the reader depends on the frequency, the antenna size of the tag, the antenna size of the reader, and the output power.
Low and high frequency devices have communication ranges of a few inches to several feet, depending on the application. Ultra-high (UHF) may have ranges of 25 feet or more.
The radio signals can go through many substances such as rain, fog, snows, dirt and grime, painted surfaces, etc. This gives RFID tags a distinct advantage over optically read items, such as barcodes, which would be useless under similar conditions. An RFID reader can receive data from as many as 1,000 tags per second.
Page 18
QUALITY CONTROL
Quality control is a necessity because groups of manufactured inlays may have experienced some damage before they reach the printer or converter. The chips in the inlays can also be damaged during the printing or converting process, which renders the RFID tag useless. Special substrates can be used to limit the damage to the chips. Quality control after printing or converting is also important to ensure that none of the chips were damaged and will all be functional. When RFID antennae are manufactured, they are usually tested with ohmmeters, milliohm meters, RF network analyzers, and impedance-measuring equipment. It is also important to remember that RFIDs are electronic devices and therefore should not be exposed to or stored near areas containing large amounts of electromagnetic or static energy. Applications The three most common uses for RFID tags are: 1. Tracking items in production lines 2. Tracking items in supply chains 3. Enhancing security measures In other industrial uses, tags attached to items for tracking during assembly or manufacture must be able to withstand heat, cold, etching processes, cleaning and degreasing procedures, moisture, dirt, and many other types of conditions and environments that would not be suitable for optically or magnetically read devices.
Page 19
PRINTING
With most types of printed applications, such as labels, the user is unaware of the existence of the chip and antenna because of the different methods of concealing them on the document. Some printers (such as label printers) purchase inlays (containing the RFID) that are already manufactured and then incorporate them into their printed products. Label Printing Label printing is one of the fastest growing segments of the printing industry using RFID technology. Smart labels and electronic surveillance labels are being used for applications in which simple, optically read bar-coding may not be suitable. Smart Labels Smart labels contain RFID transponders to automatically capture data. The standard construction of a smart label consists of a pressure sensitive face stock, an inlay, which contains the radio frequency identification transponder, and a liner. The inlay is laminated between the face stock and the liner. The transponder contains an antenna and microchip. The data from the smart label is accessed when the transponder passes by the reader. Radio wave lengths are picked up from the antenna and the data on the microchip is transferred to the reader and then passed on to a computer or printer. As the product moves from one stage to the next, its movements can be monitored and data can be updated when necessary. The smart label can identify, track in real-time, and authenticate a product. Smart labels are used on all types of applications including supply chain management, production control, work-in-process, baggage identification and tracking, express delivery services, reusable container tracking, and security systems. Equipment is available that is able to encode a separate RFID
Page 20
inlay and then bond it to the substrate after the label has been printed. A variety of label substrates can be used. This process eliminates the need for inserting transponders into blank label stock before the label stock is printed. Since the printing process can damage stock containing transponders, the process eliminates this problem by allowing the printing to happen first. The system creates a printing system that is on-demand. There is no need for special papers because the equipment can print on almost any label stock. Other equipment is able to encode data on very thin UHF RFID transponders that are inserted into smart labels. The equipment immediately verifies the proper encoding. The equipment can then print text, graphics, or barcodes on the smart label to complete the application. The smart labels can be used for a number of warehousing, inventory, and supply chain tracking applications. There are also compact desktop printers specifically design for RFID printing. The printers can read, write, and print labels that have an embedded RFID transponder. The industry acceptance of smart labels has been slow. The RFID technology can improve performance and efficiency but is expensive to startup. As more companies commit to the use of this new technology it will become more widely accepted and many will benefit from its capabilities.
Page 21
Figure 7: RFiD Card used as an EAS Label EAS labels are used as anti-theft devices. The label is used with EAS monitoring equipment to detect if an item is being removed without authorization. The EAS systems are used in retail stores, data centers, and libraries. When applied to products, the EAS label is capable of activating an alarm as it passes through an electronic surveillance detector, such as those found in retail store exits. When the product is purchased, the label is made inactive by the use of a deactivation device at the checkout station. Once the label is deactivated it is referred to as a "dead label". Labels that have not been deactivated are referred to as "live labels". RFID is only one of the technologies used for EAS labels. Other common types are AM (Acousto Magnetic) and EM (Electro Magnetic). Each of the EAS systems has its own unique detection equipment that must be used to allow the system to work
Page 22
properly. Because of the anti-theft protection they provide, the EAS labels and EAS systems allow more freedom for retail stores to display items that would usually be locked in display cases. This allows the consumer to examine the product more closely before purchasing.
Page 23
It is not necessary to have a line of sight between the RFID tag and the reader as there is with a barcode and scanner. Information can be rewritten to the tag without having to see the tag. This is true even if the tag is mixed into other items that have been tagged. Nearly 100% of RFID tags are readable, unlike items that contain a printed barcode, which can become damaged with improper handling. The potential problems associated with substandard print quality of barcodes, which in turn leads to scanning and reading problems, are eliminated.
Barcodes are universally accepted because they are very inexpensive and there are established standards for their use. RFID technology is more expensive and has fewer universal standards in the way they are used. Even if RFID technology becomes as widespread as bar-coding, it will not totally replace the universally accepted barcode technology.
Page 24
Other Print/Security Applications Besides the various types of RFID labels that are being printed for product tracking and security, plastic cards and badges embedded with RFID transponders are being produced. Data from identification cards embedded with RFID tags can be read as people pass through a doorway. RFID tags embedded in security badges offer an alternative method for controlling access to sensitive information or limiting access to specific areas. Merchandise/Inventory Tracking When used with product and inventory control, a computer keeps track of the data received from the transponders/tags through the reader and can trigger reorders based on the adjusted inventory levels. Antennas can be built into warehouse doorframes in order to receive data as merchandise, cartons, and pallets of goods containing an RFID tag pass, through the doorway. RFID costs may not become low enough for the tags to be used on all types of products and services. It may not be cost effective to include the tags with every item if the items are inexpensive commodity items, but the tags can be very useful to track full pallets of commodities for inventory control. Transportation RFID tags can be used for a number of applications in the transportation industry for monitoring and tracking of vehicles and products. Railroads RFID systems can be configured for rail car identification:
The tags are installed underneath the rail cars. The antennae are mounted between or near the tracks. The readers are usually located in a building no more
Page 25
than 100 feet away. Trucking Commercial trucking facilities also use RFID systems to monitor truck movements in and out of a main terminal. Automotive RFID systems are very useful in the automobile manufacturing industry in tracking individual vehicles through the assembly process. RFID systems are also being installed in toll booths to monitor the traffic. Airports Most airports track passenger baggage with bar-coded labels or tags, but they are often damaged do to rough handling of the baggage. Bar-coded tags that have been damaged because of rough baggage handling, may account for 10% of the total volume. All of these bags must be accounted for manually, which can be a time consuming process. RFID systems can help to eliminate the problems that occur with unreadable barcodes. When used for tracking bags at an airport, RFID tags contain a unique number assigned to the bag. Anyone with access to a reader could see the number, but any personal information could not be viewed because it is stored in a database and is not stored on the tag.
Privacy Issues Many people mistakenly believe that RFID is similar to GPS (Global Positioning System) and can be used for detailed tracking, but RFID has a range of only a few feet so this isn't possible. Another misconception that people have is that the movement of products with RFID tags can be tracked even after the product is
Page 26
purchased. Most active RFID tags have a read range of about 25 feet, which means the RFID is basically useless outside of the retail store or business. Security measures and safeguards used to protect consumer privacy when using RFID systems:
The risk of spying or intercepting data that is transmitted via radio waves is reduced with the use of data encryption and over the air protocols. The protocols require both the reader and the eavesdropper to be within range of the tag. The reader changes radio frequencies rapidly and at random, so it is difficult for a potential eavesdropper to follow the reader. Although it is possible for tags to be counterfeited, it is not very practical because of built-in safeguards, such as the ability of the RFID readers to verify authenticity of the tags.
Page 27
Photocopiers can be fitted with readers to prevent unauthorized copying. Some applications could require that a document be
Page 28
photocopied onto the same type of paper. Any institution wishing to protect documents could install readers at all exit points in the building, which would detect if any unauthorized persons were trying to leave the building with an original or copied document. The system can also be used for counterfeit prevention and for tracking manufactured products.
Page 29
Figure 8: Electronic Article Surveillance The EAS process begins by attaching labels or hard tags to merchandise. When an item is purchased, the label is deactivated or the hard tag is removed. However, if merchandise with an active label or hard tag is carried past the detector, an alarm sounds. Over 800,000 EAS systems are installed worldwide, primarily in the retail market. This includes Apparel, Drug, Discount, Home Centers, Hypermarkets, Food, Entertainment, and Specialty stores.
Page 30
Page 31
Figure 9: Swept-RF System The transmitter signal energizes the swept-RF tag or label, which is composed of a circuit containing a capacitor and an inductor or coil, both of which store electrical energy. When connected together in a loop, the components can pass energy back and forth or "resonate." The frequency at which the circuit resonates is controlled by matching the storage capacity of the coil and capacitor. The tag responds by emitting a signal that is detected by a receiver. In addition to the small tag signal, the receiver also responds to the much larger transmitter signal. By detecting a phase difference between these two signals, and other properties of the tag signal, the receiver recognizes the presence of a tag and generates an alarm.
Page 32
Figure 10: RF-ID Technology The data collected from the 'Tag' can either be sent directly to a host computer through standard interfaces, or it can be stored in a portable reader and later uploaded to the computer for data processing. The automatic reading and direct use of the 'Tag' data is often called 'automatic data capture' and with a RF-ID tag system, which works just as effectively in environments with excessive dirt, dust, moisture and poor visability, you can be assured that it
Page 33
Page 34
Figure 11: Working Of Tag System The transmission technique used between the transponder and the reader is Frequency Shift Keying (FSK) with transmissions between 134.2kHz and 124.2kHz. This approach has comparatively good resistance to noise while also being very cost effective to implement.
Page 35
PROGRAM CODE
INCLUDE REG_51.PDF LCD_DATA lcd_en lcd_rw lcd_rs bit equ P0
P2.7
bit P2.5 bit P2.6 bit bit bit bit bit bit bit bit P2.4 P2.0 P2.1 P2.2 P2.3 P3.1 P3.2 P3.3
out1 key1 key2 key3 key4 key5 key6 key7 flag flag0 valid vcard1 vcard2 vcard3 vcard4 vcard5 busy equ 21h equ 20h bit
flag.0
bit valid.0 bit valid.1 bit valid.2 bit valid.3 bit valid.4 equ 22h Page 36
bcard1 bcard2 bcard3 bcard4 bcard5 authoriz acard1 acard2 acard3 acard4 acard5 unauthoriz ucard1 ucard2 ucard3 ucard4 ucard5 card1d1 card1d2 card1d3 card1d4 card1d5 card1d6 card1d7 card1d8
bit busy.0 bit busy.1 bit busy.2 bit busy.3 bit busy.4 equ bit bit bit bit bit 23h authoriz.0 authoriz.1 authoriz.2 authoriz.3 authoriz.4 24h
equ
bit unauthoriz.0 bit unauthoriz.1 bit unauthoriz.2 bit unauthoriz.3 bit unauthoriz.4 equ equ equ equ equ equ equ equ 29h 2ah 2bh 2ch 2dh 2eh 2fh 30h Page 37
card2d1 card2d2 card2d3 card2d4 card2d5 card2d6 card2d7 card2d8 card3d1 card3d2 card3d3 card3d4 card3d5 card3d6 card3d7 card3d8 card4d1 card4d2 card4d3 card4d4 card4d5 card4d6 card4d7 card4d8 card5d1
equ equ equ equ equ equ equ equ equ equ equ equ equ equ equ equ equ equ equ equ equ equ equ equ equ
31h 32h 33h 34h 35h 36h 37h 38h 39h 3ah 3bh 3ch 3dh 3eh 3fh 40h 41h 42h 43h 44h 45h 46h 47h 48h 49h Page 38
card5d2 card5d3 card5d4 card5d5 card5d6 card5d7 card5d8 dp1 dp2 dp3 dp4 dp5 dp6 dp7 dp8
equ equ equ equ equ equ equ equ equ equ equ equ equ equ equ c1 c2 c3 m1 m2 m3
4ah 4bh 4ch 4dh 4eh 4fh 50h 51h 52h 53h 54h 55h 56h 57h 58h equ 59h equ equ equ equ equ 5ah 5bh 5ch 5dh 5eh
000bh
0013h
001bh
0023h
lcall DELAY41 lcall DELAY41 mov mov mov mov mov mov mov mov mov mov mov anl orl psw,#00h sp,#070h tmod,#2h th0,#00h tl0,#00h th1,#0f2h tl1,#0f3h tcon,#00h ie,#00h ip,#00h scon,#50h pcon,#7fh pcon,#80h
lcall LINE_2 mov mov mov mov mov mov mov mov mov mov mov mov mov mov mov mov card1d1,#00h card1d2,#00h card1d3,#00h card1d4,#00h card1d5,#00h card1d6,#00h card1d7,#00h card1d8,#00h card2d1,#00h card2d2,#00h card2d3,#00h card2d4,#00h card2d5,#00h card2d6,#00h card2d7,#00h card2d8,#00h Page 41
mov mov mov mov mov mov mov mov mov mov mov mov mov mov mov mov mov mov mov mov mov mov mov mov
card3d1,#00h card3d2,#00h card3d3,#00h card3d4,#00h card3d5,#00h card3d6,#00h card3d7,#00h card3d8,#00h card4d1,#00h card4d2,#00h card4d3,#00h card4d4,#00h card4d5,#00h card4d6,#00h card4d7,#00h card4d8,#00h card5d1,#00h card5d2,#00h card5d3,#00h card5d4,#00h card5d5,#00h card5d6,#00h card5d7,#00h card5d8,#00h
Page 42
lcall DELAY1 lcall DELAY1 lcall DELAY1 lcall DELAY1 lcall DELAY1 lcall DELAY1 lcall DELAY1 lcall DELAY1 setb tr1 main_lp1: jnb ri
mov
a,sbuf
clr mov
ri a,sbuf
mov mov
nxt1_er1: ljmp nxt2_er1: mov cjne ljmp nxt1_er2: cjne ljmp a,#11d,nxt2_er2 data_error_end Page 44 a,dp2 a,#10d,nxt1_er2 data_error_end data_error_end
nxt1_er3: cjne ljmp nxt2_er3: mov a,dp4 cjne ljmp nxt1_er4: cjne ljmp nxt2_er4: mov a,dp5 a,#11d,nxt2_er4 data_error_end a,#10d,nxt1_er4 a,#11d,nxt2_er3 data_error_end
data_error_end
a,#10d,nxt1_er5 data_error_end
a,#11d,nxt2_er5 data_error_end
ljmp nxt1_er6: cjne ljmp nxt2_er6: mov anl cjne ljmp nxt1_er7: cjne ljmp nxt2_er7: mov anl cjne ljmp nxt1_er8: cjne ljmp nxt2_er8:
data_error_end
a,#11d,nxt2_er6 data_error_end
a,#11d,nxt2_er7 data_error_end
a,#11d,nxt2_er8 data_error_end
lcall LINE_2 ret data_cmp: jnb mov mov mov mov mov mov mov mov mov mov mov mov mov mov bcard1,next0_card1 a,dp1 card1d1,a a,dp2 card1d2,a a,dp3 card1d3,a a,dp4 card1d4,a a,dp5 card1d5,a a,dp6 card1d6,a a,dp7 card1d7,a Page 47
mov mov
a,dp8 card1d8,a
lcall LINE_2 setb out1 lcall delay5s setb out1 mov dptr,#MSG1
mov
dptr,#MSG2
lcall LINE_2 ret next0_cmp0: jnb mov mov mov mov mov mov mov mov mov mov mov mov mov mov mov mov bcard2,next1_card1 a,dp1 card2d1,a a,dp2 card2d2,a a,dp3 card2d3,a a,dp4 card2d4,a a,dp5 card2d5,a a,dp6 card2d6,a a,dp7 card2d7,a a,dp8 card2d8,a
mov
dptr,#MSG1
lcall LINE_2 setb out1 lcall delay5s setb out1 mov dptr,#MSG1
mov mov mov mov mov mov mov mov mov mov mov mov
a,dp3 card3d3,a a,dp4 card3d4,a a,dp5 card3d5,a a,dp6 card3d6,a a,dp7 card3d7,a a,dp8 card3d8,a
mov
a,dp4
jnb mov
ucard3,next2_cmp0 dptr,#MSG7
lcall LINE_2 setb out1 lcall delay5s setb out1 mov dptr,#MSG1
setb bcard4 clr mov mov mov mov mov mov mov mov vcard4 a,dp1 card4d1,a a,dp2 card4d2,a a,dp3 card4d3,a a,dp4 card4d4,a Page 55
nmov
mov
a,dp6
lcall LINE_2
lcall LINE_2 setb out1 lcall delay5s setb out1 mov dptr,#MSG1
setb bcard5 clr mov mov mov mov mov mov mov mov mov mov mov mov vcard5 a,dp1 card5d1,a a,dp2 card5d2,a a,dp3 card5d3,a a,dp4 card5d4,a a,dp5 card5d5,a a,dp6 card5d6,a Page 58
mov
a,dp8
mov
dptr,#MSG1
lcall LINE_2 lcall display setb out1 lcall delay5s setb out1 mov dptr,#MSG1
key7,$
lcall LINE_2 cheak0: jnb jnb sjmp cheak1: setb ret cheak2: clr ret flag0 flag0 cheak0 key5,cheak1 key6,cheak2
PASSWORD: mov mov mov mov mov mov lcall CLR_LCD Page 62 c1,#01d c2,#01d c3,#01d m1,#10d m2,#10d m3,#10d
mov dptr,#MSG8 lcall LINE_1 lcall DELAY41 pass: lcall jnb jnb jnb jnb sjmp pc0: jnb lcall DELAY41 jnb lcall DELAY41 lcall CLR_LCD mov dec cjne mov dec cjne mov dec cjne a,c3 a a,#03d,bpc0 a,c2 a a,#02d,bpc0 a,c1 a a,#01d,bpc0 Page 63 key4,pc0 key4,pc0 disps key4,pc0 key1,pc1 key2,pc2 key3,pc3 pass
ret bpc0: mov dptr,#MSG9 lcall LINE_1 lcall DELAY5S ljmp pc1: jnb lcall DELAY41 jnb lcall DELAY41 inc djnz mov mov bpc1: pc2: jnb lcall DELAY41 jnb lcall DELAY41 djnz mov mov bpc2: ljmp pass Page 64 c2,#01d m2,#10d m2,bpc2 key2,pc2 key2,pc2 ljmp pass c1 m1,bpc1 c1,#01d m1,#10d key1,pc1 key1,pc1 password
pc3: jnb lcall DELAY41 jnb lcall DELAY41 inc djnz mov mov bpc3: ljmp pass c3 m3,bpc3 c3,#01d m3,#10d key3,pc3 key3,pc3
disps: mov LCD_DATA,#0c5h lcall COMMAND_BYTE lcall DELAY41 mov a,c1 add mov LCD_DATA,a lcall lcall DELAY41 mov a,c2 add mov LCD_DATA,a lcall lcall DELAY41 Page 65 DATA_BYTE a,#30h DATA_BYTE a,#30h
mov
a,c3
a,#30h
DATA_BYTE
lcall COMMAND_BYTE lcall DELAY41 lcall WRITE_MSG ret LINE_2: mov LCD_DATA,#0c0h
lcall DELAY ljmp CMD10 DATA_BYTE: setb lcd_rs lcall DELAY CMD10: Page 70
clr
lcd_rw
lcall DELAY ret DELAY: mov DEL: djnz r0,DEL ret DELAY1: mov mov DELAY10: djnz r0,DELAY10 djnz r1,DELAY10 ret DELAY5S: mov mov mov DEL5S: djnz r0,DEL5S Page 71 r0,#0d r1,#0d r2,#25d r0,#0d r1,#100d r0,#10d
djnz r1,DEL5S djnz r2,DEL5S ret DELAY41: mov mov DLP410: djnz r0,DLP410 djnz r1,DLP410 ret MSG1: db MSG2: db MSG3: db MSG4: db MSG5: db MSG6: db MSG7: db MSG8: db MSG9: db MSG10: db MSG11: db MSG12: db MSG13: db MSG14: db MSG15: db ' Smart Card ' ' RFID ' r0,#0d r1,#15d
' New Card ' ' Invalid Card ' ' = rfid '
' Authorized ' ' Unauthorized ' ' Enter Password ' 'Invalid Password' ' ' ' ' ' Name 1 ' Name 2 Name 3 Name 4 Name 5 ' ' ' '
MSG16: db end
'
'
Page 73