Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
ii
(05S31A0436) (05S31A0404)
SLCs Institute of Engineering & Technology (Affiliated to JNT University, Hyderabad) Piglipur (V), Hayathnagar (M) Hyderabad-501512
2009
iii
MINIPROJECT REPORT ON
SLCs Institute of Engineering & Technology (Affiliated to JNT University, Hyderabad) Piglipur (V), Hayathnagar (M) Hyderabad-501512
2009
iv
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.
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 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
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
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
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
VCC (+5V)
MAX 232
GND
P2.0-- IN
OUT
CC
NC
Relay
NO
ULN 2003
+12V
GND
RPS
GND
Bulb
+230V
Adaptor
Power Supply
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
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:
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
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
3.3
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
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.
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
11
3.6
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.
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.
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
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
14
Chapter 4
1. Main Circuit:
15
16
MSL=3fh UEPL=#00h
()
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 *
RELAY
BULB ON/OFF
END
18
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