基于单片机多功能密码锁的设计
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
基于单片机多功能密码锁的设计
摘要
在日常的生活和工作中, 住宅与部门的安全防范、单位的文件档案、财务报表以及一些个人资料的保存多以加锁的办法来解决。若使用传统的机械式钥匙开锁,人们常需携带多把钥匙, 使用极不方便, 且钥匙丢失后安全性即大打折扣。随着科学技术的不断发展,人们对日常生活中的安全保险器件的要求越来越高。为满足人们对锁的使用要求,增加其安全性,用密码代替钥匙的密码锁应运而生。密码锁具有安全性高、成本低、功耗低、易操作等优点。
单片机技术是智能化检测与控制领域应用非常普及并且具有很大潜力的技术。论文阐述一个基于单片机的液晶显示电子密码锁的设计与实现。系统采用美国Atmel公司的AT89S52单片机作为系统核心,液晶显示器LCD1602作为输出设备显示系统提示信息,4*4矩阵薄膜键盘作为输入设备,CMOS串行E2PROM存储器AT24C02作为数据存储器,配合蜂鸣器、继电器等电路构成整个系统硬件;系统软件采用汇编语言编写。设计的系统液晶显示,密码修改方便,具有报警、锁定等功能,使用便捷简单,符合住宅、办公用锁需求,具有一定的实用价值。
关键词:单片机;密码锁; AT89S52 ; LCD1602; AT24C0
Abstract
In our daily life, the security of house, company department, documents and finance forms, also some personal information always used the lock to protect them. If use the normal keys to lock out the door, we should taken many keys with ourself.That is so difficult to use. And if we lost the keys with careless, the security looks very easy to break out. As the developing of the technology,people ask for high securty machines.For satisfy this request, the cipher lock is appeared. The cipher has higher security, lower cost, lower power and easy to use.
SCM technology is very popular and has great potential in application of intelligent detection and control field. This thesis describes the design and implementation of LCD electronic password-lock system based on SCM. The system uses the product of America Atmel corporation AT89S52 as the core of system, liquid crystal monitor 1602 as the output device displaying the prompt information of system, 4*4 matrix membrane keyboard as the input device, serial E2PROM memory AT24C02 as the data storage, with buzzer, relay, and other circuits together constitute the system hardware. The software of the system is written in assembly language. The designed system display in LCD, change password easily, has the function of alarming, locking, and so on. This system is simple and easy to use, meets the demand of residential, office lock needs, has some practical value.
Key words: SCM ;Password-Lock;AT89S52 ;LCD1602;AT24C02
目录
1 绪论 (1)
2 系统设计 (1)
2.1 功能设计 (1)
2.2 结构设计 (2)
3 硬件设计 (3)
3.1 AT89S52简介 (3)
3.2液晶显示电路 (5)
3.3发声电路 (6)
3.4开锁控制电路 (6)
3.5密码存储电路 (7)
3.6键盘输入电路 (8)
3.7手动复位电路 (9)
3.8晶振电路 (9)
3.9 系统结构电路 (10)
4 软件设计 (10)
4.1 系统主程序 (11)
4.1.1 初始化及按键识别 (11)
4.1.2 按键重定位 (12)
4.1.3 保存密码 (14)
4.1.4 确认键处理 (15)
4.1.5 开锁键处理 (16)
4.1.6 改密键处理 (17)
4.1.7 校验新密码 (17)
4.2 系统相关子程序 (18)
4.2.1 按键识别子程序 (18)
4.2.2 液晶显示子程序 (20)
4.2.3 AT24C02子程序 (21)
5 系统调试与测试 (23)
总结 (26)