S

download S

of 11

description

nothing

Transcript of S

https://youtu.be/OASLaOfTZ9Q

Digital Locker System using 8051 MicrocontrollerGadgetronicx>Microcontroller>8051>8051 Projects>Digital Locker System using 8051 MicrocontrollerFrank DonaldAugust 1, 20140 Comments8051 Projects805101000000

Digital Code locker system using 8051

Microcontrollers form the most significant part of several security and surveillance systems which plays an important role in ensuring safety of our priced possession. Here we are about to see the Embedded design and programming of a Password based Digital locker system using 8051 Microcontroller. Despite the simple look this system can handle intrusions to offer high protection and also alerts the user in case anonymous person tries to break into the system.16 x 2 LCD:

162 LCD Pin diagram

16 x 2 LCD is most commonly used display in many applications, it consists of a 16 columns and 2 columns hence got the name 16 x 2 LCD. The LCD consists of a Data register which is used to write the data to be displayed and a Command register used to write the instructions needed to the display. I have written a brief article onProgramming and Interfacing LCD with 8051 Microcontrollerkindly take a look before getting started with this project.4 x 3 KEYPAD:

43 keypad

The keypad part of this project was used to feed password input and to initialize the system. I have used a 4 x 3 configuration keypad a total of 12 keys in it, you can increase the number of keys by altering the program and design. ReadProgramming and Interfacing of Keypad with 8051 Microcontrollerto obtain complete knowledge about it.DESIGN OF DIGITAL LOCKER SYSTEM:This system comprises a bit complex design in order to protect the safe from intruders and alarm the user in case any breach was detected. This design of this system comprises of three basic steps, they areINITIALIZATION: The system needs to be initialized by pressing the * key in the keypad. This locker will not respond to any of the key press before initialization using * key. It will Turn ON the LCD and count of trials is initialized to zero. A command Enter Password in the LCD and blink of cursor will convey that the system is ready for password input.PASSWORD INPUT: The strength of the password in our system is 4 characters. The password input can be fed into the system by using keys from 1,29 As soon as you enter four characters controller will verify if the entered password matches with the system password. Based on the password verification by the controller there will be two cases totally.CASE 1: If the password matches, LCD will display as Message Locker Open and relay will gets activated. After the usage of the protected locker, you need to turn off the system by means of pressing # key in the keypad The relay as the system will gets turned off.CASE 2: If the password doesnt match , LCD will display a Message Wrong Password in it and the trial count will be incremented by one in the microcontroller. Then the user have to initialize the system by pressing * before making the next try. If a user entered the correct password in the second attempt then the trail count will be back to zero and then the user have to lock the system after usage after pressing # But if the user failed to enter correct password for three continuous attempts, then alarm will start to alert the security surrounding there. Then the system will not respond to any of the key inputs therefore the intruder cannot stop the alarm. The alarm can be stopped only by turning off the system which should be accessible only to the orginal user.TURNING SYSTEM OFF: Now the Last thing after usage of the system is to turn them off using the # key. This applies only in the case if the user entered correct password. If the number of trial gets over the system enters into to alert mode and cannot be turned off using # during that period of time.WATCH THE SIMULATION VIDEO:CODE:1. #include2. #include3. #include4. #include5. void cmdwr(void); //LCD command write sub routine 6. void datwr(void); //LCD data write sub routine7. void delay(void); //Delay function8. void check(void); //Password check function9. void answ(void); //Trial and result analysis function10. void asterisk(void); //Asterisk key input function11. void debounce_delay(void); //Keypad debounce delay functiom12. void trl_chk(void); //trial Check function13. void init(void); //system initialization14. sbit en=P3^2; 15. sbit rs=P3^0;16. sbit rw=P3^1;17. sbit relay=P3^4;18. sbit alarm=P3^7;19. code unsigned char msg[14]="Enter Password";20. code unsigned char open_msg[11]="Locker Open";21. code unsigned char lock_msg[14]="Wrong Password";22. code unsigned char array1[5]={0x38,0x0f,0x06,0x01,0x80};23. code unsigned char array2[5]={0xc0,0xc0,0xc1,0xc2,0xc3};24. unsigned data passwd[5]={0,2,9,4,0}; //Locker password initial '0'is dummy25. unsigned data digit[5];26. unsigned char i,p,k,l,m,n,f,y;27. int count=0,num=0,trial=0; //initializing count,trial and num to zero28. void main()29. {30. relay=0; //turning relay off31. alarm=0; //turning alarm off32. while(1)33. {34. P2=0xf7; //Initialization key scan35. i=(P2&0xf0);36. {37. if(i==0xe0)38. {39. init();40. goto LOOP;41. }42. }43. }44. LOOP:while(1) //Entire key scan starts45. {46. P2=0xfe;47. i=(P2&0xf0);48. {49. if(i==0xe0)50. {51. debounce_delay(); //Delay to over come keypad bounce52. count++; //incrementing count53. asterisk();54. digit[count]=1; //Setting key value55. check();56. answ(); 57. } 58. else if(i==0xd0)59. {60. debounce_delay();61. count++;62. asterisk();63. digit[count]=2;64. check();65. answ();66. }67. else if(i==0xb0)68. {69. debounce_delay();70. count++;71. asterisk();72. digit[count]=3;73. check();74. answ();75. } 76. }77. P2=0xfd;78. i=(P2&0xf0);79. {80. if(i==0xe0)81. {82. debounce_delay();83. count++;84. asterisk();85. digit[count]=4;86. check();87. answ();88. }89. else if(i==0xd0)90. {91. debounce_delay();92. count++;93. asterisk();94. digit[count]=5;95. check();96. answ();97. }98. else if(i==0xb0)99. {100. debounce_delay();101. count++; 102. asterisk();103. digit[count]=6;104. check();105. answ();106. }107. }108. P2=0xfb;109. i=(P2&0xf0);110. {111. if(i==0xe0)112. {113. debounce_delay();114. count++;115. asterisk();116. digit[count]=7;117. check();118. answ();119. }120. else if(i==0xd0)121. {122. debounce_delay();123. count++;124. asterisk();125. digit[count]=8;126. check();127. answ();128. }129. else if(i==0xb0)130. {131. debounce_delay();132. count++;133. asterisk();134. digit[count]=9;135. check();136. answ();137. }138. }139. P2=0xf7;140. i=(P2&0xf0); 141. {142. if(i==0xe0)143. {144. debounce_delay();145. for(p=0;p