Академический Документы
Профессиональный Документы
Культура Документы
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.
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)
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.
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.
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.
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.
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.
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.
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.
Move data to LCD port. Select command register. Select write operation. Send enable signal. Wait for LCD to process the command.
Circuit of power supply The power supply consists of ac voltage transformer, diode rectifier, ripple
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 ..
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.
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.
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.
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.
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
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
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.
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.
34
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.
2. Flash Magic
To transfer programs into Microcontrollers at appropriate baud rate
36
37
//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(); } }
{ 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
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