RFID BASED SECURITY SYSTEM

Published on May 2016 | Categories: Types, School Work | Downloads: 58 | Comments: 0 | Views: 751
of 51
Download PDF   Embed   Report

Comments

Content

MINI PROJECT REPORT ON

RFID BASED SECURITY SYSTEM
SUBMITTED AS A PART OF THE REQUIREMENTS FOR UNIVERSITY NORMS FOR YEAR 2011-2012
BACHELOR OF TECHNOLOGY ELECTRONICS AND COMMUNICATION ENGINEERING SUBMITTED BY

NAME: ANUMANDLA BHASKAR NAME: CHINTADI TEJAS NAME: AOUSULA SOUJANYA Under the guidance of (MR. ANIL KUMAR)

ROLL NO.: 09N41A0404 ROLL NO.: 09N41A0420 ROLL NO.: 09N41A0405

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGG. JYOTHISHMATHI COLLEGE OF ENGINEERING & TECHNOLOGY (Affiliated to JNTU, Hyderabad) Turkapally (v), Shamirpet (M), Ranga Reddy Dist. Andhra Pradesh: 502278

JYOTHISHMATHI COLLEGE OF ENGINEERING &TECHNOLOGY (Recognized by AICTE and Affiliated to JNTU, Hyderabad) Turkapally (v), Shamirpet (M), Ranga Reddy Dist. Andhra Pradesh: 502278 Web: www.jcetech.in Email: [email protected]

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING CERTIFICATE
This is to certify that ANUMANDLA BHASKAR (09N41A404), CHINTADI (09N41A0420), AOUSULA SOUJANYA (09N41A0405) TEJAS

are bonafide students of

JYOTHISHMATHI COLLEGE OF ENGINERING AND TECHNOLOGY and submitted the project report on “RFID BASED SECURITY SYSTEM FOR AUTOMOBILES” in partial fulfillment of the requirement for the award of BACHELOR OF TECHNOLOGY (B.TECH) degree in ELECTRONICS AND COMMUNICATION (ECE) through Jawaharlal Nehru Technological University(JNTU)Hyderabad for the academic year 2012-2013. Internal guide (Mr. Anil Kumar) External Examiner Head of the Department (Mr.K.Ramanaiah)

ACKNOWLEDGMENT

Success will be crowned to people who made it a reality but the people whose constant guidance and encouragement made it possible will be crowned first on the eve of success. This acknowledgment transcends the reality of formality when we would like to express the deep gratitude to all those people behind the screen who guided, inspired and helped us for the completion of our project work. We wish to express our sincere gratitude to Mr. of Unisoft Technologies who has given us the opportunity to work on this project in his esteemed organization. We would like to express our thankfulness to our project guide, Mr. for his constant motivation and valuable help through the project work. We would like to extend our sincere thanks to “Sri K. Ramanaiah, Head of the Department, Electronic and Communication Engineering” for his encouragement and support at all the stages of the project. We here by take the opportunity to thank our beloved principal Dr.Moinuddin K Syed for his gratitude and kindness by giving us all the facilities required for the completion of the seminar for his We also extend our thanks to my team Members for their co-operation during our course. Finally we would like to thank our friends for their co-operation to complete this project.

ANUMANDLA BHASKAR (09N41A0404) AOUSULA SOUJANYA (09N41A0405) CHINTAKINDI TEJAS(09N41A0420)

ABSTRACT
Aim:
The aim of this project is to design an RFID Based Security System for automobiles.

Project Description:
The main objective of this project is to provide security in an organization by allowing authorized personnel to enter or to access the door to enter into the organization. For this purpose the authorized personnel are provided with an RFID card. This card contains an integrated circuit that is used for storing, processing information, modulating and demodulating the radio frequency signal that is being transmitted. Thus, once the person shows the RFID card to the RFID card reader it scans the card and compares it with that of the data present in the system and once it matches it displays the message on LCD display saying valid and unlocks the door or else states invalid and doesn’t allow the access.

Radio Frequency Identification (RFID) is a technology that uses radio frequencies to automatically identify and track people or objects. It is useful for many enterprises that want to improve their productivity, processes and gain a competitive edge by getting real time information enabling them to make proactive business decisions. RFID offers higher data storage capacities, higher identification speeds, and greater accuracy of data collection. The technology’s enhanced accuracy and security in data collection makes it an ideal data collection platform for the health care, pharmaceutical, manufacturing, warehousing, logistics and retail sectors.

CONTENTS
List of Figures List of Tables ………………..I ……………….II

1. Introduction to Embedded System……………………………………………01 1.1 Embedded System Architecture……..……………………………………...02 1.2 Application Areas…………...……………………………………………….04 2. Project Steps………………………..………………………………………..…05 2.1 Define the Task…………………………………..………………………….05 2.2 Design and Build the Circuits…………………………..…………………...06 2.3 Write the controls Program………………………...…………………….......07 2.4 Test and Debug………………………………...…………………………….07 3. Modules Used in the Project ……………………………………...….……...08 3.1 Microcontrollers……………………………………………...………………08 3.2 ULN2003………………………………………………………………….....21 3.3 Power Supply……………………………………...…………………………26 3.4 MAX232 …….……………………………...……………………………….27 3.5 Stepper Motor ……………………………...………………………………..28 3.6 Buzzer ……………………………………………………………………….30 3.7 LCD Module ………………………………..………………………………31 4. Project Implementation....…………………...…………………………………32 4.1 Microcontroller code……..………………………….……………………….33 4.2 Circuit Diagram………………………………...……………………………34 4.3 Conclusion…………………………...………………………………………35 5. Appendix …………………………………………………………..…………...36 5.1 KEIL SOFTWARE………………………………………………………….37 6. References

CHAPTER 1 INTRODUCTION TO EMBEDDED SYSTEMS

1.

EMBEDDED SYSTEMS

An embedded system can be defined as a computing device that does a specific focused job. Appliances such as the air-conditioner, VCD player, DVD player, printer, fax machines, mobile phone etc. are examples of embedded systems. Each of these appliances will have a processor and special hardware to meet the specific requirement of the application along with the embedded software that is executed by the processor for meeting the specific requirement, the embedded software is also called “firm ware”. The desktop/laptop computer is a general purpose computer. You can use it for a variety of applications such as playing games, word processing, accounting, software development and so on. In contrast, the software in the embedded systems is always fixed listed below: Some embedded systems have to operate in extreme environmental conditions such as very high temperatures and humidity.

1.1EMBEDDED SYSTEM ARCHITECTURE
Let us see the details of the various building blocks of the hardware of an embedded system. As shown in fig 1.2.2 the building blocks are; • • • • • • Central Processing Unit (CPU) Memory (Read-Only Memory and Random Access Memory) Input Devices Output Devices Communication Interfaces Application-specific Circuitry

Fig 2.2.1 Block Diagram of Hardware of Embedded System

1.1.1 Central Processing Unit (CPU):
The Central Processing Unit (Processor, in short) can be any of the following; Microcontroller, microprocessor or Digital Signal Processor (DSP). A micro-controller is a low-cost processor. Its main attraction is that on the chip itself, there will be many other components such as memory, serial communication interface, analog to digital converter etc. So, for small applications, a microcontroller is the best choice as the number of external components required will be very less. On the other hand, microprocessors are more powerful, but you need to use many external components with them. DSP is used mainly for applications in which signal processing is involved such as audio and video processing.

1.1.2 Memory:
The memory is categorized as Random Access Memory (RAM) and Read Only Memory (ROM), the contents of the RAM will be erased if the power is switched off. So, the firmware is stored in the ROM. When power is switched on, the processor reads the ROM; the program is executed.

1.1.3 Input Devices:
Unlike the desktops, the input devices to an embedded system have very limited capability. There will be no keyboard or a mouse, and hence interacting with the embedded system is no easy task. Many embedded systems will have a small keypad-you press one key to give a specific command, a keypad nay be used to input only the digits. Many embedded systems used in process control do not have any input device for user interaction.

1.1.4 Output Devices:
The output devices of the embedded systems also have very limited capability. Some embedded systems will have a few Light Emitting Diodes (LEDs) to indicate the health status of the system modules, or for visual indication of alarms. A small Liquid Crystal Display (LCD) may be used to display some more important parameters.

1.1.5 Communication Interfaces:
The embedded systems may need to interact with other embedded system at they may have to transmit data to a desktop. To facilitate this, the embedded systems are provided with one or a few communication interfaces such as RS232, RS422, Rs 485, Universal Serial Bus (USB), and IEEE 1394, Ethernet etc.

1.1.6 Application-specific Circuitry:
Sensors, transducers, special processing and control circuitry may be required for an embedded system, depending on its application. This circuitry interacts with the processor to carry out the necessary work. The entire hardware has to be given power supply either through the 230 volts main supply or through a battery. The hardware ha to design in such a way that the power consumption is minimized. 1.2 APPLICATION AREAS Nearly 99 percent of the processors manufactured end up in the embedded systems. The embedded system market is one of the highest growth areas as the systems are used in every market segment- consumer electronics, offline automation, industrial automation, biomedical engineering, wireless communication, data communication, telecommunications, and transportation, military and soon

CHAPTER 2 PROJECT STEPS

2. PROJECT STEPS:
Putting together a microcontroller’s project involves several steps:

Define the task

Design and build the Circuits

Write the control program

Test and Debug

2.1Define the Task:
Every project begins with an idea or a problem that needs a solution i.e., how can I automate the process of drilling printed circuit boards? Once you know what to accomplish, you need to determine whether that idea is been required to computer. In general, a computer is the way to go when the circuits must make complex decisions or deal with complex data. For example, a simple AND gate can easily decide whether or not two inputs are both valid logic HIGHs, and will changes its output accordingly, but it require many small scale chips to build a circuit that stores a series of values representing sensor outputs and times they occurred and display easily.

2.2 Design and building: When you are ready to design and build the circuits for a project, there are several ways to proceed. You can design your circuits from scratch, you can buy an assembled single-broad computer, adding only the interfaces and programming your application

requires and you can also build yourself, but you can also use a kit or assembled broad as a base.

2.2.1 Choosing a Chip:
Does it matter which microcontrollers chip you use? All microcontrollers contain a CPU, and chances are that you can use any of several devices for a specific project. Microcontrollers are also characterized by how many bits of data they process at once, with a higher number of bits generally including a faster or more powerful chip. Eightbit chips are popular for a simpler design, but 4-bits, 16-bits and 32-bits architectures are also available. Power consumption is another consideration, especially for battery-powered systems. Chips manufactured with CMOS processes usually have lower power consumption than those manufactured with NMOS processes.

2.3Writing the Controls Program:
When it’s time to write program that controls your project, the options include using machine code, assembly language, or a higher-level language. Which programming language you use depends on things like desired on things like desired execution speed program length, and convenience as well as price range.

2.3.1 Machine Code:
The most fundamental program form is machine code, the binary instruction that causes the CPU to perform the operations.

2.3.2 Assembly Language:
One step removed from machine code is assembly language, where abbreviation called mnemonics (memory aids) substitute for the machine codes. The mnemonics are easier to remember than the machine codes.

2.3.3 Higher-level Language:
A disadvantage to assembly language is that each device family has its own set of mnemonics, so you have to learn a new vocabulary for each family. To get around this program, higher-level languages like C, Pascal, FORTRAN, Forth, and BASIC follows a standard syntax.

2.3.4 Interpreters and Compilers:
Interpreters and compilers are two forms of higher-level languages. An interpreter translates a program into machine code each time the program runs, while a compiler translates only once, creating a new, executable that the computer runs directly, without re-translating.

2.3.5 Testing and Debugging:
After you have written a program, it’s time to test it and find correct mistakes to get it work properly. The process or ferreting out and correcting mistakes are called DEBUGGING. Easy debugging and troubleshooting can make a big difference in how long it takes to get a system up and running. We have several options.

2.4 Testing in EPROM:
One way is to burn your program into EPROM, install the EPROM in your system, run the program, and observe the results. If problems occur you modify the program, erase and re burn the EPROM and try again, repeating as many times as necessary until the system is operating properly. 2.4.1 Simulators: Another development tool is a simulate, which is software that runs on desktop computer and uses the video display to demonstrate what would happen if a specific microprocessors or microcontroller were to run a particular program. You can look “inside” the simulated chip, observe the contents of internal memory, and single step or set break point to stop

program execution at a desired program location or condition. In this way, you can get a program working properly. One of the drawbacks is that they can’t mimic all features of the chip of interest, especially interrupt-response and timing characteristics. 2.4.2 Emulators: An in-circuit emulator (ICE) is hardware that replaces the microprocessor in question by plugging into the microprocessor’s socket on the device you want to test. Like simulator, an emulator lets you control program execution and monitor what happens at each program step. Microprocessor emulators typically are expensive.

CHAPTER 3 Modules Used in the Project
3.1 MICROCONTROLLERS 3.1.1 Introduction:
• Microprocessors are single-chip CPUs used in microcomputers. • Microcontrollers and microprocessors are different in three main aspect, 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.

Difference between 8051 and 8052:

The 8052 microcontroller is the 8051's "big brother." It is a slightly more powerful microcontroller, sporting a number of additional features which the developer may make use of:


256 bytes of Internal RAM (compared to 128 in the standard 8051) and it is A third 16-bit timer, capable of a number of new operation modes and 16Additional SFRs to support the functionality offered by the third timer.

having 8k bytes of ROM.


bit reloads.


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 • Low-power Idle and Power-down Modes • Interrupt Recovery from Power-down Mode • Watchdog Timer • Dual Data Pointer • Power-off Flag

DESCRIPTION OF MICROCONTROLLER 89S52:
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 Atmel’s 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 chip; the Atmel AT89S52 is a powerful micro controller, 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, 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.

PIN DESCRIPTION OF MICROCONTROLLER 89S52
VCC Supply voltage. GND Ground

Port 0
Port 0 is an 8-bit open drain bi-directional 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 0 also receives the code bytes during Flash programming and outputs the code bytes during program verification. External pull-ups are required during program verification

Port 1
Port 1 is an 8-bit bi-directional 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. 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), respectively, as shown in the following table. Port 1 also receives the low-order address bytes during Flash programming and verification.

Port 2
Port 2 is an 8-bit bi-directional 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. Port 2 emits the highorder address byte during fetches from external program memory and during accesses to external data memory that uses 16-bit addresses (MOVX @DPTR). In this application, Port 2 uses strong internal pull-ups when emitting 1s. During accesses to external data memory that use 8-bit addresses (MOVX @ RI), Port 2emits the contents of the P2 Special Function Register. Port 2 also receives the high-order address bits and some control signals during Flash programming and verification.

Port 3
Port 3 is an 8-bit bi-directional 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 serves the functions of various special features of the AT89S52, as shown in the following table. 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. 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 of1/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. If desired, ALE operation can be disabled by setting bit 0 of SFR location 8EH 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 micro controller 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. A should be strapped to VCC for internal program executions. This pin also receives the 12-voltProgramming enables 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.

3.2ULN 2003
The UTC(unisonic technologies co. ltd) Darlington driver comprised of seven NPN ULN 2003 is high-voltage , high-current Darlington pairs . Ideally feature suited for

interfacing between low-level logic circuitry and multiple peripheral power loads , the series ULN20xxA/L load current have high-voltage , high-current Darlington arrays continuous ratings to 500mA for each of the seven drivers. The ULN2003A/L

series input resisters selected for operation directly with 5V TTL or CMOS. The

ULN2003 A/L are the standard Darlington arrays .The outputs are capable of sinking 500mA and will with stand at least 50V in the OFF state. Outputs may be paralleled for higher load current capability. The Darlington arrays are furnished in 16-pin Dual-inline plastic package and 16-lead surface- mountable SOIC’s . All devices are pinned with outputs opposite inputs to facilitate ease of Circuit board layout. All devices are rated for operation over the temperature range of -20˚ C to 85˚ C .

Features:
(1) Output current (single output) 500mA MAX . (2) High sustaining voltage output 50V MIN. (3) Output clamp diodes. (4) Inputs compatible with various types of logic . (5) Dual In-Line Plastic Package or Small-Outline IC Package

3. 3 MAX 232 Introduction:
A standard serial interface for PC, RS232C, requires negative logic, i.e., logic 1 is -3V to -12V and logic 0 is +3V to +12V. To convert TTL logic, say, TxD and RxD pins of the microcontroller thus need a converter chip. A MAX232 chip has long been using in many microcontrollers boards. It is a dual RS232 receiver / transmitter that meets all RS232 specifications while using only +5V power supply. It has two onboard charge pump voltage converters which generate +10V to -10V power supplies from a single 5V supply. It has four level translators, two of which are RS232 transmitters that convert TTL/CMOS input levels into +9V RS232 outputs. The other two level translators are RS232 receivers that convert RS232 input to 5V. Typical MAX232 circuit is shown below.

Features:
1. Operates With Single 5-V Power Supply 2.LinBiCMOSE Process Technology 3.Two Drivers and Two Receivers 4.±30-V Input Levels 5.Low Supply Current . 8 mA Typical 6.Meets or Exceeds TIA/EIA-232-F and ITU Recommendation V.28 7.Designed to be Interchangeable With Maxim MAX232 8.Applications TIA/EIA-232-F Battery-Powered Systems Terminals Modems Computers 9.ESD Protection Exceeds 2000 V Per MIL-STD-883, Method 3015 10.Package Options Include Plastic Small-Outline (D, DW) Packages and

Standard Plastic (N) DIPs

Cicuit connections:
A standard serial interfacing for PC, RS232C, requires negative logic, i.e., logic '1' is -3V to -12V and logic '0' is +3V to +12V. To convert a TTL logic, say, TxD and RxD pins of the uC chips, thus need a converter chip. A MAX232 chip has long been using in many uC boards. It provides 2-channel RS232C port and requires external 10uF pacitors. Carefully check the polarity of capacitor when soldering the board. A DS275 however, no need external capacitor and smaller. Either circuit can be used without any problems.

3.4 Power Supply
Power supply is a reference to a source of electrical power. A device or system that supplies electrical or other types of energy to an output load or group of loads is called a power supply unit or PSU. The term is most commonly applied to electrical energy supplies, less often to mechanical ones, and rarely to others This power supply section is required to convert AC signal to DC signal and also to reduce the amplitude of the signal. The available voltage signal from the mains is 230V/50Hz which is an AC voltage, but the required is DC voltage (no frequency) with the amplitude of +5V and +12V for various applications.

In this section we have Transformer, Bridge rectifier, are connected serially and voltage regulators for +5V and +12V (7805 and 7812) via a capacitor (1000µF) in parallel are connected parallel as shown in the circuit diagram below. Each voltage regulator output is again is connected to the capacitors of values (100µF, 10µF, 1 µF, 0.1 µF) are connected parallel through which the corresponding output (+5V or +12V) are taken into consideration.

3.5 STEPPER MOTOR

Introduction: A stepper motor is a brushless AC synchronous electric motor that can divide a full rotation into a large number of steps. The motor's position can be controlled precisely, without any feedback mechanism (see open loop control). Stepper motors are similar to switched reluctance motors, which are very large stepping motors with a reduced pole count, and generally are closedloop commutated. It is a “digital” version of the electric motor. The rotor moves in discrete steps as commanded, rather than rotating continuously like a conventional motor. When stopped but energized, a stepper holds its load steady with a holding torque. When we compare with the servo motor, simple drive electronics, good accuracy, good torque, moderate speed, and low cost are most advantages of stepper motor.

Stepper motor characteristics:
Stepper motors are constant-power devices (power = angular velocity x torque). As motor speed increases, torque decreases. The torque curve may be extended by using current limiting drivers and increasing the driving voltage. Steppers exhibit more vibration than other motor types, as the discrete step tends to snap the rotor from one position to another. This vibration can become very bad at some speeds and can cause the motor to lose torque. The effect can be mitigated by accelerating quickly through the problem speed range, physically damping the system, or using a micro-stepping driver. Motors with a greater number of phases also exhibit smoother operation than those with fewer phases.

3.6 LCD (Liquid Cristal Display)

Introduction:
A liquid crystal display (LCD) is a thin, flat display device made up of any number of color or monochrome pixels arrayed in front of a light source or reflector. Each pixel consists of a column of liquid crystal molecules suspended between two transparent electrodes, and two polarizing filters, the axes of polarity of which are perpendicular to each other. Without the liquid crystals between them, light passing through one would be blocked by the other. The liquid crystal twists the polarization of light entering one filter to allow it to pass through the other. A program must interact with the outside world using input and output devices that communicate directly with a human being. One of the most common devices attached to an controller is an LCD display. Some of the most common LCDs connected to the contollers are 16X1, 16x2 and 20x2 displays. This means 16 characters per line by 1 line 16 characters per line by 2 lines and 20 characters per line by 2 lines, respectively. Many microcontroller devices use 'smart LCD' displays to output visual information. LCD displays designed around LCD NT-C1611 module, are inexpensive, easy to use, and it is even possible to produce a readout using the 5X7 dots plus cursor of the display. They have a standard ASCII set of characters and mathematical symbols. For an 8-bit data bus, the display requires a +5V supply plus 10 I/O lines (RS RW D7 D6 D5 D4 D3 D2 D1 D0). For a 4-bit data bus it only requires the supply lines plus 6 extra lines(RS RW D7 D6 D5 D4). When the LCD display is not enabled, data lines are tri-state and they do not interfere with the operation of the microcontroller.

Features:
(1) Interface with either 4-bit or 8-bit microprocessor. (2) Display data RAM

available. Line lengths of 8, 16, 20, 24, 32 and 40 charact ers are all standar d, in one, two

(3) 80x8 bits (80 characters). (4) Character generator ROM (5). 160 different 5  7 dot-matrix character patterns. (6). Character generator RAM (7) 8 different user programmed 5 7 dot-matrix patterns. (8).Display data RAM and character generator RAM may be Accessed by the microprocessor. (9) Numerous instructions (10) .Clear Display, Cursor Home, Display ON/OFF, Cursor ON/OFF, Blink Character, Cursor Shift, Display Shift. (11). Built-in reset circuit is triggered at power ON. (12). Built-in oscillator.

Data can be placed at any location on the LCD. For 16×1 LCD, the address locations are:

Fig : Address locations for a 1x16 line LC

Shapes and sizes:

Even limited to character based modules, there is still a wide variety of shapes and sizes available. Line lengths of 8,16,20,24,32 and 40 characters are all standard, in one, two and four line versions. Several different LC technologies exists. “supertwist” types, for example, offer Improved contrast and viewing angle over the older “twisted nematic” types. Some modules are available with back lighting, so so that they can be viewed in dimly-lit conditions. The back lighting may be either “electro-luminescent”, requiring a high voltage inverter circuit, or simple LED illumination.

Electrical blockdiagram:

Power supply for lcd driving:

PIN DESCRIPTION: Most LCDs with 1 controller has 14 Pins and LCDs with 2 controller has 16 Pins (two pins are extra in both for back-light LED connections).

Fig: pin diagram of 1x16 lines lcd

CONTROL LINES: EN:

Line is called "Enable." This control line is used to tell the LCD that you are sending it data. To send data to the LCD, your program should make sure this line is low (0) and then set the other two control lines and/or put data on the data bus. When the other lines are completely ready, bring EN high (1) and wait for the minimum amount of time required by the LCD datasheet (this varies from LCD to LCD), and end by bringing it low (0) again. RS: Line is the "Register Select" line. When RS is low (0), the data is to be treated as a command or special instruction (such as clear screen, position cursor, etc.). When RS is high (1), the data being sent is text data which sould be displayed on the screen. For example, to display the letter "T" on the screen you would set RS high. RW: Line is the "Read/Write" control line. When RW is low (0), the information on the data bus is being written to the LCD. When RW is high (1), the program is effectively querying (or reading) the LCD. Only one instruction ("Get LCD status") is a read command. All others are write commands, so RW will almost always be low. Finally, the data bus consists of 4 or 8 lines (depending on the mode of operation selected by the user). In the case of an 8-bit data bus, the lines are referred to as DB0, DB1, DB2, DB3, DB4, DB5, DB6, and DB7.

Logic status on control lines:
• E - 0 Access to LCD disabled - 1 Access to LCD enabled • R/W - 0 Writing data to LCD - 1 Reading data from LCD • RS - 0 Instructions 1 Character

Writing data to the LCD:
1) Set R/W bit to low 2) Set RS bit to logic 0 or 1 (instruction or character) 3) Set data to data lines (if it is writing) 4) Set E line to high 5) Set E line to low

Read data from data lines (if it is reading)on LCD:
1) Set R/W bit to high 2) Set RS bit to logic 0 or 1 (instruction or character) 3) Set data to data lines (if it is writing) 4) Set E line to high 5) Set E line to low

Entering Text:
First, a little tip: it is manually a lot easier to enter characters and commands in hexadecimal rather than binary (although, of course, you will need to translate commands from binary couple of sub-miniature hexadecimal rotary switches is a simple matter, although a little bit into hex so that you know which bits you are setting). Replacing the d.i.l. switch pack with a of re-wiring is necessary. The switches must be the type where On = 0, so that when they are turned to the zero position, all four outputs are shorted to the common pin, and in position “F”, all four outputs are open circuit. All the available characters that are built into the module are shown in Table 3. Studying the table, you will see that codes associated with the characters are quoted in binary and hexadecimal, most significant bits (“left-hand” four bits) across the top, and least significant bits (“right-hand” four bits) down the left. Most of the characters conform to the ASCII standard, although the Japanese and Greek characters (and a few other things) are obvious exceptions. Since these intelligent modules were designed in the “Land of the Rising Sun,” it seems only fair that their Katakana phonetic symbols

should also be incorporated. The more extensive Kanji character set, which the Japanese share with the Chinese, consisting of several thousand different characters, is not included! Using the switches, of whatever type, and referring to Table 3, enter a few characters onto the display, both letters and numbers. The RS switch (S10) must be “up” (logic 1) when sending the characters, and switch E (S9) must be pressed for each of them. Thus the operational order is: set RS high, enter character, trigger E, leave RS high, enter another character, trigger E, and so on. The first 16 codes in Table 3, 00000000 to 00001111, ($00 to $0F) refer to the CGRAM. This is the Character Generator RAM (random access memory), which can be used to hold userdefined graphics characters. This is where these modules really start to show their potential, offering such capabilities as bar graphs, flashing symbols, even animated characters. Before the user-defined characters are set up, these codes will just bring up strange looking symbols. Codes 00010000 to 00011111 ($10 to $1F) are not used and just display blank characters. ASCII codes “proper” start at 00100000 ($20) and end with 01111111 ($7F). Codes 10000000 to 10011111 ($80 to $9F) are not used, and 10100000 to 11011111 ($A0 to $DF) are the Japanese characters.

Initialization by Instructions:

If the power conditions for the normal operation of the internal reset circuit are not satisfied, then executing a series of instructions must initialize LCD unit. The procedure for this initialization process is as above show.

3.7 BUZZER
A buzzer or beeper is a signaling device, usually electronic, typically used in automobiles, household appliances such as a microwave oven, or game shows. It most commonly consists of a number of switches or sensors connected to a control unit that determines if and which button was pushed or a preset time has lapsed, and usually illuminates a light on the appropriate button or control panel, and sounds a warning in the form of a continuous or intermittent buzzing or beeping sound. Initially this device was based on an electromechanical system which was identical to an electric bell without the metal gong . Often these units were anchored to a wall or ceiling and used the ceiling or wall as a sounding board. Another implementation with some AC-connected devices was to implement a circuit to make the AC current into a noise loud enough to drive a loudspeaker and hook this circuit up to a cheap 8-ohm speaker. Nowadays, it is more popular to use a ceramic-based piezoelectric sounder like a Son alert which makes a high-pitched tone. Usually these were hooked up to "driver" circuits which varied the pitch of the sound or pulsed the sound on and off. In game shows it is also known as a "lockout system," because when one person signals ("buzzes in"), all others are locked out from signaling. Several game shows have large buzzer buttons which are identified as "plungers". The word "buzzer" comes from the rasping noise that buzzers made when they were electromechanical devices, operated from stepped-down AC line voltage at 50 or 60 cycles. Other sounds commonly used to indicate that a button has been pressed are a ring or a beep.

4.Project Implementation

4.1 Microcontroller Code:

#include <reg51.h> #include "lcddisplay.h" #include <intrins.h> #include <string.h> #include<UART.h> sbit buz=P2^0; sbit stepper_a = sbit stepper_b = sbit stepper_c = sbit stepper_d = void stepper(); void delay(unsigned int);

P3^6; P3^5; P3^4; P3^3;

unsigned char k,n=0,rf[13],rf1[13]={'4','3','0','0','F','B','6','4','0','0','D','C'},rf2[13]={'4','6','0','0','D','0','5',' 8','2','B','E','5'}; void main() { stepper_a=0; stepper_b=0; stepper_c=0; stepper_d=0; buz=0; delay(20); buz=1; rf1[12]='\0'; rf2[12]='\0'; //P1=0xff; lcd_init(); UART_init();

lcdcmd(0x01); lcdcmd(0x80); lcdcmd(0x01); delay(100); msgdisplay("RFID SECURITY &"); lcdcmd(0xc0); msgdisplay("ACCESS CNTRL SYS"); delay(1500); while(1) { stepper_a=0; stepper_b=0; stepper_c=0; stepper_d=0; delay(10); delay(200); lcdcmd(0x01); delay(100); msgdisplay("PLEASE SCAN CARD"); n=0; //////////////////////////////////////////////////////// for(k=0;k<12;k++) { while(RI==0 ); rf[k] = SBUF; RI=0; }

/////////////////////////////////// rf[12]='\0'; /////////////////////////////////////////////////////////// lcdcmd(0x01); // msgdisplay(rf); delay(500); if(!strcmp(rf,rf1)) { lcdcmd(0x01);

msgdisplay("ACCESS GRANTED"); lcdcmd(0xc0); msgdisplay(" THANK YOU !!!"); stepper(); } else if(!strcmp(rf,rf2)) { lcdcmd(0x01); msgdisplay("ACCESS GRANTED"); lcdcmd(0xc0); msgdisplay(" THANK YOU !!!"); stepper(); } else { buz=0; lcdcmd(0x01); msgdisplay("ACCESS DENINED"); lcdcmd(0xc0); msgdisplay(" UNAUTHORISED !!!"); delay(500); buz=1;

}

delay(1000); RI=0; ////////////////////////////////////////////////////////// while(RI==1) { RI=0;

delay(100); } while(RI==1); RI=0; delay(2500); while(RI==1) { RI=0; delay(100); } while(RI==1); RI=0;

} } void stepper() { unsigned char j; lcdcmd(0x80); msgdisplay("DOOR OPENING.. "); for(j=0;j<10;j++) { stepper_a=1; stepper_b=0; stepper_c=0; stepper_d=0; delay(10); stepper_a=0; stepper_b=1; stepper_c=0; stepper_d=0; delay(80); stepper_a=0; stepper_b=0;

stepper_c=1; stepper_d=0; delay(80); stepper_a=0; stepper_b=0; stepper_c=0; stepper_d=1; delay(80); } delay(600); lcdcmd(0x80); msgdisplay("DOOR CLOSING.. "); for(j=0;j<10;j++) { stepper_a=1; stepper_b=0; stepper_c=0; stepper_d=0; delay(80); stepper_a=0; stepper_b=0; stepper_c=0; stepper_d=1; delay(80); stepper_a=0; stepper_b=0; stepper_c=1; stepper_d=0; delay(80); stepper_a=0; stepper_b=1; stepper_c=0; stepper_d=0; delay(80); } }

4.2 Circuit diagram

4.3 Conclusion
In this report, we described RFid based security system as a project that helps us talk to devices that are connected to a remote computer. A careful implementation of the idea suggested by the project can prove to be very beneficial in promoting home automation and similar activities. This project can be considered as a proof of concept, {the concept that it is possible to mobilize the control of appliances). By employing various coding techniques this can be produce security.

5.Appendix
5.1 Keil software
Installing the Keil software on a Windows PC • Insert the CD-ROM in your computer’s CD drive

• • •

On most computers, the CD will “auto run”, and you will see the Keil installation menu. If the menu does not appear, manually double click on the Setup icon, in the root directory: you will then see the Keil menu. On the Keil menu, please select “Install Evaluation Software”. (You will not require a license number to install this software). Follow the installation instructions as they appear.

Loading the Projects The example projects for this book are NOT loaded automatically when you install the Keil compiler. These files are stored on the CD in a directory “/Pont”. The files are arranged by chapter: for example, the project discussed in Chapter 3 is in the directory “/Pont/Ch03_00-Hello”. Rather than using the projects on the CD (where changes cannot be saved), please copy the files from CD onto an appropriate directory on your hard disk. Note: you will need to change the file properties after copying: file transferred from the CD will be ‘read only’.

Configuring the Simulator Open the Keil µVision2

Go to Project – Open Project and browse for Hello in Ch03_00 in Pont and open it.

Go to Project – Select Device for Target ‘Target1’

Select 8052(all variants) and click OK

Now we need to check the oscillator frequency: Go to project – Options for Target ‘Target1’

Make sure that the oscillator frequency is 12MHz.

Building the Target Build the target as illustrated in the figure below

Running the Simulation Having successfully built the target, we are now ready to start the debug session and run the simulator. First start a debug session

The flashing LED we will view will be connected to Port 1. We therefore want to observe the activity on this port

To ensure that the port activity is visible, we need to start the ‘periodic window update’ flag

Go to Debug - Go

While the simulation is running, view the performance analyzer to check the delay durations.

Go to Debug – Performance Analyzer and click on it

Double click on DELAY_LOOP_Wait in Function Symbols: and click Define button

6.REFERENCE

The 8051 Micro controller and Embedded Systems Muhammad Ali Mazidi Janice Gillispie Mazidi The 8051 Micro controller Architecture, Programming & Applications Kenneth J.Ayala Fundamentals of Micro processors and Micro computers B.Ram Micro processor Architecture, Programming & Applications Ramesh S.Gaonkar Electronic Components D.V.Prasad

Sponsor Documents

Or use your account on DocShare.tips

Hide

Forgot your password?

Or register your new account on DocShare.tips

Hide

Lost your password? Please enter your email address. You will receive a link to create a new password.

Back to log-in

Close