基于单片机的电子密码锁设计_毕业设计(论文).doc

基于单片机的电子密码锁设计_毕业设计(论文).doc

  1. 1、本文档共59页,可阅读全部内容。
  2. 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
基于单片机的电子密码锁设计 摘要 目前国内普遍使用的锁都是机械式的,这种锁结构简单、使用方便,但利用工具可轻易将其打开,这给用户带来极大的困扰和损失。本文介绍了一种基于STC89C52 单片机的电子密码锁的设计方法。该设计以STC89C52单片机为硬件核心,结合4×4 矩阵键盘电路、 LCD 显示电路、密码存储电路、开锁电路和声音报警电路等外围电路。利用单片机灵活的编程方法和丰富的I/O 端口,该系统能实现密码的输入、清除、比较,密码正确开锁,密码错误次数超次报警,用户修改密码等功能。 关键词:单片机;电子密码锁;矩阵键盘;声音报警 ABSTRACT At present, the widespread use of all mechanical locks, this lock structure is simple and easy to use, but easy to use tools to open it, which gives users a lot of confusion and loss.This paper introduces a design of electronic password lock which is based on the SCM of STC89C52. This design uses the SCM of STC89C52 as hardware core , combining with other peripheralcircuits such as 4×4 matrix keyboard interface circuit, password storage circuit,LCD displaycircuit,unlock circuit and voice alarm circuit. Using the flexible programming and the rich I/O port ofthe SCM ,the system can accomplish the following functions:input ,clear or compare the password,unlock when the password is correct, alarm when the wrong enter password times is over and the user can change the password. keywords:Single-Chip Microcomputer; electronic password lock; matrix keyboard; voice alarm 目录 TOC \o 1-3 \h \u ; void main() { LCD_init(); WrToROM(0x00,passwd,5); RdFromROM(0x00,passwd,5); LCD_DISPLAY(Welcome china ! Plz input passwd); while(1) { KeyDisp(); } } //***************** 80s52对键盘 **********************// #includereg51.h #includestring.h #define uchar unsigned char void LCD_DISPLAY(uchar *str); void write_com(uchar com); void write_data(uchar Data); void WrToROM(uchar Address,uchar Data[],uchar Num); void RdFromROM(uchar Address,uchar Data[],uchar Num); uchar code tab1[]={ERROR!}; uchar code tab2[]={RIGHT!}; uchar code tab3[]={0123456789*}; uchar code tab4[]={Input the codes:}; uchar code tab5[]={Input new codes:}; uchar code tab6[]={Input old codes:}; uchar mima[9] =24444; //存放用户密码和正确密码:前四位是用户输入密码,后四位是系统的正确密码 uchar passwd[5]=1111; uchar te[9]={0} ; sbit relay = P2^0; sbit beep = P2^1; /****

文档评论(0)

weidameili + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档