0% found this document useful (0 votes)
1K views68 pages

89C51 Security Access Control System

Students of Third Year Diploma in ELECTRONICS AND TELECOMMUNICATION ENGINEERING have satisfactorily carried out the project work entitled, "89C51 Micro-controller based Security Access Control System" they would like to thank all those people who helped us to make this project.

Uploaded by

rinku23patil
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1K views68 pages

89C51 Security Access Control System

Students of Third Year Diploma in ELECTRONICS AND TELECOMMUNICATION ENGINEERING have satisfactorily carried out the project work entitled, "89C51 Micro-controller based Security Access Control System" they would like to thank all those people who helped us to make this project.

Uploaded by

rinku23patil
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 68

MANOHAR PHALKE MEMORIAL FOUNDATIONS POLYTECHNICS Sion, Mumbai 400 022

-o0o- PROJECT REPORT ON -o0o-

8C1 i r - ot o e 9 5 M oc n l r c r l Be ad s Sc rt A esCn o Sse euiy c s ot l yt m c r

PROJECT GUIDE: Er. Santosh A. Kamble.

-o0o- WORKED BY -o0o1. Abu Sufiyan M. Kalam. 2. Jadhav Santosh Dhondu. 3. Chetan Suresh Tulaskar. 4. Vishnu Gopal Shelar.

-o0o- YEAR & COURSE -o0oTHIRD YEAR DIPLOME IN ELECTRONICS AND TELECOMMUNICATION ENGINEERING -o0o- 2005 - 2006 -o0o-

SION, MUMBAI 400 022 CRI I AE ET CT F

This is to certify that the following students of Third Year Diploma in ELECTRONICS AND TELECOMMUNICATION ENGINEERING has satisfactorily carried out the project work entitled,
89C51

Micro-controller based Security Access

Control System as a partial fulfillment of their Diploma


Engineering during academic year of 2005 2006.
1. Abu Sufiyan M. Kalam. 2. Jadhav Santosh Dhondu. 3. Chetan Suresh Tulaskar. 4. Vishnu Gopal Shelar.

_____________ (PRINCIPAL)

________________ (H.O.D) ___________________ (DATE)

___________________ (PROJECTGUIDE)

Ak o l de et c nw gm e n
We are pleasured to submit this presentation studied out in manohar phalke memorial foundations polytechnic. We would like for humble attempt to thank all those people who helped us to make this project. First it is our pleasure to Prof. Ashok D. Chavan (Principal Of M.P.M.F.P.) & Er. Parmeshwar Manegopale (H.O.D ET/EX) for granting us the opportunity to present our project

Micro-controller based Security Access Control System


We express our heart filled gratitude to honorable sir, Er. Santosh A. Kamble (college project in-charge and internal guide), who offered us all the possible assistance during our developing period and for the interest he took in sorting our difficulties and offering us guidance, constant encouragement and help. Finally we wish to extend our gratitude to all the M.P.M.F.P. Staff that all made our developing period a great experience for us.

Abu Sufiyan M. Kalam. Jadhav Santosh Dhondu. Chetan Suresh Tulaskar. Vishnu Gopal Shelar.

Ie nx d
Sr.no.
1 2 3 4 5 6 7 8 9 10 11

Topic
Introduction Block Diagram and Description Circuit Diagram and Description PCB Layout Project hardware Project Software Applications and Advantages Future Modifications Conclusion Bibliography Data sheets

Page no.

C A T R1 HPE

IN R D C IO TOUT N

1 IN R D C IO .0 T O U T N Security is prime concern in our day-today life. Every one wants to be as much as secure as to be possible. An access control system forms a vital link in security chain. The micro controller based digital lock present here is an access control system that allows only authorized persons to access a restricted area. The system comprises a small electronics unit with a numeric keypad, which is fixed out side the entry door to control a magnetic lock. When an authorized person enters predetermined number (password) via the keypad, the relay operated for a limited time to unlatched the magnetic lock so the door can be pushed/pulled to open. At the end of present delay, the relay reenergizes and the door gets locked again. If the entered password is correct the display displays that Code is correct access allowed. And if the entered password is wrong it gives three beep signals and display will displays Code is in-correct Access is denied. When the code has been incorrectly entered five times, the code lock will switch to alarm relay are turned off after entering a valid user Access code. This function thwarts any attempt by hackers to quickly try a large number of codes in a sequence. The secret code can be changed any time after entering the current code (Master code)

C A T R2 HPE

B O KD G A L C IA R M AD N DS R T N E C IP IO

2 B c D ga .0 lo k ia r m

2 B c D g a D sc ip n .1 lo k ia r m e r tio 89C51 Micro-controller based Security Access Control System has following blocks. 1. Key Pad 2. Micro-controller 89C51 3. LCD display 4. Relay Driver 5. Buzzer 6. Power supply

1. Key Pad: There are total 12 keys. These are normally open push buttons. When button is normal i.e. not pressed then it gives logic zero. And when button is pressed then it gives logic high i.e +5 Volt i.e. 1. 2. Micro-controller 89C51 : It is a low-power, high-performance CMOS and 8-bit

microcomputer with 4K bytes of Flash Programmable

Erasable Read Only Memory (PEROM). The device is manufactured using Atmels high-density nonvolatile memory technology and is compatible with the MCS-51 instruction set and pin-out. The on-

chip Flash allows the program memory to be reprogrammed in-system or by a conventional nonvolatile memory programmer. By combining a versatile 8-bit CPU with Flash on a monolithic chip, the Atmel AT89C51 is a powerful microcomputer, which provides a highly flexible and cost effective solution so many embedded control applications 3. LCD display : This display contains two internal byte wise resisters, One for the commands (RS=0) and second for character to be displayed (RS=1). It also contains a user programmed RAM area (the character RAM) that can be programmed to generate any desired character that can form using a dot matrix. To distinguish between these two data areas, the hex command byte 80H will be used to signify that display RAM address 00H is chosen. Port 1 is used to furnish the command or data byte, and ports 3.2 to 3.4 furnish register select and read/write levels. The display takes varying amounts of time to accomplish the functions. LCD bit 7 is monitored for logic high (Busy) to ensure the display is not overwritten. This LCD display is used to display the code, error message etc.

4. Relay Driver : Output of micro-controller is not sufficient to drive the relay directly. Therefore to drive the relay we are using relay driver block by using transistor as switch.

5. BUZZER: This is output device. When wrong code is pressed then buzzer will turn ON. 6. Power supply: This block converts 230 Vac into +5 volt dc and +12 volts dc. +5 volts is required for key pad, Micro-controller 89C51 board and LCD display. + 12 Volts are required for Relay driver circuit and Buzzer.

C A T R3 HPE

C C IT IR U D GA AD IA R M N DS R T N E C IP IO

3 C c it D g a .0 ir u ia r m

3 C c it D g a D sc ip n .1 ir u ia r m e r tio

Microcontroller 89C51 is heart of our project. It has four ports, port 0, port1, port2, port 3. In our project we are using switch to enter the number. The switches are normally open and normally it gives logic one output. When we press the button switch will become close, and it gives logic zero to microcontroller. Through program microcontroller will check the digit.

Relay is used as magnetic lock. Normally relay is energized therefore it is magnetized. When we press the right code then the relay will become de-energized i.e. de magnetize.

When we press wrong code then the buzzer will turn on and relay remains energized for latch. LCD is used to display the code entered. The operating frequency of the microcontroller is 12 MHz.

C A T R4 HPE

P BL y u C aot

4 P BL y u .1 C a o t

C A T R5 HPE

PR JE T O C H R WR AD AE

5P o c H r w r : r je t a d a e In our project we uses following hardware 5.1 Microcontroller 89C51 5.2 Voltage Regulator 78XX series 5.3 Relay 5.4 Capacitors 5.5 Diodes 5.6 Light Emitting Diodes (LEDs) 5.7 Buzzer and Bleeper 5.8 Presets 5.9 Transistors

5.1 Microcontroller 89C51


The AT89C51 is a low-power , high-performance CMOS 8-bit microcomputer with 4K bytes of flash programmable and erasable read only memory (PEROM). The device is manufactured using Atmels high-density nonvolatile memory technology and is compatible with the industry-standard MCS-51 instruction set and pin out. The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional nonvolatile memory programmer. By combining a versatile 8-bit CPU with Flash on a monolithic chip, the Atmel AT89C51 is a powerful microcomputer which provides a highly-flexible and cost-effective solution to many embedded control applications. The AT89C51 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 Hardware reset.

Features of 89C51
Following are the features of 89C51 Microcontroller as per the datasheet given by Atmel-

Compatible with MCS-51TM Products.

4K Bytes of In-system Reprogrammable Flash Memory Endurance 1,000 Write / Erase Cycles. Fully Static Operation : 0 Hz to 24 MHz Three-level Program Memory Lock 128 x 8-bit Internal RAM 32 Programmable I / O Lines. Two 16-bit Timer / Counters Six Interrupt Sources Programmable Serial Channel Low-power Idle and Power-down Modes

Pin Diagram of 89C51 Microcontroller

Pin Description VCC:GND:Port 0:Supply Voltage Ground 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 may 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 1output buffers can sink/source four TTL inputs. When 1s are written to port 1 pins they are pulled high by the internal pull-ups and can be used as inputs. As inputs , Port 1 pins that are externally being pulled low will source current (IIL) because of the internal pull-ups. 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. As inputs, Port 2 pins that are externally being pulled low will source current (IIL) because of the internal pull-ups. Port 2 emits the high-order address byte during fetches from external program memory and during accesses to external data memory that uses 16-bit addresses (MOVX @ DPTR). In this application, it uses strong internal pull-ups when emitting 1s. During accesses to external data memory that uses 8-bit addresses (MOVX @ RI), Port 2 emits 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 AT89C51 as listed below ,Port Pin Alternate Functions P3.0 P3.1 P3.2 P3.3 P3.4 P3.5 P3.6 P3.7 RXD (Serial input port) TXD (Serial output port) INT0 (External Interrupt 0) INT1 (External Interrupt 1) T0 (Timer 0 external input) T1 (Timer 1 external input) WR (External data memory write strobe) RD (External data memory read strobe)

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 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 1 / 6 the oscillator frequency, and may be used for external timing or clocking purposes. Note, however , that one ALE pulse is skipped during each access to external Data Memory. 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 Microcontroller is in external execution mode. PSEN:Program Store Enable is the read strobe to external

program memory. When the AT89C51 is executing code from external program memory, PSEN is activated twice each cycle, except that two PSEN activations are skipped during each access to external data memory. EA / VPP:External Access Enable. EA must be strapped to

GND in order to enable the device to fetch code from external program memory locations starting at 0000H up to FFFFH. Note, however , that if lock bit 1 is programmed , EA will be internally latched on reset. EA should be strapped to VCC for internal program executions. The pin also receives the 12-volt programming enable voltage (VPP) during Flash programming, for parts that require 12volt VPP.

XTAL1:-

Input to the inverting oscillator amplifier and input to the

internal clock operating circuit. XTAL2:Output from the inverting oscillator amplifier.

5.2 Three Terminal Voltage Regulator: General Features: A three terminal voltage regulator is a regulator in which the output voltage is set at some predetermined value. Such regulators do not require an external feedback connection. Hence, only three terminals are required for device of such types, input (Vin) output (Vo) and a ground terminal. Since the regulator operates at a preset output voltage the current limiting resistor is also internal to the device. The main advantages of such regulators are the simplicity of connections to the external circuit and the minimum of external components. Fig. Shows the basic circuit configuration of the three terminal voltage regulator. Although, the three terminal regulators offers only fixed output voltages, there are wide variety of voltages available, both +Ve and Ve. The output current range from 100 m A to 3 A. LM 78 MXX series 3 terminal positive voltage regulators. General description: The LX78MXX series of three terminal regulators is available with several fixed output voltages making them useful in a wide range

of applications. The voltage available allow these regulators to be used in logic system, instrumentation, Hi Fi and other solid state electronic equipment. Although designed primarily devices can be used with external component to obtain adjustable voltage and current. Features: 1) 2) 3) 4) 5) Internal thermal overload protection. NO external components required. Output transistor safe area protection. Internal short circuit current limit. Circularity allows start up even if output is pulled to

negative voltage (I supplies) Absolute maximum rating: Input voltage internal power dissipation Operating temperature range Maximum junction temperature Storage temperature range Lead temperature 35 V Internally limited. 00 to 700 c + 1250c - 650v to 1500c + 2300c

5.3 Relay: A relay is an electrically operated switch. Current flowing through the coil of the relay creates a magnetic field, which attracts a lever and changes the switch contacts. The coil current can be on or off so relays have two switch positions and they are double throw (changeover) switches. Relays allow one circuit to switch a second circuit, which can be completely separate from the first. For example a low voltage battery circuit can use a relay to switch a 230V AC mains circuit. There is no electrical connection inside the relay between the two circuits; the link is magnetic and mechanical. The coil of a relay passes a relatively large current, typically 30mA for a 12V relay, but it can be as much as 100mA for relays designed to operate from lower voltages. Most ICs (chips) cannot provide this current and a transistor is usually used to amplify the small IC current to the larger value required for the relay coil. The

maximum output current for the popular 555 timer IC is 200mA so these devices can supply relay coils directly without amplification. Relays are usually SPDT or DPDT but they can have many more sets of switch contacts, for example relays with 4 sets of changeover contacts are readily available. For further information about switch contacts and the terms used to describe them please see the page on switches. Most relays are designed for PCB mounting but you can solder wires directly to the pins providing you take care to avoid melting the plastic case of the relay. The supplier's catalogue should show you the relay's connections. The coil will be obvious and it may be connected either way round. Relay coils produce brief high voltage 'spikes' when they are switched off and this can destroy transistors and ICs in the circuit. To prevent damage you must connect a protection diode across the relay coil. The animated picture shows a working relay with its coil and switch contacts. You can see a lever on the left being attracted by magnetism when the coil is switched on. This lever moves the switch

contacts. There is one set of contacts (SPDT) in the foreground and another behind them, making the relay DPDT

Choosing a relay You need to consider several features when choosing a relay: Physical size and pin arrangement. If you are choosing a relay for an existing PCB you will need to ensure that its dimensions and pin arrangement are suitable. You should find this information in the supplier's catalogue. Coil voltage : The relay's coil voltage rating and resistance must suit the circuit powering the relay coil. Many relays have a coil rated for a 12V supply but 5V and 24V relays are also readily available. Some relays operate perfectly well with a supply voltage which is a little lower than their rated value. Coil resistance The circuit must be able to supply the current required by the relay coil. You can use Ohm's law to calculate the current: supply voltage coil resistance For example: A 12V supply relay with a coil resistance of 400 Relay coil current = passes a current of 30mA. This is OK for a 555 timer IC (maximum output current 200mA), but it is too much for most ICs and they will require a transistor to amplify the current.

Switch ratings (voltage and current) The relay's switch contacts must be suitable for the circuit they are to control. You will need to check the voltage and current ratings. Note that the voltage rating is usually higher for AC, for example: "5A at 24V DC or 125V AC". Switch contact arrangement (SPDT, DPDT etc) Most relays are SPDT or DPDT which are often described as "single pole changeover" (SPCO) or "double pole changeover" (DPCO). For further information please see the page on switches. Protection diodes for relays Transistors and ICs (chips) must be protected from the brief high voltage 'spike' produced when the relay coil is switched off. The diagram shows how a signal diode (eg 1N4148) is connected across the relay coil to provide this protection. Note that the diode is connected 'backwards' so that it will normally not conduct. Conduction only occurs when the relay coil is switched off, at this moment current tries to continue flowing through the coil and it is harmlessly diverted through the diode. Without the diode no current could flow and the coil would produce a damaging high voltage 'spike' in its attempt to keep the current flowing.

Relays and transistors compared Like relays, transistors can be used as an electrically operated switch. For switching small DC currents (< 1A) at low voltage they are usually a better choice than a relay. In these cases a relay will be needed, but note that a low power transistor may still be needed to switch the current for the relay's coil! The main advantages and disadvantages of relays are listed below: Advantages of relays: Relays can switch AC and DC, transistors can only switch DC. Relays can switch high voltages, transistors cannot. Relays are a better choice for switching large currents (> 5A). Relays can switch many contacts at once. Disadvantages of relays: Relays are bulkier than transistors for switching small currents. Relays cannot switch rapidly (except reed relays), transistors can switch many times per second. Relays use more power due to the current flowing through their coil. Relays require more current than many chips can provide, so a low power transistor may be needed to switch the current for the relay's coil.

5.4Capacitors Capacitors store electric charge. They are used to smooth varying DC supplies by acting as a reservoir of charge. They are also used in filter circuits because capacitors easily pass AC (changing) signals but they block DC (constant) signals. Polarised capacitors (large values, 1F +) Electrolytic capacitors are polarized and they must be connected the correct way round, at least one of their leads will be marked + or -. They are not damaged by heat when soldering. There are two designs of electrolytic capacitors; axial where the leads are attached to each end (220F in picture) and radial where both leads are at the same end (10F in picture). Radial capacitors tend to be a little smaller and they stand upright on the circuit board. It is easy to find the value of electrolytic capacitors because they are clearly printed with their capacitance and voltage rating. The voltage rating can be quite low and it should always be checked when selecting an electrolytic capacitor.

Unpolarised capacitors (small values, up to 1F) Small value capacitors are unpolarised and may be connected either way round. They are not damaged by heat when soldering, except for one unusual type

(polystyrene). It can be difficult to find the values of these small capacitors because there are many types of them and several different labeling systems. Many small value capacitors have their value printed but without a multiplier, so you need to use experience to work out what the multiplier should be! 5.5 Diodes Diodes allow electricity to flow in only one direction. The arrow of the circuit symbol shows the direction in which the current can flow. Diodes are the electrical version of a valve and early diodes were actually called valves.

Forward Voltage Drop Electricity uses up a little energy pushing its way through the diode, rather like a person pushing through a door with a spring. This means that there is a small voltage across a conducting diode, it is called the forward voltage drop and is about 0.7V for all normal diodes which are made from silicon. The forward voltage drop of a diode is almost constant whatever the current passing through the diode so they have a very steep characteristic (current-voltage graph). Reverse Voltage When a reverse voltage is applied a perfect diode does not conduct, but all real diodes leak a very tiny current of a few A or less. This can be ignored in most circuits because it will be very much smaller than the current flowing in the forward direction. However, all diodes have a maximum reverse voltage (usually 50V or more) and if this is exceeded the diode will fail and pass a large current in the reverse direction, this is called breakdown. Ordinary diodes can be split into two types: Signal diodes which pass small currents of 100mA or less and Rectifier diodes which can pass large currents. In addition there are LED (which have their own page) and Zener diodes (at the bottom of this page).

5.6 Light Emitting Diodes (LEDs) LEDs emit light when an electric current passes through them.

Colours of LEDs LEDs are available in red, orange, amber, yellow, green, blue and white. Blue and white LEDs are much more expensive than the other colours. The colour of an LED is determined by the semiconductor material, not by the colouring of the 'package' (the plastic body). LEDs of all colours are available in uncoloured packages which may be diffused (milky) or clear (often described as 'water clear'). The coloured packages are also available as diffused (the standard type) or transparent.

Bi-colour LEDs A bi-colour LED has two LEDs wired in 'inverse parallel' (one forwards, one backwards) combined in one package with two leads. Only one of the LEDs can be lit at one time and they are less useful than the tri-colour LEDs described above. Calculating an LED resistor value An LED must have a resistor connected in series to limit the current through the LED, otherwise it will burn out almost instantly. The resistor value, R is given by: R = (VS - VL) / I VS = supply voltage VL = LED voltage (usually 2V, but 4V for blue and white LEDs) I = LED current (e.g. 20mA), this must be less than the maximum permitted If the calculated value is not available choose the nearest standard resistor value which is greater, so that the current will be a little less than you chose. In fact you may wish to choose a greater resistor value to reduce the current (to increase battery life for example) but this will make the LED less bright.

For example If the supply voltage VS = 9V, and you have a red LED (VL = 2V), requiring a current I = 20mA = 0.020A,

R = (9V - 2V) / 0.02A = 350 , so choose 390 (the nearest standard value which is greater). 5.7 Buzzer and Bleeper These devices are output

transducers converting electrical energy to sound. They contain an internal oscillator to produce the sound, which is set at about 400Hz for buzzers and about 3kHz for bleepers. Buzzers have a voltage rating but it is only approximate, for example 6V and 12V buzzers can be used with a 9V supply. Their typical current is about 25mA. Bleepers have wide voltage ranges, such as 3-30V, and they pass a low current of about 10mA. Buzzers and bleepers must be connected the right way round, their red lead is positive (+).

5.8 Presets These are miniature versions of the standard variable resistor. They are designed to be mounted directly onto the circuit board and adjusted only when the circuit is built. For example to set the frequency of an alarm tone or the sensitivity of a light-sensitive circuit. A small screwdriver or similar tool is required to adjust presets. Presets are much cheaper than standard variable resistors so they are sometimes used in projects where a standard variable resistor would normally be used. Multiturn presets are used where very precise adjustments must be made. The screw must be turned many times (10+) to move the slider from one end of the track to the other, giving very fine control. 5.9 Transistors Transistors amplify current, for example they can be used to amplify the small output current from a logic chip so that it can operate a lamp, relay or other high current device. In

many circuits a resistor is used to convert the changing current to a changing voltage, so the transistor is being used to amplify voltage. A transistor may be used as a switch (either fully on with maximum current, or fully off with no current) and as an amplifier (always partly on). The amount of current amplification is called the current gain, symbol hFE. Types of transistor There are two types of standard transistors, NPN and PNP, with different circuit symbols. The letters refer to the layers of semiconductor material used to make the transistor. Most transistors used today are NPN because this is the easiest type to make from silicon. If you are new to electronics it is best to start by learning how to use NPN transistors. The leads are labelled base (B), collector (C) and emitter (E). These terms refer to the internal operation of a transistor but they are not much help in understanding how a transistor is used, so just treat them as labels!

CHAPTER 6

S SE YT M S F WR OT A E

6 Po r m . r ga :
ORG 0000H CLR P2.5 SETB P2.4 MOV DPTR,#COMM1 UP1: CLR A MOVC A,@A+DPTR INC DPTR CJNE A,#'$',COMMAND11 UP772: ACALL LOCKDISPLAY ACALL COLLAGEDISPLAY MOV A,P2 ANL A,#04H JNZ UP772 UP22: MOV R0,#7EH MOV R1,#7EH MOV R2,#7EH ACALL SWREAD MOV R2,A ACALL LCDDISPLAY ACALL SWREAD MOV R1,A ACALL LCDDISPLAY ACALL SWREAD MOV R0,A UP012: ACALL SETDISPLAY MOV A,P2 ANL A,#0CH CJNE A,#0CH,PRGORFIX AJMP UP012 ;DISPLAY CODE ;DISPLAY CODE ;DISPLAY CODE ;MSB ;DISPLAY CODE ACALL LCDDISPLAY ;LSB ;CHECK FOR FINAL SET ; LCD INITILISATION ;START

PRGORFIX: CJNE A,#08H,UP22 MOV 30H,R0 MOV 31H,R1 MOV 32H,R2 MOV 46H,#00H MOV 45H,#02H UP223: ACALL SAVEDISPLAY DJNZ 45H,UP223 SKAGAIN: MOV R0,#0FFH MOV R1,#0FFH MOV R2,#0FFH ACALL LCDDISPLAY ACALL SWREAD MOV R2,A ACALL LCDDISPLAY ACALL SWREAD MOV R1,A ACALL LCDDISPLAY ACALL SWREAD MOV R0,A UP0122: ACALL SETDISPLAY MOV A,P2 ANL A,#0CH CJNE A,#0CH,PRGORFIX2 AJMP UP0122 PRGORFIX2: CJNE A,#08H,SKAGAIN ;DISPLAY CODE ;DISPLAY CODE ;DISPLAY CODE ;MSB ;DISPLAY CODE ;LSB ;SAVE MSB ;SAVE LSB

MOV A,R0 CJNE A,30H,DENIED MOV A,R1 CJNE A,31H,DENIED MOV A,R2 CJNE A,32H,DENIED MOV 45H,#05H MOV 46H,#00H CLR P2.4 UP2232:ACALL ALLOWDISPLAY DJNZ 45H,UP2232 SETB P2.4 SJMP SKAGAIN COMMAND11: ACALL COMMAND AJMP UP1 DENIED:MOV 45H,#03H MOV A,46H CJNE A,#03H,DDDD1 SETB P2.5 YAHA: LCALL HANG SJMP YAHA DDDD1: INC 46H SETB P2.5 DENIED1:ACALL DENIEDISPLAY DJNZ 45H,DENIED1 CLR P2.5 SJMP SKAGAIN ; CALL COMMAND REGISTER OF LCD

LOCKDISPLAY: MOV A,#01H ACALL COMMAND MOV A,#80H ACALL COMMAND MOV R0,#02H P225: ACALL DELAY DJNZ R0,P225 MOV DPTR,#LINE72 UP072: CLR A MOVC A,@A+DPTR INC DPTR CJNE A,#'$',DISPLAY072 MOV A,#0C0H ACALL COMMAND MOV DPTR,#LINE73 UP73: CLR A MOVC A,@A+DPTR INC DPTR CJNE A,#'$',DISPLAY73 MOV R0,#02H UP525:ACALL DELAY DJNZ R0,UP525 RET DISPLAY072: ACALL DISPLAY AJMP UP072 DISPLAY73: ACALL DISPLAY AJMP UP73 ; CALL DATA REGISTER OF LCD FOR DISPLAY ; CALL DATA REGISTER OF LCD FOR DISPLAY ;DELAY ;DISPLAY DATA ON LINE1. ; STARTING ADDRESS OF LINE 2 OF LCD RAM ;DISPLAY DATA ON LINE1. ;DELAY ; STARTING ADDRESS OF LINE 1 OF LCD RAM ;CLEAR LCD DISPLAY

LINE72: LINE73:

DB 'SECURITY ACCESS$' DB 'CONTROL SYSTEM.$'

COLLAGEDISPLAY: MOV A,#01H ACALL COMMAND MOV A,#80H ACALL COMMAND MOV R0,#02H P5225: ACALL DELAY DJNZ R0,P5225 MOV DPTR,#LINE572 UP5072: CLR A MOVC A,@A+DPTR INC DPTR CJNE A,#'$',DISPLAY5072 MOV A,#0C0H ACALL COMMAND MOV DPTR,#LINE573 UP573: CLR A MOVC A,@A+DPTR INC DPTR CJNE A,#'$',DISPLAY573 MOV R0,#02H UP5525:ACALL DELAY DJNZ R0,UP5525 RET DISPLAY5072: ACALL DISPLAY AJMP UP5072 ; CALL DATA REGISTER OF LCD FOR DISPLAY ;DELAY ;DISPLAY DATA ON LINE1. ; STARTING ADDRESS OF LINE 2 OF LCD RAM ;DISPLAY DATA ON LINE1. ;DELAY ; STARTING ADDRESS OF LINE 1 OF LCD RAM ;CLEAR LCD DISPLAY

DISPLAY573: ACALL DISPLAY AJMP UP573 LINE572: LINE573: DB 'MANOHAR PHALKE.$' DB ' POLYTECHNIC $' ;CLEAR LCD DISPLAY ; STARTING ADDRESS OF LINE 1 OF LCD RAM ; CALL DATA REGISTER OF LCD FOR DISPLAY

SAVEDISPLAY: MOV A,#01H ACALL COMMAND MOV A,#80H ACALL COMMAND MOV R0,#02H P2251: ACALL DELAY DJNZ R0,P2251 MOV DPTR,#LINE721 UP0721: CLR A MOVC A,@A+DPTR INC DPTR CJNE A,#'$',DISPLAY0721 MOV A,#0C0H ACALL COMMAND MOV DPTR,#LINE731 UP731: CLR A MOVC A,@A+DPTR INC DPTR CJNE A,#'$',DISPLAY731 MOV R0,#02H UP5251:ACALL DELAY DJNZ R0,UP5251 RET LINE721: LINE731: DB ' NEW PASSWARD $' DB ' SAVED. $' ;DELAY ;DISPLAY DATA ON LINE1. ; STARTING ADDRESS OF LINE 2 OF LCD RAM ;DISPLAY DATA ON LINE1. ;DELAY

DISPLAY0721: ACALL DISPLAY AJMP UP0721 DISPLAY731: ACALL DISPLAY AJMP UP731 ALLOWDISPLAY: MOV A,#01H ACALL COMMAND MOV A,#80H ACALL COMMAND MOV R0,#02H P02251: ACALL DELAY DJNZ R0,P02251 MOV DPTR,#LINE0721 UP00721: CLR A MOVC A,@A+DPTR INC DPTR CJNE A,#'$',DISPLAY00721 MOV A,#0C0H ACALL COMMAND MOV DPTR,#LINE0731 UP0731: CLR A MOVC A,@A+DPTR INC DPTR CJNE A,#'$',DISPLAY0731 MOV R0,#02H UP05251:ACALL DELAY DJNZ R0,UP05251 RET ;DELAY ;DISPLAY DATA ON LINE1. ; STARTING ADDRESS OF LINE 2 OF LCD RAM ;DISPLAY DATA ON LINE1. ;DELAY ; STARTING ADDRESS OF LINE 1 OF LCD RAM ;CLEAR LCD DISPLAY ; CALL DATA REGISTER OF LCD FOR DISPLAY ; CALL DATA REGISTER OF LCD FOR DISPLAY

LINE0721: LINE0731:

DB 'CODE IS CORRECT.$' DB ' ACCESS ALLOWED $' ; CALL DATA REGISTER OF LCD FOR DISPLAY

DISPLAY00721: ACALL DISPLAY AJMP UP00721 DISPLAY0731: ACALL DISPLAY AJMP UP0731 COMMAND1: ACALL COMMAND AJMP UP1 DISPLAY1: ACALL DISPLAY ; CALL DATA REGISTER OF LCD FOR DISPLAY AJMP UP2 DISPLAY2: ACALL DISPLAY ; CALL DATA REGISTER OF LCD FOR DISPLAY AJMP UP32 DELAY: MOV R7,#0FAH LOOP1: MOV R5,#0FFH LOOP: DEC R5 MOV A,R5 JNZ LOOP DEC R7 MOV A,R7 JNZ LOOP1 RET ;DELAY OF 1 SECOND ; CALL COMMAND REGISTER OF LCD ; CALL DATA REGISTER OF LCD FOR DISPLAY

LCDDISPLAY: MOV A,#01H ACALL COMMAND MOV A,#80H ACALL COMMAND MOV DPTR,#LINE1 UP2: CLR A MOVC A,@A+DPTR INC DPTR CJNE A,#'$',DISPLAY1 UP1234: MOV A,#0C0H ACALL COMMAND MOV DPTR,#LINE2 UP32: CLR A MOVC A,@A+DPTR INC DPTR CJNE A,#'$',DISPLAY2 MOV A,#20H ACALL DISPLAY MOV A,R2 ORL A,#30H ACALL DISPLAY MOV A,R1 ORL A,#30H ACALL DISPLAY MOV A,R0 ORL A,#30H ACALL DISPLAY MOV A,#0A1H ACALL DISPLAY RET ;DISPLAY MINITE ;DISPLAY MINITE ;CONVERT IT TO ASCII ;DISPLAY MINITE ;CONVERT IT TO ASCII ;DISPLAY MINITE ;CONVERT IT TO ASCII ;DISPLAY DATA ON LINE1. ; STARTING ADDRESS OF LINE 2 OF LCD RAM ;DISPLAY DATA ON LINE1. ; STARTING ADDRESS OF LINE 1 OF LCD RAM ;CLEAR LCD DISPLAY

SETDISPLAY: ACALL DELAY MOV A,#01H ACALL COMMAND MOV A,#80H ACALL COMMAND MOV DPTR,#LINE11 UP123: CLR A MOVC A,@A+DPTR INC DPTR CJNE A,#'$',DISPLAY123 AJMP UP1234 DISPLAY123: ACALL DISPLAY DISPLAY AJMP UP123 LINE11: DB 'PRESS EN2FIX/PRG$' COMMAND: ACALL READY MOV P1,A CLR P3.2 CLR P3.3 SETB P3.4 RET DISPLAY: ACALL READY MOV P1,A SETB P3.2 CLR P3.3 SETB P3.4 CLR P3.4 ;take data to be displayed ;RS=P3.2= 1 to select data register ;write enable ;strobe character to be displayed ;Write when display is not busy ;Command Character in Port P1 ;Command resister chosen ; write enable ; Strobe Character to display ;Return CLR P3.4 ; CALL DATA REGISTER OF LCD FOR ;DISPLAY DATA ON LINE1. ; STARTING ADDRESS OF LINE 1 OF LCD RAM ;DELAY ;CLEAR LCD DISPLAY

RET READY: CLR P3.4 CLR P3.2

; Return ;strobe display ;Select command register ;read enabled ;strobe display

MOV P1,#0FFH ;configure P1 for input SETB P3.3 WAIT: CLR P3.4 SETB P3.4 JB P1.7,WAIT ;Read busy status (BF=0) CLR P3.4 RET SWREAD: MOV R6,#00H MOV A,P0 CJNE A,#0FFH,CHECKSW MOV A,P2 ANL A,#03H CJNE A,#03H,CHECKSW1 AJMP SWREAD CHECKSW: RRC A JNC DOWN111 INC R6 AJMP CHECKSW DOWN111: MOV A,P0 CJNE A,#0FFH,DOWN111 MOV A,R6 RET CHECKSW1: ;INPUT NO IS 0 ;end display strobe. ;Return

MOV R6,#08H CHECKSW11: RRC A JNC DOWN1111 INC R6 AJMP CHECKSW11 DOWN1111: MOV A,P2 ANL A,#03H CJNE A,#03H,DOWN1111 MOV A,R6 RET COMM1: DB 3CH,0EH,06H,01H,'$' LINE1: DB 'SECURITY SYSTEM.$' LINE2: DB 'ENTER CODE =$' DENIEDISPLAY: MOV A,#01H ACALL COMMAND MOV A,#80H ACALL COMMAND MOV R0,#02H PK02251: ACALL DELAY DJNZ R0,PK02251 MOV DPTR,#LINE0721K UP00721K: CLR A MOVC A,@A+DPTR INC DPTR CJNE A,#'$',DISPLAY00721K MOV A,#0C0H ACALL COMMAND ; STARTING ADDRESS OF LINE 2 OF LCD RAM ;DISPLAY DATA ON LINE1. ;DELAY ; STARTING ADDRESS OF LINE 1 OF LCD RAM ;CLEAR LCD DISPLAY

MOV DPTR,#LINE0731K UP0731K: CLR A MOVC A,@A+DPTR INC DPTR CJNE A,#'$',DISPLAY0731K MOV R0,#02H UP05251K:ACALL DELAY DJNZ R0,UP05251K RET LINE0721K: LINE0731K:

;DISPLAY DATA ON LINE1.

;DELAY

DB 'CODE IN-CORRECT.$' DB ' ACCESS DENIED. $'

DISPLAY00721K: ACALL DISPLAY DISPLAY AJMP UP00721K DISPLAY0731K: ACALL DISPLAY DISPLAY AJMP UP0731K HANG: MOV A,#01H ACALL COMMAND MOV A,#80H ACALL COMMAND MOV R0,#02H P22517: ACALL DELAY DJNZ R0,P22517 MOV DPTR,#LINE7217 UP07217: CLR A ;DISPLAY DATA ON LINE1. ;DELAY ; STARTING ADDRESS OF LINE 1 OF LCD RAM ;CLEAR LCD DISPLAY ; CALL DATA REGISTER OF LCD FOR ; CALL DATA REGISTER OF LCD FOR

MOVC A,@A+DPTR INC DPTR CJNE A,#'$',DISPLAY07217 MOV A,#0C0H ACALL COMMAND MOV DPTR,#LINE7317 UP7317: CLR A MOVC A,@A+DPTR INC DPTR CJNE A,#'$',DISPLAY7317 MOV R0,#02H UP52517:ACALL DELAY DJNZ R0,UP52517 RET LINE7217: LINE7317: DB 'System is Hanged$' DB ' Press Reset. $' ; CALL DATA REGISTER OF LCD FOR DISPLAY ;DELAY ;DISPLAY DATA ON LINE1. ; STARTING ADDRESS OF LINE 2 OF LCD RAM

DISPLAY07217: ACALL DISPLAY AJMP UP07217 DISPLAY7317: ACALL DISPLAY AJMP UP7317 ; CALL DATA REGISTER OF LCD FOR DISPLAY

CHAPTER 7

AP C T N P L A IO S AD N AVNA E DATG

7 Ap a n .1 p lic tio s: Digital card access in telephone exchange. Electrical application access. Door locking system. Password protected access to PC. Access to electronic circuit. Locker in bank. Antitheft system design. 7 A v n g s: .3 d a ta e The system used is microcontroller based. Too little space is required for it to set for any operation

at any location. way. LCD display which makes very easy to understand the Used of keyboard matrix for entering password in simple

operation taking place. Reset button is available for resetting the system. There is also facility of changing password. Simple circuit which can easily be understood.

Moderate price.

CHAPTER 8

F T R UUE M D IC T N O IF A IO S

8 F tu eMd a n .0 u r o ific tio s:

In future from our point of view we will not make use of password instead of that we shall be able to make use of detecting finger print or again in any advance technology detecting face or eyes, etc.

CHAPTER 9

CNL S N O C U IO

9. 0 CONCLUSION

It was are pleasure that we deal with our project 89C51 Microcontroller based Security Access Control System

Thus we can say that with this project we can automatically control the lock just by giving the password, for security purpose.So only the user can access it by entering the correct password.

CHAPTER 10

B L G AH IB IO R P Y

1 .0B L G A H 0 IB IO R P Y

1. The 8051 Microcontroller - Kenneth J. Ayala 2. Microcontroller 89C51 data Manual -Intel 3. Web site : www.google.com

4. web site :

www.geocities.com/sk_instru

CHAPTER 11

DATA SHEETS

You might also like