摘要自人们有“住所”的概念以来,锁就与人们的生活密不可分。最开始出现的机械锁简单方便,能很大程度的满足人们对锁的需求,但其弊端在于钥匙太多,或易丢失,锁的最基本功能——安全性还有待提高,特别是现代社会中,人们对于私密空间越来越重视,同时对自身财务,公司集体财物等安全的警惕性也越来越高,此时传统的机械锁显然已经落后于时代。红外电子密码锁则很好的解决了传统机械锁留下的问题,红外电子密码锁密码的输入形式多样化,完美结合了红外设备稳定不易受干扰的特点,能满足现代人对密码锁更严苛的要求。本设计密码锁采用STC89C51单片机做主系统,能实现自定义六位数密码、修改密码、红外输入密码、红外开锁、密码错误触动警报、显示密码错误与否等功能,全面满足不同人不同工作对密码锁的不同要求。关键词:STC89C5、红外密码锁AbstractSincepeoplehavetheconceptof"residence",lockhasbeeninseparablefrompeople'slife.Thefirstmechanicallocksweresimpleandconvenient,andcouldsatisfypeople'sneedsforlockstoagreatextent,buttheirdisadvantageswerethatthereweretoomanykeys,ortheywereeasytolose,andthebasicfunctionoflocks--safety--neededtobeimproved,especiallyinModernSocietyPeoplepaymoreandmoreattentiontotheprivatespace,atthesametime,theyaremoreandmorealerttothesafetyoftheirownfinancialandcompany'scollectiveproperty.Theinfraredelectroniccodelocksolvestheproblemleftbythetraditionalmechanicallockverywell.Theinputformoftheinfraredelectroniccodelockisdiversified,whichperfectlycombinesthecharacteristicsoftheinfraredequipmentwhichisstableandnoteasytobeinterferedCanmeetthemodernpeopletothepasswordlockmorestringentrequirements.ThisdesignpasswordlockusestheSTC89C51MonolithicIntegratedCircuitasthemainsystem,canrealizetheself-definitionsix-digitPassword,therevisionpassword,theinfraredinputpassword,theinfraredopensthelock,thepassworderroractuatesthealarm,displaysthepassworderrorornotandsoonfunctions,fullymeetthedifferentworkofdifferentpeopleonthedifferentrequirementsofthepasswordlock.Keywords:STC89C5,InfraredCodeLock目录第一章绪论..............................................11.1、课题背景和意义.................................................................................................................................11.2、电子密码锁发展趋势.........................................................................................................................2第二章总体设计方案的确定................................32.1电子密码锁设计的具体要求................................................................................................................32.2总体设计方案选定................................................................................................................................3第三章系统硬件设计......................................53.1设计原理...............................................................................................................................................53.2单片机STC89C51简介...........................................................................................................................63.3AT24C02存储芯片................................................................................................................................93.4LCD显示模块......................................................................................................................................103.5键盘设计...............................................................................................