子门锁会很快引导整个中国锁具市场,这将极大的提高了管理者的工作效率和管理区域内的安全程度。 三、主要技术指标 1. 主要工作 本设计包括硬件设计和软件设计两大部分。 硬件部分:电源模块负责将DC12V电源转化成DC5V电源,设计电源电路。选用STC12C5204AD型单片机作为主控制芯片。继电器型号选择DC5V型产品,设计出驱动电路。射频模块采用WM-17TD模块,连接天线板接收射频卡的刷卡信号,设计该模块与单片机的接口电路。显示模块显示卡号和门锁状态,设计出显示电路。 软件部分:编写主程序、显示程序、单片机与射频卡模块之间的通信程序等,实现控制功能。 2. 采用的方法、手段 根据设计要求,电源电压选择DC12V,采用7805芯片将DC12V电源转化成DC5V电源。选用STC12C5204AD型单片机作为主控制芯片,采用SKDIP28封装。射频模块采用WM-17TD模块,将该模块与单片机串行通讯口直接相连。显示模块采用LCD1602显示,使用单片机的P1口和P2口与LCD1602相连。对以上各个电路使用Protel作图软件绘制出电路原理图,生成PCB图,做出实物。 四、预期达到的结果 刷卡时将从卡里读出的数据进行校验,校验正确后,吸合门锁继电器,模拟开门;如果校验失败,则门锁继电器不动作。 指导教师签字 时 间 年 月 日
摘 要
本设计是以单片机为控制芯片,设计了射频卡电子门锁控制系统,以便于提高门锁的安全性。
系统由主控模块、电源模块、射频模块、显示模块、门锁驱动模块五部分组成。单片机作为主控芯片,直接与射频卡之间进行数据传送,控制其他模块工作。电源模块将输入电源12V转换成5V电源,为电路中各模块提供电源;射频模块负责读取卡的信息,并和单片机进行数据传送;显示模块采用LCD1602显示器,显示卡号;驱动模块采用三极管驱动DC5V继电器动作,实现模拟开门。软件部分采用Keil C软件编程,能够实现单片机对各个模块控制。
最终实现:刷卡时,单片机对卡号进行校验,校验成功后,上传卡号并显示刷卡的卡号,同时驱动继电器动作,实现模拟开门。
关键词:射频卡 单片机 液晶显示器
Abstract
This design with a Radio Frequency card electric lock control system takes single-chip microcomputer as the control chip to promote the security of doors.
The system consists of the following five parts: the master control module, the power supply module, the Radio Frequency module, the show module and the lock drivers module. As the master chip, the power supply module takes control over other modules and performs data transfer with Radio Frequency card directly. The power supply module converts the incoming power from 12V into 5V as well as provides power source to each modules in the electric circuit. The Radio Frequency module is in charge of reading the information of the card as well as performing the data transfer with single-chip microcomputer. The show module adopts monitor LCD1602 to display card number. The drive module adopts triode driver DC5V relay actuation to realize analog door opening. The software adopts Keil C software programming partially to fulfill the control of single-chip microcomputer over other modules.
The final realization of design: when swiping the card, microcomputer checks card number, if the check is successful, it will uploads the card number and displays the credit card number, simultaneously, drives the relay for action and realizes simulating open of the door.
Key words:Radio frequency card MCU LCD
目 录
第1章 绪论 ····································································································································· 1 1.1 课题研究的目的意义 ·············································································································· 1 1.2 国内外研究现状 ····················································································································· 2 1.3 论文研究内容 ························································································································· 2 第2章 基于射频卡的电子门锁设计要求及方案 ············································································ 3 2.1 设计要求 ································································································································· 3 2.2 设计方案 ································································································································· 3 第3章 系统主要元器件介绍 ·········································································································· 5 3.1 单片机介绍 ····························································································································· 5 3.2 MAX232芯片和RS-232介绍 ································································································ 9 3.2.1 MAX232的电气特性 ······································································································ 9 3.2.2 RS-232串口的电气特性 ································································································· 9 3.3 LCD显示器 ···························································································································10 3.4 WM-17TD射频刷卡模块 ······································································································12 3.4.1 射频卡工作原理 ·············································································································12 3.4.2 射频模块及其工作方式 ··································································································13 3.4.3 射频模块存贮结构 ·········································································································14 3.4.4 射频模块通讯协议 ··············································································································15 3.5 DC5V继电器 ·························································································································17 3.6 稳压芯片 ································································································································18 第4章 硬件电路设计 ·····················································································································20 4.1 单片机最小系统 ····················································································································20 4.2 继电器驱动电路 ····················································································································21 4.3 射频模块电路 ························································································································21 4.4 电源电路 ································································································································22 4.5 LCD显示电路 ·······················································································································22 第5章 软件设计 ····························································································································24 5.1 主程序模块 ····························································································································24 5.2 射频卡上传卡号 ····················································································································25 5.3 LCD显示模块 ·······················································································································26 第6章 结论 ····································································································································28 参考文献 ···········································································································································29 致谢 ···················································································································································30 附录 ···················································································································································31
I
附录A 外文资料 ·························································································································31 附录B 电路原理图 ······················································································································46 附录C PCB布局图 ·····················································································································47 附录D 源程序 ·····························································································································48
II