基于单片机的数字密码锁设计(含电路原理图,仿真程序)(任务书,开题报告,论文10400字,仿真程序)
摘要
在当代社会中,数字密码锁不再是一个陌生的词汇,已经逐渐进入人们生活之中,被人们普遍接受。本文设计的数字密码锁,是一种通过从外界的键盘上输入密码,密码随即被传送给单片机,通过单片机来控制电路运行和芯片工作,从而控制机械开关的开闭,实现开锁、闭锁功能的电子锁设备。数字密码锁其本身具有许多优点,比如:保密性高、使用灵活以及安全等级高等,在用户中很受欢迎,前景良好,有很大的发展空间。
本次设计,按照各部分的不同功能,将整体系统分为6个相互独立又相互关联的模块,主要包括AT89C51单片机模块、按键控制模块、LCD1602液晶显示模块、报警模块、存储模块和继电器模块等模块。单片机模块可以控制液晶显示屏显示内容、控制蜂鸣器报警和继电器的开关。液晶显示模块,通过LCD1602液晶屏,可以显示密码输入正确、错误及密码重置等等。按键模块中包含了数字键位和功能键位,它采用4×4型矩阵式键盘,向单片机输入数字信号和功能信号。而报警模块中,蜂鸣器提示音有三种情况:一声提示音表示有密码输入,两声提示音表示表示密码锁执行功能成功,三声提示音表示密码输入错误。总体而言,该密码锁具有输入、修改八位用户密码、密码错误报警和超次报警并锁定等功能,根据具体的情况还可以增添语音播报和设置随机密码等功能。本系统成本低廉,功能实用。
关键词:AT89C51;单片机设计;密码锁;控制电路
Abstract
In the modern society, the digital password is not a strange noun. It has gradually entered people's lives, and it is generally accepted by people. In this paper, the design of digital password lock, is aelectronic lock devicewhich can accept the password from the outside of the keyboard.Password was immediately transmitted to the SCM soon. Through the MCU to control the circuit operation and chip to work, so as to realize unlocking and locking functions of the electronic lock. Digital password lock has its own advantages, such as: high confidentiality, flexible use, and high security, it is very popular among users. It has good prospects and an amount of developmental space.
In this design, according to the different functions of each part, the whole system is divided into six mutually independent and interrelated modules, including AT89C51 SCM module, the keyboard control module, LCD1602 display module, alarm module, a storage module and a relay module. SCM module can control the LCD screen to display the character, control buzzer toalarm and relay switch to open or close. In the LCD module, through the LCD1602 screen, you can display the character of passwordinputcorrectly, error and password reset, etc.. Key module contains the numeral keys and function keys. It uses 4 * 4 matrix keyboard, and inputs function and digital signal to the microcontroller. And in the alarm module, buzzer sound has three conditions: a tone represents entering a password, the two tone represents the successful execution of the password lock’s function and the three tone representsinputting thewrong password. Overall, the password lock has the functions that the input and modify the eight digital password andpassword error alarm etc.According to the specific situation, thedesign can also add thefunctionof voice broadcast and random password setting etc. The system is low-cost and practical.
Keywords: AT89C51; The SCM design; Password lock; Control circuit
目录
摘要 I
Abstract II
目录 III
第一章绪论 1
1.1背景 1
1.2设计目标 2
1.3基本功能 2
1.4论文结构 2
第二章硬件电路设计 4
2.1整体设计方案 4
2.2单片机模块 4
2.2.1复位电路 5
2.2.2晶振电路 5
2.2.3单片机的引脚定义 6
2.3液晶显示模块 7
2.4按键控制模块 8
2.5 E2PROM存储模块 9
2.6蜂鸣器报警模块 9
2.7继电器模块 10
2.8本章小结 11
第三章软件设计 12
3.1主函数程序设计 12
3.2系统初始化 12
3.3显示界面 13
3.4输入密码 15
3.5执行各项功能 16
3.5.1调用E2PROM密码 16
3.5.2判断密码 17
3.5.3设置新密码 18
3.5.4蜂鸣器报警 19
3.5.5密码锁锁定 19
3.6本章小结 20
第四章软件仿真 21
4.1数字密码锁总电路图 21
4.2仿真结果 21
第五章硬件调试 25
第六章硬件调试过程中所遇到的问题 29
第七章总结 30
参考文献 31
致谢 32
|