Presentation is loading. Please wait.

Presentation is loading. Please wait.

Building Security and Access Control System Group Members: Abdulrahman Daher Saeed199901447 Khalid Younus Ali Kalbat199900132 Mohammed Ramadan Sarhan199905274.

Similar presentations


Presentation on theme: "Building Security and Access Control System Group Members: Abdulrahman Daher Saeed199901447 Khalid Younus Ali Kalbat199900132 Mohammed Ramadan Sarhan199905274."— Presentation transcript:

1 Building Security and Access Control System Group Members: Abdulrahman Daher Saeed Khalid Younus Ali Kalbat Mohammed Ramadan Sarhan Mohammed Numan Shehadeh

2 Executive Summary Designing and implementing a secure access and control system for an office building Designing and implementing a secure access and control system for an office building The system consists of two sites. The system consists of two sites. –system site –local site The two sites are connected using serial communication RS-232 The two sites are connected using serial communication RS-232

3 Executive Summary Local Site: where the personal computer is located and a user interface program is installed Local Site: where the personal computer is located and a user interface program is installed System site: a keypad and a Liquid Crystal Display (LCD) are located at the entrance of the system System site: a keypad and a Liquid Crystal Display (LCD) are located at the entrance of the system The LCD is used to show all the needed messages to the user to inform him/her about what to do at the entrance The LCD is used to show all the needed messages to the user to inform him/her about what to do at the entrance

4 Introduction The importance of this project lies in the fact that it serves the security for offices, hospitals, businesses or institutional buildings The importance of this project lies in the fact that it serves the security for offices, hospitals, businesses or institutional buildings The system is environmentally friendly, it doesnt pollutes the environment. The system is environmentally friendly, it doesnt pollutes the environment. The system gives access to any person who has an authorized User ID and password The system gives access to any person who has an authorized User ID and password

5 Introduction System Operation: System Operation: –The LCD will show a message to the user asking him to enter his/her User ID and password –Then it will show a wait message while the data will be transmitted to the PC via RS-232 interface –The PC compares the data with the database to check if the person should be allowed to enter or not

6 Introduction System Operation: System Operation: –If a valid User ID and password were entered, the LCD will show an acceptance message –The stepper motor will start rotating and open the door to give the person the permission to enter the building –Otherwise, if the User ID and the password were not valid, another message will be displayed showing INVALID on the LCD

7 Project Description The project is basically a Microcontroller based system The project is basically a Microcontroller based system Microchip PIC16F877 microcontroller was selected Microchip PIC16F877 microcontroller was selected The different components of the system are controlled by microcontroller The different components of the system are controlled by microcontroller

8 Project Description The system consists of the following major components: Liquid Crystal Display (LCD) System Liquid Crystal Display (LCD) System Microcontrollers and other chips Microcontrollers and other chips Sensors (Opto-Switches) Sensors (Opto-Switches) Stepper motor Stepper motor Keypad Keypad

9 System Block Diagram

10 Microcontrollers There are many companies which provide series of microcontrollers There are many companies which provide series of microcontrollers –Atmel –Motorola –Microchip Technology. The PIC16F877 microcontroller was selected The PIC16F877 microcontroller was selected The PIC microcontroller series are produced by Microchip Technology The PIC microcontroller series are produced by Microchip Technology

11 Microcontrollers The PIC microcontroller has many powerful features. The PIC microcontroller has many powerful features. It has low cost compared to other products It has low cost compared to other products It is available in the Electrical Engineering Department with its programming tools It is available in the Electrical Engineering Department with its programming tools

12 Microcontrollers Main Features: Main Features: –256 Bytes EEPROM data memory –Interrupt capability (up to 14 sources) –Three different built-in timers –8 channels 10-bit analog-to-digital converter –Universal Synchronous Asynchronous Receiver Transmitter (USART)

13 Development Tools MPLAB IDE is a Windows based Integrated Development Environment (IDE) MPLAB IDE is a Windows based Integrated Development Environment (IDE) MPLAB IDE is used to write, debug, and optimize programs in Assembly language MPLAB IDE is used to write, debug, and optimize programs in Assembly language

14 Development Tools MPLAB IDE tools is used to: MPLAB IDE tools is used to: –Assemble, compile, and link source code –Debug the executable logic by watching program flow with the simulator –Make timing measurements –View variables in watch windows –Program firmware with PICSTART Plus

15 Development Tools PICSTART PLUS is used to PICSTART PLUS is used to Program micrcontrollers PICSTART PLUS makes designing simple. PICSTART PLUS makes designing simple.

16 PIC16F877 Pin Configuration

17 Keypad Interface Keypad is used for command and data input in computer systems Keypad is used for command and data input in computer systems The user can enter the User ID number and the password by the keypad The user can enter the User ID number and the password by the keypad

18 Keypad Interface keypads are usually arranged as a simple matrix of conductors keypads are usually arranged as a simple matrix of conductors switches connect each row to each column switches connect each row to each column

19 Keypad Interface Keypad scanning mechanism: –Forcing the rows to zero by making the appropriate Port B pins outputs and writing 0s to these pins –Making the pins associated with the columns inputs and checking these pins to determine if any are 0 –Forcing the columns to zero by making the appropriate Port pins outputs and writing 0s to these pins

20 Keypad Interface Keypad scanning mechanism: –Making the pins associated with the rows inputs and checking these pins to determine which row is zero –Using the row and column numbers to look-up the key value in a table and returning this value in the W accumulator –Returning from the subroutine.

21 Stepper Motor The stepper motor is used to open and close the door The stepper motor is used to open and close the door The stepper motor moves one step at a time The stepper motor moves one step at a time In order to rotate the stepper motor specific sequence of voltages should be applied to the stator coils In order to rotate the stepper motor specific sequence of voltages should be applied to the stator coils

22 Stepper Motor Unipolar stepper motor is used since its easy to control Unipolar stepper motor is used since its easy to control Permanent magnet is used for the rotor and coils are put on the stator Permanent magnet is used for the rotor and coils are put on the stator 4 poles stepper motor has step angle of 90 degrees 4 poles stepper motor has step angle of 90 degrees

23 Stepper Motor The turn of the motor is controlled by the electric current which passes into the motor terminals The turn of the motor is controlled by the electric current which passes into the motor terminals The motor can rotate in clockwise direction or counterclockwise direction The motor can rotate in clockwise direction or counterclockwise direction

24 Stepper Motor Turning off coil A and turning on coil B will rotate the rotor in clockwise direction Turning off coil A and turning on coil B will rotate the rotor in clockwise direction Turning off coil B and turning on coil C will move the rotor one step further Turning off coil B and turning on coil C will move the rotor one step further

25 Stepper Motor Control The microcontroller was used to control the stepper motor The microcontroller was used to control the stepper motor A program was written in assembly language to control the speed and the direction of rotation of the stepper motor A program was written in assembly language to control the speed and the direction of rotation of the stepper motor

26 Stepper Motor

27 Opto-Switch The Opto-Switch is a special type of sensors used as a switch The Opto-Switch is a special type of sensors used as a switch Consists of two sections: Consists of two sections: –Infrared LED –Phototransistor There is a small gap between the two sections There is a small gap between the two sections

28 Opto-Switch The Opto-switches were used to provide a feedback to the microcontroller while the door is moving The Opto-switches were used to provide a feedback to the microcontroller while the door is moving There are three Opto-switches located on the track on which the door is sliding There are three Opto-switches located on the track on which the door is sliding The microcontroller senses the changes on these sensors and performs the proper action The microcontroller senses the changes on these sensors and performs the proper action

29 Liquid Crystal Display (LCD) LCD can operate in one of the two modes: LCD can operate in one of the two modes: –8 bits data interface mode –4 bits data interface mode 8 bits mode is easier to implement because it requires less memory size but it also requires more additional I/O lines 8 bits mode is easier to implement because it requires less memory size but it also requires more additional I/O lines

30 Liquid Crystal Display (LCD) The LCD has 11 data and control pins The LCD has 11 data and control pins D0-D7 is the bi-directional data bus D0-D7 is the bi-directional data bus R/W determines if we read from or write to the LCD R/W determines if we read from or write to the LCD According to RS pin, the data on the data bus is treated either as a command or character data According to RS pin, the data on the data bus is treated either as a command or character data

31 Liquid Crystal Display (LCD)

32 Power Supply The power supply is needed to operate the microcontroller and the other components: The power supply is needed to operate the microcontroller and the other components: –5 Vdc is needed to operate the microcontroller, LCD, and sensors –12 Vdc is needed to operate the stepper motor

33 Power Supply

34 System Integration The microcontroller supports five ports with a width of 8 bits each except for the ports A and E The microcontroller supports five ports with a width of 8 bits each except for the ports A and E The first four pins of PORTA(RA0:RA3) are configured as output ports to control the stepper motor by setting the corresponding register TRISA to ones The first four pins of PORTA(RA0:RA3) are configured as output ports to control the stepper motor by setting the corresponding register TRISA to ones The keypad is connected to seven pins of PORTB(RB1:RB7) The keypad is connected to seven pins of PORTB(RB1:RB7)

35 System Integragtion RB0 is reserved to be used as an interrupt pin to open the door directly from the computer RB0 is reserved to be used as an interrupt pin to open the door directly from the computer The three sensors used in the system are connected to PORTC(RC0:RC2) The three sensors used in the system are connected to PORTC(RC0:RC2) RC6 (TX) and RC7 (RX) are configured to send/receive data to/from the microcontroller at a baud rate of 9600 RC6 (TX) and RC7 (RX) are configured to send/receive data to/from the microcontroller at a baud rate of 9600

36 System Integration PORTD and PORTE are reserved for the LCD display module PORTD and PORTE are reserved for the LCD display module PORTD is connected to the bi-directional data bus (D0-D7) of the LCD PORTD is connected to the bi-directional data bus (D0-D7) of the LCD The three pins of PORTE(RE0:RE2) are connected to RS, RW and EN, respectively The three pins of PORTE(RE0:RE2) are connected to RS, RW and EN, respectively

37 System Integration The assembly code to configure the ports: The assembly code to configure the ports: BANKSEL ADCON1 MOVLW 0X06 MOVWF ADCON1 BANKSEL TRISE MOVLW 0X00 MOVWF TRISE MOVLW 0X00 MOVWF TRISD MOVLW 0X00 MOVWF TRISA

38 System Integration The assembly code to configure the serial port: The assembly code to configure the serial port: MOVLW 0xC7 MOVWF TRISC MOVLW SPBRG_VAL MOVWF SPBRG MOVLW 0x24 MOVWF TXSTA BANKSEL PORTE MOVLW 0x90 MOVWF RCSTA

39 System Integration A user defined byte is used for the purpose of building multifunctional subroutines (AUX) A user defined byte is used for the purpose of building multifunctional subroutines (AUX) Only six bits of the AUX byte are used by the program Only six bits of the AUX byte are used by the program UP EQU 0;USERNAME/PINCODE VINV EQU 1;INVALID/VALID MOT EQU 2;NOT MOTOR/MOTOR OPCL EQU 3;OPENNING/CLOSING WNW EQU 4;WAITING/NOT WAITING DOFFON EQU 5;DOOR OFF/ON

40 System Integration LCD initialization: LCD initialization:LCD_INIT MOVF COUNT,W CALL INIT MOVWF DAT CALL COMMANDIN INCF COUNT, F MOVLW 0X08 SUBWF COUNT,W BTFSS STATUS, Z GOTO LCD_INIT

41 System Integration After initializing the LCD module, the main part of the program starts After initializing the LCD module, the main part of the program starts The microcontroller sends commands to the LCD to write a message ENTER USERNAME The microcontroller sends commands to the LCD to write a message ENTER USERNAME The data are stored in a subroutine called USRNM_DATA The data are stored in a subroutine called USRNM_DATA

42 System Integration A memory location (DIGITS) is initialized so that the user can enter only four digits A memory location (DIGITS) is initialized so that the user can enter only four digits The data entered by the user is processed in a loop call DATAL The data entered by the user is processed in a loop call DATAL The data entered by the user is also sent to the LCD and computer The data entered by the user is also sent to the LCD and computer

43 System Integration Controlling the stepper motor Controlling the stepper motor –After entering 4 digits by the user, PLS_WAIT subroutine will be called to poll if the PIN code is valid or invalid –If the pin cod is invalid, the user will have another chance to enter his/her PIN code and only for three times –If the PIN code is valid, the program will activate the motor by setting DOFFON and WNW bits in the AUX memory location

44 System Integration

45 Database Program Database is used to store the users information such as: –User Name –User ID Numbers –User Password

46 Database Program Database usually consists of tables. Database usually consists of tables. Tables consists of fields Tables consists of fields In our case there are three fields which are: In our case there are three fields which are: –User Name –User ID –Password

47 Database Program There are several methods which are used to locate specific records in database tables There are several methods which are used to locate specific records in database tables FindFirst method is one of these methods FindFirst method is one of these methods In the visual basic program the method will try to match the input to the system with the data in the table In the visual basic program the method will try to match the input to the system with the data in the table The value of the NoMatch property indicates the success or the failure of the search operation The value of the NoMatch property indicates the success or the failure of the search operation

48 Database Program Another method is looping through all the records and testing the EOF property in each iteration Another method is looping through all the records and testing the EOF property in each iteration The EOF property indicates the end of the records in a table The EOF property indicates the end of the records in a table The above method is slower than the previous one in large databases The above method is slower than the previous one in large databases

49 Database Program The second method was used in the project to locate the records of the users The second method was used in the project to locate the records of the users The implemented code in visual basic can be divided into three parts: The implemented code in visual basic can be divided into three parts: –Declarations –Initializations –Loop

50 Database Program Declarations: Declarations: –Dim Db As DAO.Database –Dim Rst As DAO.Recordset –Dim Found As Boolean Initializations: Initializations: –Found = False –Set Db = CurrentDb() –Set Rst = Db.OpenRecordset("User)

51 Database Program Loop: Loop: Do While Not Rst.EOF And Not Found If Rst("User ID") = Val(Text1.Text) Then MsgBox "Match Found Found = True End If Rst.MoveNextLoop If Not Found Then MsgBox "No Match Found"

52 Local Site Interface The visual basic program is installed in a PC located in the local site The visual basic program is installed in a PC located in the local site The interface shows the User Name text box and the User ID text box The interface shows the User Name text box and the User ID text box There is a command button used to open the door directly from the PC There is a command button used to open the door directly from the PC

53 Local Site Interface

54 System Operation The LCD continuously shows a message to enter the User ID number The LCD continuously shows a message to enter the User ID number

55 System Operation If the user enters the number, the microcontroller reads the number and transmits it through a serial port to the computer while the LCD shows Please Wait message If the user enters the number, the microcontroller reads the number and transmits it through a serial port to the computer while the LCD shows Please Wait message

56 System Operation The visual basic program checks the existence of the user in the users database The visual basic program checks the existence of the user in the users database If the user is a registered user in the system, a valid signal is sent to the microcontroller through the serial port If the user is a registered user in the system, a valid signal is sent to the microcontroller through the serial port The microcontroller writes VALID message on the LCD The microcontroller writes VALID message on the LCD

57 System Operation Then the user is allowed to enter the pin code Then the user is allowed to enter the pin code The LCD shows ENTER PINCODE message The LCD shows ENTER PINCODE message

58 System Operation If the pin code is correct the visual basic program sends another valid signal to the microcontroller If the pin code is correct the visual basic program sends another valid signal to the microcontroller The microcontroller operates and controls the stepper motor to open the door for the user The microcontroller operates and controls the stepper motor to open the door for the user There are three sensors which provide the feedback to the microcontroller to control the opening and closing operation There are three sensors which provide the feedback to the microcontroller to control the opening and closing operation

59 System Operation If the user is not registered in the system, the local site program sends an invalid signal to the microcontroller. If the user is not registered in the system, the local site program sends an invalid signal to the microcontroller. The LCD shows INVALID message The LCD shows INVALID message

60 Conclusion & Recommendations Conclusion: Conclusion: –The system controls the access to a building using PIC microcontroller and personal computer –The implemented system is effective in terms of the cost –Low level and high level programming languages were used effectively in the project –System integration was successful

61 Conclusion & Recommendations Recommendations: Recommendations: –Microcontroller based systems should be given more interest from the department. –The students from the electrical department should learn how to implement a circuit in a printed circuit board. –The labs should be available for students at the evening time.


Download ppt "Building Security and Access Control System Group Members: Abdulrahman Daher Saeed199901447 Khalid Younus Ali Kalbat199900132 Mohammed Ramadan Sarhan199905274."

Similar presentations


Ads by Google