加入星計(jì)劃,您可以享受以下權(quán)益:

  • 創(chuàng)作內(nèi)容快速變現(xiàn)
  • 行業(yè)影響力擴(kuò)散
  • 作品版權(quán)保護(hù)
  • 300W+ 專業(yè)用戶
  • 1.5W+ 優(yōu)質(zhì)創(chuàng)作者
  • 5000+ 長(zhǎng)期合作伙伴
立即加入

基于單片機(jī)的指紋門禁設(shè)計(jì)STC89C52

09/12 17:05
1542
服務(wù)支持:
技術(shù)交流群

完成交易后在“購(gòu)買成功”頁(yè)面掃碼入群,即可與技術(shù)大咖們分享疑惑和經(jīng)驗(yàn)、收獲成長(zhǎng)和認(rèn)同、領(lǐng)取優(yōu)惠和紅包等。

虛擬商品不可退

當(dāng)前內(nèi)容為數(shù)字版權(quán)作品,購(gòu)買后不支持退換且無(wú)法轉(zhuǎn)移使用。

加入交流群
掃碼加入
獲取工程師必備禮包
參與熱點(diǎn)資訊討論
放大
實(shí)物圖
相關(guān)方案
  • 方案介紹
  • 相關(guān)文件
  • 相關(guān)推薦
  • 電子產(chǎn)業(yè)圖譜
申請(qǐng)入駐 產(chǎn)業(yè)圖譜

功能:

研究?jī)?nèi)容:本課題以單片機(jī)為核心采用C語(yǔ)言來(lái)開發(fā)一指紋電子密碼鎖。系統(tǒng)擬在Altium?Designer9開發(fā)平臺(tái)上設(shè)計(jì)原理圖,并繪制PCB并制成單片機(jī)開發(fā)板,然后根據(jù)原理圖將相關(guān)元器件焊接到開發(fā)板上。軟件部分在Keil?uVision4開發(fā)平臺(tái)上進(jìn)行相關(guān)代碼的編寫和調(diào)試。然后利用串口助手工具將代碼下載到開發(fā)板進(jìn)行運(yùn)行,觀察硬件各模塊是否可以正常運(yùn)行。以及測(cè)試結(jié)果是否能夠滿足需求,便于及時(shí)調(diào)整設(shè)計(jì)。

課題的主要任務(wù)是設(shè)計(jì)出一個(gè)可以錄入指紋,并可對(duì)錄入指紋進(jìn)行匹配比較,如果正確即可開鎖。

  1. 設(shè)置有管理員密碼,管理員密碼內(nèi)置不可修改,密碼具有掉電存儲(chǔ)功能。
  2. 輸入管理員密碼后進(jìn)入指紋錄制模式,錄入自己的指紋
  3. 錄制成功后,支持指紋開鎖,指紋匹配成功后,繼電器吸合表示開門,并且語(yǔ)音提示開鎖成功
  4. 當(dāng)遇到震動(dòng)時(shí),語(yǔ)音提示,請(qǐng)勿強(qiáng)行開鎖,并且可以通過(guò)sim模塊發(fā)送報(bào)警短信
  5. 單片機(jī)內(nèi)置用戶密碼,匹配成功后可以通過(guò)app使用密碼開鎖。

重點(diǎn)難點(diǎn):指紋的錄制與識(shí)別,語(yǔ)音提示,并且具有報(bào)警系統(tǒng),當(dāng)遇到震動(dòng)時(shí)時(shí)可以發(fā)出語(yǔ)音報(bào)警和sim短信報(bào)警,硬件元器件較多使用了大量串口,pcb排版要注意,避免各個(gè)部件之間的干擾。

電路原理圖:

資料內(nèi)容包括:

部分程序:

#include <intrins.h>
#include <INTRINS.H>
#include"lcd1602.h"
#include "string.h"

sbit led= P0^7;
sbit buz= P2^0;
sbit j1= P2^1;
sbit shock= P2^2;

sbit in_1 = P1^4; //°′?ü
sbit in_2 = P1^5;
sbit in_3 = P1^6;
sbit in_4 = P1^7;

sbit out_1 = P3^7; //°′?ü
sbit out_2 = P3^6;
sbit out_3 = P3^5;
sbit out_4 = P3^4;

unsigned char password[6] = {1,2,3,4,5,6};
unsigned char password2[6] = {1,2,3,4,5,6};
unsigned char runCount=0;
unsigned char R_flag=0;

unsigned char number = 0;
unsigned char recSign = 0;//?óê?êy?Y±ê??
unsigned char rec[16]; //?óê?êy?Y?o′?
unsigned char recIndex = 0;//?óê?êy?Y
unsigned char recTemp = 0;//?óê?êy?Y
char zf[3];
char rec_num = 0; //?óê?êy?Y??êy

uchar sign = 0;

#define Max_User 10
#define error 2
#define S2RI 0x01 ? ?//′??ú2?óê??D?????ó±ê????
#define S2TI 0x02 ? ?//′??ú2·¢?í?D?????ó±ê????

unsigned char num_4x4=0;
char KeyVal = 0;

int count = 0; //?¨ê±?÷±?á?

 

#define Max_User 10
#define error 2

char user_num = 0;
unsigned char ?? ?SaveNumber=0,searchnum=0;
unsigned int ??? ?SearchNumber=0;
unsigned int ?? ?clk0=0;
unsigned int ?? ?rec_number = 0; //?óê?êy?Y
unsigned char str[3]={0,'?','?'};

bit modeflag=0,clearallflag=0,changeflag=0;//??è??aê?±e?£ê?£?è?1??a1?a??è??????£ê?,????è?ò?′?SaveNumber++

//3£ó???á??¨ò?/

//Verify ?Password ? £o?é?¤éè±???ê??úá?
unsigned char code VPWD[16]={16,0X01 ,0Xff,0xff,0xff,0xff, 0x01,0,7,0x13,0x00,0x00,0x00,0x00,0x00,0x1b};?? ? //???í12??

//éè??éè±???ê??úá?
unsigned char code STWD[16]={16,0X01 ,0Xff,0xff,0xff,0xff, 0x01,0,7,0x12,0x00,0x00,0x00,0x00,0x00,0x1a};?? ? //???í12??

//GetImage ? ? ? ? ? £oì?2aê???2¢′ó′??D?÷é??áè?í???
unsigned char code GIMG[14]={12, 0X01 ,0Xff,0xff,0xff,0xff, 0x01, 0,3,1,0x00,0x05};?? ?//???í12??

//Gen Templet1 ? ? ? ?£o?ù?Y?-ê?í???éú3é????ì??÷1
unsigned char code GENT1[14]={13,0X01 ,0Xff,0xff,0xff,0xff,0x01,0,4,2,1,0x00,0x08};?? ?//???í12??

//Gen Templet2 ? ? ? ?£o?ù?Y?-ê?í???éú3é????ì??÷2
unsigned char code GENT2[14]={13,0X01 ,0Xff,0xff,0xff,0xff,0x01,0,4,2,2,0x00,0x09}; //???í12??

//Search Finger ? ? ?£oò?CharBufferA?òCharBufferB?Dμ?ì??÷???t???÷?????ò2?·??????a
unsigned char code SEAT[18]={17, ?0X01 ,0Xff,0xff,0xff,0xff, 0x01, ? 0,8, 4,1,0,0, ? ?0,0x65, ?0x00,0x73};?? ?//???í12??

//Merge Templet ? ? ?;??CharBufferAó?CharBufferB?Dμ?ì??÷???to?2¢éú3é?£°?£??á1?′?óúModelBuffer?£
unsigned char code MERG[14]={12, ?0X01 ,0Xff,0xff,0xff,0xff, 0x01, ?0,3,5 , 0x00,0x09};//???í12??

//Store Templet ? ? ?£o??ModelBuffer?Dμ????t′¢′?μ?flash?????a?D
unsigned char code STOR[16]={15, ?0X01 ,0Xff,0xff,0xff,0xff, 0x01, ?0,6,6,2, ? ? 0x00,0x00, ? ? 0x00,0x0f}; //???í12??

//DEL one templet
unsigned char code DELE_one[16]={16, 0X01 ,0Xff,0xff,0xff,0xff, 0x01, ? 0,7, ?0x0c, ? ?0x00,0x00, 0,1, 0x00,0x15};

//DEL templet ? ? ?;?????????a
unsigned char code DELE_all[12]={12,0X01 ,0Xff,0xff,0xff,0xff, 0x01, 0,3, ?0x0d,0x00,0x11};

//3£ó???á??¨ò?-------?áê?///

//oê?¨ò?
#define FALSE 0
#define TURE ?1

//×′ì??¨ò?±í
#define on ? ??? ?1
#define off ? ?? ?0

#define MAX_NUMBER ? ?63
#define _Nop() ?_nop_()

unsigned char ?? ??? ? ?FifoNumber=0;
unsigned char ? FIFO[MAX_NUMBER+1]={0};

//oê?¨ò?------------?áê?

/*********1oá???óê±3ìDò**********/
void delay1ms(unsigned int t)
{
unsigned int i,j;
for(i=0;i<t;i++)
for(j=0;j<120*6;j++)
;
}
void delay10ms(unsigned int c) ? //?ó2? 0us
{
unsigned char a, b;
//--cò??-?ú′?μY1yà′μ?ê±oòò??-?3?μá?£??ùò??úforó???μúò????í2?ó??3?μá?--//
for (;c>0;c--)
{
for (b=38*6;b>0;b--)
{
for (a=130;a>0;a--);
}
}
}
/********************************************************************
* ??3? : delay()
* 1|?ü : ?óê±,?óê±ê±???a 100us * t?£?aê?í¨1yèí?t?óê±£?óDò??¨?ó2??£
* ê?è? : t
* ê?3? : ?T
***********************************************************************/
void delay(unsigned int t)
{
unsigned int i,j;
for(i=0; i<t; ?i++)
for(j=0; j<10; j++);
}

void beep()
{
buz=0;
delay10ms(30);
buz=1;
delay10ms(30);
}

void KeyDown(void) ?//êμ?????ó?ü?ì?£·μ???μ?a£??÷°′?üμ??ü?μ£?′??ü?μóéó??§×??o?¨ò??£
{
KeyVal = 99;
num_4x4 = 99;
out_1 = 0;
out_2 = 1;
out_3 = 1;
out_4 = 1;
delay10ms(2);
if(in_1==0)
{
KeyVal = 0;
}
else if(in_2==0)
{
KeyVal = 1;
}
else if(in_3==0)
{
KeyVal = 2;
}
else if(in_4==0)
{
KeyVal = 3;
}
delay10ms(2);
out_1 = 1;
out_2 = 0;
out_3 = 1;
out_4 = 1;
delay10ms(2);
if(in_1==0)
{
KeyVal = 4;
}
else if(in_2==0)
{
KeyVal = 5;
}
else if(in_3==0)
{
KeyVal = 6;
}
else if(in_4==0)
{
KeyVal = 7;
}
delay10ms(2);
out_1 = 1;
out_2 = 1;
out_3 = 0;
out_4 = 1;
delay10ms(2);
if(in_1==0)
{
KeyVal = 8;
}
else if(in_2==0)
{
KeyVal = 9;
}
else if(in_3==0)
{
KeyVal = 10;
}
else if(in_4==0)
{
KeyVal = 11;
}
delay10ms(2);
out_1 = 1;
out_2 = 1;
out_3 = 1;
out_4 = 0;
delay10ms(2);
if(in_1==0)
{
KeyVal = 12;
}
else if(in_2==0)
{
KeyVal = 13;
}
else if(in_3==0)
{
KeyVal = 14;
}
else if(in_4==0)
{
KeyVal = 15;
}

if(KeyVal!=99)
{
beep();
switch(KeyVal)
{
case 0:?? ? num_4x4 = 1;
break;
case 1:?? ? num_4x4 = 4;
break;
case 2:?? ? num_4x4 = 7;
break;
case 3:?? ? num_4x4 = 10;
break;
case 4:?? ? num_4x4 = 2;
break;
case 5:?? ? num_4x4 = 5;
break;
case 6:?? ? num_4x4 = 8;
break;
case 7:?? ? num_4x4 = 0;
break;
case 8:?? ? num_4x4 = 3;
break;
case 9:?? ? num_4x4 = 6;
break;
case 10: num_4x4 = 9;
break;
case 11: num_4x4 = 11;
break;
case 12: num_4x4 = 12;
break;
case 13: num_4x4 = 13;
break;
case 14: num_4x4 = 14;
break;
case 15: num_4x4 = 15;
break;
}
}
//?? ?Lcd1602_Com(0x80);
//?? ?Lcd1602_Data('0'+num_4x4%100/10);
//?? ?Lcd1602_Data('0'+num_4x4%10);
delay10ms(50);
}

需要完整的資料可在我的資源里下載,也可以加入我的紛傳圈子,里面有資源壓縮包的百度網(wǎng)盤下載地址及提取碼。

紛傳點(diǎn)擊用微信打開即可,過(guò)程有點(diǎn)繁瑣請(qǐng)見諒。

  • 有需要資料的可了解一下.docx

相關(guān)推薦

電子產(chǎn)業(yè)圖譜