MINI PROJECT REPORT ON
RFID BASED SECURITY SYSTEM SUBMITTED AS A PART OF THE REQUIREMENTS FOR UNIVERSITY UNIVERSITY NORMS FOR YEAR 2011-2012 BACHELOR OF TECHNOLOGY
ELECTRONICS AND COMMUNICATION ENGINEERING
SUBMITTED BY
NAME: ANUMANDLA BHASKAR
ROLL NO.: 09N41A0404
NAME: CHINTADI TEJAS
ROLL NO.: 09N41A0420
NAME: AOUSULA SOUJANYA
ROLL NO.: 09N41A0405
Under the guidance of (MR. ANIL KUMAR)
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 Th is is to cert certif ify y that that ANUMAN ANUMANDLA DLA BHASKA BHASKAR R (09N41A40 (09N41A404), 4), CHINTADI CHINTADI (09N41A (09N41A0420 0420), ), AOUSUL AOUSULA A
SOUJAN SOUJANYA YA (09N41A0 (09N41A0405) 405)
TEJAS TEJAS
are are bona bonafi fide de stud studeents nts 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 degree in ELECTRONIC ELECTRONICS S AND COMMUNI COMMUNICATION CATION (ECE) through Jawaharlal Jawaharlal Nehru Technological University(JNTU)Hyderabad for the academic year 2012-2013. Internal guide
Head of the Department
(Mr. Anil Kumar)
(Mr.K.Ramanaiah)
External Examiner
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 grati gratitu tude de to all all those those peopl peoplee behind behind the scree screen n who who guide guided, d, inspir inspired ed and helpe helped d 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 Communication Engineering” 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: 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 being transmitted. transmitted. Thus, once the the person shows the RFID RFID card to the RFID card 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, productivity, processes processes and gain a competitive competitive edge by getting real time information information enabling them to make proactive business decisions. RFID offers higher data storage capacities, higher identification identification speeds, and greater accuracy of data collection. The technology’s enhanced accuracy and security in data data colle collect ction ion make makess it an idea ideall data data colle collect ction ion plat platfor form m for for the the heal health th care, care, pharm pharmac aceu euti tical cal,, manufacturing, warehousing, logistics and retail sectors.
CONTENTS
List of Figures
………………..I
List of Tables
……………….II
1. Introduction to Embedded System……………………………………………01 1.1 Embedded Embedded System System Architecture……..………………… Architecture……..……………………………………...02 …………………...02 1.2 Application Application Areas…………...…………………………… Areas…………...……………………………………………….04 ………………….04 2. Project Steps………………………..……………………… Steps………………………..………………………………………..…05 ………………..…05 2.1 Define the the Task…………………………………..…… Task…………………………………..………………………….05 …………………….05 2.2 Design Design and Build the Circuits……………………… Circuits…………………………..………………… …..…………………...06 ...06 2.3 Write Write the controls Program………………… Program………………………...………………… ……...…………………….......07 ….......07 2.4 Test and Debug………………… Debug………………………………...…………… ……………...…………………………….07 ……………….07 3. Modules Used in the Project …………………………… ……………………………………...….……...08 ………...….……...08 3.1 Microcontroll Microcontrollers………… ers…………………………………… …………………………………...………………0 ………...………………08 8 3.2 ULN2003…………………… ULN2003……………………………………………… …………………………………………….....21 ………………….....21 3.3 Power Supply……………………… Supply……………………………………...……… ……………...…………………………26 …………………26 3.4 MAX232 MAX232 …….……………………………...………… …….……………………………...……………………………….27 …………………….27 3.5 Stepper Motor Motor ……………………………...………… ……………………………...………………………………..28 ……………………..28 3.6 Buzzer ………………………… ……………………………………………………… …………………………………………….30 ……………….30 3.7 LCD Module Module ………………………………..………… ………………………………..………………………………31 ……………………31 4. Project Implementation....…………………...…………… Implementation....…………………...…………………………………32 ……………………32 4.1 Microcontroll Microcontroller er code……..………………………….…… code……..………………………….……………………….33 ………………….33 4.2 Circuit Circuit Diagram………………………………...…… Diagram………………………………...……………………………34 ………………………34 4.3 Conclusion……………… Conclusion…………………………...………… …………...…………………………………… ……………………………35 …35 5. Appendix …………………………… ……………………………………………………… ……………………………..…………...36 …..…………...36 5.1 KEIL SOFTWARE………………………………………………………….37 6. References
CHAPTER 1 INTRODUCTION TO EMBEDDED SYSTEMS
1.
EMBE EMBEDD DDED ED SYST SYSTEM EMS S
An embedded system can be defined as a computing device that does a specific focused job. Appliances Appliances such as the air-conditioner air-conditioner,, VCD player, player, DVD player, printer, printer, fax machines, machines, mobile phone etc. are examples of embedded systems. Each of these appliances will have a processor processor and special special hardware hardware to meet the specific specific requirement 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. computer. You can use it for a variety variety of applications applications such as playing games, games, word processing, processing, accounting, accounting, software software development development and so on. In contrast, contrast, the software 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 1.1 EMBEDDED SYSTEM ARCHITECTURE 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 Central Processi Processing ng Unit (CPU): (CPU): Thee Centr Th Central al Proce Process ssing ing Unit Unit (Pro (Proce cess ssor or,, in short short)) can be any of the 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. processing.
1.1 1.1.2 Mem Memory ory: 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 processor reads reads the ROM; ROM; the program program is executed. executed.
1.1. 1.1.3 3 Inpu Inputt Dev Devic ices es:: 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 embe embedde dded d syst system emss used used in proce process ss contr control ol do not have have any input input devic devicee for for user user interaction.
1.1. 1.1.4 4 Ou Outp tput ut Dev Devic ices es:: 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 1.1.5 Commu Communic nicati ation on Interfa Interfaces ces:: 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 provided with one or a few communication communication interfaces interfaces such as RS232, RS422, Rs 485, Universal Serial Bus (USB), and IEEE 1394, Ethernet etc.
1.1.6 Applicati Application-s on-specif pecific ic Circuitr Circuitry: y: Sensors Sensors,, transdu transducer cers, s, specia speciall process processing ing and control control circui circuitry try may be require required d for an embedd embedded ed system system,, depending depending on its applicat application. ion. This This circuit circuitry ry 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. battery. The hardware hardware ha to design in such a way that the power consumption consumption is minimized.
1.2 APPLIC APPLICATI ATION ON AREAS AREAS
Nearly Nearly 99 percent of the processors processors manufactured manufactured end up in the embedded embedded systems. 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 biomedical
engineering, engineering,
wireless wireless
communication, communication,
telecommunications, and transportation, military and soon
data
communication communication,,
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 required to compute computer. r. In general, general, a computer computer is the way to to go when the the circuits 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. Eight bit chips are popular for a simpler simpler design, but 4-bits, 4-bits, 16-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 2.3 Writing the Controls Program: Program: When it’s time to write program that controls your project, the options include using using machi machine ne code, code, asse assembl mbly y langu languag age, e, or a higher higher-l -leve evell langu languag age. e. Whic Which h programming programming language 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 step remo removed ved from from machi machine ne code code is asse assembl mbly y langu languag age, e, wher wheree 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: Interpr Interprete eters rs and compil compilers ers are two forms forms of higherhigher-leve levell language languages. s. 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 mistak mistakes es to get it work work properl properly. y. The process process or ferret ferreting ing out and correct correcting ing mistakes mistakes are called DEBUGGING. DEBUGGING. Easy debugging debugging and troubleshooting 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 run the prog progra ram, m, and obser observe ve the resu result lts. s. If probl problem emss occur occur you you mo modi dify fy the the program, program, erase and re burn the EPROM and try again, repeating as many times as necessary until the system is operating properly.
2.4. 2.4.1 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 happen if a specifi specificc micropr microproce ocesso ssors rs or microc microcontr ontroll oller er were were to run a particular particular program. program. You can look “inside” the simulated simulated chip, observe the contents of internal memory, and single step or set break point to stop
program program execution execution at a desired program location or condition. 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.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 t he Project
3.1 MICROCONTROLLERS MICROCONTROLLERS 3.1.1 Introduction: • Microprocessors are single-chip CPUs used in microcomputers.
• Microco Microcontr ntrolle ollers rs and micropr microproces ocessor sorss are differe different nt in three three main main aspect, aspect, hardwar hardwaree architecture, applications, and instruction set features.
• Hardware Hardware architecture: architecture: A microprocess microprocessor or is a single chip CPU while a microcontrolle microcontrollerr is a single IC contains a CPU and much of remaining circuitry circuitry of a complete computer (e.g., RAM, ROM, serial interface, parallel interface, timer, and interrupt handling circuit).
• Appli Applicat catio ions: ns: Micr Micropr oproce ocess ssor orss are commo commonl nly y used used as a CPU CPU in compu compute ters rs whil whilee microcon microcontro trolle llers rs are found found in small, small, minimum minimum compone component nt designs designs perform performing ing control 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 instructions for input/output operations, operations, event timing, enabling and setting setting priority priority levels levels for interrupts interrupts caused by by external external stimuli. 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
having 8k bytes of ROM. •
A third 16-bit timer, capable of a number of new operation modes and 16-
bit reloads. reloads. •
Additional SFRs to support the functionality offered by the third timer.
AT89S52: Features: • Compatible with MCS-51 Products • 8K Bytes of In-System Programmable (ISP) Flash Memory – Endurance: Endurance: 1000 Write/E Write/Erase rase Cycles 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 with the industr industry-s y-stand tandard ard 80C51 80C51 micro micro control controller ler.. The on-chip on-chip Flash Flash allows allows the program memory memory to be reprogrammed reprogrammed in-system in-system or by a conventional conventional nonvolatile nonvolatile memo memory ry prog progra ramm mmer er.. By comb combin inin ing g a vers versat atil ilee 8-bi 8-bitt CPU CPU with with in-s in-sys yste tem m programmable programmable flash one monolithic monolithic chip; the Atmel AT89S52 AT89S52 is a powerful powerful micro control controller ler,, which which provide providess a highly highly flexibl flexiblee and cost-eff cost-effect ective ive soluti solution on to many many embedded control applications.
The AT89S52 provides the following standard features: 8K bytes of Flash, 256 bytes of RAM, 32 I/O lines, lines, Watchdog timer, timer, two data pointers, pointers, three 16-bit timer/ timer/coun counter ters, s, full full duplex duplex serial serial port, port, on-chip on-chip oscill oscillator ator,, and clock clock circuit circuitry. ry. In additio addition, n, the AT89S5 AT89S52 2 is designe designed d with with static static logic for operation operation down down to zero zero frequency and supports two software selectable power saving modes. The Idle Mode stops stops the CPU while allowi allowing ng the RAM timer/co timer/counte unters, rs, serial serial port, port, and interr interrupt upt 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 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) (P1.0/T2) and the timer/counter timer/counter 2 trigger trigger input P1.1/T2EX), P1.1/T2EX), respectively, respectively, as shown in the following table. Port 1 also receives the low-order address bytes during Flash programming programming and verifica verification. tion.
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 sink/source four TTL inputs. When 1s are written to Port 2 pins, they are pulled high by the internal internal pull-ups 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 exte externa rnall data data memo memory ry that that uses uses 16-bi 16-bitt addre address sses es (MOV (MOVX X @DPT @DPTR) R).. In this 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, however, that that one ALE ALE pulse is skipped skipped during during each access access to external external data data Memory. 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 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 UTC(unisonic technologies technologies co. ltd) Darlington Darlington
driver comprised comprised of
seven
ULN 2003
NPN
Darlington Darlington
is high-voltage high-voltage , high-current high-current pairs . Ideally Ideally
suited
for
interfacing between low-level logic circuitry and multiple peripheral power loads , the series ULN20xxA/L ULN20xxA/L load current have
high-voltage high-voltage , high-current high-current
ratings to
500mA for each each of the seven drivers. drivers.
series series input resisters resisters selected selected
ULN2003 ULN2003 A/L are are the standard standard 500mA and will
Darlington Darlington arrays
for operation operation
Darlington Darlington
directly directly
continuous continuous
The ULN2003A/L ULN2003A/L
with 5V TTL or CMOS. The
arrays .The .The outputs outputs
are capable capable of sinking sinking
with stand at least 50V in the OFF state. Outputs may be paralleled
for higher load current capability. The Darlington arrays are furnished line plastic plastic
feature feature
in 16-pin Dual-in-
package and 16-lead surfacesurface- mountable mountable SOIC’s . All devices are pinned
with outputs opposite inputs to facilitate 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 sustainin g voltage output 50V 5 0V 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 micr microco ocont ntrol rolle lerr thus thus need need a conve convert rter er chip. chip. A MAX2 MAX232 32 chip chip has long long been been using using in many many micr microco ocont ntrol rolle lers rs board boards. s. It is a dual dual RS232 RS232 recei receiver ver / trans transmit mitte terr that that meet meetss all all RS232 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: 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 provides 2-channel RS232C port and requires external 10uF pacitors. 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, voltage, but the required is DC voltage voltage (no frequency) frequency) with the amplitude 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 parallel as shown in the circuit diagram diagram below. below. Each voltage regulator regulator output is again again is connected 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 motor that can divide a full rotation rotation into into a large large numb number er of steps. steps. The motor's motor's positio position n can be control controlled led precisely precisely,, without 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: 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 problem speed range, physically physically damping the system, system, or using a micro-stepping micro-stepping driver. Motors 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 monochrome pixels pixels arrayed in front of a light source or reflector. reflector. Each pixel consists of a column of liquid crystal molecules suspended between two transparent electrodes, and two polarizing polarizing filters, filters, the axes of polarity of which are perpendicular perpendicular to each other. Without Without the liquid crystals 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 lines and 20 characte characters rs per line line by 2 lines, lines, respectivel respectively. y.
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 possible to produce a readout using the 5X7 dots plus cursor cursor of the display. They have a standard ASCII set set of characters and mathematic mathematical al symbols. symbols. For an 8-bit data bus, the display display requires a +5V supply supply plus 10 I/O lines (RS (RS RW D7 D6 D6 D5 D4 D3 D2 D2 D1 D0). For a 4-bit data data bus it only 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) (2) Display data RAM
available. Line lengths o 8, 16, 20, 24, 32 an 40 charact ers ers are are all standar d, in one,
(3) 80x8 bits (80 characters). (4) (4) Character generator ROM (5). 160 different 5 7
dot-matrix 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) (9) Numerous instructions (10) (10) .Clear Display, Cursor Home, Display ON/OFF, Cursor ON/OFF, Blink Character, Cursor Shift, Display (11). (11). Built-in reset circuit is (12). (12). Built-in
triggered
Shift.
at power
ON.
oscillator.
Data can be placed at any location on the LCD. For 16×1 LCD, 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 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: 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, position, all four outputs are shorted shorted to the common common pin, and in position “F”, all four outputs 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
#include "lcddisplay.h" #include #include #include sbit buz=P2^0; sbit stepper_a = sbit stepper_b = sbit stepper_c = sbit stepper_d =
P3^6; P3^5; P3^4; P3^3;
void stepper(); void delay(unsigned int); 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)) 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 check the oscillat oscillator or frequency: 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