摘 要:研究并設計一種基于單片機的紅外遙控電子密碼鎖,介紹了系統軟硬件的實現原理及實現方法。系統在不擴展任何外圍芯片的情況下,能夠實現密碼修改、按鍵提示、密碼錯誤報警、超次提示、本機開鎖、遙控開鎖等功能,而且當按鍵間隔超時時,有自動復位的特點。系統成本低、可靠性高、使用方便,值得廣泛應用。
關鍵詞:電子密碼鎖; 紅外遙控; 單片機; 自動復位
中圖分類號:TP274 文獻標識碼:A
文章編號:1004-373X(2010)13-0159-03
Design and Implementation of Infrared Remote Control Code Lock
MA Dong-mei, QU Xia
(Jiangsu Polytechnic University, Changzhou 213016,China)
Abstract: A kind of infrared remote electronic code lock based on single-chip microcomputer is researched and designed, whose theory and method of the software and hardware are introduced. The system contains code modification, button cue, wrong code alarm, local unlock and remote control without expanding any peripheral chips. The system has characteristic of automatic reset when there′s no button pressed after another in three seconds. The system is safe and reliable,easy to use,worthy of widely use, and has low cost.
Keywords: electronic code lock; infrared remote control; single-chip microcomputer; automatic reset
0 引 言
隨著科學技術的進步和社會經濟的發展,電子密碼鎖取代傳統的機械鎖已成為一種必然的趨勢[1]。以往基于單片機的密碼鎖系統,直接將編好的密碼程序存儲在片內EPROM中,但不易實現密碼的修改;如要完成修改密碼功能,多采用片外串行E2PROM實現[2]。本文研究并設計的一種基于單片機的紅外遙控電子密碼鎖,不但具有普通密碼鎖智能控制上鎖、開鎖、報警等特點,而且在不擴展E2PROM的情況下,可以實現8位密碼任意修改的功能,節省了硬件資源,減小了系統體積,這是本設計的一個創新點。另外還增加了遙控開鎖的特點。所以該系統不但成本低、保密性強,更適用于那些正常人體不宜接近的特殊場合,比如高輻射區、高傳染區等。
1 系統硬件設計方案
1.1 系統總體設計
系統主要由紅外發射模塊和本機處理接收模塊兩部分構成,系統總體設計框圖如圖1所示。發射模塊和本機處理接收模塊的核心分別采用AT89C2051和AT89S52單片機。紅外信號的收發通過串口進行通信,兩部分的串口工作方式及通信波特率的設置相同[3]。……