Sei sulla pagina 1di 42

i

ii

PASSWORD CONTROLLER BASED APPLIANCE

G. SUMA CHANDANA K. CHETAN

(05S31A0436) (05S31A0404)

Department of Electronics & Communication Engineering

SLCs Institute of Engineering & Technology (Affiliated to JNT University, Hyderabad) Piglipur (V), Hayathnagar (M) Hyderabad-501512
2009

iii

MINIPROJECT REPORT ON

PASSWORD CONTROLLER BASED APPLIANCE


Submitted in partial fulfillment of the requirement for the award of the Degree of Bachelor of Technology in Electronics & Communication Engineering
By (05S31A0436) (05S31A0404)

G. SUMA CHANDANA K. CHETAN

Department of Electronics & Communication Engineering

SLCs Institute of Engineering & Technology (Affiliated to JNT University, Hyderabad) Piglipur (V), Hayathnagar (M) Hyderabad-501512
2009
iv

SLCs INSTITUTE OF ENGINEERING AND TECHNOLOGY


Survey No 17/2, Piglipur Village, Near Ramoji Film City, Hyderabad. 501 512 (Affiliated to Jawaharlal Nehru Technological University) Website: www.slciet.com email: enquiry@slciet.com

CERTIFICATE This is to certify that the project report entitled PASSWORD CONTROLLER BASED APPLIANCE being submitted by Miss. G. SUMA CHANDANA (05S31A0436), Mr. K. CHETAN (05S31A0404) in partial fulfillment for the award of the degree of Bachelor of Technology in Electronics and Communication Engineering to the JAWAHARLAL NEHRU

TECHNOLOGICAL UNIVERSITY is a record of bonafied work carried out by him under my guidance and supervision. The results embodied in this project report have not been submitted to any other University or Institute for the award of any Degree or Diploma.

PROF. K.V.S.S.S.S. SAIRAM Head of the ECE Department SLCs Institute of Engg & Tech

Mrs. A. RAJAKUMARI Associate Professor Internal Guide Department of ECE SLCs Institute of Engg & Tech

ACKNOWLEDGEMENT

We would like to express our appreciation to Mrs. A. RAJAKUMARI, Professor in ECE department, our project guide for her dynamic invaluable technical guidance and constant encouragement, without which we could not have completed our project work successfully. We are also grateful to Prof. K.V.S.S.S.S.SAIRAM , Head of Department in ELECTRONICS AND COMMUNICATIONS Engineering, whose guidance have provided us enough strength and confidence in attaining the goal in a designed manner. We are also very thankful to our college Principal C.SRI RAM whose constant interest and support went a long way in the timely completion of this mini project work. We feel it as a pleasure to convey our regards to P.SRIDHAR, for his esteemed guidance and support in completing the work in time. We are very thankful to our college Secretary T.SATYANARAYANA whose constant interest and support went a long way in the timely completion of this mini project work. We express our thanks to all the faculty members who have co-operated directly or indirectly in the successful completion of this mini project work.

G. Suma Chandana (05S31A0436) K. Chetan (05S31A0404)

vi

ABSTRACT
Security is a prime concern in our day-to-day life. Everyone wants to be as much secure as possible. An access control for any appliances forms a vital link in a security chain. The microcontroller based light is an access control system that allows only authorized persons to access restricted devices. Present project deals with the activation of the power supply of an electric bulb. The system is fully controlled by the 8 bit microcontroller P89V51RD2 which has a flash for the program memory. The password is stored in the flash memory. The system has a Keypad by which the password can be entered through it. The user entered password is compared with the password in the flash memory. When the entered password matches with the password stored in the memory then the relay gets activated, LCD displays as ACCESS GRANTED and the bulb glows. If the password entered is wrong then the LCD displays that ACCESS DENIED. The same password is then used to off the bulb. The system uses 16*2 alphanumeric LCD that displays the password in a secure way entered using the keypad of 4*3 push button switches. The total circuit enhances the user to provide a secured operation. The application can be used with various appliances like door lock system, alarm systems etc. The security provides an advance feature for the present home automation industry.

vii

INDEX

CHAPTER 1 : INTRODUCTION

CHAPTER 2 : BLOCK DIAGRAM

CHAPTER 3 : COMPONENTS SPECIFICATION

CHAPTER 4 : SCHEMATIC OF MOTHER BOARD

CHAPTER 5 : FLOW CHART

CHAPTER 6 : SOURCE CODE

CHAPTER 7 : APPLICATIONS & FUTURE ASPECTS

CHAPTER 8 : CONCLUSION

APPENDICES

BIBLOGRAPHY

viii

TABLE OF CONTENTS

CHAPTER NO

TOPIC

PAGE

INTRODUCTION

BLOCK DIAGRAM 2.1 System Description 2.2 System Installation 2.3 System Operation

6 7 7 8

COMPONENTS SPECIFICATION 3.1. Components List 3.1.1 P89V51RD2 Micro controller 3.1.2 MAX 232 IC 3.1.3 ULN 2003 IC 3.1.4 16*2 alphanumeric LCD Display 3.1.5 4 x 3 Keypad 3.1.6 12 V Electromagnetic Relay 3.1.7 Regulated Power Supply

9 9 9 10 12 13 14 16 17

ix

3.1.8 Adaptor 3.1.9 Wires 3.1.10 Electric Bulb as appliance.

18 18 18

SCHEMATIC OF MOTHER BOARD 4.1 Main Circuit 4.2 Power Supply Unit

19 19 19

FLOW CHART

22

SOURCE CODE

24

APPLICATIONS & FUTURE ASPECTS

34

CONCLUSION

35

APPENDICES

36 - 39

BIBLOGRAPHY

40

LIST OF FIGURES

FIGURE NO

TITLE Block Diagram of entire system Pin Configuration of Microcontroller Pin Configuration of MAX 232 IC Pin Configuration of ULN 2003 IC 16x2 alphanumeric LCD display

PAGE NO 6 9 11 12 13 14 15 15 16 16 17 19 20

2.1 3.1

3.2 3.3 3.4 3.5 3.6 3.7 3.8 3.9 3.10 4.1 4.2

Schematic of 16x2 alphanumeric LCD display 4 x 3 keypad Matrix keypad connections Electromagnetic Relay Relay Schematic Diagram Block Diagram of Power Supply Unit Schematic Diagram of Main Circuit Schematic Diagram of Power Supply Unit

LIST OF TABLES

TABLE NUM. NO

TITLE

PAGE

3.1

Pin Description of MAX232

11

xi

CHAPTER 1 1. INTRODUCTION
There are now a days in the market many different types of Home Automation Systems that provides many appliances to users which make them comfortable. The main goal of the project is to develop a very-low cost and small electronic system that provides security to the home appliances. The appliance can be light bulb, door lock system or alarming system. The Password Controller Based Lighting mainly consists of a mother board circuit that has P89V51RD2 microcontroller, MAX 232 IC and LCD display. The circuit board also connects components such as 4 x 3 Keypad, Relay, ULN 2003 IC and a Regulated Power Supply. The microcontroller has a 64kB of on-chip flash memory and 1024B of RAM. The microcontroller is programmed such that the LCD displays to enter the password which is accepted by the keypad. When this password matches with the password that is entered by the user, the ULN 2003 IC makes the relay to activate and thus the relay functions to switch the light.

The Regulated Power Supply gives 9V to ULN 2003 IC and 12V to the relay to function.

CHAPTER 2

2. SYSTEM BLOCK DIAGRAM

VCC (+5V)

LCD DISPLAY PORT 1.2 to 1.7

MAX 232

8951RD2 Micro Controller

Port 0.1 to 0.7

Key Pad (4*3)

GND

P2.0-- IN

OUT
CC

NC

Relay
NO

ULN 2003

+12V

GND

RPS
GND

Bulb
+230V

Adaptor

Power Supply

Figure 2 : Block diagram of the system

2.1

System Description:

The system for the password controller has the following components: 1. P89V51RD2 Micro controller 2. MAX 232 IC 3. ULN 2003 IC 4. 16*2 alphanumeric LCD Display 5. 4 x 3 Keypad 6. 12 V Electromagnetic Relay 7. Regulated Power Supply 8. Adaptor 9. Wires and 10. Electric Bulb as appliance.

2.2

System Installation:

The microcontroller, MAX 232 IC, LCD display, resistors, capacitors and diodes etc., are together soldered in a circuit board. The circuit is connected to the computer through a serial interface and switched ON by an adaptor connected to the mains. The microcontroller is programmed by software and the serial cable is removed. The keypad is connected to the microcontroller of port 0.1 to 0.7. Ports 1.2 to 1.7 are used for the LCD display. The port 2.0 pin of microcontroller is connected to 1st pin of ULN 2003 IC. 8th pin of the ULN 2003 IC is grounded. 9th pin is supplied with 9V from Regulated Power Supply. The 16th pin of the ULN 2003 IC is connected to the Relay. The relay has 5 pins in which 1st pin is connected to RPS for 12V power supply.2nd pin is grounded. One wire of the Power supply and one wire from the bulb are joined together and the other two wires are connected to remaining two pins. One pin is left unused.

2.3

System Operation:

Password Controller Based Lightening System is used for providing security to the appliances. The sequence of operations given below shall be followed for operating the system. 1. Switch ON the mains of the bulb, Regulated Power Supply, adapter and switch in the circuit board. 2. The LCD display prompts to enter the Password. Type in the password from the keypad provided with push button switches.

3. If the password entered is correct LCD displays as ACCESS GRANTED and the relay activates to glow the bulb. 4. If the password entered is not correct LCD displays as ACCESS DENIED.

5. Enter the correct password which makes the bulb glow and off. We can provide even a door lock in place of bulb. The operation follows same as above.

CHAPTER 3

3. COMPONENTS DESCRIPTION
This chapter gives the basic description of the main hardware components required to make a complete system.

3.1

P89V51RD2 Micro controller:

The P89V51RD2 is 80C51 microcontroller with 64kB flash and 1024 B of data RAM. The key feature of P89V51RD2 is that it achieves twice the through put at same clock frequency. The flash memory supports both parallel programming and in serial ISP. Parallel programming mode offers gang-programming at high speed, reducing programming costs and time to market. ISP allows a device to be reprogrammed in the end product under software control. The P89V51RD2 allows the flash program memory to be reconfigured even while the application is running. The pin configuration of the microcontroller is described below:

Figure 3.1. Pin configuration of microcontroller

1. Ports 0.0 to 0.7, 1.0 to 1.7, 2.0 to 2.7 and 3.0 to 3.7 are 8-bit bidirectional general purpose I/O ports. 2. amplifier. 4. Pin 20 is ground; pin 30 is used for Address Latch Enable. 5. Pin 31 is External Access Enable; Pin 40 is for Power Supply. is program store enable for external program memory. 3. Pin 9 is for reset, pin 19 and 18 are crystal 1 and 2 used for input and output inverting

3.2

MAX 232 IC:

Although devices can communicate directly if their Rx and Tx pins are connected with each other. However to reduce noise interference and increase transmission distance over wire the voltage levels of logical 0 and 1 are changed. This is usually implemented using a TTL level conversion chip, called Max-232. this chip accepts the converted high voltage values and convert them to TTL logical values and present them to microcontroller, it also accepts the logical value from microcontroller and converts it to high voltage levels for transmission. The main features of MAX 232 IC are mentioned below: Operates From a Single 5-V Power Supply with 1.0 F Charge-Pump Capacitors Operates Up To 120 kbit/s Two Drivers and Two Receivers 30-V Input Levels Low Supply Current . . . 8 mA Typical Applications TIA/EIA-232-F, Battery-Powered Systems, Terminals, Modems, and Computers The Pin diagram: MAX232 IC has 16pins . The pin diagram of MAX232 IC is shown below:

Figure 3.2 : Pin Configuration of MAX 232 IC Num 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Name C1+ V+ C1C2+ C2VT2out R2in R2out T2in T1in R1out R1in T1out GND VCC Purpose + connector for capacitor C1 output of voltage pump - connector for capacitor C1 + connector for capacitor C2 - connector for capacitor C2 output of voltage pump / inverter Driver 2 output Receiver 2 input Receiver 2 output Driver 2 input Driver 1 input Receiver 1 output Receiver 1 input Driver 1 output Ground Power supply

Table 3.1. Pin Description of MAX232

3.3

ULN 2003 IC:

The ULN 2003 IC is a high-voltage, high-current Darlington transistor array. The main features of the ULN 2003 IC are: Each consists of seven npn Darlington pairs that feature high-voltage outputs with common-cathode clamp diodes for switching inductive loads. The collector-current rating of a single Darlington pair is 500mA. The Darlington pairs can be paralleled for higher current capability. High sustaining voltage output 50V MIN. Output Clamp diodes. Applications of ULN 2003 include relay drivers, hammer drivers, lamp drivers, display drivers (LED and gas discharge), line drivers and logic buffers. The pin configuration of ULN 2003 IC is:

Figure 3.3. Pin Description of MAX232 The IC is of 16-pin monolithic linear IC. It has 7darlington pairs internally, of 7 inputs and 7 outputs i.e.1 to 7 are inputs of Darlington pairs and 10 to 16 are the outputs .8-pin is ground and 9-pin is common free wheeling diode.

3.4

16*2 alphanumeric LCD Display:

Liquid Crystal Displays are created by sandwiching a thin (10-12 micro mm) layer of a liquid crystal fluid between two glass plates. A transparent, electrically conductive film or back plane is put up on the rear glass sheet. The transparent sections of the conductive film in the shape of the desired characters are coated on the front glass plate. When a voltage is applied between a segment and the back plane, an electric field is created in the region under the segment. This electric field changes the transmission of light through the region under the segment film. Liquid crystal display or LCD is a very commonly used device in electronics projects to display data and interact with users. LCDs contain s special crystals, which change their optical characteristics, when electric current is applied to them; this makes them visible, on a contrast background.

Figure 3.4. 16x2 alphanumeric LCD display Pin Configuration: The LCD has 6 lines that can be connected directly to the PIC microcontroller pins. The 10k potentiometer connected to pin 3 is used to adjust the contrast of the display.

All unused lines should be tied to ground as shown.

Figure 3.5. Schematic of 16x2 alphanumeric LCD display

3.5

4 x 3 keypad:

Keypad is a commonly used device to get user input. Keypads are collection of push button switches arranged in the form of a matrix. So there are rows and columns of switches. The two connections of a switch are also connected in the matrix, so that the row has common connection and column has a common connection. Thus when a button is pressed a row and a column, where the button is pressed gets connected internally. The output available from keypad is arranged as rows and columns. In order to connect the keypad to microcontroller you need to pull the columns pins high with 10K pull-up resistors. The rows can be connected directly or preferably through 470 ohms current limiting resistors, as when a switch is pressed, the row pin and column pin will get short.

10

Figure 3.6. 4 x 3 keypad

Scanning and identifying the key:


The fig shows a 4 x 3 matrix connected to two ports. The rows are connected to an output port and the columns are connected to an input port. If no key has been pressed, reading the input port will yield 1s for all columns since they are all connected to high (Vcc). If all the rows are grounded and a key is pressed, one of the columns will have 0 since the key pressed provides the path to ground. It is the function of the microcontroller to scan the keyboard continuously to detect and identify the key pressed.

Figure 3.7. Matrix keypad connections

11

3.6

12V Electromechanical Relay:

A relay is a simple electromechanical switch made up of an electromagnet and a set of contacts. A relay uses an electromagnet. This is a device consisting of a coil of wire wrapped around an iron core. When electricity is applied to the coil of wire it becomes magnetic.

Figure 3.8. Matrix keypad connections

To control that devices we are using Electromagnetic switches (Relays) which are connected to ULN2003 output pins. These Relays can switch 50Hz 250V so we can directly switch the liner and household devices.

Figure 3.9. Relay Schematic Diagram

12

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

3.7 Regulated Power Supply:


Every electronic system requires one or more than one DC voltages for its operation. It is essential that these DC voltages are nicely filtered and well regulated. Power supply does the job of providing required DC voltages from available AC mains in case of mains operated systems and DC input in case of portable systems. General Block Diagram of a Power Supply Unit: The general block diagram of power supply unit is as shown in figure.

Figure 3.10. Block Diagram of Power Supply Unit

Here we use micro controller IC, ULN 2003 IC, MAX 232 IC. All these IC required supply voltage ranges from 3 to 6 volt d. c. regulated supply and relay required 12V supply. Regulated Power Supply consists of two channels upto a maximum range of 30V. one channel is assigned to relay as its electrical specification is 12v and another channel with 9 volts is assigned to current Driver chip uln 2003 IC (pin no : 9) for power supply purpose.

13

Available source for us is 230 V.A.C. mains to convert this A.C. into lower value A.C. (i.e. step down up to 15 V.A.C.) we use step down transformer of 230 V. primary to 0-15 V (500MA) secondary. After step down we rectify this A.C. to D.C. using full wave bridge type rectifier. And filter the ripple using filter conductor. For regulated +5V. d. c. and short circuit overload projection we use voltage regulator IC 7805 and for 12V we use voltage regulator IC 7812.

3.8

Adaptor :
As direct supply from switch board cannot be given to circuit, adapter is used to

step down supply voltage and bring it to desired volt i.e. 12 V essential for circuit to run. Adapter is close circuit which consist of step down transformer, rectifier etc. The adaptor connected to power supply of 220v gives output of 5 volts to the circuit board. Its output specification is 5V/1A DC.

3.9

Wires :
Wires are used for connection purpose. Wires may have single or multi-strength

of metal. They are used as per current capacity. These are insulated wires and have a low current carrying capacity and soldering metal is used to solder electronic components on PCB with the help of soldering.

3.10

Appliance Like Bulb :


The output device that is used in this project is an appliance. It can be an electric

bulb, door lock system or any appliance in home automation system.

14

Chapter 4

4. SCHEMATIC DIAGRAM OF MOTHER BOARD


The schematic diagram of the Circuit Board is shown in two parts: 1. Main Circuit. 2. Power Supply Unit

1. Main Circuit:

Figure 4.1. Schematic Diagram of Main Circuit

15

2. Power Supply Unit:

Figure 4.2. Schematic Diagram of Power Supply Unit

16

CHAPTER 5 5. FLOW CHART


Start

MSL=3fh UEPL=#00h

APL = find actual password

()

Clr LCD , Display Enter Password Length

Waiting for the user to press the keypad DELAY

Memory Location Clr 40h to 50h

(A== *) Back space

Clear LCD, Display ACCESS DENIED

N Y
A==#

UEPL ==00

N
Clr Memory Location, Clr UEPL, Clr LCD Location, Cursor Location

UEPL == APL

N
UEPL==15

Y Y
Value_UPL == APL value INC MSL MSL location = A

N Y E D A 17 C B

A E D
Clr , Display ACCESS GRANTED

Display *

Compliment Port (ON/ OFF)

RELAY

BULB ON/OFF

END

Abbreviations in Flow Chart:


MSL : Memory Starting Location = 3Fh UEPL : User Entered Password Length APL : Actual Password Length = 9959931760 ( 10 digits)

18

CHAPTER 5 SOURCE CODE:


The main loops of the source code are give below: LCD initialization org 0000h ;MOV P1,#00H ACALL LCD_INIT main function main:MOV R7,#3Fh;Starting location(Storing the Password which is user enter) mov R5,#00H ; Count for user enter pwd mov DPTR,#PASSWORD counting loop : This will count no of enterered bits in password and maniplaters the register operations by taking values from p0.7 to p0.4 output(row) and p0.3 to p0.0 input(col) still_count: CLR A MOVC A,@A+DPTR jz count_completed inc dptr Inc R2 sjmp still_count count_completed: ;Displaying the "Enter Password :" mov DPTR,#DATA1 ACALL clrscr_display ;Accepting the user password MOV A,#0C0H mov r2,#00H ; user password length ;To Find out lenght of the password

19

ACALL COMMD ACALL DELAY mov P0,#0fh input(col) in over loop keypad row scanning will takes place in a sequence from 0 to 3 for identification for pressed key like: OVER: acall delay2 mov a,P0 anl a,#0fh cjne a,#0fh,over1 sjmp k2 OVER1: clr P0.4 setb P0.5 setb P0.6 setb P0.7 mov a,P0 anl a,#0fh cjne a,#0fh,ROW0 ROW0: MOV DPTR,#KCODE0 SJMP FIND validation loop for # character(enter) valid_to_hash: backspace: cjne A,#'#',pwd_enter sjmp validation cjne R5,#00H,bk_continue LJMP K1 validation loop for * character(enter) max_length_pwd: INC R7 mov r6,01h ; row 1 selected ;P0.7 to P0.4 output(row) and P0.3 to P0.0

20

mov r1,07h MOV @R1,A mov r1,06h mov a,#'*' ; to print * on the LCD ACALL DATAWRT inc r5 loop writing data to lcd DATAWRT: ACALL DELAY MOV R4,A ANL A,#0F0H MOV P1,A SETB P1.2 SETB P1.3 NOP CLR P1.3 MOV A,R4 SWAP A ANL A,#0F0H MOV P1,A SETB P1.2 SETB P1.3 NOP CLR P1.3 RET DELAY LOOP DELAY: MOV R0,#7FH AGAIN:MOV R1,#0FFH HERE: DJNZ R1,HERE DJNZ R0,AGAIN RET ;RS=1 ;increment LCD display (count)

21

loop for lcd displaying for correct or wrong password and also assigning data bits of password: DATA1: DB "ENTER PASSWORD : ",0 PASSWORD: DB "9959931760",0 FAIL_MSG: DB "ACCESS DENIED",0 SUCC_MSG: DB "ACCESS GRANTED",0 assigning characters of keypad KCODE0: DB ' ','#','0','*'

22

CHAPTER 6
6. APPLICATIONS & FUTURE ASPECTS
Password Controller Based Lightening is very useful to provide security to any appliances. The designed system can be used for control any electrical appliance ,if the respective appliance gets placed in the position of bulb. Like a door lock system, alarming system etc. This project can be used in wide variety of areas such as i. ii. Home Automation i.e for house hold purposes Industrial Automation like schools, offices etc.

FUTURE ASPECTS: Some of the pins of the microcontroller are left unused & hence can be used in the future by defining the functions. We can control many devices by increasing the ULN2003 ICs (which are connected to the microcontroller). We may implement this project for the industrial purposes also.

This system will act according to the parameters given by the user.

23

CHAPTER 7

7. CONCLUSION:
The objective of this project was to illustrate the design and implementation of a microcontroller ( P89V51RD2 is 80C51 microcontroller with 64kB flash and 1024 B of data RAM ) controlled system that could be programmed in keil software. It is monitored by LCD and controlled with Keypad. The program is dumped in microcontroller by using Flash Magic software and interfaced with keyboard. It is connected with a sequence of components such as ULN 2003 IC which is a current driver, relay and appliance like bulb which is to check functioning. The testing as well as design and system integration is an important feature of this project. This is an example of how a practical application can be used to allow a user to control with an industrial system using the password security and firm software. This project develops essential skills and knowledge for a process control system, here a Password controlled one, but this technique could be applied to almost any industrial setting including robotics and also door lock system by using an appliance like door lock as appliance in place of bulb . The project is an example of a practical application which can be performed in an industrial setting as well as in a control laboratory. This experience develops skills in designing an security system and process control system with practical applications in an industrial setting. Through numerous experiments on the manual password entry process,it was verified that the project is an effective module for an graduate capstone project course.

24

APPENDICES APPENDIX A

25

26

APPENDIX B

27

28

BIBLOGRAPHY 1. Douglas V.Hall, Microprocessor And Interfacing, Tata McGrawHill,2nd edition, 2002. 2. Kenneth J. Ayala, The 8051 Microcontroller programming application, Penram International ,2nd edition, 2003. 3. Muhammad Ali Mazidi and Janice Gillispie Mazidi, The 8051 Microcontroller and Embedded system,PEARSON Education, 2nd edition 2002. 4. Roy Chowdary, Linear Integrated Circuits, New Age International Publications ,2nd Edition,2000.

29

30

31

Potrebbero piacerti anche