CN109025528A - A kind of coded lock controller - Google Patents

A kind of coded lock controller Download PDF

Info

Publication number
CN109025528A
CN109025528A CN201710435336.4A CN201710435336A CN109025528A CN 109025528 A CN109025528 A CN 109025528A CN 201710435336 A CN201710435336 A CN 201710435336A CN 109025528 A CN109025528 A CN 109025528A
Authority
CN
China
Prior art keywords
temp
password
num
key
coded lock
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201710435336.4A
Other languages
Chinese (zh)
Inventor
不公告发明人
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hunan Bailimu Technology Co Ltd
Original Assignee
Hunan Bailimu Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hunan Bailimu Technology Co Ltd filed Critical Hunan Bailimu Technology Co Ltd
Priority to CN201710435336.4A priority Critical patent/CN109025528A/en
Publication of CN109025528A publication Critical patent/CN109025528A/en
Pending legal-status Critical Current

Links

Classifications

    • EFIXED CONSTRUCTIONS
    • E05LOCKS; KEYS; WINDOW OR DOOR FITTINGS; SAFES
    • E05BLOCKS; ACCESSORIES THEREFOR; HANDCUFFS
    • E05B49/00Electric permutation locks; Circuits therefor ; Mechanical aspects of electronic locks; Mechanical keys therefor

Abstract

The invention patent relates to a kind of coded lock controllers, the present invention is using MCS-51 series monolithic AT89S52 as main control chip, in conjunction with peripheral circuit, pin design lock control system, if can be realized input password correctly unlocks (green LED is bright), if password bad, issue alarm signal (red light emitting diodes are bright).

Description

A kind of coded lock controller
Technical field
The invention patent relates to electronic design art more particularly to a kind of coded lock controllers.
Background technique
Computer system significantly develops towards three hugeization, singualtion, networking directions.The purpose of hugeization development It is that the arithmetic speed and processing capacity of computer is continuously improved, to solve complication system calculating and high-speed data processing, such as System emulation and simulation, real-time operation and processing.Singualtion is computer system to be integrated in as far as possible a block semiconductor chip On, its object is to the reliability of computer micromation and raising system, this monolithic calculates abbreviation single-chip microcontroller.
The internal hardware structure of single-chip microcontroller and instruction system primarily directed to automatically control apply and design so monolithic Machine is also known as microcontroller (Micro Controller Unit).Computer easily can be embedded into various instrument with it In device and field control equipment, therefore single-chip microcontroller is called and does embedded microcontroller (Embedded MCU).Single-chip microcontroller is from 20 generation It has recorded since coming out the seventies, is grown rapidly with its salient feature, be widely used to household electrical appliance, intelligent toy, intelligence The fields such as energy instrument and meter, Industry Control, aerospace, by development in more than 30 years, performance was continuously improved, and kind is constantly rich Richness has formed a core force of automatic control.According to statistics, China single-chip microcontroller year capacity up to 1~300,000,000, and it is every Year is increased with about 16% speed, but the occupation rate relative to international market China is less than 1%.This illustrates single chip application There is wide prospect in China.For the technical staff for being engaged in automatic control, Fundamentals of Mono-Chip Computers and its application have been grasped Through becoming essential learning tasks.
As the improvement of people's living standards, the safety precaution of house and department in daily life and work, unit A series of safe antitheft problems such as the preservation of archive files, financial statement and some personal informations become especially prominent.Tradition Mechanical lock due to its construction it is simple, the event prized is commonplace, and people need to often carry more keys, not using pole It is convenient, once key loss safety is had a greatly reduced quality.To meet people to the requirement of lock, increase its safety, use is close Code replaces the coded lock of key to come into being.Coded lock because with high security, it is at low cost, low in energy consumption, easy to operate the advantages that, by The favor of users is arrived.
According to the relevant information, the research of electronic password lock is begun to from the 1930s, in some Code in Hazardous Special Locations Already applied.But it was that cooperative mechanical lock one works and there is such as volume is larger mostly at that time, higher cost, reliably Property it is lower the disadvantages of for the moment be difficult to popularize.
After the 1980s, with information technology, the development of integrated circuit, semiconductor technology, electronic password lock is set Meter also achieves quick progress.
There are mainly two types of schemes for coded lock design common now, and one is the schemes of medium scale integration (MSI) control, separately One is monolithic processor controlled schemes.For the scheme using integrated circuit control, coded electronic lock circuit therein is divided into volume Code circuit, control circuit, reset circuit, decoding circuit, anti-theft warning circuit, doorbell circuit, and electronic lock is mainly by input member Part, circuit (including power supply) and lock body three parts composition.The physics realization structure of obvious such scheme is complex and again The operating process that password, input password is arranged can also bring certain inconvenience to user;And monolithic processor controlled scheme is utilized, Due to the flexible Programming of single-chip microcontroller and the port I/O abundant, and its accuracy of control, it is not only able to achieve basic password Lock function, moreover it is possible to add power down storage, acousto-optic hint even addition remote control function, but it also has certain limitation, just It is the complexity of its control principle and requires designer that there is more good programming capability, debugging is relatively complicated, Otherwise program once running flies that unexpected loss will be caused.
Patent of invention content
The invention patent relates to a kind of coded lock controllers, and the present invention is using MCS-51 series monolithic AT89S52 as master control Chip is correctly unlocked (green emitting two in conjunction with peripheral circuit, pin design lock control system if can be realized input password Pole pipe is bright), if password bad, issue alarm signal (red light emitting diodes are bright).
Detailed description of the invention
Fig. 1: system structure diagram.
Fig. 2: reset circuit figure.
Fig. 3: clocking scheme.
Fig. 4: LCD display circuit figure.
Fig. 5: matrix keyboard circuit figure.
Fig. 6: warning circuit figure.
Fig. 7: program flow diagram.
Specific embodiment
In order to which the objects, technical solutions and advantages of the invention patent are more clearly understood, below in conjunction with attached drawing and implementation Example, is further elaborated the invention patent.It should be appreciated that specific embodiment described herein is only used to explain The invention patent is not intended to limit the present invention patent.
The invention patent relates to a kind of coded lock controller, the present invention uses the AT89S52 conduct of MCS-51 series monolithic Main control chip, in conjunction with peripheral circuit, pin design lock control system, if can be realized input password correctly unlocks (green send out Optical diode is bright), if password bad, issue alarm signal (red light emitting diodes are bright).
Further, user password can be arbitrarily arranged using one 4 × 4 matrix keyboard in the present invention, to improve The confidentiality of password.
Further, the present invention uses LCD display unit, improves readability, provides good man-machine interface.
Further, hardware circuit block diagram of the present invention is as shown in Figure 1, circuit is made of two large divisions: AT89S51 single-chip microcontroller And its peripheral circuit and cipher lock circuit.
Further, reset circuit of the invention as shown in Fig. 2, clock circuit as shown in figure 3, LCD display circuit such as Fig. 4 Shown, matrix keyboard circuit is as shown in figure 5, warning circuit is as shown in Figure 6.
Further, program circuit of the invention is as shown in fig. 7, program source code is as follows:
#include <reg52.h>
#define uint unsigned int
#define uchar unsigned char
#define KEY P1 // keyboard input port
Return value when #define No_key 20 // without key
The data-in port of P0 // 1602 #define lcddata
sbit lcden= P2^2;
sbit lcdrs= P2^0;
sbit lcdrw= P2^1;
sbit light= P3^0;
sbit light1= P3^1;
uchar j ;// be used to count the global variable for inputting number
uchar aa;// the global variable for being used to count in timer
uchar code table[]= " Hello!";
uchar code table1[]=" OK! " ;
uchar code table2[]="Enter please:" ;
uchar code key_table[16] =
{
1,2,3,10,
4,5,6,11,
7,8,9,12,
0,13,14,15
};
uchar password[]={9,2,0,6,0,1} ;// setting initial password
uchar save[6];// save the data inputted
uchar conflag ;// acknowledgement indicator
uchar lockflag;// keyboard mark
uchar startflag;// opening flag
void delay(uint z);// delay subfunction
void wright_com(uchar com);// write command function
void wright_data(uchar date) ;// write data function
void init();// initialization
void display_OK();// display OK
void delete();// delete last number inputted
uchar keyscan() ;// keyboard scan the program with return value
void enter_code(uchar t);// input cipher function, in the data of input deposit array and Corresponding thing is shown on screen,
void confirm();// confirmation password one by one compares the data of input with password, complete one to or not Sample is upright really,
void succeed_an();Response when // input password success,
void fail_an();It is responded when // input password failure
void lockkey();// keyboard three seconds
void reset();// complex potential function
void display_enter();// display input
void main(void)
{
uchar temp;
init();
while(1)
{
if(lockflag)
{
temp=keyscan();Also keyboard scan is carried out during // locking key
if(temp!=No_key) // clock again three seconds
{
aa=0;// counted in timer again
}
}
else
{
temp=keyscan();// it is repeatedly scanned with input, waiting inputs at any time
if(temp!=No_key) // have and just carries out following operation by key pressing
{
if(temp==10)
{
reset();
startflag=1;The set of // opening flag
}
if(startflag)
{
enter_code(temp);// every run-down keyboard will carry out single treatment, save the number of input Value
If (temp==13) // password confirming will be carried out by pressing confirmation keyboard
{
confirm();// carry out confirmation judgement
If (conflag) // password confirming is correct
{
succeed_an();// password is correct, makes corresponding reaction
}
else
{
fail_an();// password mistake, makees respective reaction
}
}
if(temp==14)
{
delete();// make delete operation
}
}
}
}
}
}
/ * * * * * * display enter********/
void display_enter()
{
uchar num;
wright_com(0x80);
for(num=0;num<13;num++)
{
wright_data(table2[num]);
}
}
/ * * * * * * display OK********/
void display_OK()
{
uchar num;
wright_com(0x80);
for(num=0;num<13;num++)
{
wright_data(table1[num]);
}
}
/ * * * * * * delete the last one * * * * * * * */
void delete()
{
wright_com(0x80+0x40+j);// determine and delete object
wright_data(' ');// display space is to delete
save[--j]=0;Zeros data after // deletion
wright_com(0x80+0x40+j);// to finish writing position when next input data, it is necessary to it is after the last one Face
}
/ * * * * * * to various variables carry out reset * * * * * * * */
void reset()
{
uchar num;
display_enter();
wright_com(0x80+0x40);Display on // erasing screen
for(num=0;num<6;num++)
{
save[num]=0;// numerical value of input is zeroed out
wright_data(' ');// space is shown
}
wright_com(0x80+0x40);It can be inputted again from initial position when inputting again // next time
lockflag=0;// various variables will reset back initial state
conflag=0;
j=0;
}
/ * * * * * * input password correctly carry out response * * * * * * * */
void succeed_an()
{
light=0;// lamp is bright
display_OK();// show successfully
delay(5000);
light=1;// lamp goes out
}
/ * * * * * * input password mistake carry out response * * * * * * * */
void fail_an()
{
lockkey();
}
Three seconds * * * * * * * * * * * * of/* * * * * * keyboard/
void lockkey()
{
lockflag=1;
}
/ * * * * * * input password and show on the screen asterisk * * * * * */
void enter_code(uchar t)
{
if(t>=0&&t<10)
{
if(j==0)
{
wright_com(0x80+0x40) ;It wants first writing address to instruct when the // the first input, otherwise can not Display
wright_data('*') ;
}
else
{
wright_data('*') ;// it is not that first input does not have to write address again then
}
save[j++]=t;// save the data inputted
}
}
/ * * * * * * checks cipher with determine be correct * * * * * * * * * */
void confirm()
{
uchar k;
for(k=0;k<6;k++)
{
if(password[k]!=save [k]) // content in array is compared one by one, once there are data not To exiting circulation at once
{
break;
}
}
If (k==6) if illustrating six numbers entirely to password if // condition exits
{
conflag=1;// carry out indicating that password is correct
}
}
/ * * * * * * interrupt service routine * * * * * * * * * */
void timer0() interrupt 1
{
TH0=(65536-50000)/256;
TL0=(65536-50000)%256;// refitting initial value
if(lockflag)
{
aa++;
light1=0;
If (aa >=60) // it arrives within tri- seconds
{
aa=0;// clearing can be convenient and reuses next time
light1=1;// close alarm
lockflag=0;// flag clear releases key-lock, facilitates next use
}
}
}
/ * * * * * * initialization * * * * * * * * * * */
void init()
{
uchar num;
/ * * * * * timer initialization * * * */
TMOD=1;
TH0=(65536-50000)/256;
TL0=(65536-50000)%256;
ET0=1;
EA=1;// open total interrupt
TR0=1;// timer is closed
The initialization of/* * * * 1602 * * * * * */
lcdrw=0;// this has to zero setting, otherwise can not normally it show
lcden=0;
wright_com(0x38) ;// initialization
wright_com(0x0c) ;// opening cursor 0x0c, display highlighting 0x0e cursor does not dodge, 0x0f cursor dodges
wright_com(0x01) ;// display clearly
wright_com(0x80) ;
for(num=0;num<9;num++)
{
wright_data(table[num]);
delay(1);
}
}
1602 write instruction * * * * * * * * * * * * of/* * * * * */
void wright_com(uchar com)
{
lcdrs=0;
lcddata=com;
delay(1);
lcden=1;
delay(1);
lcden=0;
}
The write-in of/* * * * * * 1602 data * * * * * * * * * * */
void wright_data(uchar date)
{
lcdrs=1;
lcddata=date;
delay(1);
lcden=1;
delay(1);
lcden=0;
}
/ * * * * * * delay function * * * * * * * * * * * */
void delay(uint z)
{
uint x,y;
for(x=z;x>0;x--)
for(y=110;y>0;y--) ;
}
/ * * * * * * * * * * 4x4 matrix keyboard scanning function * * * * * * * * */
uchar keyscan()
{
uchar temp,num=No_key;The return value when initial value of //num will be pressed for on-keyboard
/ * * * * * * * * * scanning the first row * * * * * * * * * * * * * * * */
KEY=0xfe;
temp=KEY;
temp=temp&0xf0;// reading is four high
while(temp!=0xf0)
{
delay(5);// delay disappears and trembles
temp=KEY;
temp=temp&0xf0;
while(temp!=0xf0) // confirm have really by key pressing
{
temp=KEY;
Which switch (temp) // according to this eight level can be determined that by key pressing
{
case 0xee:num=1;
break;
case 0xde:num=2;
break;
case 0xbe:num=3;
break;
case 0x7e:num=10;
break;
}
while(temp!=0xf0) // wait and loosing one's grip
{
temp=KEY;
temp=temp&0xf0;
}
}
}
The second row * * * * * * * * * * * * * * * of/* * * * * * * * * scanning/
KEY=0xfd;
temp=KEY;
temp=temp&0xf0;
while(temp!=0xf0)
{
delay(5);
temp=KEY;
temp=temp&0xf0;
while(temp!=0xf0)
{
temp=KEY;
switch(temp)
{
case 0xed:num=4;
break;
case 0xdd:num=5;
break;
case 0xbd:num=6;
break;
case 0x7d:num=11;
break;
}
while(temp!=0xf0)
{
temp=KEY;
temp=temp&0xf0;
}
}
}
/ * * * * * * * * * scan the third line * * * * * * * * * * * * * * * */
KEY=0xfb;
temp=KEY;
temp=temp&0xf0;
while(temp!=0xf0)
{
delay(5);
temp=KEY;
temp=temp&0xf0;
while(temp!=0xf0)
{
temp=KEY;
switch(temp)
{
case 0xeb:num=7;
break;
case 0xdb:num=8 ;
break;
case 0xbb:num=9;
break;
case 0x7b:num=12;
break;
}
while(temp!=0xf0)
{
temp=KEY;
temp=temp&0xf0;
}
}
}
/ * * * * * * * * * scanning fourth line * * * * * * * * * * * * * * * */
KEY=0xf7;
temp=KEY;
temp=temp&0xf0;
while(temp!=0xf0)
{
delay(5);
temp=KEY;
temp=temp&0xf0;
while(temp!=0xf0)
{
temp=KEY;
switch(temp)
{
case 0xe7:num=0;
break;
case 0xd7:num=13;
break;
case 0xb7:num=14;
break;
case 0x77:num=15;
break;
}
while(temp!=0xf0)
{
temp=KEY;
temp=temp&0xf0;
}
}
}
return num;
}
The above description is only a preferred embodiment of the patent of the present invention, is not intended to limit the invention patent, all in the present invention Made any modifications, equivalent replacements, and improvements etc., should be included in the guarantor of the invention patent within the spirit and principle of patent Within the scope of shield.

Claims (3)

1. the present invention is using MCS-51 series monolithic AT89S52 as master the invention patent relates to a kind of coded lock controller Chip is controlled, in conjunction with peripheral circuit, pin design lock control system, is correctly unlocked (green emitting if can be realized input password Diode is bright), if password bad, issue alarm signal (red light emitting diodes are bright).
2. a kind of coded lock controller according to claim 1, which is characterized in that the present invention uses one 4 × 4 matrix User password can be arbitrarily arranged in formula keyboard, to improve the confidentiality of password.
3. a kind of coded lock controller according to claim 1, which is characterized in that the present invention uses LCD display unit, mentions High readability, provides good man-machine interface.
CN201710435336.4A 2017-06-11 2017-06-11 A kind of coded lock controller Pending CN109025528A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710435336.4A CN109025528A (en) 2017-06-11 2017-06-11 A kind of coded lock controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710435336.4A CN109025528A (en) 2017-06-11 2017-06-11 A kind of coded lock controller

Publications (1)

Publication Number Publication Date
CN109025528A true CN109025528A (en) 2018-12-18

Family

ID=64630013

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710435336.4A Pending CN109025528A (en) 2017-06-11 2017-06-11 A kind of coded lock controller

Country Status (1)

Country Link
CN (1) CN109025528A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101603396A (en) * 2009-07-06 2009-12-16 芜湖欣兰德工业制品有限责任公司 A kind of intelligent coffer and control method thereof
CN201924683U (en) * 2010-12-17 2011-08-10 西安理工大学 Wireless alarming combination padlock
CN102852426A (en) * 2012-09-28 2013-01-02 马鞍山晟志科技有限公司 Intelligent safe with built-in power grid and image pickup system
CN102979380A (en) * 2011-09-05 2013-03-20 赵良水 Electronic cipherer
CN204463260U (en) * 2015-01-12 2015-07-08 南京信息工程大学 A kind of based on Bluetooth technology controlled in wireless electronic password lock
CN105894639A (en) * 2016-04-27 2016-08-24 广西科技大学 Electronic coded lock system based on single chip microcomputer

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101603396A (en) * 2009-07-06 2009-12-16 芜湖欣兰德工业制品有限责任公司 A kind of intelligent coffer and control method thereof
CN201924683U (en) * 2010-12-17 2011-08-10 西安理工大学 Wireless alarming combination padlock
CN102979380A (en) * 2011-09-05 2013-03-20 赵良水 Electronic cipherer
CN102852426A (en) * 2012-09-28 2013-01-02 马鞍山晟志科技有限公司 Intelligent safe with built-in power grid and image pickup system
CN204463260U (en) * 2015-01-12 2015-07-08 南京信息工程大学 A kind of based on Bluetooth technology controlled in wireless electronic password lock
CN105894639A (en) * 2016-04-27 2016-08-24 广西科技大学 Electronic coded lock system based on single chip microcomputer

Similar Documents

Publication Publication Date Title
CN101074589A (en) Fingerprint safe, its controlling system and method
CN104268970A (en) Intelligent electronic coded lock
CN204496592U (en) A kind of smart lock with power saving management function
CN205743333U (en) Intelligent fingerprint coded lock
CN105888403A (en) Intelligent fingerprint coded lock
CN109025528A (en) A kind of coded lock controller
CN106703542A (en) Intelligent multi-angle knock-on type algorithm coded lock
CN205750963U (en) A kind of Laboratory Management System of Entrance Guard
CN206448642U (en) Combination lock control circuit
CN210983551U (en) Intelligent access control installs equipment additional
CN205908129U (en) Dynamic digit password fingerprint pickproof lock
CN208622160U (en) A kind of multi-functional enabling identifying system in intelligent residential district
CN202380836U (en) Electronic coded lock system device for wireless video
CN207734007U (en) A kind of curtain control device
CN205038690U (en) Acoustic control password anti -theft system
CN207148925U (en) A kind of intelligentized business administration attendance checking system
CN202373077U (en) Double-frequency active radio frequency identification intelligent cabinet
CN211454685U (en) Entrance guard capable of being unlocked by swiping card and password
CN107094342A (en) A kind of intelligent lighting control system construction method
CN206097253U (en) Intelligence lock control system based on arduino
Chen et al. Iems: an intelligent environment monitoring system of server room
CN208636903U (en) A kind of practical Intelligent door lock control device
CN206236126U (en) A kind of intelligent card read/write device with humiture display function
CN218332705U (en) Access control system based on cloud platform and mobile terminal
Zhan et al. Fingerprint attendance machine design based on C51 single-chip microcomputer

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20181218

WD01 Invention patent application deemed withdrawn after publication