The attendance system is basically an embedded one. Embedded stands for ‘hardware controlled by software’. Here, the software using a microcontroller controls all the hardware components. The microcontroller plays an important role in the system. The main objective of the system is to uniquely identify and to make attendance for a person. This requires a unique product, which has the capability of distinguishing different person.
This is possible by the new emerging technology RFID (Radio Frequency Identification). The main parts of an RFID system are RFID tag (with unique ID number) and RFID reader (for reading the RFID tag). In this system, RFID tag and RFID reader used are operating at 125 KHz. The EEPROM used for storing the details has the capability of storing 256 person details at a time. The PC can be used for restoring all the details of attendance made. 1. 2 WHAT IS RFID? RFID stands for Radio-Frequency Identification. The acronym refers to small electronic devices that consist of a small chip and an antenna.
The chip typically is capable of carrying 2,000 bytes of data or less. The RFID device serves the same purpose as a bar code or a magnetic strip on the back of a credit card or ATM card; it provides a unique identifier for that object. And, just as a bar code or magnetic strip must be scanned to get the information, the RFID device must be scanned to retrieve the identifying information. The object of any RFID system is to carry data in suitable transponders, generally known as tags, and to retrieve data, by machine-readable means, at a suitable time and place to satisfy particular application needs.
Data within a tag may provide identification for an item in manufacture, goods in transit, a location, the identity of a vehicle, an animal or individual. A system requires, in addition to tags, a means of reading or interrogating the tags and some means of communicating the data to a host computer or information management system. A system will also include a facility for entering or programming data into the tags, if this is not undertaken at source by the manufacturer. Quite often an antenna is distinguished as if it were a separate part of an RFID system.
While its importance justifies the attention it must be seen as a feature that is present in both readers and tags, essential for the communication between the two. ?What is the purpose of RFID? RFID allows data to be transmitted by a product containing an RFID tag microchip, which is read by an RFID reader. The data transmitted can provide identification or location information about the product, or specifics such as date of purchase or price 1. 2. 1 Data Flow in RFID: To understand and appreciate the capabilities of RFID systems it is necessary to consider their constituent parts.
It is also necessary to consider the data flow requirements that influence the choice of systems and the practicalities of communicating across the air interface. By considering the system components and their function within the data flow chain it is possible to grasp most of the important issues that influence the effective application of RFID. However, it is useful to begin by briefly considering the manner in which wireless communication is achieved, as the techniques involved have an important bearing upon the design of the system components. . 2. 1. 1 Wireless communication and the air interface Communication of data between tags and a reader is by wireless communication. Two methods distinguish and categories RFID systems, one based upon close proximity electromagnetic or inductive coupling and one based upon propagating electromagnetic waves. Coupling is via ‘antenna’ structures forming an integral feature in both tags and readers. While the term antenna is generally considered more appropriate for propagating systems it is also loosely applied to inductive systems.
To transfer data efficiently via the air interface or space that separates the two communicating components requires the data to be superimposed upon a rhythmically varying (sinusoidal) field or carrier wave. This process of superimposition is referred to as modulation, and various schemes are available for this purpose, each having particular attributes that favour their use. They are essentially based upon changing the value of one of the primary features of an alternating sinusoidal source, its amplitude, frequency or phase in accordance with the data carrying bit stream.
On this basis one can distinguish amplitude shift keying (ASK), frequency shift keying (FSK) and phase shift keying (PSK). In addition to non-contact data transfer, wireless communication can also allow non-line-of-sight communication. 1. 2. 2 RFID Operating Frequencies ?Low Frequency (125 kHz) Applications: Access control, livestock, race timing, pallet tracking, automotive immobilizers, pet identification – Inductively coupled devices, electro-mechanical field – Antenna coil has many turns – Read range (near contact to 1 meter) – Limited data rate due to a lower bandwidth ?High Frequency (13. 56 MHz)
Applications: Supply chain, wireless commerce, ticketing, product authentication, clothing identification, library book identification, smart cards – Inductively coupled devices – Fewer antenna turns than LF device – Read range is from 1 to 1. 5 meters – Higher data transfer rate than LF ?Ultra-High Frequency (860-960 MHz) Applications: Supply chain, tool tags, RTLS, EPC case and pallet – RF communication uses propagation coupling – Smaller reader antenna design than LF or HF – Read distance (1 m to 10 m) – High data transfer rate – More complex reader electronic components 1. 2. 3 Data transfer rate and bandwidth
Choice of field or carrier wave frequency is of primary importance in determining data transfer rates. In practical terms the rate of data transfer is influenced primarily by the frequency of the carrier wave or varying field used to carry the data between the tag and its reader. Generally speaking the higher the frequency the higher the data transfer or throughput rates that can be achieved. This is intimately linked to bandwidth or range available within the frequency spectrum for the communication process. The channel bandwidth needs to be at least twice the bit rate required for the application in mind.
Where narrow band allocations are involved the limitation on data rate can be an important consideration. It is clearly less of an issue where wide bandwidths are involved. Using the 2. 4 – 2. 5 GHz spread spectrum band, for example, 2 megabits per second data rates may be achieved, with added noise immunity provided by the spread spectrum modulation approach. Spread spectrum apart, increasing the bandwidth allows an increase noise level and a reduction in signal-to-noise ratio. 1. 2. 4 Range: The range that can be achieved in an RFID system is essentially determined by: ?
The power available at the reader/interrogator to communicate with the tag(s) ? The power available within the tag to respond ?The environmental conditions and structures, the former being more significant at higher frequencies including signal to noise ratio 1. 3 RFID SYSTEM AND COMPONENTS: 1. 3. 1 TRANSPONDER/TAG RFID tags are tiny microchips with memory and an antenna coil, thinner than paper and some only 0. 3 mm across. RFID tags listen for a radio signal sent by a RFID reader. When a RFID tag receives a query, it responds by transmitting its unique ID code and other data back to the reader. ?Tag Types Active Tags:Battery powered, long read range – Semi-active:Battery power to preserve memory – Passive Tags: Low-cost, no battery required, medium read range ?Active RFID Tags Active RFID tags, are called transponders because they contain a transmitter that is always, are powered by a batter, about the size of a coin, and are designed for communications up to 100 feet from RFID reader. They are larger and more expensive than passive tags, but can hold more data about the product and are commonly used for high-value asset tracking. Active tags may be read-write, meaning data they contain can be written over. Semi-Active RFID Tags Semi-active tags contain a small battery that boosts the range and preserves memory. ?
Passive RFID Tags Passive tags can be as small s 0. 3 mm and don’t require batteries. Rather, they are powered by the radio signal of a RFID reader, which ? §wakes them up?? to request a reply. Passive RFID tags can be read from a distance of about 20 feet. They are generally read-only, meaning the data they contain cannot be altered or written over. Comparison of Passive and Active Tags: Tag Packing Formats ?Weather-proof or environment-proof enclosure ?Pressure Sensitive Label ?Laminated card Embedded in packaging or product Transponder Examples ?32 mm and 23 mm capsule transponder ?? inch key head transponder ?Smart Labels (Clear and Adhesive) ?Circular transponders 1. 3. 2 RFID READERS Readers are radio frequency devices that: ?Transmit and receive RF signals ?Contain a control unit to execute commands ?Incorporate an interface to transfer data ?Receives commands from a Host computer ?Passes data back to the Host RFID readers, also called interrogators, first and foremost are used to query RFID tags in order to obtain identification, location, and other information about the device or product the tag is embedded in.
The RF energy from the reader antenna is collected by the RFID tag antenna and used to power up the microchip. READER CHARACTERISTICS: – Stationary or handheld (different RFID Reader Modules) – Weather-proof or industrialized – Typical read ranges vary from a few centimeters to a few meters – Read range is dependent upon: Broadcast signal strength Size of broadcast antenna Size of transponder antenna The environment Metallic, Liquid -Multi-frequency readers ?RFID read-only readers These devices can only query or read information from a nearby RFID tag.
These readers are found in fixed, stationary applications as well as portable, handheld varieties. ?RFID read-write readers Also known as encoders, these devices read and also write (change) information in an RFID tag. Such RFID encoders can be used to program information into a ? §blank?? RFID tag. A common application is to combine such a RFID reader with a barcode printer to print. Smart labels contain a UPC bar code on the front with an RFID tag embedded on the back. 1. 3. 3 ANTENNAS: Antenna Characteristics: – Transmits and receives RF signals Typically made of copper or aluminum, new technologies for printed antennas – Stationary or handheld – Weather-proof/industrialized – Fixed or tunable 1. 3. 4 RFID System Considerations ?Read distance requirements – Long read range – Short read range ?Frequency – All frequencies have their pros and cons ?ISO standards – Proprietary or standards-based ?Government regulations – Varies from country to country ?Multiple Tag Reading in Same Field – Anti-collision ?Sensitivity to Orientation – A single orientation or omni-directional ?Hardware Set-up – Environment can affect performance
Bonding ability – Bonding surface – Substrate – Interference – Historical reasons – Security – Reliability 1. 4 AREAS OF APPLICATION FOR RFID: – Livestock tracking – Automotive immobilizer – Contact less payment – Anti-theft – Library books – Speed pass – Control Access – Production/Inventory tracking A range of miscellaneous applications may also be distinguished, some of which are steadily growing in terms of application numbers. They include: -Animal tagging -Waste management -Time and attendance -Postal tracking -Airline baggage reconciliation -Road toll management 1. WHAT IS THE ADVANTAGE OF USING RFID TECHNOLOGY? No contact or even line-of-sight is needed to read data from a product that contains an RFID tag. This means no more checkout scanners at grocery stores, no more unpacking shipping boxes, and no more getting keys out of your pocket to start your car. RFID technology also works in rain, snow and other environments where bar code or optical scan technology would be useless. Contact less Credit Card Advantages Credit card companies are claiming the following advantages for contact less credit cards: The card is faster to use.
To make a purchase, the card owner just waves his card over the RFID reader, waits for the acceptance indicator – and goes on his way. American Express, Visa and MasterCard have all agreed to waive the signature requirement for contactless credit card transactions under $25. Looking at the numbers, here is where this technology is taking us in our need for speed (average transaction speeds): 1. Contact less credit card transaction: 15 seconds 2. Magnetic strip card transaction: 25 seconds 3. Cash transaction: 34 seconds The contact less card never transmits your card number.
Instead, the RFID chip within the card creates a unique number for the transaction; if a criminal intercepted the number, it would be useless even if successfully decrypted. Contact less cards probably use other measures although this is just speculation, there are certainly other ways to secure the data on the card. For example, the RFID reader that sits on the merchant’s counter may use some sort of special signal, or offer a special set of frequencies, that would be difficult for a thief with an off-the-shelf reader to duplicate. 1. 6 COMMON PROBLEMS WITH RFID
Some common problems with RFID are reader collision and tag collision. Reader collision occurs when the signals from two or more readers overlap. The tag is unable to respond to simultaneous queries. Systems must be carefully set up to avoid this problem. Tag collision occurs when many tags are present in a small area; but since the read time is very fast, it is easier for vendors to develop systems that ensure that tags respond one at a time. ?Problems with RFID Standards Different manufacturers have implemented RFID in different ways; global standards are still being worked on.
It should be noted that some RFID devices are never meant to leave their network (as in the case of RFID tags used for inventory control within a company). This can cause problems for companies. Consumers may also have problems with RFID standards. For example, Exxon Mobil’s Speed Pass system is a proprietary RFID system; if another company wanted to use the convenient Speed Pass (say, at the drive-in window of your favorite fast food restaurant) they would have to pay to access it . On the other hand, if every company had their own “Speed Pass” system, a consumer would need to carry many different devices with them. RFID systems can be easily disrupted Since RFID systems make use of the electromagnetic spectrum (like WiFi networks or cell phones), they are relatively easy to jam using energy at the right frequency. Although this would only be an inconvenience for consumers in stores (longer waits at the checkout), it could be disastrous in other environments where RFID is increasingly used, like hospitals or in the military in the field. Also, active RFID tags (those that use a battery to increase the range of the system) can be repeatedly interrogated to wear the battery down, disrupting the system. ?RFID Reader Collision
Reader collision occurs when the signals from two or more readers overlap. The tag is unable to respond to simultaneous queries. Systems must be carefully set up to avoid this problem; many systems use an anti-collision protocol (also called a singulation protocol. Anti-collision protocols enable the tags to take turns in transmitting to a reader. ?RFID Tag Collision Tag collision occurs when many tags are present in a small area; but since the read time is very fast, it is easier for vendors to develop systems that ensure that tags respond one at a time. ?Security & privacy problems with RFID
An RFID tag cannot tell the difference between one reader and another. RFID scanners are very portable; RFID tags can be read from a distance, from a few inches to a few yards. This allows anyone to see the contents of your purse or pocket as you walk down the street. . ?RFID tags are difficult to remove RFID tags are difficult to for consumers to remove; some are very small (less than a half-millimeter square, and as thin as a sheet of paper) – others may be hidden or embedded inside a product where consumers cannot see them. New technologies allow RFID tags to be “printed” right on a product and may not be removable at all. RFID tags can be read without your knowledge Since the tags can be read without being swiped or obviously scanned (as is the case with magnetic strips or barcodes), anyone with an RFID tag reader can read the tags embedded in your clothes and other consumer products without your knowledge. For example, you could be scanned before you enter the store, just to see what you are carrying. ?RFID tags can be read a greater distance with a high-gain antenna For various reasons, RFID reader/tag systems are designed so that distance between the tag and the reader is kept to a minimum.
However, a high-gain antenna can be used to read the tags from much further away, leading to privacy problems. RFID tags with unique serial numbers could be linked to an individual credit card number. At present, the Universal Product Code (UPC) implemented with barcodes allows each product sold in a store to have a unique number that identifies that product. Work is proceeding on a global system of product identification that would allow each individual item to have its own number. When the item is scanned for purchase and is paid for, the RFID tag number for a particular item can be associated with a credit card number. . 7 WILL RFID REPLCE THE UPC BARCODE TECHNOLOGY? Probably not, at least not soon. Besides the fact that RFID tags still cost more than UPC labels, different data capture and tracking technologies offer different capabilities. Many businesses will likely combine RFID with existing technologies such as barcode readers or digital cameras to achieve expanded data capture and tracking capabilities that meet their specific business needs. ?Advantages of RFID Versus Barcodes RFID tags and barcodes both carry information about products.
However, there are important differences between these two technologies: Barcode readers require a direct line of sight to the printed barcode; RFID readers do not require a direct line of sight to either active RFID tags or passive RFID tags. RFID tags can be read at much greater distances; an RFID reader can pull information from a tag at distances up to 300 feet. The range to read a barcode is much less, typically no more than fifteen feet. RFID readers can read, RFID tags much faster; read rates of forty or more tags per second are possible.
Reading barcodes is much more time-consuming; due to the fact that a direct line of sight is required, if the items are not properly oriented to the reader it may take seconds to read an individual tag. Barcode readers usually take a half-second or more to successfully complete a read. Line of sight requirements also limit the ruggedness of barcodes as well as the reusability of barcodes. (Since line of sight is required for barcodes, the printed barcode must be exposed on the outside of the product, where it is subject to greater wear and tear. RFID tags are typically more rugged, since the electronic components are better protected in a plastic cover. RFID tags can also be implanted within the product itself, guaranteeing greater ruggedness and reusability. Barcodes have no read/write capability; that is, one cannot add to the information written on a printed barcode. RFID tags, however, can be read/write devices; the RFID reader can communicate with the tag, and alter as much of the information as the tag design will allow. RFID tags are typically more expensive than barcodes, in some cases. BLOCK DIAGRAM 2. 1 GNERAL BLOCK DIAGRAM (POWER SUPPLY+CONTROLLER SECTION+RFID) Figure 2. 1 General Block Diagram POWER SUPPLY: This block provides 5V and 9V DC supply to controller and RFID section respectively. It simply consists of a bridge rectifier along with a step down transformer of 230/0-12v, which converts 230v to 12v. The capacitor provide smoothing to the DC voltage. The regulator IC 7805 provides regulation by eliminating the ripples by setting DC output to fixed voltage. CONTROLLER SECTION:
It is a main section of the project which consists of microcontroller AT89S52, RTC DS1307, E2PROM AT24C08, 16X2 LCD and all the necessary components to control the data flow, to display the data and provide the serial data to the RFID section. This section is the main interface between power supply and RFID section. RFID SECTION: This section is the heart of the project. The entire module includes RFID tag for marking attendance, RFID reader to detect the tag and an antenna coil which allows the reception of EM waves. 2. 2 BLOCK DIAGRAM SHOWING THE INSIDE VIEW OF THE CONTROLLER SECTION
Figure 2. 2- Block Diagram Showing Inside View of Controller Section POWER SUPPLY 1: This block provides 5V supply to Microcontroller, RTC, E2PROM, MAX232, and DISPLAY. It simply consists of a bridge rectifier along with a step down transformer and also 7805. It uses capacitor for filtering when bridge rectifier converts 230V AC to 12V pulsating DC. It makes partial smooth dc that is given to 7805 and give an out put of 5V DC. MICROCONTROLLER: This section controls the functioning of the whole system and is interfaced with RTC, E2PROM, MAX232, and DISPLAY.
RTC: It is DS1307 RTC. This section is interfaced with microcontroller . This RTC will display date and time when nothing is detected. It gives information about seconds, minutes, hours, days, weeks, months, POWER SUPPLY 2: This section is the backup supply voltage for RTC it is the 3v dc battery. It will provide voltage during the low power supply or power supply failure. With the help of this power supply RTC can keep track on its real time working. E2PROM: It is AT24C08. This section is external ROM to store the student data when internal ROM is full.
Due to the extra storage requirement to store the student information it is require to extend the storage capacity of microcontroller that’s why EEPROM is connected in this section. It will store the data of around 256 students. MAX232: It is dual driver-receiver IC. This section helps to communicate with computer. It is required for transferring data of student from internal and external ROM. It is used to collect the daily data of student and keeps the record of the attendance saved in the computer. DISPLAY: It is 16×2 LCD display.
This section display date and time when nothing is detected at reader side and shows student information when tag is detected at reader. POWER SUPPLY 3: It is inbuilt in the RFID module and provides 9v DC supply to the section. RFID MODULE: It is a ready-made module that contain ANTENNA coil, RFID READER and TAG shown in block diagram 3. 2. 3 RFID MODULE Figure 2. 3-RFID Module RFID READER: This block is heart of this module that read the tag with the help of antenna coil. It requires 5V DC supply for it’s functioning that is provided by 7805 mounted on RFID module PCB. ANTENNA:
This helps the reader to detect the tag and provide the range of about 8 centimeters. It is an inductive coil of low impedance. It’s a loop antenna. BUZZER AND LED: This block gives indication about the tag reading. When tag comes in the range of reader the LED will glow and buzzer will generate a sound. 3 CIRCUIT DIAGRAM 3. 1 ENTIRE CIRCUIT DIAGRAM Figure 3. 1-Entire Circuit Diagram Entire Circuit Diagram: The entire circuit diagram includes all the three sections that is controller, power supply and the RFID section. AT89S52 is 8-bit microcontroller with 8k bytes of in-system programmable flash memory.
LCD, RTC, EEPROM and MAX232 all are interfaced with the microcontroller. The reader gives the serial data of the ID it reads to the microcontroller. A 5v DC supply is required by the entire circuit except the RFID section. The reader section is a 28-pin IC. Pin 27 & 28 are for connection to the antenna. A buzzer is connected across the pins 3 & 12. Pin 6 gives the serial data to the microcontroller. A 9v DC supply is required for RFID section which is provided separately in the module. AT24C08 is the EEPROM which is used for storing details of the student’s data. It has the capability of storing 256 person details at a time.
It enhances the data storing capability of the system. 16×2 LCD will initially display date and time, and when a TAG is showed it will display the username of the TAG. MAX232 is dual driver-receiver that is used for communication with a PC. DS1307 is a serial real time clock (RTC). It provides 2-wire serial interface nad is used for low power applications. 3V supply is needed for DS1307. In actual the connection between microcontroller and RFID module is not single wired connection. It is RS232 connection. The module having female RS232 connector and microcontroller having male RS232 connector. . 2 CONTROLLER SECTION CIRCUIT DIAGRAM: Figure 3. 2-Controller Section Circuit Diagram Controller Section Circuit Diagram: The controller section contain AT89S52 (Micro controller), AT24C08 (EEPROM), MAX 232 (Dual driver), 16X2 LCD,DS1307 (RTC). Microcontroller is the heart of entire section that controls all operation. Microcontroller is interfaced with EEPROM. It is external ROM provided to extend the data storage capacity of the system. When internal ROM memory become full the extra data then store to this EEPROM. It will store around 256 student data.
Pin 21 and 22 of microcontroller is connected to pin 5 and 6 of EEPROM respectively pin 1, 2, 3, 4, 7 are connected to the ground and pin 8 is connected to Vcc. For real time operation microcontroller is connected to RTC DS1307. It provides information about second, minutes, hours, days, weeks, months, years. It has information up to year 2100. It automatically sets the days in particular month. Microcontroller is interfaced with RTC to show date and time when card is not detected at reader side. It connected to RTC through pin 5(serial clock), pin 6(serial data), pin 7(square wave/output driver) via pin 3(P1. 2), pin2(P1. ), pin1(P1. 0) of microcontroller. A crystal of 32. 768 Khz is connected across to provide the required baud rate. It is connected to 3V battery to maintain the real time operation when power is OFF. Microcontroller is interfaced with LCD which display’s the information when the tag is detected. When no Tag is detected at reader side it display date and time. Whenever Tag is detected it shows the Tag related data on display. Four switches are provided to scroll the menus in LCD. Microcontroller is connected to MAX232 to communicate between system and computer. It communicates via RS232 connector. 3. 3 READER CIRCUIT DIAGRAM
Figure 3. 3-RFID Circuit Diagram RFID Reader: RFID is an acronym for Radio Frequency Identification. RFID is one member in the family of Automatic Identification and Data Capture (AIDC) technologies and is a fast and reliable means of identifying just about any material object. There are several characteristics of an RFID reader that determine the types of tags with which it can communicate. The most fundamental characteristic is the frequency or frequencies at which the reader’s radio communicates. Readers and tags must be tune to same frequency in order to communicate. Some RFID readers can communicate at more than one frequency.
Some corporation offers a dual-frequency RFID reader and tag product line. Supporting dual-frequency communications enables these types of readers to operate efficiently in changing environments. Most RFID readers communicate exclusively with active tags or exclusively with passive tags. This means that an RFID reader that is manufactured to communicate with passive tags will not be able to communicate with active tags and vice versa. Passive tags are generally smaller, lighter and less expensive than those that are active and can be applied to objects in harsh environments, are maintenance free and will last for years.
These transponders are only activated when within the response range of a reader. The RFID reader emits a low-power radio wave field which is used to power up the tag so as to pass on any information that is contained on the chip. A key feature of an RFID reader is the number of tags that it can sample in its tag population. Some readers may be able to sample 10 tags a second while others may be able to sample 100 tags a second. The following items usually influence the number of tags sampled per second: ?The anti-collision algorithm used by the tags The processing capabilities of the reader which usually maps to the type and speed of processor in the reader ? The amount of memory in the reader ?The capabilities of the digital signal processor in the reader’s radio RFID readers come in many sizes, frequencies and with different data processing and reporting capabilities. Understanding these characteristics is important for designing an RFID solution that will function properly and be maintainable. Antenna: The antenna in an RFID tag is a conductive element that permits the tag to exchange data with the reader.
Passive RFID tags make use of a coiled antenna that can create a magnetic field using the energy provided by the reader’s carrier signal. The antenna used for an RFID tag is affected by the intended application and the frequency of operation. Low-frequency (LF) passive tags are normally inductively coupled, and because the voltage induced is proportional to frequency, many coil turns are needed to produce enough voltage to operate an integrated circuit. Compact LF tags, like glass-encapsulated tags used in animal and human identification, use a multilayer coil (3 layers of 100–150 turns each) wrapped around a ferrite core.
The scanning antennas can be permanently affixed to a surface; handheld antennas are also available. They can take whatever shape you need; for example, you could build them into a doorframe to accept data from persons or objects passing through. When an RFID tag passes through the field of the scanning antenna, it detects the activation signal from the antenna. That “wakes up” the RFID chip, and it transmits the information on its microchip to be picked up by the scanning antenna. How RFID Works How does RFID work? A Radio-Frequency Identification system has three parts: – A scanning antenna A transceiver with a decoder to interpret the data – A transponder – the RFID tag – that has been programmed with information. The scanning antenna puts out radio-frequency signals in a relatively short range. The RF radiation does two things: – It provides a means of communicating with the transponder (the RFID tag) AND – It provides the RFID tag with the energy to communicate (in the case of passive RFID tags). 3. 4 POWER SUPPLY Figure 3. 4 Power Supply Circuit Diagram This circuit generates positive 5V DC supply which is given to the controller section. It consists of 230V/0-12V transformer.
A bridge rectifier is formed by the bridge connections of four 1N4007 diodes. The output is full wave varying DC since it utilizes the entire AC cycle. Smoothing is performed by a large capacitor connected across the DC supply. It is done by C3 and it smoothes DC to small ripples. LM7805 is the regulator IC which eliminates ripples by setting DC output to fixed voltage. 4 HARDWARE 4. 1 AT89S52 8-bit Microcontroller with 8K Bytes In-System Programmable Flash Features ?Compatible with MCS-51 Products ?8K Bytes of In-System Programmable (ISP) Flash Memory – Endurance: 1000 Write/Erase Cycles ? 4. 0V to 5. 5V Operating Range Fully Static Operation: 0 Hz to 33 MHz ?Three-level Program Memory Lock ?256 x 8-bit Internal RAM ?32 Programmable I/O Lines ?Three 16-bit Timer/Counters ?Eight Interrupt Sources ?Full Duplex UART Serial Channel ?Low-power Idle and Power-down Modes ?Interrupt Recovery from Power-down Mode ?Watchdog Timer ?Dual Data Pointer ?Power-off Flag Description: The AT89S52 is a low-power, high-performance CMOS 8-bit microcontroller with 8K bytes of in-system programmable Flash memory. The device is manufactured using Atmel’s high-density nonvolatile memory technology and is compatible with the industry- standard 80C51 instruction set and pin out.
The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional nonvolatile memory programmer. By combining a versatile 8-bit CPU with in-system programmable Flash on a monolithic chip, the Atmel AT89S52 is a powerful microcontroller which provides a highly-flexible and cost-effective solution to many embedded control applications. The AT89S52 provides the following standard features: 8K bytes of Flash, 256 bytes of RAM, 32 I/O lines, Watchdog timer, two data pointers, three 16-bit timer/counters, a full duplex serial port, on-chip oscillator, and clock circuitry.
In addition, the AT89S52 is designed with static logic for operation down to zero frequency and supports two software selectable power saving modes. The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial port, and interrupt system to continue functioning. The Power-down mode saves the RAM contents but freezes the oscillator, disabling all other chip functions until the next interrupt or hardware reset. Block diagram: Figure 4. 1-AT89S52 Block Diagram Figure 4. 2-AT89S52 Pin Diagram PIN DESCRIPTION ?VCC Supply voltage (+5V DC). ?GND Ground. ?Port 0
Port 0 is an 8-bit open drain bidirectional I/O port. As an output port, each pin can sink eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as high impedance inputs. Port 0 can also be configured to be the multiplexed low order address/data bus during accesses to external program and data memory. In this mode, P0 has internal pull-ups. ?Port 1: Port 1 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 1 output buffers can sink/source four TTL inputs. When 1s are written to Port 1 pins, they are pulled high by the internal pull-ups and can be used as inputs.
As inputs, Port 1 pins that are externally being pulled low will source current (IIL) because of the internal pull-ups. In addition, P1. 0 and P1. 1 can be configured to be the timer/counter 2 external count input (P1. 0/T2) and the timer/counter 2 trigger input (P1. 1/T2EX), ?Port 2: Port 2 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 2 output buffers can sink/source four TTL inputs. When 1s are written to Port 2 pins, they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 2 pins that are externally being pulled low will source current (IIL) because of the internal pull-ups.
Port 2 emits the high-order address byte during fetches from external program memory and during accesses to external data memory that uses 16-bit addresses (MOVX @ DPTR). ?Port 3: Port 3 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 3 output buffers can sink/source four TTL inputs. When 1s are written to Port 3 pins, they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 3 pins that are externally being pulled low will source current (IIL) because of the pull-ups. Port 3 also receives some control signals for Flash programming and verification. RST Reset input. A high on this pin for two machine cycles while the oscillator is running resets the device. This pin drives High for 96 oscillator periods after the Watchdog times out. ?ALE/PROG: Address Latch Enable (ALE) is an output pulse for latching the low byte of the address during accesses to external memory. This pin is also the program pulse input (PROG) during Flash programming. In normal operation, ALE is emitted at a constant rate of 1/6 the oscillator frequency and may be used for external timing or clocking purposes.
Note, however, that one ALE pulse is skipped during each access to external data memory. With the bit set, ALE is active only during a MOVX or MOVC instruction. Otherwise, the pin is weakly pulled high. Setting the ALE-disable bit has no effect if the microcontroller is in external execution mode. ?PSEN Program Store Enable (PSEN) is the read strobe to external program memory. When the AT89S52 is executing code from external program memory, PSEN is activated twice each machine cycle, except that two PSEN activations are skipped during each access to external data memory. ?EA/VPP External Access Enable.
EA must be strapped to GND in order to enable the device to fetch code from external program memory locations starting at 0000H up to FFFFH. Note, however, that if lock bit 1 is programmed, EA will be internally latched on reset. EA should be strapped to VCC for internal program executions. This pin also receives the 12-volt programming enable voltage (VPP) during Flash programming. ?XTAL1: Input to the inverting oscillator amplifier and input to the internal clock operating circuit. ?XTAL2: Output from the inverting oscillator amplifier. SPECIAL FUNCTION REGISTERS: A map of the on-chip memory area called the Special Function Register (SFR).
Read accesses to these addresses will in general return random data, and write accesses will have an indeterminate effect. ?Timer 2 Registers: Control and status bits are contained in registers T2CON and T2MOD for Timer 2. The register pair are the Capture/Reload registers for Timer 2 in 16-bit capture mode or 16-bit auto-reload mode. ?Interrupt Registers: The individual interrupt enable bits are in the IE register. Two priorities can be set for each of the six interrupt sources in the IP register. Memory Organization: MCS-51 devices have a separate address space for Program and Data Memory.
Up to 64K bytes each of external Program and Data Memory can be addressed. ?Program Memory: If the EA pin is connected to GND, all program fetches are directed to external memory. On the AT89S52, if EA is connected to VCC, program fetches to addresses 0000H through 1FFFH are directed to internal memory and fetches to addresses 2000H through FFFFH are to external memory. ?Data Memory: The AT89S52 implements 256 bytes of on-chip RAM. The upper 128 bytes occupy a parallel address space to the Special Function Registers. This means that the upper 128 bytes have the same addresses as the SFR space but are physically separate from SFR space.
When an instruction accesses an internal location above address 7FH, the address mode used in the instruction specifies whether the CPU accesses the upper 128 bytes of RAM or the SFR space. Instructions which use direct addressing access of the SFR space. Instructions that use indirect addressing access the upper 128 bytes of RAM. ?Watchdog Timer (One-time Enabled with Reset-out) The WDT is intended as a recovery method in situations where the CPU may be subjected to software upsets. The WDT consists of a 13-bit counter and the Watchdog Timer Reset (WDTRST) SFR. The WDT is defaulted to disable from exiting reset.
To enable the WDT, a user must write 01EH and 0E1H in sequence to the WDTRST register (SFR location 0A6H). When the WDT is enabled, it will increment every machine cycle while the oscillator is running. The WDT timeout period is dependent on the external clock frequency. There is no way to disable the WDT except through reset (either hardware reset or WDT overflow reset). When WDT overflows, it will drive an output RESET HIGH pulse at the RST pin. ?Using the WDT To enable the WDT, a user must write 01EH and 0E1H in sequence to the WDTRST register (SFR location 0A6H).
When the WDT is enabled, the user needs to service it by writing 01EH and 0E1H to WDTRST to avoid a WDT overflow. The 13-bit counter overflows when it reaches 8191 (1FFFH), and this will reset the device. When the WDT is enabled, it will increment every machine cycle while the oscillator is running. This means the user must reset the WDT at least every 8191 machine cycles. To reset the WDT the user must write 01EH and 0E1H to WDTRST. WDTRST is a write-only register. The WDT counter cannot be read or written. When WDT overflows, it will generate an output RESET pulse at the RST pin. The RESET pulse duration is 96xTOSC, where TOSC=1/FOSC.
To make the best use of the WDT, it should be serviced in those sections of code that will periodically be executed within the time required to prevent a WDT reset. ?WDT during Power-down and Idle In Power-down mode the oscillator stops, which means the WDT also stops. While in Power-down mode, the user does not need to service the WDT. There are two methods of exiting Power-down mode: by a hardware reset or via a level-activated external interrupt which is enabled prior to entering Power-down mode. When Power-down is exited with hardware reset, servicing the WDT should occur as it normally does whenever the AT89S52 is reset.
Exiting Power-down with an interrupt is significantly different. The interrupt is held low long enough for the oscillator to stabilize. When the interrupt is brought high, the interrupt is serviced. To prevent the WDT from resetting the device while the interrupt pin is held low, the WDT is not started until the interrupt is pulled high. It is suggested that the WDT be reset during the interrupt service for the interrupt used to exit Power-down mode. To ensure that the WDT does not overflow within a few states of exiting Power-down, it is best to reset the WDT just before entering Power-down mode.
Before going into the IDLE mode, the WDIDLE bit in SFR AUXR is used to determine whether the WDT continues to count if enabled. The WDT keeps counting during IDLE (WDIDLE bit = 0) as the default state. To prevent the WDT from resetting the AT89S52 while in IDLE mode, the user should always set up a timer that will periodically exit IDLE, service the WDT, and reenter IDLE mode. With WDIDLE bit enabled, the WDT will stop to count in IDLE mode and resumes the count upon exit from IDLE. ?UART The UART in the AT89S52 operates the same way as the UART in the AT89C51 and AT89C52.
For further information on the UART operation, refer to the ATMEL Web site (http://www. atmel. com). From the home page, select ‘Products’, then ‘8051-Architecture Flash Microcontroller’, then ‘Product Overview’. ?Timer 0 and 1 Timer 0 and Timer 1 in the AT89S52 operate the same way as Timer 0 and Timer 1 in the AT89C51 and AT89C52. For further information on the timers’ operation, refer to the ATMEL Web site (http://www. atmel. com). From the home page, select ‘Products’, then ‘8051-Architecture Flash Microcontroller’, then ‘Product Overview’. ?Timer 2 Timer 2 is a selected by bits in T2CON, as shown in Table 3.
Timer 2 consists of two 8-bit registers, TH2 and TL2. In the Timer function, the TL2 register is incremented every machine cycle. Since a machine cycle consists of 12 oscillator periods, the count rate 16-bit Timer/Counter that can operate as either a timer or an event counter. The type of operation is selected by bit C/T2 in the SFR T2CON (shown in Table 2). Timer 2 has three operating modes: capture, auto-reload (up or down counting), and baud rate generator. The modes are is 1/12 of the oscillator frequency. 4. 2 AT24C08 2-wire Serial EEPROM Features: ?Low-voltage and Standard-voltage Operation –2. 7 (VCC = 2. 7V to 5. 5V) –1. (VCC = 1. 8V to 5. 5V) ?Internally Organized 128 x 8 (1K), 256 x 8 (2K), 512 x 8 (4K), ? 1024 x 8 (8K) or 2048 x 8 (16K) ?2-wire Serial Interface ?Schmitt Trigger, Filtered Inputs for Noise Suppression ?Bi-directional Data Transfer Protocol ?100 kHz (1. 8V) and 400 kHz (2. 5V, 2. 7V, 5V) Compatibility ? Write Protect Pin for Hardware Data Protection ?8-byte Page (1K, 2K), 16-byte Page (4K, 8K, 16K) Write Modes ? Partial Page Writes are Allowed ?Self-timed Write Cycle (5 ms max) ?High-reliability –Endurance: 1 Million Write Cycles –Data Retention: 100 Years ?Automotive Grade, Extended Temperature and Lead-free/Halogen-free Devices ?
Available ?8-lead PDIP, 8-lead JEDEC SOIC, 8-lead MAP, 5-lead SOT23, ? 8-lead TSSOP and 8-ball dBGA2™ Packages ?Description: The AT24C08 provides 8192 bits of serial electrically erasable and programmable read-only memory (EEPROM) organized as 1024 words of 8 bits each. The device is optimized for use in many industrial and commercial applications where low-power and low-voltage operation are essential. The AT24C08 is available in space-saving 8-lead PDIP, 8-lead JEDEC SOIC, 8-lead MAP, 5-lead SOT23 , 8- lead TSSOP and 8-ball dBGA2 packages and is accessed via a 2-wire serial interface
Block diagram: Figure 4. 3-AT24C08 Block Diagram Figure 4. 4-AT24C08 Pin Diagram Pin Description ?SERIAL CLOCK (SCL): The SCL input is used to positive edge clock data into each EEPROM device and negative edge clock data out of each device. ?SERIAL DATA (SDA): The SDA pin is bi-directional for serial data transfer. This pin is open-drain driven and may be wire-ORed with any number of other open-drain or open collector devices. ?DEVICE/PAGE ADDRESSES (A2, A1, A0): The A2, A1 and A0 pins are device address inputs. The A0 pin is a no connect.
The AT24C08 only uses the A2 input for hardwire addressing and a total of two 8K devices may be addressed on a single bus system. The A0 and A1 pins are no connects. Memory Organization ?AT24C08, 8K SERIAL EEPROM: Internally organized with 64 pages of 16 bytes each, the 8K requires a 10-bit data word address for random word addressing. Device Operation ?CLOCK and DATA TRANSITIONS: The SDA pin is normally pulled high with an external device. Data on the SDA pin may change only during SCL low time periods. ?START CONDITION: A high-to-low transition of SDA with SCL high is a start condition which must precede any other command STOP CONDITION: A low-to-high transition of SDA with SCL high is a stop condition. After a read sequence, the stop command will place the EEPROM in a standby power mode ?
ACKNOWLEDGE: All addresses and data words are serially transmitted to and from the EEPROM in 8-bit words. The EEPROM sends a zero to acknowledge that it has received each word. ?STANDBY MODE: The AT24C08 features a low-power standby mode which is enabled: (a) upon power-up and (b) after the receipt of the STOP bit and the completion of any internal operations. ?MEMORY RESET: After an interruption in protocol, power loss or system eset, any 2- wire part can be reset by following these steps: 1. Clock up to 9 cycles. 2. Look for SDA high in each cycle while SCL is high. 3. Create a start condition. Device Addressing: The 8K EEPROM only uses the A2 device address bit with the next 2 bits being for memory page addressing. The A2 bit must compare to its corresponding hard-wired input pin. The A1 and A0 pins are not connected. Write Operations ?BYTE WRITE: A write operation requires an 8-bit data word address following the device address word and acknowledgment.