基于单片机的门禁系统的设计 下载本文

内容发布更新时间 : 2024/11/7 14:33:40星期一 下面是文章的全部内容请认真阅读。

洛阳理工学院毕业设计(论文)

基于单片机的门禁系统的设计

摘 要

门禁系统采用89C52 单片机作为控制核心,外围加蜂鸣器控制电路、开门指示灯电路、电控锁控制电路以及LCD液晶显示电路等。门禁系统主要由CPU、复位电路、电源指示电路、工作指示电路、振荡电路、蜂鸣器电路、门控锁电路、出门按钮、读卡模块、显示模块等组成。该门禁系统采用射频卡完成刷卡进门,按刷卡出门等功能。其工作原理为:当刷卡时,蜂鸣器响一下,如卡权限获得允许,显示模块显示卡号,同时继电器动作将门锁打开,指示灯点亮,延时一段时间后继电器再次动作将门锁锁闭,指示灯熄灭。当按下出门按钮时,继电器动作将门锁打开,指示灯点亮,延时一段时间后继电器再次动作将门锁锁闭,指示灯熄灭。当输入初始密码时,若输入正确,继电器动作将门锁打开,指示灯点亮,延时一段时间后继电器再次动作将门锁锁闭。此外,程序中还增加了射频卡权限判断的功能,当遇到合法卡时显示卡号,门锁打开,延时5s自动关闭,当遇到非法卡时不显示卡号门锁不开。本系统设计简单、性能优良,具有一定的实用性。

关键词:门禁,射频卡,电控锁,显示,控制

.

I

洛阳理工学院毕业设计(论文)

Microcontroller-based access control system design

ABSTRACT

Entrance guard system uses 89C52 single chip microcomputer as control core and periphery add a buzzer control circuit, open the door indicator light circuit, control circuit and control lock LCD display circuit, etc. Entrance guard system mainly by the CPU and reset circuit, the power indicative circuit, work instructions circuit, oscillating circuit, a buzzer circuit, door control circuit, go out and lock button reading card module, display module. The entrance guard system uses RF card complete charge take the door, according to credit to go out, and other functions. Its working principle is: when credit, a buzzer rang, such as card to be allowed to access, display module display card number, and at the same time relay action will open the door lock, indicator light, delay after period of time relay action will again only door lock, lights go out. When the press out button, the relay action will open the door lock, indicator light, delay after period of time relay action will again only door lock, lights go out. When the input password, if you input the correct, relay action will open the door lock, indicator light, delay after period of time relay action will lock door lock again. In addition, the program will also increase the RF card authority judgment function, when facing legal card showed the card number, door open, delay 10 s automatically shut off, when meeting the illegal CARDS don't show the card number locks don't open. The system is simple in design, good performance, and has practical value!

KEY WORDS: Access control, Radio frequency card, Electronically controlled lock, Display, control

.

II

洛阳理工学院毕业设计(论文)

目 录

前 言 ................................................................................................ 1 第1章 概述 ...................................................................................... 3

1.1

方案的论述 ........................................................................ 3 1.1.1 方案的选择 ................................................................. 3 1.1.2 CPU的选择 ................................................................. 4 1.1.3 射频卡的选择 ............................................................. 5

第2章 最小系统的设计 ................................................................... 6

2.1 电路图的系统设计 ............................................................... 6 2.2 最小系统的设计 ................................................................... 7

2.2.1 89C52的简述 .............................................................. 7 2.2.2 单片机资源分配 ....................................................... 10 2.2.3 硬件电路原理图的设计 ............................................ 11

第3章 硬件电路的设计 ................................................................. 12

3.1 门控锁电路设计 ................................................................. 12 3.2 显示模块设计 ..................................................................... 12

3.2.1 1602主要技术参数 ................................................... 13 3.2.2 引脚功能说明 ........................................................... 13 3.2.3 1602指令集 ............................................................... 15 3.2.4 与HD4478相兼容的芯片时序表 ............................ 16 3.2.5 显示模块电路图 ....................................................... 17 3.3 4×4矩阵键盘电路设计 ....................................................... 17 3.4 蜂鸣器电路设计 ................................................................. 18 3.5 读卡模块设计 ..................................................................... 19 3.6 控制指示灯电路设计 ......................................................... 21 第4章 门禁系统的软件设计 ......................................................... 22

4.1 KeilC51的概述 ................................................................... 22 4.2 系统主程序及流程图 ......................................................... 22 4.3 子程序流程图 ..................................................................... 25

III