You are on page 1of 41

CHAPTER 1 1.

INTRODUCTION
In this Project, RF ID Tag is given to the Each Employee. Before that the RF tag is registered by the Administrator of the Office. So the Registered RF ID tag is given to the employee. When registering process the computer assigns ID to the employee. Also the Details of the Employee are fed into the Database. If the Employee enters the RF Tag just show into the RF ID Reader, it receives and checks the ID of the employee. If the ID Received by the RF ID Reader is valid one, it will make the attendance of the Employee. The Same procedure is followed, when the Employee leaves from his cabin or office. If the RF ID Card Showed by the Employee is found Invalid it will alarm and Red LED indication to the Administrator. In addition to the above, the same RF ID card can be used for door opening system. The Hardware requirement for this project is RF ID reader, RF ID tag, Micro controller, computer, Level converter, LCD module, Indicator circuit, buzzer, buffer circuit, driver circuit and a motor for opening and closing the door. The micro controller we are using is AT89C51 of which serial port is attached with micro controller for serial communication with level converter. The communication between the controller and RF ID reader is 9600 bps. We use assembly language for micro controller programming and Visual C++ software for computer side. In this project we are AT89c51 micro controller with use of Assembly language, LCD Display, Buzzer indication, LED indication Circuit and Computer.

LCD DISPLAY DOOR

SWITCHING UNIT

DRIVER BUZZER

MICROCONTROLLER RFID READER LEVEL CONVERTER

PRG- ENABLE

RESET UNIT

CLOCK GEN

POWER SUPPLY UNIT

Figure 1: Block diagram of project

1.1 BLOCK DIAGRAM EXPLANATION


POWER SUPPLY:
To make things really simple lets start with a simple power supply and it is also the one they usually give you in your first electronics project. Well the reason is quite obvious because all electronics circuits require a DC power supply to work. You really do plug in the wires of your electronic items in AC mains supply but they do have AC to DC converters to provide DC to the circuits. All this is done with a power supply in the right place. This source voltage is given to LCD display, Level converter, driver, microcontroller, reset circuit, and RF reader. LCD DISPLAY: In our project we use an intelligent LCD display of two lines, 16 characters per line that is interfaced to the AT 89C51. The display contains two internal byte-wide registers, one for commands (RS=0) and the second for the characters to be displayed (RS=1). It also contains a user-programmed RAM area that can be programmed to generate any desired character that can be formed using a dot matrix. To distinguish between these two data areas, the hex command byte 80 will be used to signify that the display RAM address 00h is chosen.

LEVEL CONVERTER: It is line driver such as a bridge. It is voltage doublers. Voltage doubles mean by get 5v from power supply and maintaining 10V to -10V. This I.C. also includes two receivers and two transmitters in the same package. This is useful in many cases when you only want to use the Transmit and Receive data Lines. You don't need to use two chips, one for the receive line and one for the transmission. However this

convenience is expensive, but compared with the price of designing a new power supply it is very cheap. The level converter block is used for communication between the microcontrollers to other peripherals. For example GPS ,GSM, and Zigbee modems , personal computer , RF ID reader , smart card reader and Mayfair card . MODE SELECT SWITCH:
It is nothing but electronics switches. It has double pole and double through.

Relay on: The method employed is based upon electronic switch principle. If the relay is ON then detach the RF ID reader and attach the computer to microcontroller according to 10digit number. All this is done with our software in the right place.
Relay off:

This mode select switch block is as a double contactor. If the relay is OFF then default connection between RF ID reader and microcontroller. The controller will get data from RF ID reader when the power is ON and RF ID tag nearer. As well as detach communication between MC to computer. DRIVER: The diver block as a control relay when the microcontroller remains the signal. This will be supported ON/OFF of the relay. It consists of transistor. PRGRAM- ENABLE 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. CLOCK GENERATION( 11.0592 Crystal): Input to the inverting oscillator amplifier and input to the internal clock operating circuit. Output from the inverting oscillator amplifier. It belongs to microcontroller.

RESET UNIT: This block is as a micro-switch of the controller. It consists of one capacitor and resistor along with push button. When the controller is getting hangover then we press the push button on the kit. So that the controller rebooting the task.

GATE MECHANISM: The gate mechanism is as a DVD/CD loader (mechanism). It will be connected to relays. This is our door mechanism. MICROCONTROLLER: It is heart of our project. 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 Atmels 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 six-vector two-level interrupt architecture, 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 con-tents but freezes the oscillator, disabling all other chip functions until the next interrupt or hardware reset. RF ID READER: 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. It was connected to microcontroller through level converter. RF ID TAG: It has memory chip. It has 10-digit numbers. It is our security code. It consists of internal coil in form of squire. It is used for antenna.

Figure 2: RFID Tag 6

CHAPTER 2 2.EMBEDDED SYSTEMS


Embedded systems are electronic devices that incorporate microprocessors with in their implementations. The main purposes of the microprocessors are to simplify the system design and provide flexibility. Having a microprocessor in the device helps in removing the bugs, making modifications, or adding new features that are only matter of rewriting the software that controls the device. Or in other words embedded computer systems are electronic systems that include a microcomputer to perform a specific dedicated application. The computer is hidden inside these products. Embedded systems are ubiquitous. Every week millions of tiny computer chips come pouring out of factories finding their way into our everyday products. Embedded systems are self-contained programs that are embedded within a piece of hardware. Whereas a regular computer has many different applications and software that can be applied to various tasks, embedded systems are usually set to a specific task that cannot be altered without physically manipulating the circuitry. Another way to think of an embedded system is as a computer system that is created with optimal efficiency, thereby allowing it to complete specific functions as quickly as possible. Embedded systems designers usually have a significant grasp of hardware technologies. They use specific programming languages and software to develop embedded systems and manipulate the equipment. When searching online, companies offer embedded systems development kits and other embedded systems tools for use by engineers and businesses. Embedded systems technologies are usually fairly expensive due to the necessary development time and built in efficiencies, but they are also highly valued in specific industries. Smaller businesses may wish to hire a consultant to determine what sort of embedded systems will add value to their organization. Embedded system technology is revolutionizing the way work is being done in industries today and will keep changing the world what we see today.

CHARACTERISTICS.
Two major areas of differences are cost and power consumption. Since many embedded systems are produced in tens of thousands to millions of units range, reducing cost is a major concern. Embedded systems often use a (relatively) slow processor and small memory size to minimize costs. The slowness is not just clock speed. The whole architecture of the computer is often intentionally simplified to lower costs. For example, embedded systems often use peripherals controlled by synchronous serial interfaces, which are ten to hundreds of times slower than comparable peripherals used in PCs. Programs on an embedded system often run with real-time constraints with limited hardware resources: often there is no disk drive, operating system, keyboard or screen. A flash drive may replace rotating media, and a small keypad and LCD screen may be used instead of a PC's keyboard and screen. One common configuration for embedded systems is the system on a chip, an application-specific integrated circuit, for which the CPU was purchased as intellectual property to add to the IC's design.

TOOLS.
Like a typical computer programmer, embedded system designers use compilers, assemblers and debuggers to develop an embedded system. Those software tools can come from several sources: Software companies that specialize in the embedded market Ported from the GNU software development tools. Sometimes, development tools for a personal computer can be used if the embedded processor is a close relative to a common PC processor. Some designers keep a utility program to turn data files into code, so that they can include any kind of data in a program

OPERATING SYSTEM.
They often have no operating system, or a specialized embedded operating system (often a real-time operating system), or the programmer is assigned to port one of these to the new system.

DEBUGGING.
Debugging is usually performed with an in-circuit emulator, or some type of debugger that can interrupt the micro controllers internal microcode. The microcode interrupt lets the debugger operate in hardware in which only the CPU works. The CPU-based debugger can be used to test and debug the electronics of the computer from the viewpoint of the CPU.

DESIGN OF EMBEDDED SYSTEMS.


The electronics usually uses either a microprocessor or a microcontroller. Some large or old systems use general-purpose mainframes computers or minicomputers.

START-UP.
All embedded systems have start-up code. Usually it disables interrupts, sets up the electronics, tests the computer (RAM, CPU and software), and then starts the application code. Many embedded systems recover from short-term power failures by restarting (without recent self-tests). Restart times under a tenth of a second are common. Many designers have found one of more hardware plus software-controlled LEDs useful to indicate errors during development (and in some instances, after product release, to produce troubleshooting diagnostics). A common scheme is to have the electronics turn off the LED(s) at reset, whereupon the software turns it on at the first opportunity, to prove that the hardware and start-up software have performed their job so far. After that, the software blinks the LED(s) or sets up light patterns during normal operation, to indicate program execution progress and/or errors. This serves to reassure most technicians/engineers and some users.

THE CONTROL LOOP.


In this design, the software has a loop. The loop calls subroutines. Each subroutine manages a part of the hardware or software. Interrupts generally set flags, or update counters that are read by the rest of the software. A simple API disables and enables interrupts. Done right, it handles nested calls in nested subroutines, and restores the preceding interrupt state in the outermost enable. This is one of the simplest methods of creating an exocrine. Typically, there's some sort of subroutine in the loop to manage a list of software timers, using a periodic real time interrupt. When a timer expires, an associated subroutine is run, or flag 9

is set. Any expected hardware event should be backed-up with a software timer. Hardware events fail about once in a trillion times. Complex functions like internal combustion controls are often handled with multidimensional tables. Instead of complex calculations, the code looks up the values. The software can interpolate between entries, to keep the tables small and cheap. This system's strength is its simplicity, and on small pieces of software the loop is usually so fast that nobody cares that it is not predictable. Another advantage is that this system guarantees that the software will run. There is no mysterious operating system to blame for bad behavior. One major disadvantage of this system is that it does not guarantee a time to respond to any particular hardware event. Careful coding can easily assure that nothing disables interrupts for long. Thus interrupt code can run at very precise timings. Another major weakness of this system is that it can become complex to add new features. Algorithms that take a long time to run must be carefully broken down so only a little piece gets done each time through the main loop.

USER INTERFACES.
Interface designers at PARC, Apple Computer, Boeing and HP minimize the number of types of user actions. For example, use two buttons (the absolute minimum) to control a menu system (just to be clear, one button should be "next menu entry" the other button should be "select this menu entry"). A touch-screen or screen-edge buttons also minimize the types of user actions. Another basic trick is to minimize and simplify the type of output. Designs should consider using a status light for each interface plug, or failure condition, to tell what failed. A cheap variation is to have two light bars with a printed matrix of errors that they select- the user can glue on the labels for the language that she speaks. Designers use colors to specify the functionality. Red defines the users can get hurt- think of blood. Yellow defines something might be wrong. Green defines everything's OK. Another essential trick is to make any modes absolutely clear on the user's display. If an interface has modes, they must be reversible in an obvious way. Most designers prefer the 10

display to respond to the user. The display should change immediately after a user action. If the machine is going to do anything, it should start within 7 seconds, or give progress reports.

2.2 EMBEDDED C LANGUAGE.


Having decided to use processor as the basis of your embedded system, the next key decision that needs to be made is the choice of programming language. In order to identify a suitable language for embedded systems, we might begin by making the following observations: Computers (such as microcontroller, microprocessor or DSP chips) only accept instructions in machine code (object code). Machine code is, by definition, in the language of the computer, rather than that of the programmer. Interpretation of the code by the programmer is difficult and error prone. All software, whether in assembly, C, C++, Java or Ada must ultimately be translated into machine code in order to be executed by the computer. There is no point in creating perfect source code, if we then make use of a poor translator program (such as an assembler or compiler) and thereby generate executable code that does not operate as we intended. Embedded processors like the 8051 have limited processor power and very limited memory available: the language used must be efficient. To program embedded systems, we need low-level access to the hardware: this means, at least, being able to read from and write to particular memory locations (using pointers or an equivalent mechanism). Of course, not all of the issues involved in language selection are purely technical: No software company remains in business for very long if it generates new code, from scratch, for every project. The language used must support the creation of flexible libraries, making it easy to re-use (well-tested) code components in a range of projects. It must also be possible to adapt complete code systems to work with a new or updated processor with minimal difficulty.

11

Staff members change and existing personnel have limited memory spans. At the same time, systems evolve and processors are updated. As concern over the Year 2000 problem in recent years has illustrated, many embedded systems have a long lifespan. During this time, their code will often have to be maintained. Good code must therefore be easy to understand now, and in five years time (and not just by those who first wrote it).

The language chosen should be in common use. This will ensure that you can continue to recruit experienced developers who have knowledge of the language.

It will also mean that your existing developers will have access to sources of information (such as books, training courses, WWW sites) which give examples of good design and programming practice. Even this short list immediately raises the paradox of programming language selection. From one point of view, only machine code is safe, since every other language involves a translator, and any code you create is only as safe as the code written by the manufacturers of the translator. On the other hand, real code needs to be maintained and re-used in new projects, possibly on different hardware: few people would argue that machine code is easy to understand, debug or to port. Inevitably, therefore, we need to make compromises; there is no perfect solution. All we can really say is that we require a language that is efficient, high-level, gives low-level access to hardware, and is well defined. In addition of course the language must be available for the platforms we wish to use. Against all of these points, C scores well. We can summarize Cs features as follows: _ It is mid-level, with high-level features (such as support for functions and modules), and low-level features (such as good access to hardware via pointers). It is very efficient. It is popular and well understood. Even desktop developers who have used only Java or C++ can soon understand C syntax. Good, well-proven compilers are available for every embedded processor (8-bit to 32-bit or more). Experienced staff is available. Books, training courses, code samples and WWW sites discussing the use of the language are all widely available. 12

CHAPTER 3 3.RFID
Radio frequency identification (RFID) is a generic term that is used to describe a system that transmits the identity (in the form of a unique serial number) of an object or person wirelessly, using radio waves. It's grouped under the broad category of automatic identification technologies. Auto-ID technologies include bar codes, optical character readers and some biometric technologies, such as retinal scans. The auto-ID technologies have been used to reduce the amount of time and labor needed to input data manually and to improve data accuracy. A typical RFID tag consists of a microchip attached to a radio antenna mounted on a substrate. (For more detail and for information about tags that dont use silicon chips, read The Basics of RFID Technology.) The chip can store as much as 2 kilobytes of data. For example, information about a product or shipmentdate of manufacture, destination and sell-by datecan be written to a tag. To retrieve the data stored on an RFID tag, you need a reader. A typical reader is a device that has one or more antennas that emit radio waves and receive signals back from the tag. The reader then passes the information in digital form to a computer system. Antennas read passive tags on cases stacked on a pallet

Why RFID Is Hot :


Wal-Mart's push to use RFID in the open supply chain is a big reason why the technology is hot today. But it's not the only reason. Several important factors have come together around the same time. One is the advances in ultra-high frequency RFID systems. UHF systems are able to deliver the read range needed for supply chain applications, such as scanning tags on products as pallets are moved through a dock door or scanning cases on a high shelf in a warehouse.

13

Figure 3: RFID READER

2.3 POWER SUPPLY


The input to the circuit is applied from the regulated power supply. The a.c. input i.e., 230V from the mains supply is step down by the transformer to 12V and is fed to a rectifier. The output obtained from the rectifier is a pulsating d.c voltage. So in order to get a pure d.c voltage, the output voltage from the rectifier is fed to a filter to remove any a.c components present even after rectification. Now, this voltage is given to a voltage regulator to obtain a pure constant dc voltage.

D.C 230V AC 50Hz Output

Step

down

Bridge Rectifier Filter Regulator

transformeR RRRRRRRR

Figure 4: Power supply

14

Circuit Explanation:
Transformer: Usually, DC voltages are required to operate various electronic equipment and these voltages are 5V, 9V or 12V. But these voltages cannot be obtained directly. Thus the a.c input available at the mains supply i.e., 230V is to be brought down to the required voltage level. This is done by a transformer. Thus, a step down transformer is employed to decrease the voltage to a required level. Rectifier: The output from the transformer is fed to the rectifier. It converts A.C. into pulsating D.C. The rectifier may be a half wave or a full wave rectifier. In this project, a bridge rectifier is used because of its merits like good stability and full wave rectification. Filter: Capacitive filter is used in this project. It removes the ripples from the output of rectifier and smoothens the D.C. Output received from this filter is constant until the mains voltage and load is maintained constant. However, if either of the two is varied, D.C. voltage received at this point changes. Therefore a regulator is applied at the output stage. Voltage regulator: As the name itself implies, it regulates the input applied to it. A voltage regulator is an electrical regulator designed to automatically maintain a constant voltage level. In this project, power supply of 5V and 12V are required. In order to obtain these voltage levels, 7805 and 7812 voltage regulators are to be used. The first number 78 represents positive supply and the numbers 05, 12 represent

Figure 5:Voltage Regulator 15

CHAPTER 4 4. MICROCONTROLLER
4.1 INTRODUCTION
In this chapter we are discussing briefly about the micro controller, how it is different microprocessor, features of 8952 over other MC s and its pin description and architecture of 8952 mc and also switch, led interfacing with the micro controller by using block diagrams and especially about the memory allocation and RAM and ROM memory

4.2 Microprocessor Vs Microcontroller


Microprocessors are single-chip CPUs used in microcomputers. Microcontrollers and microprocessors are different in three main aspects: Hardware architecture, applications, and instruction set features. Hardware architecture: A microprocessor is a single chip CPU while a microcontroller is a single IC contains a CPU and much of remaining circuitry of a complete computer (e.g., RAM, ROM, serial interface, parallel interface, timer, and interrupt handling circuit). Applications: Microprocessors are commonly used as a CPU in computers while microcontrollers are found in small, minimum component designs performing control oriented activities. Microprocessor instruction sets are processing Intensive. Their instructions operate on nibbles, bytes, words, or even double words. Addressing modes provide access to large arrays of data using pointers and offsets. They have instructions to set and clear individual bits and perform bit operations. They have instructions for input/output operations, event timing, enabling and setting priority levels for interrupts caused by external stimuli. Processing power of a microcontroller is much less than a microprocessor.

16

\ 4.3 AT89S52:

Figure 6: pin configuration of AT89S52

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 256K Internal RAM 32 Programmable I/O Lines 3 16-bit Timer/Counters Eight Interrupt Sources Full Duplex UART Serial Channel 17

Low-power Idle and Power-down Modes Interrupt Recovery from Power-down Mode Watchdog Timer Dual Data Pointer Power-off Flag

4.4 Description of Microcontroller AT89S52:


The AT89S52 is a low-power, high-performance CMOS 8-bit micro controller with 8Kbytes of in-system programmable flash memory. The device is manufactured Using Atmels high-density nonvolatile memory technology and is compatible with the industry-standard 80C51 micro controller. 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 one monolithic http; the Atmel AT89S52 is a powerful micro controller, which provides a highly flexible and cost effective solution to any cost effective solution to any embedded control applications to any 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, 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.

18

Figure 7: Architecture of AT89s52

4.5 PIN DESCRIPTION OF MICROCONTROLLER 89S52:


Pins 1-8: Port 1 each of these pins can be configured as input or output. Pin 9: RS Logical one on this pin stops microcontrollers operating and erases the contents of most registers. By applying logical zero to this pin, the program starts execution from the beginning. In other words, a positive voltage pulse on this pin resets the microcontroller. Pins10-17: Port 3 Similar to port 1, each of these pins can serve as universal input or output. Besides, all of them have alternative functions: 19

Pin 10: RXD Serial asynchronous communication input or Serial synchronous communication output. Pin 11: TXD Serial asynchronous communication output or Serial synchronous communication clock output. Pin 12: INT0 Interrupt 0 inputs Pin 13: INT1 Interrupt 1 input Pin 14: T0 Counter 0 clock input Pin 15: T1 Counter 1 clock input Pin 16: WR Signal for writing to external (additional) RAM Pin 17: RD Signal for reading from external RAM Pin 18, 19: X2 X1 Internal oscillator input and output. A quartz crystal which determines operating frequency is usually connected to these pins. Instead of quartz crystal, the miniature ceramics resonators can be also used for frequency stabilization. Later versions of the microcontrollers operate at a frequency of 0 Hz up to over 50 Hz.

Figure 8: Oscillator Connections

20

Pin 20: GND Ground Pin 21-28: Port 2 if there is no intention to use external memory then these port pins are configured as universal inputs/outputs. In case external memory is used then the higher address byte, i.e. addresses A8-A15 will appear on this port. It is important to know that even memory with capacity of 64Kb is not used ( i.e. note all bits on port are used for memory addressing) the rest of bits are not available as inputs or outputs. Pin 29: PSEN if external ROM is used for storing program then it has a logic-0 value every time the microcontroller reads a byte from memory. Pin 30: ALE Prior to each reading from external memory, the microcontroller will set the lower address byte (A0-A7) on P0 and immediately after that activates the output ALE. Upon receiving signal from the ALE pin, the external register (74HCT373 or 74HCT375 circuit is usually embedded) memorizes the state of P0 and uses it as an address for memory chip. In the second part of the microcontrollers machine cycle, a signal on this pin stops being emitted and P0 is used now for data transmission (Data Bus). In this way, by means of only one additional (and cheap) integrated circuit, data multiplexing from the port is performed. This port at the same time used for data and address transmission. Pin 31: EA By applying logic zero to this pin, P2 and P3 are used for data and address transmission with no regard to whether there is internal memory or not. That means that even there is a program written to the microcontroller, it will not be executed, the program written to external ROM will be used instead. Otherwise, by applying logic one to the EA pin, the microcontroller will use both memories, first internal and afterwards external (if it exists), up to end of address space. Pin 32-39: Port 0 Similar to port 2, if external memory is not used, these pins can be used as universal inputs or outputs. Otherwise, P0 is configured as address output (A0-A7) when the ALE pin is at high level (1) and as data output (Data Bus), when logic zero (0) is applied to the ALE pin. 21

Pin 40: VCC Power

supply

Pin 40: VCC Power supply Input/output Ports (I/O Ports) All 8051 microcontrollers have 4 I/O ports, each consisting of 8 bits which can be configured as inputs or outputs. This means that the user has on disposal in total of 32 input/output lines connecting the microcontroller to peripheral devices logic state on a pin determines whether it is configured as input or output: 0=output, 1=input. If a pin on the microcontroller needs to be configured as output, then logic zero (0) should be applied to the appropriate bit on I/O port. In this way, a voltage level on the appropriate pin will be 0.Similar to that, if a pin needs to be configured as input, and then a logic one (1) should be applied to the appropriate port. In this way, as a side effect a voltage level on the appropriate pin will be 5V (as it is case with any TTL input). This may sound a bit confusing but everything becomes clear after studying a simplified electronic circuit connected to one I/O pin. Only in case P0 is used for addressing external memory (only in that case), the microcontroller will provide internal power supply source in order to establish logical ones on pins. There is no need to add external pull-up resistors.

Port 1 This is a true I/O port, because there are no role assigning as it is the case with P0. Since it has embedded pull-up resistors it is completely compatible with TTL circuits.

Port 2

22

Similar to P0, when using external memory, lines on this port occupy addresses intended for external memory chip. This time it is the higher address byte with addresses A8-A15. When there is no additional memory, this port can be used as universal input-output port similar by its features to the port 1.

Port 3 Even though all pins on this port can be used as universal I/O port, they also have an alternative function. Since each of these functions use inputs, then the appropriate pins have to be configured like that. In other words, prior to using some of reserve port functions, a logical one (1) must be written to the appropriate bit in the P3 register. From hardwares perspective, this port is also similar to P0, with the difference that its outputs have a pull-up resistor embedded. Current limitations on pins When configured as outputs (logic zero (0)), single port pins can "receive" current of 10mA. If all 8 bits on a port are active, total current must be limited to 15mA (port P0: 26mA). If all ports (32 bits) are active, total maximal current must be limited to 71mA. When configured as inputs (logic 1), embedded pull-up resistor provides very weak current, but strong enough to activate up to 4 TTL inputs from LS series. It may be seen from description of some ports, that even though all pins have more or less similar internal structure, it is necessary to pay attention to which of them will be used for what and how. For example: If they are used as outputs with high voltage level (5V), then port 0 should be avoided because its pins do not have added resistor for connection to +5V. Only low logic level can be obtained therefore, if another port is used for the same purpose, one should have in mind that pull-up resistors have a relatively high resistance.

CHAPTER 5
23

5. LIQUID CRYSTAL DISPLAY


5.1 INTRODUCTION:
Here in this chapter we are mainly discuss about the LCD and its pin functions, basic commands of LCD, connections and also initializing of LCD and functioning of the LCD.

5.2 LCD DISPLAY


LCD stands for Liquid Crystal Display. LCD is finding wide spread use replacing LEDs (seven segment LEDs or other multi segment LEDs) because of the following reasons: 1. The declining prices of LCDs. 2. The ability to display numbers, characters and graphics. This is in contrast to LEDs, which are limited to numbers and a few characters. 3. Incorporation of a refreshing controller into the LCD, thereby relieving the CPU of the task of refreshing the LCD. In contrast, the LED must be refreshed by the CPU to keep displaying the data. 4. Ease of programming for characters and graphics.

Figure 9:LCD Display Pin Functions: 24

There are pins along one side of the small printed board used for connection to the microcontroller. There are total of 14 pins marked with numbers. Function Ground Power supply Contrast Pin Number 1 2 3 4 Name Vss Vdd Vee RS Logic State 0 1 0 1 0 6 E 1 From 1 to 0 Description 0V +5V 0 - Vdd D0 D7 commands D0 D7 are interpreted as data Write data (from controller to LCD) Read data (from LCD to controller) Access to LCD disabled Normal operating Data/commands are transferred to

are

interpreted

as

Control operating

of 5

R/W

Data / commands

7 8 9 10 11 12 13 14

LCD D0 0/1 Bit 0 LSB D1 0/1 Bit 1 D2 0/1 Bit 2 D3 0/1 Bit 3 D4 0/1 Bit 4 D5 0/1 Bit 5 D6 0/1 Bit 6 D7 0/1 Bit 7 MSB Figure 10: PIN Functions of LCD

5.2.1 LCD screen: LCD screen consists of two lines with 16 characters each. Each character consists of 5x7 dot matrix. Contrast on display depends on the power supply voltage and whether messages are displayed in one or two lines. For that reason, variable voltage 0-Vdd is applied on pin marked as Vee. Trimmer potentiometer is usually used for that purpose. Some versions of displays have built in backlight (blue or green diodes). When used during operating, a resistor for current limitation should be used (like with any LE diode). 25

Figure 11: LCD Screen 5.2.2 LCD Basic Commands: All data transferred to LCD through outputs D0-D7 will be interpreted as commands or as data, which depends on logic state on pin RS: RS = 1 - Bits D0 - D7 are addresses of characters that should be displayed. Built in processor addresses built in map of characters and displays corresponding symbols. Displaying position is determined by DDRAM address. This address is either previously defined or the address of previously transferred character is automatically incremented. RS = 0 - Bits D0 - D7 are commands which determine display mode. List of commands which LCD recognizes are given in the table below:

5.2.3 LCD Connections: Depending on how many lines are used for connection to the microcontroller, there are 8bit and 4-bit LCD modes. The appropriate mode is determined at the beginning of the process in 26

a phase called initialization. In the first case, the data are transferred through outputs D0-D7 as it has been already explained. In case of 4-bit LED mode, for the sake of saving valuable I/O pins of the microcontroller, there are only 4 higher bits (D4-D7) used for communication, while other may be left unconnected. Consequently, each data is sent to LCD in two steps: four higher bits are sent first (that normally would be sent through lines D4-D7), four lower bits are sent afterwards. With the help of initialization, LCD will correctly connect and interpret each data received. Besides, with regards to the fact that data are rarely read from LCD (data mainly are transferred from microcontroller to LCD) one more I/O pin may be saved by simple connecting R/W pin to the Ground. Such saving has its price. Even though message displaying will be normally performed, it will not be possible to read from busy flag since it is not possible to read from display. 5.2.4 LCD Initialization: Once the power supply is turned on, LCD is automatically cleared. This process lasts for approximately 15mS. After that, display is ready to operate. The mode of operating is set by default. This means that: 1. Display is cleared 2. Mode DL = 1 Communication through 8-bit interface N = 0 Messages are displayed in one line F = 0 Character font 5 x 8 dots

3. Display/Cursor on/off D = 0 Display off

27

U = 0 Cursor off B = 0 Cursor blink off 4. Character entry ID = 1 Addresses on display are automatically incremented by 1 S = 0 Display shift off Automatic reset is mainly performed without any problems. Mainly but not always! If for any reason power supply voltage does not reach full value in the course of 10mS, display will start perform completely un predictably. If voltage supply unit cannot meet this condition or if it is needed to provide completely safe operating, the process of initialization by which a new reset enabling display to operate normally must be applied.

CHAPTER 6 6.LEVEL CONVERTER


Almost all digital devices we use require TTL or CMOS logic levels. That's why the first step when trying to connect the device to RS-232 port is transformation of RS-232 levels ack into 0 and 5 Volts. As we have already said, this is done by RS-232 Level Converters. Two common RS-232 Level Converters are the 1488 RS-232 Driver and the 1489 RS-232 Receiver. Each package contains 4 inverters of the one type, either Drivers or Receivers. The driver

28

requires two supply rails, +7.5 to +15v and -7.5 to -15v. This may pose a problem in many instances where only a single supply of +5V is present. However the advantage of these IC's is their cheapness.

Figure 12:Pinouts for the MAX-232, RS-232 Driver/Receiver. Typical MAX-232 Circuit. Another device is the MAX-232. It includes a Charge Pump, which generates +10V and -10V from a single 5v supply. This I.C. also includes two receivers and two transmitters in the same package. This is useful in many cases when you only want to use the Transmit and Receive data Lines. You don't need to use two chips, one for the receive line and one for the transmission. However this convenience is expensive, but compared with the price of designing a new power supply it is very cheap. There are also many variations of these devices. The large value of capacitors are not only bulky, but also expensive. That's why other devices are available which use smaller capacitors and even some with built-in capacitors. (Note : Some MAX-232's can use 1 micro farad Capacitors). However the MAX232 is the most common, and thus this RS-232 Level Converter will be used in our examples.

CHAPTER 7 7.RELAYS 7.1 INTRODUCTION


When a coil of wire is wound on a non magnetic material such as plastic, paper etc. ,it is called a air-core solenoid or simply a solenoid .if a soft iron core is inserted into the coil, it becomes an electromagnet. this electromagnet is the basic component for relay and many other electromechanical devices such as electric bell, circuit breaker etc,.

29

7.2 OPERATION
When a current flows through the coil, the resulting magnetic field attracts an armature that is mechanically linked to a moving contact. The movement either makes or breaks a connection with a fixed contact. When the current to the coil is switched off, the armature is returned by a force approximately half as strong as the magnetic force to its relaxed position. Usually this is a spring, but gravity is also used commonly in industrial motor starters. Most relays are manufactured to operate quickly. In a low voltage application, this is to reduce noise. In a high voltage or high current application, this is to reduce arcing.

Relay on:
The method employed is based upon electronic switch principle. If the relay is ON then detach the RF ID reader and attach the computer to microcontroller according to 10digit number. All this is done with our software in the right place.

Relay off:
This mode select switch block is as a double contactor. If the relay is OFF then default connection between RF ID reader and microcontroller. The controller will get data from RF ID reader when the power is ON and RF ID tag nearer. As well as detach communication between MC to computer.

CIRCUIT COMPONENTS
Transistors:A transistor is a semiconductor device, commonly used as an amplifier or an electrically controlled switch. The transistor is the fundamental building block of the circuitry that governs the operation of computers, cellular phones, and all other modern electronics. Because of its fast response and accuracy, the transistor may be used in a wide variety of digital and analog functions, including amplification, switching, voltage regulation, signal modulation, and oscillators.

30

Transistors may be packaged individually or as part of an integrated circuit, which may hold a billion or more transistors in a very small area. Resistors:-

A resistor is a two-terminal electrical or electronic component that resists an electric current by producing a voltage drop between its terminals in accordance with Ohm's law R = V/I The electrical resistance is equal to the voltage drop across the resistor divided by the current through the resistor. Resistors are used as part of electrical networks and electronic circuits

Resistor Color Codings Four-band identification is the most commonly used color coding scheme on all resistors. It consists of four colored bands that are painted around the body of the resistor. The scheme is simple: The first two numbers are the first two significant digits of the resistance value, the third is a multiplier, and the fourth is the tolerance of the value. Each color corresponds to a certain number, shown in the chart below. The

31

tolerance for a 4-band resistor will be 2%, 5%, or 10%. Figure 13:Resistor coding Table

Capacitors:A capacitor is an electrical device that can store energy in the electric field between a pair of closely spaced conductors (called 'plates'). When current is applied to the capacitor, electric charges of equal magnitude, but opposite polarity, build up on each plate. Capacitors are used in electrical circuits as energy-storage devices. They can also be used to differentiate between high-frequency and low-frequency signals and this makes them useful in electronic filters. 32

Capacitors are occasionally referred to as condensers. This is now considered an antiquated term. The capacitor's capacitance (C) is a measure of the amount of charge (Q) stored on each plate for a given potential difference or voltage (V) which appears between the plates: C=Q/V In SI units, a capacitor has a capacitance of one farad when one coulomb of charge is stored due to one volt applied potential difference across the plates. Since the farad is a very large unit, values of capacitors are usually expressed in microfarads (F), nanofarads (nF), or picofarads (pF). The capacitance is proportional to the surface area of the conducting plate and inversely proportional to the distance between the plates. It is also proportional to the permittivity of the dielectric (that is, non-conducting) substance that separates the plates. Diodes:In electronics, a diode is a component that restricts direction of flow of charge carriers. Essentially, it allows electric current to flow in one direction, but blocks it in the opposite direction. Thus, the diode can be thought of as an electronic version of a check valve. Circuits that require current flow in only one direction typically include one or more diodes in the circuit design. Early diodes included "cat's whisker" crystals and vacuum tube devices (called thermionic valves in British English). Today the most common diodes are made from semiconductor materials such as silicon or germanium. the an

33

CIRCUIT DIAGRAM:

Figure 14:Circuit diagram

34

CHAPTER 9 9. SOFTWARE DESCRIPTION AND PROJECT CODE 9.1 INTRODUCTION TO EMBEDDED C:


Ex: Hitec c, Keil c. HI-TECH Software makes industrial-strength software development tools and C compilers that help software developers write compact, efficient embedded processor code. For over two decades HI-TECH Software has delivered the industry's most reliable embedded software development tools and compilers for writing efficient and compact code to run on the most popular embedded processors. Used by tens of thousands of customers including General Motors, Whirlpool, Qualcomm, John Deere and many others, HI-TECH 's reliable development tools and C compilers, combined with world-class support have helped serious embedded software programmers to create hundreds of breakthrough new solutions. Whichever embedded processor family you are targeting with your software, whether it is the ARM, PICC or 8051 series, HI-TECH tools and C compilers can help you write better code and bring it to market faster. I-TECH PICC is a high-performance C compiler for the Microchip PIC C compiler - not a subset implementation like some other PIC compilers. The PICC compiler implements full ISO/ANSI C, with the exception of recursion. All data types are supported including 24 and 32-bit IEEE standard floating point. HI-TECH PICC makes full use of specific PIC features and using an intelligent optimizer, can generate high-quality code easily rivaling hand-written assembler. Automatic handling of page and bank selection frees the programmer from the trivial details of assembler code. 9.1.1 EMBEDDED C COMPILER: ANSI C - full featured and portable Reliable - mature, field-proven technology Multiple C optimization levels An optimizing assembler Full linker, with overlaying of local variables to minimize RAM usage

35

Comprehensive C library with all source code provided Includes support for 24-bit and 32-bit IEEE floating point and 32-bit long data Mixed C and assembler programming Unlimited number of source files Listings showing generated assembler Compatible - integrates into the MPLAB development tools Runs on multiple platforms: Windows, Linux, UNIX, Mac OS X, Solaris 9.1.2 EMBEDDED SYSTEMS TYPES: High-end embedded & Lower- end embedded systems. High-end embedded system - Generally 32, 64 Bit Controllers used with OS. Examples: Personal Digital Assistant and Mobile phones etc . Lower end embedded systems - Generally 8, 16 Bit Controllers used with an minimal operating systems and hardware layout designed for the specific purpose. Examples: Small controllers and devices in our every day life like Washing Machine, Microwave Owens, where they are embedded in. Classification: Real Time Systems RTS classification Hard Real Time Systems:"Hard" real-time systems have very narrow response time. Example: Nuclear power system , Cardiac pacemaker. Soft Real Time System: "Soft" real-time systems have reduced constrains on "lateness" but still must operate very quickly and repeatable. Example: Railway reservation system takes a few extra seconds the data remains valid. 9.1.1APPLICATIONS OF EMBEDDED SYSTEMS: Embedded computing systems are found everywhere, including in cellular telephones, pagers, VCRs, camcorders, thermostats, automated supermarket stockers, computerized inventory control devices, digital thermometers, telephone answering machines, printers etc. 36 IDE, MPLAB ICD and most 3rd-party types

They are also found in various fields like handheld P D As, cameras, and microwave ovens. Cars are full of them, as are airplanes, satellites, and advanced military and medical equipments. Consumer/internet appliances: Business handheld computers, business network computers/terminals, electronic books, internet smart handheld devices, PDAs. Data communications: Analog modems, ATM switches, cable modems, XDSL modems, Ethernet switches, concentrators. Digital imaging: Copiers, digital still cameras, Fax machines, printers, scanners. Industrial measurement and control: Hydro electric utility research & management traffic management systems, train marine vessel management systems. Telecommunications: ATM communication products, base stations, networking switches, SONET/SDH cross connect, multiplexer. Mobile data infrastructures: Mobile data terminals, pagers, VSATs, Wireless LANs, Wireless phones. 9.1.2 ADVANTAGES AND DISADVANTAGES OF COMPILER: The main advantage of this system is its simplicity, and on small pieces of software the loop is usually so fast. Another advantage is that this system guarantees that the software will run. There is no mysterious operating system to blame for bad behavior. One major weakness of this system is that it does not guarantee a time to respond to any particular hardware event. Careful coding can easily assure that nothing disables interrupts for long. Thus interrupt code can run at very precise timings. Another major weakness of this system is that it can become complex to add new features. Algorithms that take a long time to run must be carefully broken down so only a little piece gets done each time through the main loop.

37

CHAPTER 10 10. APPLICATIONS


RFID can be used in a variety of applications, such as Automatic attendance with opening and closing the door RFID tags for animals represent one of the oldest uses of RFID technology Tracking of goods and RFID in retail Tracking of persons and animals Toll collection and contactless payment Airport baggage tracking logistics Car-sharing service uses RFID cards for locking and unlocking cars and for member identification Location based services etc. In an effort to make passports more secure, several countries have implemented RFID in passports RFID technologies are now also implemented in end-user applications in museums When customers enter a dressing room, the mirror reflects their image and also images of the apparel item being worn by celebrities on an interactive display. A webcam also projects an image of the consumer wearing the item on the website for everyone to see. This creates an interaction between the consumers inside the store and their social network outside the store. The technology in this system is an RFID interrogator antenna in the dressing room and Electronic Product Code RFID tags on the apparel item School authorities in the Japanese city of Osaka are now chipping children's clothing, back packs, and student IDs in a primary school Many forms of RFID race timing have been in use for timing races of different types since the early 1990s Implantable RFID chips designed for animal tagging are now being used in humans. The DoD requirements for RFID tags on packages is prescribed in the Defense Federal Acquisition Regulations Supplements (DFARS

38

CHAPTER 11 11. CONCLUSION


RFIDs are easy to conceal or incorporate in other items. For example, in 2009 researchers at Bristol University successfully glued RFID microtransponders to live ants in order to study their behavior This trend towards increasingly miniaturized RFIDs is likely to continue as technology advances. In an effort to make passports more secure, several countries have implemented RFID in passports. However, the encryption on UK chips was broken in under 48 hours. Since that incident, further efforts have allowed researchers to clone passport data while the passport is being mailed to its owner. Where a criminal used to need to secretly open and then reseal the envelope, now it can be done without detection, adding some degree of insecurity to the passport system. The use of RFID technology has engendered considerable controversy and even product by consumer privacy advocates. The two main privacy concerns regarding RFID are:

Since the owner of an item will not necessarily be aware of the presence of an RFID tag and the tag can be read at a distance without the knowledge of the individual, it becomes possible to gather sensitive data about an individual without consent.

If a tagged item is paid for by credit card or in conjunction with use of a loyalty card, then it would be possible to indirectly deduce the identity of the purchaser by reading the globally unique ID of that item (contained in the RFID tag). This is only true if the person doing the watching also had access to the loyalty card data and the credit card data, and the person with the equipment knows where you are going to be.

By this we can conclude that by the use of RFID, we got numerous advantages as well as disadvantages. So proper steps should be taken to avoid the privacy concerns which serves as the major disadvantage.

39

CHAPTER 12 12.FUTURE SCOPE


With the advancement of technology like miniaturized ICs, we can even extend the project to such a extent that we can track each and every student of the college where ever he is which means member identification. In future, the project can be implemented with the combination of RF ID reader and finger print sensors

40

REFERENCES
WEB SITES
www.atmel.com www.wikipidea.com www.jntuworld.com www.google.com

BOOKS
1. Electrical and Electronic Measurements & Measurements By A.K.SAWHNEY 2. Principles of Electronics By V.K. MEHTA 3. Principles of Electronics By B.V. NARAYANA RAO 4. Basic Electronics By GROB 5. Communication Systems By Simon Haykin

41

You might also like