You are on page 1of 87

Project 2011 LOCKER SECURITY SYSTEM

ACKNOWLEDGEMENT

We should like to express our heartfelt gratitude to Mrs. C.G. Anitha, Principal of our polytechnic for providing the best facility and atmosphere for this Project work. We greatly thankful to Mrs. Suhara .K.M, Head of Department of Electronics for all necessary help extended by her in the fulfillment of this Project. We acknowledge our Project guide Mr.Devarajan.M.K, Mr. Sureshkumar.K.B, Mrs.sussamma Mathew, Mrs. Padmaja Detha, Lucturers in Electronics Engineering for the guidance and help they have always given us. Finally we thank all our colleagues for their heartfelt co-operation and tremendous support they have given to us during the collection of materials and also during our Project.

Department of Electronics

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

CONTENTS

1.INTRODUCTION 2.BLOCK DIAGRAM DESCRIPTION 3.EXPLANATION 4.CIRCUIT DIAGRAM 5.FLOW CHART 6.PROGRAM 7.PCB LAYOUT 8.PCB FABRICTION 9. MERITS AND DEMERITS 10.FUTURE ENHANCEMENT 11.CONCLUSION 12REFERENCE

Department of Electronics

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

CHAPTER 1 INTRODUCTION

The project locker security system is aimed at protecting the offering box from robbery. The project is based on micro-controller AT89C51 and some associated components. The major advantage of this security system other than the available security system is that this sounds and alarm and calls to a predefined mobile number when an attempt of robbery is detected. The mobile number can be of any persons managing the offering box and there is an option for a second mobile number to which the controller makes a second call at the time of robbery. The second mobile number can be the number of police station, so police will get notified and they can do the necessary actions immediately. As soon as the mobile calling section is finished by the controller it will generate an alarm. This alarm can only be disabled by using a secure password. So this security system has 3 levels of protection, password protection, call to predefined mobile number and an alarm.

Department of Electronics

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

CHAPTER 2 BLOCK DIAGRAM AND EXPLANATION

2.1 Block Diagram

Figure 2.1 Basic block diagram

Department of Electronics

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

EXPLANATION AT89C51:

Compatible with MCS-51 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

The

AT89C51

is

low-power,

high-performance

CMOS

8-bit

microcomputer with 4Kbytes of Flash programmable and erasable read only memory (PEROM). The devices manufactured using Atmelshighdensity nonvolatile memory technology and incompatible with the industry standardMCS-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
Department of Electronics

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

Flash on a monolithic chip, the Atmen AT89C51 is a powerful microcomputer which provides a highly-flexible and cost-effective solution to many embedded control applications.

Pin Configuration:

Department of Electronics

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

Block Diagram:

The AT89C51 provides the following standard features: 4K bytes of Flash, 128 bytes of RAM, 32 I/O lines, two 16-bit timer/counters, a five vector two-level interrupt architecture, a full duplex serial port, on-chip oscillator and clock circuitry. In addition, the AT89C51 is designed with static logic for operation down to zero
Department of Electronics

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

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.

Pin Description: 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 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 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
Department of Electronics

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

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 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, it uses strong internal pull-ups when emitting 1s. During accesses to external data memory that use 8-bit addresses (MOVX @ RI), Port 2 emits the Contents of the P2 Special Function Register. Port 2 also receives the highorder 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:

Department of Electronics

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

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 output pulse for latching the low byte of the address during accesses to external memory. This pin is also the program pulse input (PROG) during Flash Programming. In normal operation ALE is emitted at a constant rate of 1/6 the oscillator frequency, and may be used for external timing or clocking purposes. Note, however, that one ALE pulse is skipped during each access to external Data Memory. 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.

Department of Electronics

10

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

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 machine cycle, except that two PSEN activations are skipped during each access to external data memory. EA/VPP

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

Input to the inverting oscillator amplifier and input to the internal clock operating circuit. XTAL2

Output from the inverting oscillator amplifier. Unconnected while XTAL1 is driven as shown in Figure 2. There are no requirements on the duty cycle of the external clock signal, since the input to the internal clocking circuitry is through a divide-by-two flip-flop, but minimum and maximum voltage high and low time specifications must be observed.

Department of Electronics

11

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

Idle Mode

In idle mode, the CPU puts itself to sleep while all the on chip peripherals remain active. The mode is invoked by software. The content of the onchip RAM and all the special functions registers remain unchanged during this mode. The idle mode can be terminated by any enabled interrupt or by a hardware reset. It should be noted that when idle is terminated by a hard ware reset, the device normally resumes program execution, from where it left off, up to two machine cycles before The internal reset algorithm takes control. On-chip hardware inhibits access to internal RAM in this event, but access to the port pins is not inhibited. To eliminate the possibility of an unexpected write to a port pin when Idle is terminated by reset, the instruction following the one that invokes Idle should not be one that writes to a port pin or to external memory. Programming Algorithm:

Before programming the AT89C51, the address, data and control signals should be set up according to the Flash programming mode table and Figure 3 and Figure 4. To program the AT89C51, take the Following steps: 1. Input the desired memory location on the address lines. 2. Input the appropriate data byte on the data lines. 3. Activate the correct combination of control signals. 4. Raise EA/VPP to 12V for the high-voltage programming mode.
Department of Electronics

12

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

5. Pulse ALE/PROG once to program a byte in the Flash array or the lock bits. The byte-write cycle is self-timed and typically takes no more than 1.5 ms. Repeat steps 1 through 5, changing the address and data for the entire array or until the end of the object file is reached. Data Polling:

The AT89C51 features Data Polling to indicate the end of a write cycle. During a write cycle, an attempted read of the last byte written will result in the complement of the written datum on PO.7. Once the write cycle has been completed, true data are valid on all outputs, and the next cycle may begin. Data Polling may begin any time after a write cycle has been initiated. Ready/Busy:

The progress of byte programming can also be monitored by the RDY/BSY output signal. P3.4 is pulled low after ALE goes high during programming to indicate BUSY. P3.4 is pulled high again when programming is done to indicate READY. WATCH DOG TIMER The WDT is intended as a recovery method in situations where the CPU may be subjected to software upsets. The WDT consists of a 14-bit counter and the Watchdog Timer Reset (WDTRST) SFR. The WDT is defaulted to disable from exiting reset. To enable the WDT, a user must write 01EH and 0E1H in sequence to the WDTRST register (SFR location 0A6H). When the WDT is enabled, it will increment every machine cycle while the oscillator is running. The WDT timeout period is dependent on the external clock frequency. There is no way to disable the WDT except
Department of Electronics

13

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

through reset (either hardware reset or WDT overflow reset). When WDT overflows, it will drive an output RESET HIGH pulse at the RST pin Program Verify:

If lock bits LB1 and LB2 have not been programmed, the programmed code data can be read back via the address and data lines for verification. The lock bits cannot be verified directly. Verification of the lock bits is achieved by observing that their features are enabled. Chip Erase:

The entire Flash array is erased electrically by using the proper combination of control signals and by holding ALE/PROG low for 10 ms. The code array is written with all 1s. The chip erase operation must be executed before the code memory can be re-programmed. UART (Universal Asynchronous Receiver and Transmitter) The UART in the AT89S52 operates the same way as the UART in the AT89C51 and AT89C52. Also known as a serial port. It is a duplex port, which means that it can transmit and receive data simultaneously. P0, P1, P2, P3 - Input/output ports 4 ports within a total of 32 input-output lines are available to the user for connection to peripheral environment T2CON Timer/Counter 2 Control Register

Department of Electronics

14

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

TF2- Timer 2 overflow flag set by a Timer 2 overflow and must be cleared by software. TF2 will not be set when either RCLK = 1 or TCLK = 1. EXF2- Timer 2 external flag set when either a capture or reload is caused by a negative transition on T2EX and EXEN2 = 1. When Timer 2 interrupt is enabled, EXF2 = 1 will cause the CPU to vector to the Timer 2 interrupt routine. EXF2 must be cleared by software. EXF2 does not cause an interrupt in up/down counter mode (DCEN = 1). RCLK- Receive clock enable. When set, causes the serial port to use Timer 2 overflow pulses for its receive clock in serial port modes 1 and 3. RCLK = 0 causes Timer 1 overflow to be used for the receive clock. TCLK- Transmit clock enable. When set, causes the serial port to use Timer 2 overflow pulses for its transmit clock in serial port modes 1 and 3. TCLK = 0 causes Timer 1 overflows to be used for the transmit clock. EXEN2- Timer 2 external enable. When set, allows a capture or reload to occur as a result of a negative transition on T2EX if Timer 2 is not being used to clock the serial port. EXEN2 = 0 causes Timer 2 to ignore events at T2EX. TR2- Start/Stop control for Timer 2. TR2 = 1 starts the timer. C/T2- Timer or counter select for Timer 2. C/T2 = 0 for timer function. C/T2 = 1 for external event counter (falling edge triggered). CP/RL2- Capture/Reload select. CP/RL2 = 1 causes captures to occur on negative transitions at T2EX if EXEN2 = 1. CP/RL2 = 0, causes automatic reloads to occur when Timer 2 overflows or negative transitions occur at T2EX when EXEN2 = 1.

Department of Electronics

15

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

Reading the Signature Bytes:

The signature bytes are read by the same procedure as a normal verification of locations 030H, 031H, and 032H, except that P3.6 and P3.7 must be pulled to a logic low. The values returned are as follows. (030H) = 1EH indicates manufactured by Atmel (031H) = 51H indicates 89C51 (032H) = FFH indicates 12V programming (032H) = 05H indicates 5V programming Programming Interface

Every code byte in the Flash array can be written and the entire array can be erased by using the appropriate combination of control signals. The write operation cycle is self timed and once initiated, will automatically time itself to completion. All major programming vendors offer worldwide support for the Atmen microcontroller series. Please contact your local programming vendor for the appropriate software revision. Power supply
Block diagram of Power Supply

BRIDGE TRANSFORMER RECTIFIER

FILTER

TRANSFORMER

Regulated output

VOLTAGE REGULATOR

Figuer 2.2 Block diagram of power supply


Department of Electronics

16

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

Almost all electronic devices used in electronic circuits need a dc source of power supply to operate .The source of dc power is used to establish the dc operating points for the passive and active electronic devices incorporated in the system. The combination of a transformer, a rectifier, and a filter constitutes an ordinary dc supply, also called an unregulated power supply. For many applications in electronics unregulated power supply is not good because of the following reasons. Poor regulation. Variations in the ac supply main. Variations in temperature.

(1) Transformer Transformers are devices which are designed to transfer electrical energy from one electrical circuit to another. They do so utilizing the principle of electromagnetic induction. In addition to performing such energy transfer they are also capable of delivering a different value of ac current or voltage at their output terminals than the value applied to other input terminal. Transformer can provide isolation. In this circuit step down transformer is used.

(2) Bridge rectifier In the bridge circuit 4 diodes are connected I the form of a Wheatstone bridge. When the upper end of the transformer secondary winding is positive, say during first half cycle of the input supply, diodes D1 and D3 are forward biased and current flows through the arm AB,
Department of Electronics

17

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

enters the load at positive terminal leaves the load at negative terminal. During the negative half cycle, the diodes D2 and D4 are forward biased so the current is not allowed to flow in arms AD and BC. In both cases the direction of flow of current through load resistance is same. (3) Voltage Regulator (7805) Fixed three-terminal linear regulators are commonly available to generate fixed voltage of plus 3V, and plus or minus 5V, 9V, 12V or 15V when the load is less than about 7 amperes. The 78 series (7805, 7812, etc) regulate positive voltages. Often, the last two digits of the device numbers are the output voltages, e.g. a 7805 is a +5V regulator. These regulators eliminate the distribution problems associated with single point regulation.

Figure 2.3 Power supply circuit

.2.2.6 LCD MODULE

Figure 2.6 LCD Display

Department of Electronics

18

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

In recent years the LCD is finding widespread use replacing LEDs. This is due to the following reasons:

The declining price of the LCDs. The ability to display numbers, characters and graphics. This is in contrast to LEDs, limited to displaying only numbers to few characters.

Features
+ 5V power supply (Also available for + 3V) 1/16 duty cycle To be driven by pin 1, pin 2 or pin 15, pin 16

LCD pin descriptions These are the 16 pins and they are given below along with their basic functions and symbols used to represent them. PIN NU MBE R 1 2 3 4 5 6 7 8 9 10 11
Department of Electronics

SYMBOL

FUNCTION

Vss Vdd Vo RS R/W E DB0 DB1 DB2 DB3 DB4


19

GND + 3Vor + 5V Contrast Adjustment H/L Register Select Signal H/L Read/Write Signal H ->L Enable Signal H/L Data Bus Line H/L Data Bus Line H/L Data Bus Line H/L Data Bus Line H/L Data Bus Line
Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

12 13 14 15 16

DB5 DB6 DB7 A/Vee

H/L Data Bus Line H/L Data Bus Line H/L Data Bus Line + 4.2V for LED/Negative

Voltage Output K Power Supply for B/L (OV) Table 2.1 Lcd pin discription

Vcc, Vss, Vee The Vcc or Vdd pin is used to provide supply of +5V, Vss is the ground pin and the Vee or Vo is used for controlling LCD contrast. RS, Register Select There are 2 very important types of register inside the LCD. The RS pin is used for their selection as follows. If RS=0, the command code register is selected. If RS=1, the data register is selected, allowing user to send data to be displayed on the LCD. R/W, Read/Write R/W input allows the user to write the information to the LCD or read information from it. If this pin is set high then read will be selected, else if zero implies write. E, Enable This pin is used by the LCD to latch information presented to its data pins. When data is supplies to data pins, a high to low pulse must be applied to this pin in order for the LCD to latch in the data present in the data pins. This pulse must be a minimum of 450ns wide. DO - D7, Data lines The 8-bit data pins, DO - D7, are used to send information to the LCD or read the contents of the LCD's internal registers. To display letters and numbers, we send ASCII codes for the letters A - Z, a - z, and numbers
Department of Electronics

20

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

0 - 9 to these pins while making RS = 1. There are also instruction command codes that can be sent to the LCD to clear the display or force the cursor to the home position or blink the cursor. We also use RS = 0 to check the busy flag bit to see if the LCD is ready to receive information The busy flag is D7 and can be read when R/W = 1 and RS = 0, as follows: if R/W = 1,RS = O. When D7 = 1 (busy flag = 1 ) , the LCD is busy taking care of internal operations and will not accept any new information.

2.2.7 MAX 232 It meets or Exceeds TIA/EIA-232-F and ITU. It operates from a single 5-V power supply with 1.0F Charge-Pump Capacitors. It can operate up to 120 kbit/s. It has two drivers and two receivers and 30-V input levels. It works at low supply current 8 mA typical. ESD Protection Exceeds JESD 22. 2000-V Human-Body Model A114A. Upgrade with improved ESD (15-kV HBM) and 0.1F Charge-Pump capacitor is available with the MAX202. 2.2.8 KEYPAD ENCODER The MM74C922 and MM74C923 CMOS key encoders provide all the necessary logic to fully encode an array of SPST switches. The keyboard scan can be implemented by either an external clock or external capacitor. These encoders also have on-chip pull-up devices which permit switches with up to 50 kW on resistance to be used. No diodes in the switch array are needed to eliminate ghost switches. The internal debounce circuit needs only a single external capacitor and can be defeated by omitting the capacitor. The Data available output returns to a low level when the entered key is released, even if another key is depressed. The Data available will return high to indicate acceptance of the new key after
Department of Electronics

21

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

a normal debounce period; this two-key roll-over is provided between any two switches. An internal register remembers the last key pressed even after the key is released. The 3-STATE outputs provide for easy expansion and bus operation and are LPTTL compatible.

Figure 2.7 74C922 Encoder Features 50 kW maximum switch on resistance On or off chip clock On-chip row pull-up devices Keybounce elimination with single capacitor Last key register at outputs

CHAPTER 3 CIRCUIT DIAGRAM


3.1 Circuit Diagram

Department of Electronics

22

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

Figure 3.1 Circuit diagram

CIRCUIT COMPONENTS AT89C51 LCD- 2line- 5x7-16 char Transformer 12v Diode 1N4007 LM7805 Capacitors Keypad Buzzer Relay Mobile Crystal 12Mhz
23 Govt.Polytechnic

Department of Electronics

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

Resistors Transistors-BC547 3.2 Working The heart of the circuit is the micro-controller AT89c51. The power supply unit supplies regulated 5volt to the controller using lm7805. The transformer steps down the ac voltage to 12volt and rectifier diodes are used to convert 12volt ac to 12volt DC. This 12volt DC is then regulated to 5volt using LM7805. The controller on power up initializes the whole system. There is a power on reset circuit connected to the reset pin of the controller. So whenever power is switched on the controller resets. As per the program logic the controller first configures the LCD for displaying initializing data on the screen. Then the controller goes for controlling and monitoring other hardware peripherals. A keypad is connected to the circuit for entering the password. The controller then checks this password correct or not. If its correct code the controller then actuates the relay for opening the door. When the controller opens the door it disables the tampering circuit sensors for eliminating false triggering. For closing the door a door close key is provided. When the door is closed the controller immediately enables the tamper circuitry. If a wrong password is entered more than 3 times the controller calls to the predefined number and sounds an alarm. The tamper is detected using a special custom made vibration sensor which works on Newtons 3rd law of motion. The vibration sensors give an interrupt to the controller to indicate a tamper. The LCD display displays the name of the security system and gives direction to the user to enter password and also notifies the user if the password is wrong and also gives indication about the calls during tamper.
Department of Electronics

24

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

The door of the offering box is made using an electronic sliding mechanism. On entering the correct password the correct password the controller actuates relay1 and relay 2. The relay outputs are connected to the motor of the sliding door mechanism. To open the door the motor is given a polarity at which it rotates in clockwise direction and to close the door the polarity of the motor is reversed. The crystal used is 12 MHz; this gives clock to the micro-controller. Transistor logic is used to actuate switches on the mobile phone for making calls. The transistor BC-547 is used as a switch mode. When the controller gives negative to the respective transistor base that transistor gets switched on and the corresponding key on the mobile phone is actuated. A backup battery is provided to work when power loss occurs. So this will ensure the proper working of the circuit in all conditions.

CHAPTER 4 PROGRAM FLOW CHART


Department of Electronics

25

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

CHAPTER 5 PROGRAM
Department of Electronics

26

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

#include<reg51.h> #include<absacc.h>

unsigned char

i=0,j=0,m=0,cc=0,str=0,ii,key_enable=0x0,w;

sfr lcd=0x090; sbit rs=P3^0; sbit rw=P3^1; sbit en=P3^7; sbit busy=P1^7; sbit it0=TCON^0; sbit it1=TCON^2; sbit bzr=P3^5; sbit lock=P3^7; //sbit move=P3^0; sbit drcl=P3^4; sbit dupkey=P3^1;

//LCD connected to port 1 //LCD control pins->rs, rw, en

sbit m1 =P2^4; // shoul be connected to p1 transtr pins sbit m2=P2^5;


Department of Electronics

27

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

sbit kc=P2^0; sbit ko=P2^1; sbit k1=P2^2; sbit k2=P2^3;

// mobile keys

sbit row_0=P0^3; sbit row_1=P0^1; sbit row_2=P0^0; sbit row_3=P0^6; sbit col_0=P0^2; sbit col_1=P0^4; sbit col_2=P0^5; //sbit col_3=P1^7;

//Keypad connected to P1

sbit key_pressed=P1^7; //Key pressed @ P2.4

code unsigned char msg1[]={'w','r','o','n','g',' ','c','o','d','e',0}; code unsigned char msg2[]={'c','o','r','r','e','c','t',' ','c','o','d','e',0}; code unsigned char msg3[]={'O','F','F','E','R','I','N','G',' ','B','O','X',0}; code unsigned char msg4[]={'S','E','C','U','R','I','T','Y',' ','S','Y','S','T','E','M',0};
Department of Electronics

28

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

code unsigned char msg5[]={'e','n','t','e','r',' ',0}; code unsigned char msg6[]={'s','e','c','u','r','i','t','y',' ','c','o','d','e',0}; code unsigned char msg7[]={'a','c','c','e','s','s',' ','d','e','n','i','e','d',0}; code unsigned char msg8[]={'a','c','c','e','s','s',' ','g','r','a','n','t','e','d',0}; code unsigned char msg9[]={'c','a','l','l','i','n','g',0 }; code unsigned char msg10[]={'P','o','l','i','c','e',' ','S','t','a','t','i','o','n','.','.',0}; code unsigned char msg11[]={'d','o','o','r',' ','u','n','l','o','c','k','e','d',0}; code unsigned char msg12[]={'d','o','o','r',' ','l','o','c','k','e','d',0}; code unsigned char msg13[]={'d','u','p','l','i','c','a','t','e',' ','k','e','y','!',0}; code unsigned char msg14[]={'b','o','x',' ','n','o','t',' ','i','n',' ','p','l','c','e',0}; code unsigned char msg15[]={'P','A','S','S','W','O','R','D',0}; code unsigned char sc[]={'1','2','3','4',0}; unsigned char rc[4];//recvd cde unsigned char drpn=0; void ms_delay(unsigned char delay_time)//milli-second delay { unsigned int m,n; for(n=0;n<=delay_time;n++) ms delay { //delay_time* 1 //secret cde

Department of Electronics

29

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

for(m=0;m<1275;m++); delay } }

//1 ms

void lcd_ready(void) Checking LCD's busy flag before using LCD { busy = 1; busy as i/p rs = 0; //Select command register rw = 1; //Select read from LCD while(busy==1) //Check busy flag { en = 0; //Enable -> High to low ms_delay(1); ms delay en = 1; }
Department of Electronics

//LCD ready =>

//Set

//1

30

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

return; }

void lcd_write(void) {

//Write to LCD

//(Commom portion for lcd_data & lcd_cmd) rw = 0; //Select write to LCD en = 1; //Enable -> High to low ms_delay(1); ms delay en = 0; } //1

void lcd_cmd(unsigned char value)//LCD command write =>Writing commands to LCD { lcd_ready(); //Checking LCD's busy flag before using LCD lcd = value; value to LCD data line
Department of Electronics

//Move

31

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

rs = 0; //Select command register lcd_write(); return; }

void lcd_data(unsigned char value)//LCD data write =>Writing data to LCD { lcd_ready(); //Checking LCD's busy flag before using LCD lcd = value; value to LCD data line rs = 1; //Select data register lcd_write(); LCD return; } //Write to //Move

void lcd_display(unsigned char *addr,unsigned char pos) {


Department of Electronics

32

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

lcd_cmd(pos); //LCD address while(*addr!=0) end of array { lcd_data(*addr); //Displaying value from array addr++; } return; } //Point to next address //While

void lcd_init(void) //LCd initialization { lcd_cmd(0x38); //2 lines, 5x7 matrix

lcd_cmd(0x0C); //LCD on, cursor on lcd_cmd(0x01); lcd_cmd(0x06); lcd_cmd(0x80); } void call(void)//disply callig police
Department of Electronics

//LCD clear //Shift cursor right //Line 1, position 0

33

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

{ lcd_cmd(0x01); lcd_display(&msg9,0x80); lcd_display(&msg10,0xc0); }

void mobile(void) { bzr=0; kc=1; ms_delay(600); kc=0; ms_delay(100); kc=1; ms_delay(600); kc=0; ms_delay(100); k1=1; ms_delay(1000); k1=0;
Department of Electronics

//clear

//clear

//press 1 for speed dial

34

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

ms_delay(9000);// call for one minut ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(7000); ms_delay(9000);
Department of Electronics

35

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000);// call for one minut ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000);
Department of Electronics

36

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(7000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000);
Department of Electronics

37

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000);// call for one minut ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000);
Department of Electronics

38

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(7000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000);
Department of Electronics

39

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ko=1; ms_delay(200);// cut the call ko=0; ms_delay(100); kc=1; ms_delay(600); kc=0; ms_delay(100); kc=1; ms_delay(600); kc=0; ms_delay(100); k2=1; ms_delay(1000); k2=0;
Department of Electronics

//clear

//clear

40

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

ms_delay(7000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(7000); ms_delay(9000); ms_delay(9000);
Department of Electronics

41

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000);// call for one minut ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000);
Department of Electronics

42

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(7000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000);
Department of Electronics

43

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000);// call for one minut ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000);
Department of Electronics

44

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(7000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000);
Department of Electronics

45

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ko=1; ms_delay(100); ko=0; ms_delay(100); kc=1; ms_delay(600); kc=0; ms_delay(100); kc=1; ms_delay(600); kc=0; //clear //clear

} void ex0(void)interrupt 0 //intr for keypad { key_enable=0x01;


Department of Electronics

46

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

ii=0; for(i=0;i<4;i++) { rc[i]='0';

} lcd_cmd(0x01); lcd_display(&msg5,0x80); lcd_display(&msg6,0xc2); ms_delay(6500); lcd_cmd(0x01); lcd_display(&msg15,0x84); lcd_cmd(0xc0);

void buzzer(void) { while(1) {


Department of Electronics

47

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

bzr=1; ms_delay(250); bzr=0; ms_delay(450); } } void ex1(void)interrupt 2 { IE=0x00; call(); mobile(); buzzer(); lock=1; //intr for tmpr

} void enter(unsigned char num) { if(key_enable==0x01) first. { rc[ii]=num;


Department of Electronics

//used t check if * is ressed

48

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

ii++; } return;

void cmr(void) {

//comparing the codes

key_enable=0x00;

//else { for(i=0;i<4;i++) { if(rc[i]==sc[i]) { //j=0; } else


Department of Electronics

49

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

{ j++; } } if(j==0&&ii<5) { lcd_display(&msg2,0x80); cde //crrect

ms_delay(1000); m1=1;//rotate the motor to opn m2=0; ms_delay(4000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(4000);

m1=0;
Department of Electronics

50

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

m2=0; drpn=1; //lcd_cmd(0x01); lock=1;//unlock the door led sink lcd_display(&msg11,0xc0); cc=0;

} else { lcd_display(&msg1,0x80); cc++; if(cc>2) { lcd_display(&msg7,0xc0);//dislay access denined aftr 3 try //now call function for gsm call ms_delay(4000); call(); mobile(); buzzer();
Department of Electronics

//wrng cde

51

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

} } } j=0; }

void key_scan(void) { while(1) { if(key_enable==0x00) return; else { P0=0x0Fe; bzr=0; row_0=0; //Make Row 0 = 0

Department of Electronics

52

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

if(col_0==0) 0 { while(col_0==0); lcd_data('*'); enter('1'); key_pressed=1; ms_delay(10); key_pressed=0; } else if(col_1==0) 1 { while(col_1==0); lcd_data('*'); enter('2'); key_pressed=1; ms_delay(10); key_pressed=0; }

//Check column

//Check column

Department of Electronics

53

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

else if(col_2==0) 2 { while(col_2==0); lcd_data('*'); enter('3'); key_pressed=1; ms_delay(10); key_pressed=0; }

//Check column

row_0=1; //Make Row 0 = 1 row_1=0; //Make Row 1 = 0 if(col_0==0) 0 { while(col_0==0); lcd_data('*'); enter('4');
54 Govt.Polytechnic

//Check column

Department of Electronics

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

key_pressed=1; ms_delay(10); key_pressed=0; } else if(col_1==0) 1 { while(col_1==0); lcd_data('*'); enter('5'); key_pressed=1; ms_delay(10); key_pressed=0; } else if(col_2==0) 2 { while(col_2==0); lcd_data('*'); enter('6'); key_pressed=1;
Department of Electronics

//Check column

//Check column

55

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

ms_delay(10); key_pressed=0; }

row_1=1; //Make Row 1 = 1 row_2=0; //Make Row 2 = 0 if(col_0==0) 0 { while(col_0==0); lcd_data('*'); enter('7'); key_pressed=1; ms_delay(10); key_pressed=0; } else if(col_1==0) 1 {
56 Govt.Polytechnic

//Check column

//Check column

Department of Electronics

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

while(col_1==0); lcd_data('*'); enter('8'); key_pressed=1; ms_delay(10); key_pressed=0; } else if(col_2==0) 2 { while(col_2==0); lcd_data('*'); enter('9'); key_pressed=1; ms_delay(10); key_pressed=0; } //Check column

row_2=1; //Make Row 2 = 1

Department of Electronics

57

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

row_3=0; //Make Row 3 = 0 if(col_0==0) 0 { while(col_0==0); lcd_data('*'); //* is select key //Check column

//lcd_cmd(0x01); //m=1; //ii=0;

key_pressed=1; ms_delay(10); key_pressed=0; } else if(col_1==0) 1 { while(col_1==0); lcd_data('*'); enter('0'); key_pressed=1;


Department of Electronics

//Check column

58

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

ms_delay(10); key_pressed=0; } else if(col_2==0) 2 #is the enter key { while(col_2==0); lcd_cmd(0x01); m=0; cmr(); // cmare sc and rc //Check column

key_pressed=1; ms_delay(10); key_pressed=0; } row_3=1; //Make Row 3 = 1 } } return; } void close()//check for drcl
Department of Electronics

59

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

{ if(drpn==1)//cosing the door once { m1=0; m2=1;//reversing the motor to close ms_delay(4000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(9000); ms_delay(4000); lcd_cmd(0x01); lcd_display(&msg12,0x80); m1=0; m2=0; drpn=0; lock=0;// led in sink; ms_delay(6500); lcd_cmd(0x01); lcd_display(&msg3,0x82);
Department of Electronics

60

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

lcd_display(&msg4,0xc0); key_scan(); } } void moving(void) { lcd_cmd(0x01); lcd_display(&msg14,0x80);

} void main() { P0=0X00; kc=0; ko=0; k1=0; k2=0; m1=0; m2=0; bzr=1;//sinkind mode lock=0;//lock the door
Department of Electronics

61

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

IE=0x85; it0=1; it1=1; lcd_init(); lcd_display(&msg3,0x82); lcd_display(&msg4,0xc1); while(1) { //move=1; //lcd_display(&bjt,0x85); if(drcl==0) { close(); } key_scan();

} }

PCB LAYOUT

Department of Electronics

62

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

Department of Electronics

63

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

FABRICATION OF PCB
Making a Printed Circuit Board is the first step towards building electronic equipment by any electronic industry. We should keep in mind that quality of soldering affects the quality of the output. The procedure for fabricating the PCB for setting up the circuit of any multipurpose project is described below. PCB Making: The making of PCB is as much as art on a technique particularly so when they are to fabricated in very small numbers. There are several ways of drawing PCB patterns and making the final boards. The making of PCB essentially involves two steps:
Department of Electronics

64

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

1. Preparing PCB drawing 2. Fabricating PCB from the drawing The traditional method of drawing with complete placement of parts, taking a photographic negative of the drawing, developing the image of the negative formed on photo sensitized copper plate and dissolving the excess copper by etching is a standard practice being followed by large scale operations. However for small-scale operations, where large numbers of copies are not required, the cost saving method presented here may be adopted. PCB Drawing: Making of PCB drawing involves placement of components, locating holes, optimum area each component should occupy shape and size of pads for the components, track size and spacing and prevention of overcrowding of components at a particular area. With these details the sketch of the PCB is made. For anchoring leads of component 1mm diameter holes and for fixing PCB holding screws to the 3mm holes diameter can be made. Following these hints, a sketch of PCB is made. PCB Fabrication: The fabrication of the PCB starts by transferring the PCB drawing onto a copper clad sheet. For a small number of PCB, a direct photographic transfer of the PCB drawing from a negative image of the drawing to a photo sensitized copper clad sheet is carried out. The copper from the unexposed area is later etched away. For large quantity production, screen printing method is used to transfer the PCB drawing image to the copper clad sheet. For etching the copper clad sheet 20-30grms of ferric chloride 75ml of water heated to about 60degree Celsius may be used . The copper clad sheet is placed in the solution with its copper side upwards in a plastic tray. Stirring the solution helps in speedy etching. The dissolution of unwanted copper would take about 45min. If etching takes longer, the solution may be heated again and the process is repeated. The paint on the pattern can be removed by rubbing with a rag soaked in thinner, turpentine or acetone. The PCB can then be washed and dried.
Department of Electronics

65

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

APPLICATION

The pads are drilled with proper drill sizes of 0.9mm, 1mm, 3mm etc for the leads and mounting holes. Basically this project is use as a security purpose. We are using here this project for providing the security to our home, similarly we can use this project to protect any restricted area like power plant security, Border security etc. Project can be use to operate any device automatically, in this application the interruption of the infrared waves is use to operate the device. It can use for military purpose. It can be use as Power supply regulators.

MERITS AND DEMERITS


Advantages
Unauthorized access can be avoided. Easy to use and secured over a long period of time. Limited place is required. No need to connect this system to a P.C always.

Disadvantages
Identity theft. costly Very little power available to digital portion of the IC, limited functionality. Lack of standards and protocols

Department of Electronics

66

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

APPENDIX

Department of Electronics

67

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

AT89C51
Features
Compatible with MCS-51 Products 8K 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 256 x 8-bit Internal RAM 32 Programmable I/O Lines Three 16-bit Timer/Counters Eight Interrupt Sources Programmable Serial Channel Low-power Idle and Power-down Modes

Description
The AT89C51 is a low-power, high-performance CMOS 8-bit microcomputer with 8K 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 80C51 and 80C52 instruction set and pinout. The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional nonvolatile memory programmer.

Department of Electronics

68

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

Absolute Maximum Ratings


Operating Temperature.......................................... -55C to +125C Storage Temperature ............................................. -65C to +150C Voltage on Any Pin with Respect to Ground .........-1.0V to +7.0V Maximum Operating Voltage .................................. 6.6V DC Output Current................................................... 15.0 mA
DC CHARACTERISTICS

Department of Electronics

69

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

External Program and Data Memory Characteristics

74C922- 16 KEY ENCODER


These CMOS key encoders provide all the necessary logic to fully encode an array of SPST switches. The keyboard scan can be implemented by either an external clock or external capacitor. These encoders also have on-chip pullup devices which permit switches with up to 50 kX on resistance to be used. No diodes in the switch array are needed to eliminate ghost switches. The internal debounce circuit needs only a single external capacitor and can be defeated by omitting the capacitor. A Data Available output goes to a high level when a valid keyboard entry has been made. The Data Available output returns to a low level when the entered key is released, even if another key is depressed. The Data Available will return high to indicate acceptance of the new key after a normal debounce period; this two-key rollover is provided between any two switches. An internal register remembers the last key
Department of Electronics

70

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

pressed even after the key is released. The TRI-STATE outputs provide for easy expansion and bus operation and are LPTTL compatible.
Features

50 kX maximum switch on resistance On or off chip clock On-chip row pull-up devices 2 key roll-over Keybounce elimination with single capacitor Last key register at outputs TRI-STATE outpust LPTTL compatible Wide supply range 3V to 15V Low power consumption

Department of Electronics

71

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

DC Electrical characteristics

Department of Electronics

72

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

Department of Electronics

73

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

EEPROM 24C08
Features Low-voltage and Standard-voltage Operation

2.7 (VCC = 2.7V to 5.5V) 1.8 (VCC = 1.8V to 5.5V) Internally Organized 128 x 8 (1K), 256 x 8 (2K), 512 x 8 (4K), 1024 x 8 (8K ) or 2048 x 8 (16K) 2-wire Serial Interface Schmitt Trigger, Filtered Inputs for Noise Suppression Bi-directional Data Transfer Protocol 100 kHz (1.8V) and 400 kHz (2.5V, 2.7V, 5V) Compatibility Write Protect Pin for Hardware Data Protection 8-byte Page (1K, 2K), 16-byte Page (4K, 8K, 16K) Write Modes Partial Page Writes are Allowed Self-timed Write Cycle (5 ms max) High-reliability Endurance: 1 Million Write Cycles Data Retention: 100 Years Automotive Grade, Extended Temperature and Lead-free/Halogen-free Devices Available
8-lead PDIP, 8-lead JEDEC SOIC, 8-lead MAP, 5-lead SOT23, 8-lead TSSOP and 8-ball dBGA2 Packages Absolute Maximum Ratings Operating Temperature...................................... -55 C to +125C Storage Temperature ......................................... -65 C to +150C Voltage on Any Pin with Respect to Ground ...-1.0V to +7.0V Maximum Operating Voltage ............................ 6.25V DC Output Current............................................. 5.0 mA

Department of Electronics

74

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

BC547 Transistor:

Department of Electronics

75

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

This device is designed for use as general purpose amplifiers and switches requiring collector currents to 300 mA. Sourced from Process 10. See PN100A for characteristics. NOTES: 1) These ratings are based on a maximum junction temperature of 150 degrees C. 2) These are steady state limits. The factory should be consulted on applications involving pulsed or low duty cycle operations. Absolute Maximum Ratings

Department of Electronics

76

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

Relay

(12V,

200

ohm):

A relay is an electrical switch that opens and closes under control of another electrical circuit. In the original form, the switch is operated by an electromagnet to open or close one or many sets of contacts. It was invented by Joseph Henry in 1835. Because a relay is able to control an output circuit of higher power than the input circuit, it can be considered, in a broad sense, to be a form of electrical amplifier. Operation:

When a current flows through the coil, the resulting magnetic field attracts an armature that is mechanically linked to a moving contact. The movement either makes or breaks a connection with a fixed contact. When the current to the coil is switched off, the armature is returned by a force that is half as strong as the magnetic force to its relaxed position. Usually
Department of Electronics

77

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

this is a spring, but gravity is also used commonly in industrial motor starters. Relays are manufactured to operate quickly. In a low voltage application, this is to reduce noise. In a high voltage or high current application, this is to reduce arcing. If the coil is energized with DC, a diode is frequently installed across the coil, to dissipate the energy from the collapsing magnetic field at deactivation, which would otherwise generate a spike of voltage and might cause damage to circuit components. If the coil is designed to be energized with AC, a small copper ring can be crimped to the end of the solenoid. This "shading ring" creates a small out-of-phase current, which increases the minimum pull on the armature during the AC cycle. [1] The contacts can be either Normally Open (NO), Normally Closed (NC), or change-over contacts. Normally-open contacts connect the circuit when the relay is activated; the circuit is disconnected when the relay is inactive. It is also called Form A contact or "make" contact. Form A contact is ideal for applications that require to switch a high-current power source from a remote device. Normally-closed contacts disconnect the circuit when the relay is activated; the circuit is connected when the relay is inactive. It is also called Form B contact or "break" contact. Form B contact is ideal for applications that require the circuit to remain closed until the relay is activated. Change-over contacts control two circuits: one normally-open contact and one normally-closed contact with a common terminal. It is also called Form C contact or "transfer" contact.
Department of Electronics

78

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

By analogy with the functions of the original electromagnetic device, a solid-state relay is made with a thyristor or other solid-state switching device. To achieve electrical isolation, a light-emitting diode (LED) is used with a photo transistor. Voltage Regulator (7805, 7809): Features:

Output Current up to 1A Output Voltages of 5, 6, 8, 9, 10, 12, 15, 18, 24V Thermal Overload Protection Short Circuit Protection Output Transistor Safe Operating Area Protection

Department of Electronics

79

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

The MC78XX/LM78XX/MC78XXA series of three terminal positive regulators are available in the TO-220/D-PAK package and with several fixed output voltages, making them useful in a wide range of applications. Each type employs internal current limiting, thermal shut down and safe operating area protection, making it essentially indestructible. If adequate heat sinking is provided, they can deliver over 1A output current. Although designed primarily as fixed voltage regulators, these devices can be used with external components to obtain adjustable voltages and currents. Internal Block Diagram:
80 Govt.Polytechnic

Department of Electronics

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

Typical Applications:

DC PARAMETERS

LOAD REGULATION
Department of Electronics

81

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

Constant Current Regulator

Notes: (1) To specify an output voltage. Substitute voltage value for "XX." A common ground is required between the input and the Output voltage. The input voltage must remain typically 2.0V above the output voltage even during the low point on the input ripple voltage. (2) CI is required if regulator is located an appreciable distance from power Supply filter. (3) CO improves stability and transient response LM78XX (KA78XX, MC78XX) FIXED VOLTAGE REGULATOR (POSITIVE):

Department of Electronics

82

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

(LM7805 Voltage Regulator) 3-TERMINAL 1A POSITIVE VOLTAGE REGULATORS

The LM78XX series of three-terminal positive regulators are available in the TO-220/D-PAK package and with several fixed output voltages, making them useful in a wide range of applications. Each type employs internal current limiting, thermal shut-down and safe area protection, making it essentially indestructible. If adequate heat sinking is provided, they can Deliver over 1A output current. Although designed primarily as fixed voltage regulators, these devices can be used with external components to obtain adjustable voltages and currents. FEATURES:

Output Current up to 1A Output Voltages of 5, 6, 8, 9, 10, 11, 12, 15, 18, 24V Thermal Overload Protection Short Circuit Protection
Department of Electronics

83

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

Output Transistor SOA Protection

BLOCK DIAGRAM:

LCD DISPLAY
Absolute Maximum Ratings

Department of Electronics

84

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

Electrical Characteristics

PIN Description

Department of Electronics

85

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

CONCLUSION
The project Locker Security system has been completed and working has been observed. entering the password. The controller then checks this

password correct or not. If its correct code the controller then actuates the relay for opening the door. When the controller opens the door it disables the tampering circuit sensors for eliminating false triggering. For closing the door a door close key is provided. When the door is closed the controller immediately enables the tamper circuitry. If a wrong password is entered more than 3 times the controller calls to the predefined number and sounds an alarm.It is a simple method and is
reliable.

Department of Electronics

86

Govt.Polytechnic

College,Nattakom

Project 2011 LOCKER SECURITY SYSTEM

REFERENCES

Electronics for you ( Oct. 2004 ) http://www.atmel.com http://www.electronics4u.com http://www.ttransenergie.com.au Microprocessors And Interfacing( Programming & Hardware)Douglas V. Hall Vedam Subrahmanayam- Power Electronics.

Department of Electronics

87

Govt.Polytechnic

College,Nattakom

You might also like