Tải bản đầy đủ (.docx) (57 trang)

Automatic door system using password and rfid card

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (4.39 MB, 57 trang )

CONTENTS

CATEGORY OF FIGURE.............................................................................................IV
CATEGORY OF TABLE................................................................................................V
LIST OF ACRONYMS...................................................................................................VI
CHAPTER 1. OVERVIEW OF TOPIC..........................................................................1
1.1 INTRODUCTION TO THE TOPIC........................................................................................1
1.2 RESEARCH SUBJECTS..................................................................................................1
1.3 RESEARCH SCOPE.......................................................................................................1
1.4 EXPECTED RESULTS....................................................................................................1
CHAPTER 2. THEORETICAL BASIC..........................................................................3
2.1 MICROCONTROLLERS.................................................................................................3
2.2 RFID APPLICATION.............................................................................................13
2.3 KEYPAD (3X4)..........................................................................................................15
2.4 LIQUID-CRYSTAL DISPLAY (LCD)...........................................................................16
2.5 ELECTROMAGNETIC DOOR LOCK..............................................................................18
CHAPTER 3. BLOCK DIAGRAM AND CONTROL ALGORITHMS....................20
3.1 BLOCK DIAGRAM..........................................................................................................20
3.2 CONTROL ALGORITHMS...............................................................................................21
CHAPTER 4. CIRCUIT DESIGN AND MODEL CONSTRUCTION......................22
4.1 CIRCUIT DESIGN......................................................................................................22

4.1.1 Principle diagram.................................................................................................22
4.1.2 PCB layout............................................................................................................23
4.1.3 Actual circuit.........................................................................................................24
4.2.2 Complete project...................................................................................................25
CHAPTER 5. EXPERIMENT........................................................................................26

5.1 EXPERIMENTAL PROGRESS.......................................................................................26
5.2 EXPERIMENTAL RESULTS..........................................................................................26


CHAPTER 6. OUTCOME..............................................................................................34

6.1 ADVANTAGES...............................................................................................................34
6.2 DISADVANTAGES..........................................................................................................34
6.3 DEVELOPMENT.............................................................................................................35

PROGRAM 36

CATEGORY OF FIGURE

1- Pic 16F877a----------------------------------------------------------------------------------4
2- PIC16F877A General Structure-----------------------------------------------------------5
3- RDM 6300----------------------------------------------------------------------------------14
4- Matrix keypad------------------------------------------------------------------------------15
5- LCD 1602A--------------------------------------------------------------------------------16
6- ASCII CODE TABLE FOR LCD------------------------------------------------------17
7- Electromagnetic door lock---------------------------------------------------------------18
8- Principle diagram on Proteus------------------------------------------------------------22
9- PCB layout---------------------------------------------------------------------------------23
10- Actual circuit-----------------------------------------------------------------------------23
11- Actual circuit-----------------------------------------------------------------------------24
12- Complete mod----------------------------------------------------------------------------24
13-Main screen--------------------------------------------------------------------------------25
14- Enter the pass-----------------------------------------------------------------------------26
15- Correct pass-------------------------------------------------------------------------------26
16- Correct card-------------------------------------------------------------------------------27
17- Incorrect pass-----------------------------------------------------------------------------27
18- Incorrect card-----------------------------------------------------------------------------28
19- Incorrectly more than 3 times----------------------------------------------------------29
20- Menu monitor----------------------------------------------------------------------------29

21- Change password------------------------------------------------------------------------29

Y

CATEGORY OF TABLE

Table 1- Table pin of pic 16F877a.............................................................................5

LIST OF ACRONYMS

RFID: Radio Frequency Identification
PIC: Programmable Intelligent Computer
LCD: Liquid crystal display
PCB: Printed Circuit Board

PROJECT OF EMPLOYED SYSTEMS
Page 1/18

CHAPTER 1. OVERVIEW OF TOPIC

1.1 Introduction to the topic
This system provides users with two options to unlock the door: entering a
password or scanning a card. If the correct password is entered, the system will give
users the option to change the password. However, users are only allowed a
maximum of three attempts to enter the password or scan the card. If this limit is
exceeded, the system will activate an alarm to alert the possibility of a thief
attempting to break in.Research purposes
Utilizing the knowledge gained from the study of microcontrollers, I aim to develop
an automatic door opening system that incorporates both a password and magnetic
card function. The purpose of this system is to enhance safety and security measures

for door access.

1.2 Research subjects
Microcontroller PIC 16F877A, LCD 1602A, ELECTROMAGNETIC DOOR
LOCK, RDM 6300, MATRIX KEYPAD.

1.3 Research scope
Smart magnetic door with accurate processing and good security, ensuring safety
for households, offices or factories.

1.4 Expected results
The door access system mandates that users either input a password or scan a
magnetic card. Upon completing these actions, the LCD display will present one of
two statuses. If the user enters the correct password and successfully scans the card,
the LCD will exhibit a correct status message. However, if incorrect information is
entered or scanned, the LCD will show an error message and trigger the buzzer. If
the number of allowed access attempts exceeds the maximum limit, an alarm siren

PROJECT OF EMPLOYED SYSTEMS
Page 2/18

will blare. This automatic door opening system also facilitates the password change
function, providing users with an option to update their password as desired.

CHAPTER 2. THEORETICAL BASIC
2.1 Microcontrollers
Microcontroller is a computer integrated on a chip, it is often used to control
electronic devices. A microcontroller, in essence, is a system consisting of a
microprocessor with sufficient performance and low cost (different from general-


PROJECT OF EMPLOYED SYSTEMS
Page 3/18

purpose microprocessors used in computers) combined with peripheral blocks such
as a microprocessor. memory, input/output modules, digital-to-analog and analog-
to-digital conversion modules, etc. In computers, modules are usually built by chips
and external circuits.

Microcontrollers are commonly used to build embedded systems. It is also used in
electrical and electronic equipment such as washing machines, microwave ovens,
telephones, DVD players, multimedia equipment or automated production lines, etc.

The processor in this system is 16F877A.

PIC16F877A is a 40-pin PIC Microcontroller and is used mostly in embedded
projects and applications. It has five ports starting from port A to port E. It has three
timers of which two are 8-bit timers and one is 16-bit timers. It supports many
communication protocols such as serial protocol, parallel protocol, I2C protocol.
The PIC16F877A supports both hardware pin interrupts and timer interrupts.

PROJECT OF EMPLOYED SYSTEMS
Page 4/18

Figure 2.1- Pic 16F877a

PROJECT OF EMPLOYED SYSTEMS
Page 5/18

Figure 2.2- PIC16F877A General Structure


Table 1- Table pin of pic 16F877a

Pin Name Function

- / MCLR: Active low

reset

1 /MCLR/VPP

- VPP: programmable

voltage input

– RA0: input/output

2 RA0/AN0 number

– AN0 : analog input

– RA1: output/import

3 RA1/AN1 numbers

– AN1 : analog input

4 RA2/AN2/VREF-/CVREF – RA2: output/import

PROJECT OF EMPLOYED SYSTEMS
Page 6/18


numbers

– AN 2: analog input

– ON-: standard (low)
voltage input of the A/D
unit

– RA3: output/import
numbers

5 RA3/AN3/VREF+ – AN3 : analog input

– VREF+ : standard

(high) voltage input of A/

D . unit

– RA4: output/import
numbers

6 RA4/TOCKI/C1OUT – TOCKI : external clock

input for timer0

– C1 OUT : 1 .
comparator output
– RA5: output/import

numbers

– AN4 : 4 . analog input

7 RA5/AN4//SS /C2OUT – SS : auxiliary SPI

selection input

– C2 OUT : 2 .
comparator output

8 RE0//RD/AN5 – RE0 : input and output

PROJECT OF EMPLOYED SYSTEMS
Page 7/18

numbers

– RD : control reading at
parallel branch port

– AN5 : analog input
– RE1 : output/import
numbers

9 RE1//WR/AN6 – WR : control writing at

parallel branch port

– AN6 : analog input

– RE2: export/import
numbers

10 RE2//CS/AN7 – CS : Control selection

chip at parallel branch

port

– AN7: analog input

11 VDD Power pin of PIC

12 VSS Ground pin

13 OSC1/CLKI External clock or quartz

oscillator input.

– OSC1 : quartz oscillator
input or external clock.
Schmit trigger input
when configured in RC
mode; another way of
CMOS.

PROJECT OF EMPLOYED SYSTEMS
Page 8/18

– CLKI: external pulse

source input. Always
associated with OSC1
functionality.

Clock or quartz oscillator
input

– OSC2 : Quartz
oscillator output. Connect
to quartz or resonator.
14 OSC2/CLKO – CLKO: in RC mode,
the output of OSC2,
equals the frequency of
OSC1 and indicates the
speed of the instruction
cycle.

– RC0 : input/output
number

15 RC0/T1 OCO/T1CKI – T1OCO : 1 . Timer

oscillator input

– T1CKI : Timer 1 .
external clock input

– RC1 : output/import
numbers


16 RC1/T1OSI/CCP2 – T1OSI: Timer 1 .

oscillator input

– CCP2 : Capture 2 input,

PROJECT OF EMPLOYED SYSTEMS
Page 9/18

compare 2 output, PWM2
. output

– RC2: output/import
numbers

17 RC2/CCP1 – CCP1 : Capture 1 input,

compare 1 output, PWM1

. output

– RC3: output/import
numbers

– SCK : synchronous

18 RC3/SCK/SCL serial clock input/output

of SPI . mode


– SCL: synchronous
serial clock input/output
of I2C mode

– RD0: output/import

numbers

19 RD0/PSP0

– PSP0 : parallel branch

port data

– RD1: output/import

numbers

20 RD1/PSP1

– PSP1 : parallel branch

port data

21 RD2/PSP2 – RD2: output/import

numbers

PROJECT OF EMPLOYED SYSTEMS
Page 10/18


– PSP2 : parallel branch
port data

– RD3: output/import

numbers

22 RD3/PSP3

– PSP3: parallel branch

port data

– RC4: output/import
numbers

23 RC4/SDI/SDA – SDI: data to SPI

– SDA: export/import
data to I2C

– RC5: output/import

24 RC5/SDO numbers

– SDO: SPI output data

– RC6: output/import
numbers


25 RC6/TX/CK – TX: asynchronous

transmission USART

– CK : USART
synchronous pulse

26 RC7/RX/DT – RC7: output/import

numbers

– RX : get disagreement
USART

PROJECT OF EMPLOYED SYSTEMS
Page 11/18

– DT : USART
synchronous data

– RD4: output/import

numbers

27 RD4/PSP

– PSP4: parallel branch

port data


– RD5: output/import

numbers

28 RD5/PSP5

– PSP5: parallel branch

port data

– RD6: output/import

numbers

29 RD6/PSP6

– PSP6: parallel branch

port data

– RD7: output/import

numbers

30 RD7/PSP7

– PSP7: parallel branch

port data


31 VSS Ground pin

32 VDD Power pin of PIC

– RB0: output/import

33 RB0/INT numbers

– INT : external interrupt

34 RB1 Export/import number

35 RB2 Export/import number

36 RB3 – RB3: output/import

PROJECT OF EMPLOYED SYSTEMS
Page 12/18

numbers

– ICPS . low voltage
programming enable pin

– Export/import numbers

37 RB4

– PortB interrupt


– Export/import numbers

38 RB5

– PortB interrupt

– RB6: output/import
numbers

39 RB6/PGC – PGC : ICSP

programming clock and

differential circuit

– PortB interrupt
– RB7: output/import
numbers

40 RB7/PGD – PGD: differential

circuit and ICSP

programming data

– PortB interrupt

2.2 RFID APPLICATION
RFID, short for Radio Frequency Identification, uses electromagnetic fields to


automatically identify and track objects equipped with special tags. Such

technology consists of an RFID tag, reader, and radio transmitter. Triggered by an

electromagnetic pulse, the queried RFID tag responds with a unique numeric value,

PROJECT OF EMPLOYED SYSTEMS
Page 13/18

allowing objects, such as goods or equipment, to be tracked. Simply put, RFID is an
automated identification method that uses data storage devices and remote
communication.

An RFID tag comprises three integral components, including a chip that stores and
processes informational data, modulation and demodulation of radio frequency
signals, an antenna for signal reception and transmission, and a substrate. The RFID
tag's data is stored in EEPROM memory.

RFID tags come in three variations- passive, active, and battery-powered passive
tags. Active tags have a power source and can send data. Passive tags are usually
cheaper since they derive energy to power the IC from radio waves. RFID tags can
be read-only with a serial number, or read/write enabled, permitting the user to
write special data to the tag. Programmable tags can be written once and read
multiple times, while blank tags can be written with an electronic product code by
the user.

When queried, RFID tags respond with their identifier (ID) information as well as
additional product or manufacturing data. Due to each RFID tag possessing a
unique serial number, an RFID system is designed to read multiple tags at once,

providing they are within the RFID reader's range.

Compact in its design, the RDM6300 RF 125kHz UART RFID transceiver module
is equipped with an RFID antenna, as well as transmission and reception circuits
utilizing the UART communication standard, set at a fixed Baudrate parameter of
9600, N, 8, 1. The accompanying RFID code will appear in the form of 10-digit
ASCII code, requiring users to select this specific encoding method in order to
accurately perceive the card code.

PROJECT OF EMPLOYED SYSTEMS
Page 14/18

Figure 2.3- RDM 6300

2.3 Keypad (3x4)
A key matrix is a grouping of buttons arranged in a grid pattern that feature rows
and columns for connectivity. The total number of available buttons is determined
by multiplying the number of rows by the number of columns. In contrast, to
command twelve buttons, we typically need sixteen General Purpose Input/Ouput
(GPIO) pins. However, by applying matrix keys, it's only necessary to utilize eight
GPIO pins instead.

PROJECT OF EMPLOYED SYSTEMS
Page 15/18

Figure 2.4- Matrix keypad

2.4 Liquid-Crystal Display (LCD)



×