Вы находитесь на странице: 1из 48

1

ABSTRACT

Many embedded systems have substantially different design constraints than desktop computing applications. No single characterization applies to the diverse spectrum of embedded systems. However, some combination of cost pressure, long life-cycle, real-time requirements, reliability requirements, and design culture dysfunction can make it difficult to be successful applying traditional computer design methodologies and tools to embedded applications. Embedded systems in many cases must be optimized for life-cycle and business-driven factors rather than for maximum computing throughput. There is currently little tool support for expanding embedded computer design to the scope of holistic embedded system design. However, knowing the strengths and weaknesses of current approaches can set expectations appropriately, identify risk areas to tool adopters, and suggest ways in which tool builders can meet industrial needs.Most educational
institutions' administrators are concerned about student irregular attendance. Truancies can affect student overall academic performance. The conventional method of taking attendance by calling names or signing on paper is very time consuming and insecure, hence inefficient. Radio Frequency Identification (RFID) based attendance system is one of the solutions to address this problem. This system can be used to take attendance for student in school, college, and university. It also can be used to take attendance for workers in working places. Its ability to uniquely identify each person based on their RFID tag type of ID card make the process of taking the attendance easier, faster and secure as compared to conventional method. Students or workers only need to place their ID card on the reader and their attendance will be taken immediately. With real time clock capability of the system, attendance taken will be more accurate since the time for the attendance taken will be recorded. The system can be connected to the computer through RS232 or Universal Serial Bus (USB) port and store the attendance taken inside database. An alternative way of viewing the recorded attendance is by using HyperTerminal software. A prototype of the system has been successfully fabricated.

TABLE OF CONTENT Chapter No Title Page No

1. Introduction 1.1Background 1.2 Definition of a Microcontroller 2. Microcontrollers circuits and connection 2.1 Pin configuration 2.2 Reset circuit 2.3 Bit memory 2.4 Input-output units 2.5 Serial communication 2.6 Timer unit 2.7 LCD Interfacing 2.8 Power supply system 2.8.1 TRANSFORMER 2.8.2 RECTIFIER 2.8.3 REGULATOR 3 RFID module . 3.1 History of RFID

13

9 10 11 14 14 15 15 16 16 17 17 18 18 19 19 20 22 23 24 25 28 29 29 29 29 30 31 32 33 34 35 38 38 39 39 40 42 49 49 49
3

3.2 RFID Reader 3.3 RFID Tag 4 Components of RFID 4.1 Antenna 4.2 TAGS (Transponders) 4.3 RF Transceiver 5. Logical Structure 5.1 Explanation 5.1.1 Microcontroller 5.1.2 MAX232 5.1.3 LCD 5.2 Circuit Diagram 5.2.1 About 89C51 Microcontroller 5.2.2 IC 7805 5.2.3 Disc Capacitor
5.2.4 RTC(REAL TIME CLOCK)

6. PCB Construction 6.1 Basics about PCB


7. Working of RFID module 7.1 Basic Working 7.2 Software Tools 7.3 Microcontroller Program 8. Advantages 8.1 Advantages of RFID Over Bar Coding 8.2 Advantages

8.3 Disadvantages 9. Conclusion 10 References .

49 50 51

CHAPTER 1 INTRODUCTION

1.1

BACKGROUND

Circumstances that we find ourselves in today in the field of microcontrolle r s h a d t h e i r beginnings in the development of technology of integrated circuits. This development has made it possible to store hundreds of thousands of transistors into one chip. That was a prerequisitef o r p r o d u c t i o n o f m i c r o p r o c e s s o r s , a n d t h e f i r s t c o m p u t e r s w e r e m a d e b y a d d i n g e x t e r n a l peripherals such as memory, inputoutput lines, timers and other. Further increasing of thevolume of the package resulted in creation of integrated circuits. These integrated circuits contained both processor and peripherals.That is how the first chip containing a microcomputer or what would later known as a MCROCONTROLLER.

EXAMPLES OF EMBEDDED SYSTEM: Automated tiller machines (ATMS).


Avionic, such as inertial guidance systems, flight control hardware /

software and letter integrated system in aircraft and missile. Cellular telephones and telephonic switches. Computer network equipment, including routers timeservers and firewalls Computer printers,Copiers. Disk drives (floppy disk drive and hard disk drive) Engine controllers and antilock brake controllers for automobiles.
Home automation products like thermostat, air conditioners sprinkles andsecurity monitoring

system. House hold appliances including microwave ovens, washing machines, TVsets DVD players/recorders. Medical equipment .
M e a s u r e m e n t e q u i p m en t s u c h a s d i g i t a l s t o r a g e o s c i l l o s c o p e s , l o g i c
6

analyzers and spectrum analyzers. Multimedia appliances: internet radio receivers, TV set top boxes. Personal digital assistants (PDAs), i.e., small hand held computer With P1M5 and other applications.
Programmable logic controllers (PLCs) for industrial automation andmonitoring.

Stationary video game controllers. Wearable computers.

1.2 Definition of a Microcontroller


Microcontroller, as the name suggests, are small controllers. They are like s i n g l e c h i p computers that are often embedded into other systems to function as processing/controlling unit.For example, the remote control you are using probably has microcontrollers inside that dodecoding and other controlling functions. They are also used in automobiles, washing machines,microwave ovens, toys ... etc, where automation is needed. In the fast growing market of embedded systems there is an increasing need to write application programs in a high-level language such as C. Basically there are two reasons for this trend: programs for embedded systems become more complex (and hence are difficult to maintain in assembly language), and processor models for embedded systems have a decreasing lifespan (which implies more frequent re-adapting of applications to new instruction sets). The code re-usability achieved by C-level programming is considered to be a major step forward in addressing these issues. Various technical areas have been identified where functionality offered by processors (such as DSPs) that are used in embedded systems cannot easily be exploited by applications written in C. Examples are fixed-point operations, usage of different memory spaces, low level I/O operations and others. The current proposal addresses only a few of these technical areas. Embedded processors are often used to analyze analogue signals and process these signals by applying filtering algorithms to the data received. Typical applications can be found in all wireless
7

devices. The common data type used in filtering algorithms is the fixed-point data type, and in order to achieve the necessary speed, embedded processors are often equipped with special hardware for fixed-point data. The C language (as defined in ISO/IEC 9899:1999) does not provide support for fixed-point arithmetic operations, currently leaving programmers with no option but to handcraft most of their algorithms in assembly language. This Technical Report specifies a fixed-point data type for C, definable in a range of precision and saturation options. Optimizing C compilers can generate highly efficient code for fixed-point data as easily as for integer and floating-point data.Many embedded processors have multiple distinct banks of memory and require that data be grouped in different banks to achieve maximum performance. Ensuring the simultaneous flow of data and coefficient data to the multiplier/accumulator of processors designed for FIR filtering, for example, is critical to their operation. In order to allow the programmer to declare the memory space from which a specific data object must be fetched, this Technical Report specifies basic support for multiple address spaces. As a result, optimizing compilers can utilize the ability of processors that support multiple address spaces, for instance, to read data from two separate memories in a single cycle to maximize execution speed.

The key features of microcontrollers include:


High Integration of Functionality. Microcontrollers sometimes are called single-chip computers because they have on-chip memory and I/O circuitry and other circuitries that enable them to function as small standalone computers without other supporting circuitry. Field Programmability, Flexibility Microcontrollers often use EEPROM or EPROM as their storage device to allow field programmability so they are flexible to use. Once the program is tested to be correct then large quantities of microcontrollers can be programmed to be used in embedded systems. Easy to UseAssembly language is often used in microcontrollers and since they usually follow RISCarchitecture, the instruction set is small. The development package of
8

microcontrollerso f t e n i n c l u d e s a n a s s e m b l e r , a s i m u l a t o r , a p r o g r a m m e r t o " b u r n " t h e c h i p a n d demonstration board. Some packages include a high level language compiler such as a Compiler and more sophisticated libraries.
.

RFID (radio frequency identification) is a new technology that incorporates the use of electromagnetic or electrostatic coupling in the radio frequency (RF) portion of the electromagnetic spectrum to uniquely identify an object, animal, or person. RFID tags are not an "improved bar code" as the proponents of the technology would like you to believe. An RFID system consists of three components: an antenna and transceiver (often combined into one reader) and a transponder (the tag). The antenna uses radio frequency waves to transmit a signal that activates the transponder. When activated, the tag transmits data back to the antenna. RFID technology differs from bar codes. RFID can read the tag using RF, meaning that the RFID reader can be read from a distance, right through your clothes, wallet, backpack or purse. Besides the RFID tag consist of unique ID for each tag. The technology used in RFID has been around since the early 1920s. In our country, this technology already been used for several years in certain place such as in Highway using card Touch N Go and our government also apply this technology by using RFID as I.C (identification card). Some places, they prefer to used Barcode which is cheaper than RFID. Technology spread very fast. In few years later, there is not impossible if RFID will replace the barcode system in todays life. Nowadays, there are lots of universities around our country and each of the university consists of student up to 10 thousand. To handle a large amount of student may be problem especially to get the attendance. Now, process to get attendance in majority universities still used the manual process. The manual process means that when start the class/lecture, lecturer will give a piece of attendance paper and students will check their name and then will sign on it. At the end of class, lecturer will take back the attendance paper and keep it as a record. Normally, the attendance paper need much time to sign by all students especially for class with a lot of student. Students also forget to sign that attendance and they were assuming absent that class. The problem also will happen when lecturer forget to bring the attendance paper to class. Students need to write their name on a piece of paper and sometimes student will take change to cheat in process getting the attendance. The suitable solution for this problem is by design a system that will record attendance automatic.

CHAPTER 2 MICROCONTROLLER CIRCUITS AND CONNECTIONS:


2.1 PIN CONFIGURATION:

We have 4 ports in 8051 micro controller. They are port0, port1, port2, port3 which canbe accessed as i/o ports. The pins of the micro controller are explained below Reset: It resets total microcontroller. RXD: It receives data in serial communication. TXD: It transmits data in serial communication. INT0: External interrupt for timer 0. INT1: External interrupt for timer1 T0: Timer0. T1: Timer1. .ALE: Address latch enable which is used to access the address locations from external memory.

PSEN: Program store enable which is used for storing programmingcode into the external memory. EA: External Access: 64 KB of ROM is the limit for external memory.

2.2 RESET CIRCUIT:

Reset circuit of microcontroller Capacitor is storing charge permanently until we use it. Crystal Oscillator is used to generate a carrier signal with stable frequency. With the help of this oscillator we will deduce the execution speed in terms of bytes/ sec.It generates 12 clock pulses /machine cycle. Capacitors provide charge for crystal oscillator. If we are not connecting any external memory to micro controller, A i s connected to Vcc in case of 8051.

2.3 BIT MEMORY:


The 8051, being a communication oriented microcontroller, gives the user the ability to acess a n u m b e r o f bit variables. T h e s e v a r i a b l e s m a y b e e i t h e r 1 o r 0 . The user may make use of these variables with commands such as SETB and CLR. It is important to note that Bit Memory is really a p a r t o f I n t e r n a l R A M . That way is called as BUS. Physically, it represents a group of 8, 16, or more wires. T h e r e a r e t w o t y p e s o f b u s e s : a d d r e s s a n d d a t a b u s . T h e f i r s t one consists of as many lines as the amount of memory we wish to address and the other one is as wide as data, in our case 8 bits or the

connection line. First one serves to transmit address from CPU m e m o r y , a n d t h e second to connect all blocks inside the microcontroller.

2.4 Input-output unit:


Those locations weve just added are called ports. There are several types of ports: Input, output or bidirectional ports. When working with ports, first of all it is necessary to choose which port we need to work with, and then to send data to,or take it from the port.

2.5 Serial communication:


Beside stated above we've added to the already existing unit the p o s s i b i l i t y o f c o m m u n i c a t i o n with an outside world. However, this way of communicating has its drawbacks. One of the basic drawback i s t h e n u m b e r o f l i n e s which need to be used in order to transfer data.The number of lines t i m e s n u m b e r o f kilometers doesn't promise the economy of the project. It leaves us having to reduce the number of lines in such a way that we don't lessen its functionality. Suppose we are working with three l i n e s o n l y , a n d t h a t o n e l i n e i s u s e d f o r s e n d i n g d a t a , o t h e r f o r r e c e i v i n g , a n d t h e t h i r d o n e i s used as a reference line for both the input and the output side. In order for this to work, we need to set the rules of exchange of data. These rules are called protocol. Protocol is therefore defined in advance so there would not be any misunderstanding between the sides that are communicating with each other. For example, if one man is speaking in French, and the other in English, it is highly unlikely that they will quickly and effectively understand each other.

2.6 TIMER UNIT:


Since we have the serial communication explained, we can receive, send and process data. Timer unit generating signals in regular time intervalsHowever, in order to utilize it in industry we need a few additionally blocks. One of those is the timer block which is significant to u s b e c a u s e it can give us information about time, duration, protocol etc. The basic unit of the timer is a free-run counter which is in fact a r e g i s t e r w h o s e numeric value increments by one in even intervals, so that by taking its value during periods T1and T2 and on the basis of their difference we can determine how much time has elapsed. This is a very important part of the microcontroller whose understanding requires most of our time. Microcontroller outline with basic elements and internal connections For a real application, a microcontroller alone is not enough. Beside a microcontroller, we need a p r o g r a m t h a t would be executed, and a few more elements which make up i n t e r f a c e l o g i c towards the elements of regulation (which will be discussed next).

2.7 LCD INTERFACING:


Speeds, or various peripheral control devices. The internal operation of the LCD is determined by signals sent from the MCU.

Sending Commands to LCD


To send commands we simply need to select the command register. E v e r y t h i n g i s s a m e a s w e have done in the initialization routine. But we will summarize the common steps and put the min a single subroutine. Following are the steps:

Move data to LCD port. Select command register. Select write operation. Send enable signal. Wait for LCD to process the command.

2.8 POWER SUPPLY SYSTEM:

Circuit of power supply The power supply consists of ac voltage transformer, diode rectifier, ripple

filter, and voltage regulator.

The description of the components is shown below:

2.8.1 TRANSFORMER: The transformer is a static electro-magnetic device that transforms one alternating Voltage (current) into another voltage (current).However; power remains the same during the transformation. Transformers play a major role in the transmission and distribution of ac power. PRINCIPLE: Transformer works on the principle of mutual induction. A transformer consists of laminated magnetic core forming the magnetic frame. Primary and secondary coils are wound upon the two cores of the magnetic frame, linked by the common magnetic flux. When an alternating voltage is applied across the primary coil ,a current flows in the primary coil producing magnetic flux in the transformer core. This flux induces voltage in secondary coil. Transformers are classified as: (a) Based on position of the windings with respect to core i.e.(1) core type transformer (2) shell type transformer (b) transformation ratio(1) step up transformer(2) step down transformer DC power supply exists in every electronic box whether it is a computer, TV, or equipment in the laboratory. The power supply consists of ac voltage transformer, diode rectifier, ripple filter, and voltage

transformer, diode rectifier, ripple filter and voltage regulator. The Transformer is an ac device. I t h a s t w o c o i l windings, the primary and the secondary, around a common magnetic core. The current flowing in the primary winding generates a time varying electromagnetic field which in turn induces an output voltage across the secondary winding. The ratio of turns in the two windings determines the ratio of the input voltage and output voltage. The power supply that we are building in this experiment is a linear power supply. In other words, the circuit functions with analog signals. In our kit, we have a small transformer which can convert 230Vac from the wall plug to 6-12 V ac.

2.8.2 RECTIFIER: The rectifier is based on p-n junction. One can use a single diode f o r m i n g a h a l f - w a v e rectifier or four diodes forming a full-wave rectifier or a bridge rectifier. In the experiment, wea r e g o i n g t o u s e t h e p o w e r rectifyin g diode, 1N4001 or IN4007 . You can read f r o m t h e specification sheet the characteristics of the diode. The most important thing to know is the polarity of the diode. The arrow is the p-side and the bar is the n-side. A positive voltage i s needed on the p-side to make the diode conduct. IN4001 can block off large negative bias in thehundred voltage range. 2.8.3 REGULATOR: To make the output voltage as constant as possible, one needs a regulator. The regulator consists of a voltage reference, e.g., a Zener diode. It can also be an IC component with voltage reference and feedback control circuit inside ..

Chapter 3 RFID MODULE


3.1 History of RFID
Its generally said that the roots of radio frequency identification technology can be traced back to World War II. The Germans, Japanese, Americans and British were all using radar which had been discovered in 1935 by Scottish physicist Sir Robert Alexander Watson-Watt to warn of approaching planes while they were still miles away. The problem was there was no way to identify which planes belonged to the enemy and which were a countrys own pilots returning from a mission. Radio Frequency Identification (RFID) research and discovery began in earnest in the 1970s. RFID is commonly used to transmit and receive information without wires. RFID readers and tags communicate through a distance using radio waves. There are a lot of advantages in RFID system, included their price, size, memory capacity and their capability. The pure memory-based RFID chip without a co-processor is cheap, and its footprint is small and usually use in car immobilizer applications where the IC has to fit in a tiny glass tube buried in the key. RFID fast processing speed is also essential. Advances in radar and RF communications systems continued through the 1950s and 1960s. Scientists and academics in the United States, Europe and Japan did research and presented papers explaining how RF energy could be used to identify objects remotely. Companies began commercializing anti-theft systems that used radio waves to determine whether an item had been paid for or not. Electronic article surveillance tags, which are still used in packaging today, have a 1-bit tag. The bit is either on or off. If someone pays for the item, the bit is turned off, and a person can leave the store. But if the person doesn't pay and tries to walk out of the store, readers at the door detect the tag and sound an alarm. The First RFID Patents Mario W. Cardullo claims to have received the first U.S. patent for an active RFID tag with rewritable memory on January 23, 1973. That same year, Charles Walton, a California entrepreneur, received a patent for a passive transponder used to unlock a door without a key. A card with an embedded transponder communicated a signal to a reader near the door. When the reader detected a valid identity number stored within the RFID tag, the reader unlocked the door. Walton licensed the

technology to Schlage Lock of San Francisco, a lock maker, and other companies. Later, companies developed a low-frequency (125 kHz) system, featuring smaller transponders. A transponder encapsulated in glass could be injected under the cows skin. This system is still used in cows around the world today. Low frequency transponders were also put in cards and used to control the access to buildings. Over time, companies commercialized 125 kHz systems and then moved up the radio spectrum to high frequency (13.56 MHz), which was unregulated and unused in most parts of the world. High frequency offered greater range and faster data transfer rates. Companies, particularly those in Europe, began using it to track reusable containers and other assets. Today, 13.56 MHz RFID systems are used for access control, payment systems (Mobile Speedpass) and contactless smart cards. Theyre also used as an anti- theft device in cars. A reader in the steering column reads the passive RFID tag in the plastic housing around the key. If it doesnt get the ID number it is programmed to look for, the car won't start. In the early 1990s, IBM engineers developed and patented an ultra-high frequency (UHF) RFID system. UHF offered longer read range (up to 20 feet under good conditions) and faster data transfer. IBM did some early pilots with Wal-Mart, but never commercialized this technology. When it ran into financial trouble in the mid-1990s, IBM sold its patents to Intermec, a bar code systems provider. Intermec RFID systems have been installed in numerous different applications, from warehouse tracking to farming. But the technology was expensive at the time due to the low volume of sales and the lack of open, international standards.

3.2 RFID Reader


The RFID reader sends a pulse of radio energy to the tag and listens for the tags response. The tag detects this energy and sends back a response that contains the tags serial number and possibly other information as well. In simple RFID systems, the readers pulse of energy functioned as an on-off switch; in more sophisticated systems, the readers RF signal can contain commands to the tag, instructions to read or write memory that the tag contains, and even passwords. Historically, RFID reader were designed to read only a particular king of tag, but so-called multimode readers that can read many different kinds of tags are becoming increasingly popular. RFID readers are usually on, continually transmitting radio energy and awaiting any tags that enter their field of operation. However, for some applications, this is unnecessary and could be undesirable in battery-powered devices that need to conserve energy. Thus, It is possible to configure an RFID reader so that it sends the radio pulse only in response to an external event. For example, most electronic toll collection systems have the reader constantly powered up so that every passing car will be record ed. On the other hand, RFID scanners used in veterinarians offices are frequently equipped with triggers and power up the only when the trigger is pulled. Like the tag themselves, RFID readers come in many size. The largest readers might consist of a desktop personal computer with a special card through shielded cable. Such A reader would typically have a network connection as well so that it could report tags that it reads to other computers. The smallest readers are the size of a postage stamp and are designed to be embedded in mobile telephones.

Nowadays lot of RFID reader sold with multiple brands such as Mifare, Hitachi, and Philip. Because of the major application used in worldwide, many systems require the simultaneous use of more than one operating frequency. Most systems available on the world market at present operate at one of the following frequencies or frequency ranges: below 135 kHz (125 kHz, 134.2kHz for example), 13.56MHz, UHF (860/960 MHz), 2.45GHz and 5.8GHz. The operating and control characteristics are different for each of these frequencies, and therefore each of them is more appropriate for certain types of application or certain countries.

3.3 RFID Tag


The tag, also known as the transponder (derived from the terms transmitter and responder), holds the data that is transmitted to the reader when the tag is interrogated by the reader. The most common tags today consist of an Integrated Circuit with memory, essentially a microprocessor chip. Other tags are chip less and have no onboard Integrated circuit. Chip less tags are more effective in applications where simpler range of functions is all that is required; although they can help achieve more accuracy and better detection range, at potentially lower cost than their Integrated Circuit-based counterparts. From here on out, we will use the term tag to mean Integrated Circuit-based tag. We will refer to chip less tags explicitly, when needed. RFID tags come in two general varieties which are passive and active tag. Passive tags require no internal power source, thus being pure passive devices (they are only active when a reader is nearby to power them), whereas active tags require a power source, usually a small battery.

Chapter 4 COMPONENTS OF RFID


A basic RFID system consists of three components: An antenna or coil A transceiver (with decoder) A transponder (RF tag) electronically programmed with unique information These are described below:

4.1 ANTENNA
The antenna emits radio signals to activate the tag and read and write data to it. Antennas are the conduits between the tag and the transceiver, which controls the system's data acquisition and communication. Antennas are available in a variety of shapes and sizes; they can be built into a door frame to receive tag data from persons or things passing through the door, or mounted on an interstate tollbooth to monitor traffic passing by on a freeway. The electromagnetic field produced by an antenna can be constantly present when multiple tags are expected continually. If constant interrogation is not required, a sensor device can activate the field. Often the antenna is packaged with the transceiver and decoder to become a reader (a.k.a. interrogator), which can be configured either as a handheld or a fixed-mount device. The reader emits radio waves in ranges of anywhere from one inch to 100 feet or more, depending upon its power output and the radio frequency used. When an RFID tag passes through the electromagnetic zone, it detects the reader's activation signal. The reader decodes the data encoded in the tag's integrated circuit (silicon chip) and the data is passed to the host computer for processing.

Antenna

4.2 TAGS (Transponders) An RFID tag is comprised of a microchip containing identifying information and an antenna that transmits this data wirelessly to a reader. At its most basic, the chip will contain a serialized identifier, or license plate number, that uniquely identifies that item, similar to the way many bar codes are used today. A key difference, however is that RFID tags have a higher data capacity than their bar code counterparts. This increases the options for the type of information that can be encoded on the tag, including the manufacturer, batch or lot number, weight, ownership, destination and history (such as the temperature range to which an item has been exposed). In fact, an unlimited list of other types of information can be stored on RFID tags, depending on application needs. An RFID tag can be placed on individual items, cases or pallets for identification purposes, as well as on fixed assets such as trailers, containers, totes, etc. Tags come in a variety of types, with a variety of capabilities. Key variables include: "Read-only" versus "read-write" There are three options in terms of how data can be encoded on tags: (1) Read-only tags contain data such as a serialized tracking number, which is pre-written onto them by the tag manufacturer or distributor. These are generally the least expensive tags because they cannot have any additional information included as they move throughout the supply chain. Any updates to that information would have to be maintained in the application software that tracks SKU movement and activity. (2) "Write once" tags enable a user to write data to the tag one time in production or distribution processes. Again, this may include a serial number, but perhaps other data such as a lot or batch number. (3) Full "readwrite" tags allow new data to be written to the

tag as neededand even written over the original data. Examples for the latter capability might include the time and date of ownership transfer or updating the repair history of a fixed asset. While these are the most costly of the three tag types and are not practical for tracking inexpensive items, future standards for electronic product codes (EPC) appear to be headed in this direction.

RFID TAGS

Data capacity
The amount of data storage on a tag can vary, ranging from 16 bits on the low end to as much as several thousand bits on the high end. Of course, the greater the storage capacity, the higher the price per tag.

Form factor
The tag and antenna structure can come in a variety of physical form factors and can either be selfcontained or embedded as part of a traditional label structure (i.e., the tag is inside what looks like a regular bar code labelthis is termed a 'Smart Label') companies must choose the appropriate form factors for the tag very carefully and should expect to use multiple form factors to suit the tagging needs of different physical products and units of measure. For example, a pallet may have an RFID tag fitted only to an area of protected placement on the pallet itself. On the other hand, cartons on the pallet have RFID tags inside bar code labels that also provide operators human-readable information and a backup should the tag fail or pass through non RFID-capable supply chain links.

Passive versus active


Passive tags have no battery and "broadcast" their data only when energized by a reader. That means they must be actively polled to send information. "Active" tags are capable of broadcasting their data using their own battery power. In general, this means that the read ranges are much greater for active tags than they are for passive tagsperhaps a read range of 100 feet or more, versus 15 feet or less for most passive tags. The extra capability and read ranges of active tags, however, come with a cost; they are several times more expensive than passive tags. Today, active tags are much more likely to be used for high-value items or fixed assets such as trailers, where the cost is minimal compared to item value, and very long read ranges are required. Most traditional supply chain applications, such as the RFID-based tracking and compliance programs emerging in the consumer goods retail chain, will use the less expensive passive tags.

Frequencies
Like all wireless communications, there are a variety of frequencies or spectra through which RFID tags can communicate with readers. Again, there are trade-offs among cost, performance and application requirements. For instance, low-frequency tags are cheaper than ultra high- frequency (UHF) tags, use less power and are better able to penetrate non-metallic substances. They are ideal for scanning objects with high water content, such as fruit, at close range. UHF frequencies typically offer better range and can transfer data faster. But they use more power and are less likely to pass through some materials. UHF tags are typically best suited for use with or near wood, paper, cardboard or clothing products. Compared to low-frequency tags, UHF tags might be better for scanning boxes of goods as they pass through a bay door into a warehouse. While the tag requirements for compliance mandates may be narrowly defined, it is likely that a variety of tag types will be required to solve specific operational issues. You will want to work with a company that is very knowledgeable in tag and reader technology to appropriately identify the right mix of RFID technology for your environment and applications.

EPC Tags
EPC refers to "electronic product code," an emerging specification for RFID tags, readers and business applications first developed at the Auto-ID Center at the Massachusetts Institute of Technology. This organization has provided significant intellectual leadership toward the use and application of RFID technology. EPC represents a specific approach to item identification, including an emerging standard for the tags themselves, including both the data content of the tag and open wireless communication protocols. In a sense, the EPC movement is combining the data standards embodied in certain bar code specifications, such as the UPC or UCC-128 bar code standards, with the wireless data communication standards that have been developed by ANSI and other groups.

4.3 RF Transceiver:
The RF transceiver is the source of the RF energy used to activate and power the passive RFID tags. The RF transceiver may be enclosed in the same cabinet as the reader or it may be a separate piece of equipment. When provided as a separate piece of equipment, the transceiver is commonly referred to as an RF module. The RF transceiver controls and modulates the radio frequencies that the antenna transmits and receives. The transceiver filters and amplifies the backscatter signal from a passive RFID tag.

Chapter 5 Logical Structure

5.1 Explanation:
5.1.1 Microcontroller: It is the Heart of the circuit. We will be using PHILIPS P89V51RD2 microcontroller. The controller that we will be using is PHILIPS P89V51RD2 , which is a 40 pin microcontroller with 32 I/O lines. The controller communicates with the RFID reader & the PC using RS232 protocol for which MAX 232 IC is required. 5.1.2 MAX232: Microcontroller communicates with the PC using its inbuilt Serial Port. The voltage levels are 0 & 5 Volts, but for the controller to communicate with the PC we are using RS232 protocol so for

converting the CMOS (0-5) voltage levels into RS232 (12) voltage levels we will be using MAX 232.

5.1.3 LCD: We will be using 2-Line, 16 characters LCD. This will be used to display the real time, scan successful or not and other such details. FEATURES: 5 x 8 dots with cursor Built-in controller (KS 0066 or Equivalent) + 5V power supply (Also available for + 3V) 1/16 duty cycle B/L to be driven by pin 1, pin 2 or pin 15, pin 16 or A.K (LED) N.V. optional for + 3V power supply

5.2 Circuit Diagram

5.2.1 ABOUT P89V51RD2 MICROCONTROLLER 5.2.1.1 Features


1. 2. A key feature of the P89V51RD2 is its X2 mode option. The P89V51RD2 is an 80C51 microcontroller with 64 kB Flash and 1024 bytes of Data RAM.

3. 80C51 Central Processing Unit. 4. 5 V Operating voltage from 0 to 40 MHz 5. 64 kB of on-chip Flash program memory with ISP (In-System Programming) and IAP (In-Application Programming). 6. Supports 12-clock (default) or 6-clock mode selection via software or ISP. 7. SPI (Serial Peripheral Interface) and enhanced UART. 8. PCA (Programmable Counter Array) with PWM and Capture/Compare functions. 9. Four 8-bit I/O ports with three high-current Port 1 pins (16 mA each). 10. Three 16-bit timers/counters. 11. Programmable Watchdog timer (WDT). 12. Eight interrupt sources with four priority levels. 13. Second DPTR register. 14. Low EMI mode (ALE inhibit). 15. TTL- and CMOS-compatible logic levels.

5.2.1.2 Description
The P89V51RD2 is an 80C51 microcontroller with 64 kB Flash and 1024 bytes of data RAM. A key feature of the P89V51RD2 is its X2 mode option. The design engineer can choose to run the application with the conventional 80C51 clock rate (12 clocks per machine cycle) or select the X2 mode (6 clocks per machine cycle) to achieve twice the throughput at the same clock frequency. Another way to benet from this feature is to keep the same performance by reducing the clock frequency by half, thus dramatically reducing the EMI. The Flash program memory supports both parallel programming and in serial In-System Programming (ISP). Parallel programming mode offers gang-programming at high speed, reducing programming costs and time to market. ISP allows a device to be reprogrammed in the end product under software control. The capability to eld/update the application rmware makes a wide range of applications possible.

The P89V51RD2 is also In-Application Programmable (IAP), allowing the Flash program memory to be recongured even while the application is running.

5.2.2 IC 7805
7805 is a voltage regulator integrated circuit. It is a member of 78xx series of fixed linear voltage regulator ICs. The voltage source in a circuit may have fluctuations and would not give the fixed voltage output. The voltage regulator IC maintains the output voltage at a constant value. The xx in 78xx indicates the fixed output voltage it is designed to provide. 7805 provides +5V regulated power supply. Capacitors of suitable values can be connected at input and output pins depending upon the respective voltage levels.

Pin Diagram:

Pin Description: Pin No 1 2 3 Function Input voltage (5V-18V) Ground (0V) Regulated output; 5V (4.8V-5.2V) Name Input Ground Output

5.2.3 Disc Capacitor

A ceramic disc capacitor is a capacitor constructed with a ceramic disc as the dielectric. You'll recall that the basic definition of a capacitor is two conductors separated by an insulator (dielectric) of some kind. As a charge is driven onto one plate of a capacitor, the extra charge there builds up an electric field. Each charge arriving on one plate forces a charge off the other plate. Charge (and, therefore, voltage) builds. Let's build one to see how it works. Imagine a thick coin of some kind, but made of ceramic. You will (of course) have a ceramic disc. If you coat each face with metal and attach a lead to it, you'll have the basic construct. Note that the edges of the disc are left uncoated, and the two faces, which are conductive now, are insulated by the disc. Just dip the capacitor into a phenolic or epoxy to coat it and it's ready to go, except for the labels. These caps are used in tuning or decoupling applications in RF circuits. And the leads are a dead giveaway to their through-hole use. Crimped or straight leads, please? Use the link below to view some pictures, and all this will make a lot more sense.

5.2.4 RTC(REAL TIME CLOCK) FEATURES:


1. Real time clock counts seconds, minutes, hours, date of the month, month, day of the week,and year with leap year compensation valid up to 2100. 2. 56 byte nonvolatile RAM for data storage. 3. 2-wire serial interface. 4. Programmable squarewave output signal 5. Automatic power-fail detect and switch circuitry Consumes less than 500 nA in battery backup mode with oscillator running. 6. Optional industrial temperature range. 7. 40C to +85C. 8. Available in 8-pin DIP or SOIC. 9. Recognized by Underwriters Laboratory.

DESCRIPTION
The DS1307 Serial Real Time Clock is a low power, full BCD clock/calendar plus 56 bytes of nonvolatile SRAM. Address and data are transferred serially via a 2-wire bi-directional bus. The clock/calendar provides seconds, minutes, hours, day, date, month, and year information. The end of the month date is automatically adjusted for months with less than 31 days, including corrections for leap year. The clock operates in either the 24-hour or 12-hour format with AM/PM indicator. The DS1307 has a built-in power sense circuit which detects power failures and automatically switches to the battery supply.

SIGNAL DESCRIPTIONS:
VCC, GND - DC power is provided to the device on these pins. VCC is the +5 volt input. When 5 volts is applied within normal limits, the device is fully accessible and data can be written and read.

When a 3-volt battery is connected to the device and VCC is below 1.25 x VBAT, reads and Writes are inhibited.However, the Timekeeping function continues unaffected by the lower input voltage. As VCC falls below VBAT the RAM and timekeeper are switched over to the external power supply (nominal 3.0V DC) at VBAT. VBAT - Battery input for any standard 3-volt lithium cell or other energy source. Battery voltage must be held between 2.0 and 3.5 volts for proper operation. The nominal write protect trip point voltage at which access to the real time clock and user RAM is denied is set by the internal circuitry as 1.25 x VBAT nominal. A lithium battery with 48 mAhr or greater will back up the DS1307 for more than 10 years in the absence of power at 25 degrees C. SCL (Serial Clock Input) - SCL is used to synchronize data movement on the serial interface. SDA (Serial Data Input/Output) - SDA is the input/output pin for the 2-wire serial interface. The SDA pin is open drain which requires an external pullup resistor. SQW/OUT (Square Wave/ Output Driver) - When enabled, the SQWE bit set to 1, the SQW/OUT pin outputs one of four square wave frequencies (1 Hz, 4 kHz, 8 kHz, 32 kHz). The SQW/OUT pin is open drain which requires an external pullup resistor. SQW/OUT will operate with either Vcc or Vbat applied. X1, X2 - Connections for a standard 32.768 kHz quartz crystal. The internal oscillator circuitry is designed for operation with a crystal having a specified load capacitance (CL) of 12.5 pF. In this configuration, the X1 pin is connected to the external oscillator signal and the X2 pin is floated.

Chapter 6 PCB CONSTRUCTION


After checking the system on the breadboard, now it was time to design it on PCB. There are some steps for PCB designing:

6.1 Basics about PCB:


A printed circuit board, or PCB, is used to mechanically support and electrically connect electronic components using conductive pathways, tracks or signal traces etched from copper sheets laminated onto a non-conductive substrate. It is also referred to as printed wiring board (PWB) or etched wiring board. A PCB populated with electronic components is a printed circuit assembly (PCA), also known as a printed circuit board assembly or PCB Assembly (PCBA). Printed circuit boards are used in virtually all but the simplest commercially produced electronic devices. Alternatives to PCBs include wire wrap and point-to-point construction. PCBs are often less expensive and more reliable than these alternatives, though they require more layout effort and higher initial cost. PCBs are much cheaper and faster for high-volume production since production and soldering of PCBs can be done by automated equipment. Much of the electronics industry's PCB design, assembly, and quality control needs are set by standards that are published by the IPC (Association Connecting Electronics Industries) organization.

34

Chapter 7 Working of RFID MODULE


7.1 Basic Working
Low frequency RFID works on the principle of radio waves and at the frequency of 125 KHz. There is a coil inside the RFID tag and when it is influenced by magnetic field, it sends an identity code to a device for further processing. (For more details, refer interfacing RFID with AT89C51). The RFID tag is used as an identity for a particular user. If the identity (serial number of the tag) of the user is matched with the one already stored in this system, he gets immediate access through it. This RFID based secured access system also has many additional features. In beginning, the user is prompted to scan his tag or ID. The serial code of the tag is identified by the reader module and is sent to P89V51RD2 for checking. If the ID is matched by the microcontroller, the user gets the access. A new user needs to press the switch to register after which his identity is verified twice with RFID tag. The new record is stored by the microcontroller to grant future access. The system also shows Error if the tags do not match during verification. If a different tag is scanned through the reader, LCD displays you have shown different ID. When an RFID tag comes in this range, the reader detects it and sends a unique code of the tag serially. This serial code, consisting of 12 bytes, is received by the microcontroller. This code is treated as an ID for the user and is stored as an array in the microcontroller. If the ID is matched with this code, the user is granted access though the system.

35

Above Fig. Shown is a RFID transceiver that communicates with a passive Tag. Passive tags have no power source of their own and instead derive power from the incident electromagnetic field. Commonly the heart of each tag is a microchip. When the Tag enters the generated RF field it is able to draw enough power from the field to access its internal memory and transmit its stored information. When the transponder Tag draws power in this way the resultant interaction of the RF fields causes the voltage at the transceiver antenna to drop in value. This effect is utilized by the Tag to communicate its information to the reader. The Tag is able to control the amount of power drawn from the field and by doing so it can modulate the voltage sensed at the Transceiver according to the bit pattern it wishes to transmit.

7.2 Software Tools


1. Keil Software
To write,compile and execute the LPC2148 NXP programs in embedded C

2. Flash Magic
To transfer programs into Microcontrollers at appropriate baud rate

36

Programming Microcontroller through Flash Magic

37

7.3 Microcontroller Program

//Program to interface RFID with 8051 microcontroller (P89V51RD2) /*RFID main program*/
#include <reg51.H> #include "lcd.h" #include "serial.h" #include "string.h" #include "rtc.h" code char ashish[] = {0x02,0x31,0x46,0x30,0x30,0x31,0x41,0x39,0x37,0x45,0x44,0x37,0x46,0x0D,0x0A,0x03}; code char dhruv[] = {0x02,0x31,0x46,0x30,0x30,0x31,0x41,0x36,0x33,0x44,0x36,0x42,0x30,0x0D,0x0A,0x03}; code char sourabh[] = {0x02,0x30,0x41,0x30,0x30,0x38,0x31,0x43,0x33,0x34,0x34,0x30,0x43,0x0D,0x0A,0x03}; unsigned char x; char rx_data[16]; unsigned int compare() { unsigned char match = 0; while(1) { for(x=0;x<16;x++) { if(rx_data[x] == ashish[x]) match = 1; else { match = 0; break; } } if(match) { lcd_clr(); lcd_puts("ATTENDANCE delay(1000); return 1; } match = 0; for(x=0;x<16;x++) {
38

CONFIRMED");

if(rx_data[x] == dhruv[x]) match = 1; else { match = 0; break; } } if(match) { lcd_clr(); lcd_puts("ATTENDANCE delay(1000); return 2; }

CONFIRMED");

match = 0; for(x=0;x<16;x++) { if(rx_data[x] == sourabh[x]) match = 1; else { match = 0; break; } } if(match) { lcd_clr(); lcd_puts("ATTENDANCE CONFIRMED"); delay(1000); return 3; } if(!match) return 0; } } void main() { unsigned int r; lcd_init(); serial_init(); Rtc_Init(); lcd_puts("RFID BASED delay(2000); lcd_clr(); while(1) { lcd_puts("PLEASE SWYPE YOUR CARD");
39

ATTENDANCE SYSTEM");

for(x=0;x<16;x++) rx_data[x] = 0x00; for(x=0;x<16;x++) rx_data[x] = ser_rxc(); lcd_clr(); r = compare(); if( r == 1) { lcd_clr(); r=0; lcd_puts(" ASHISH "); lcd_cmd(0xC0); Rtc_Get_Time(); } else if( r == 2) { lcd_clr(); r=0; lcd_puts(" DHRUV "); lcd_cmd(0xC0); Rtc_Get_Time(); } else if( r == 3) { lcd_clr(); r=0; lcd_puts(" SOURABH "); lcd_cmd(0xC0); Rtc_Get_Time(); } delay(2000); lcd_clr(); } }

/*Program to Display on LCD*/(LCD read and write commands)


sbit RS = P3^6; sbit EN = P3^7; sfr ldata = 0x80; void delay(unsigned int time) { int i,j; for(i=0;i<time;i++) for(j=0;j<114;j++); } void lcd_cmd(unsigned char val)
40

{ RS = 0; ldata = val; EN = 1; delay(1); EN = 0; delay(1); } void lcd_data(unsigned char val) { RS = 1; ldata = val; EN = 1; delay(1); EN = 0; } void lcd_puts(unsigned char *str) { unsigned char i=0; while(*str) { lcd_data(*str++); i++; if(i == 16) lcd_cmd(0xC0); } } void lcd_clr() { lcd_cmd(0x01); lcd_cmd(0x80); } void lcd_init() { lcd_cmd(0x38); lcd_cmd(0x06); lcd_cmd(0x0C); lcd_cmd(0x01); }

41

/*Program to display the time through RTC*/(RTC=real time clock)


sbit SDA = P2^5; sbit SCL = P2^4; sbit MSB = ACC^7; sbit LSB = ACC^0; unsigned char time[4] = { 0x20, 0x22, 0x17 }; unsigned int i; unsigned char c,sec,min,hour,temp; void delay_ms(unsigned int time) { int i,j; for(i=0;i<time;i++) { for(j=0;j<114;j++); } } void start() { SDA = 1; SCL = 1; SDA = 0; } void stop() { SDA = 0; SCL = 1; SDA = 1; } void wt_lcd(unsigned char s) { unsigned char temp1,temp2; temp1 = ((s & 0xf0)>>4) + 0x30; lcd_data(temp1); delay_ms(1); temp2 = (s & 0x0f) + 0x30; lcd_data(temp2); delay_ms(1); } void write(unsigned char val) {
42

// initialize the value of sec, min, hour...

// to set unit digit...

// to set decimal digit...

unsigned char a; for(a=0;a<8;a++) { SCL = 0; delay_ms(1); SDA = val & 0x80; val = val << 1; delay_ms(1); SCL = 1; delay_ms(1); SCL = 0; delay_ms(1); } SDA = 1; delay_ms(1); SCL = 1; delay_ms(1); SCL = 0; delay_ms(1); } unsigned char read(void) { unsigned char j; SDA = 1; delay_ms(1); for(j=0;j<8;j++) { SCL = 1; delay_ms(1); temp = temp << 1; temp = temp | SDA; delay_ms(1); SCL = 0; delay_ms(2); } SDA = 0; delay_ms(1); SCL = 1; delay_ms(1); SCL = 0; delay_ms(1); SDA = 1; delay_ms(1); return(temp); } unsigned char last_read(void) { unsigned char j; SDA = 1; delay_ms(1);

// 1 0 0 0

0000

43

for(j=0;j<8;j++) { SCL = 1; delay_ms(1); temp = temp << 1; temp = temp | SDA; delay_ms(1); SCL = 0; delay_ms(2); } return(temp); } void Rtc_Get_Time() // reading from rtc... { start(); write(0xD0); write(0x00); stop(); delay_ms(1); start(); write(0xD1); lcd_cmd(0xC0); sec = read(); min = read(); hour = last_read(); wt_lcd(hour); lcd_data(0x3A); wt_lcd(min); lcd_data(0x3A); wt_lcd(sec); stop(); delay_ms(1); } void Rtc_Init() { SCL = 1; SDA = 1; start(); write(0xD0); write(0x00); for(i=0;i<3;i++) write(time[i]); stop();
44

delay_ms(1); }

45

Chapter 8 Advantages

8.1 Advantages of RFID Over Bar Coding 1. No "line of sight" requirements: Bar code reads can sometimes be limited or problematic due to the need to have a direct "line of sight" between a scanner and a bar code. RFID tags can be read through materials without line of sight. 2. More automated reading: RFID tags can be read automatically when a tagged product comes past or near a reader, reducing the labor required to scan product and allowing more proactive, real-time tracking. 3. Improved read rates: RFID tags ultimately offer the promise of higher read rates than bar codes, especially in high-speed operations such as carton sortation. 4. Greater data capacity: RFID tags can be easily encoded with item details such as lot and batch, weight, etc. 5. "Write" capabilities: Because RFID tags can be rewritten with new data as supply chain activities are completed, tagged products carry updated information as they move throughout the supply chain. 8.2 Advantages 1. Store data on a tag 2. Can be hidden 3. Work in harsh environment 8.3 Disadvantges 1. Lack of standards! 2. Short range 3. Cost

46

CHAPTER 9 CONCLUSION
Embedded systems have virtually entered every sphere of our life, right from the time we work out on tread mills to the cars that we drive today. The possibilities in this field are only limited by our imagination.Many of the embedded systems are managed by human controllers by some sort of man machine interface-for example a cash register,a cell phone, a TV screen or a PC interface.It is this MMI that often represents the most costly investment in the systems development,interms of both time and money. The project RFID based attendance system has a ID number and related details which are sent to computers.RFID module comprising of a RFID Reader and a RF Tag avails an easy implementations option and is a farless tedious bid. It is a simple method and is reliable. Saving attendance in a computer allows easy verification and longer record keeping.

47

References

1. 8051 and embedded system by Mazidi and Mazidi. 2. Daniel D. Gajski. Frank Vahid, Sanjiv Narayan & Jie Gong, Specification and

Design of Embedded Systems. PTR Prentice Hall, Englewood Cliffs NJ, 1994.
3. Jack Ganssle, Art of programming Embedded Systems, Academic Press, San Diego.

1992.
4. Radio-frequency identification. Wikipedia (online). Wikimedia Foundation, Inc., 2009. 5. HID Corporation, "Understanding Card Data Formats", Technology Basics White Paper, 2009. 6. All datasheets from www.datasheetcatalog.com 7. www.triindia.co.in

48

Вам также может понравиться