Cov txheej txheem:

Arduino High Tech Safe: 6 Kauj Ruam
Arduino High Tech Safe: 6 Kauj Ruam

Video: Arduino High Tech Safe: 6 Kauj Ruam

Video: Arduino High Tech Safe: 6 Kauj Ruam
Video: Amazing arduino project 2024, Kaum ib hlis
Anonim
Arduino High Tech Safe
Arduino High Tech Safe

Nov yog kuv arduino high tech nyab xeeb. Koj yuav tsum luam koj tus ntiv tes, luam koj daim npav, tom qab ntawd nkag mus rau tus lej 4 tus lej txhawm rau qhib lub tub rau khoom. Txoj haujlwm no tsis pom zoo rau cov pib tshiab vim tias nws zoo heev. Cov cai yog ntev, tab sis kuv yuav qhia nws hauv qhov haujlwm no. Tus nqi nyob ib puag ncig $ 75 yog tias koj tsim kev nyab xeeb zoo ib yam li kuv. Txoj haujlwm no tseem tuaj yeem siv sijhawm 1-3 hnub los ua kom tiav. Yog li, cia pib!

Khoom siv

Txhawm rau tsim kom muaj kev nyab xeeb ib yam li kuv koj yuav xav tau:

Arduino (Uno pom zoo vim tias kuv tsis muaj cov kauj ruam rau arduino mega lossis nano. Tab sis koj tseem tuaj yeem siv lawv)

daim ntawv qhia zaub mov

siv

jumper cov xov hlau

joystick

20*4 (koj tuaj yeem siv 16*4, tab sis koj yuav tau hloov txoj cai)

tuabneeg scanner

mfrc522 rfid daim npav scanner

ib lub thoob ntawm legos

Kauj Ruam 1: Tsim Lub Thawv

Tsim Lub Thawv
Tsim Lub Thawv

Ua ntej koj yuav xav tau lub thawv tso koj cov khoom siv hluav taws xob rau hauv. Koj tuaj yeem siv legos, lub thawv luam ntawv 3d, lossis txawm tias duab los qhia! (Txawm hais tias qhov no yuav nyuaj dua) Tsis txhob hnov qab muab lub qhov rau hauv lub tub rau khoom, thiab koj cov khoom siv hluav taws xob. Yog tias koj siv daim npav rfid scanner, koj tsis tas yuav muab lub qhov rau qhov ntawd yog tias koj phab ntsa nyias nyias. Cov ntawv tseem ua haujlwm, tab sis koj yuav tsum muab cov keychains kaw kom cov rfid daim npav senor tuaj yeem nyeem lawv. Kuj tseem tawm hauv chav rau koj cov arduino thiab cov xov hlau sab hauv. NCO TSEG: Thaum koj tsim lub tub rau khoom, tso lub qhov rau nws kom koj lub servo tuaj yeem tig thiab xauv lub tub rau khoom.

Kauj ruam 2: Txuas Txuas

Txuas Txuas!
Txuas Txuas!

Cov kauj ruam no tuaj yeem nyuaj vim tias koj xav tau ntsaws cov xov hlau nyob hauv qhov chaw tseeb lossis cov khoom siv hluav taws xob yuav tsis ua haujlwm. Kuv tsis muaj daim duab thaiv kab, tab sis kuv yuav qhia koj txhua tus yuav mus. Txoj hlua yog rau arduino uno nkaus xwb. Koj yuav tsum tau tshawb nrhiav kom tso cov xov hlau yog tias koj siv lub arduino mega lossis nano. Yog tias koj tsis siv txhua lub tshuab hluav taws xob uas kuv muaj, koj tsuas tuaj yeem hla txoj hlua ntawd.

Finger print scanner: ntsuab xaim: D2 xaim dawb: D3 xaim dub: GND liab xaim: 5V

Joystick: 5V = 3.3V GND = GND X = A2 Y = A3 Hloov = D4

rfid card scanner: 3.3V = 3.3V rst = D9 GND = GND miso = D12 mosi = D11 sck = D13 sda = D10

lcd screen: 5V = 5V GND = GND sda = A4 sck = A5

Servo: liab hlau: 5V Xim av xim hlau: GND daj hlau: D6

NCO TSEG: Tsis txhob ntsaws daim npav RFID daim npav SCANNER rau hauv 5V. Yog tias koj ua, Nws YUAV TSUM !!!

Koj yuav xav tsis thoob vim li cas kuv hais kom ntsaws lub joystick zog rau 3.3V thaum nws hais tias 5V ntawm sab. Tias yog vim li cas servo, tshuaj ntsuam, thiab ntiv tes ntsuas lub tshuab xav tau 5V. Yog tias koj ntxiv tus joystick rau qhov ntawd, cov khoom siv hluav taws xob yuav tsis ua haujlwm vim txhua yam xav tau 5V. Tus joystick tseem yuav ua haujlwm nrog 3.3V. Nws tsuas yog tus nqi siab tshaj yuav tsis yog 1023, nws yuav yog ~ 670.

Kauj ruam 3: Rub tawm Cov Tsev Qiv Ntawv

Hauv txoj haujlwm no, koj yuav xav tau 6 lub tsev qiv ntawv los siv txhua yam khoom siv hluav taws xob. 1 rau servo, 1 rau lub ntsuas ntiv tes, 2 rau rfid daim npav scanner, thiab 2 rau lub vijtsam. Joystick tsis xav tau lub tsev qiv ntawv. Tam sim no, lub tsev qiv ntawv yog dab tsi? Nws yog cov ntaub ntawv uas tuav ntau tus lej uas koj tuaj yeem siv hauv koj txoj haujlwm nrog cov lus txib yooj yim. Txhawm rau kom tau txais cov tsev qiv ntawv no, koj yuav tsum mus rau qhov chaw hu ua GitHub. Yog tias koj paub yuav rub tawm thiab unzip cov tsev qiv ntawv, tsuas yog mus rau qhov txuas hauv qab no rau rub tawm. Yog tias koj tsis paub yuav ua li cas, koj tuaj yeem mus rau kuv cov lus qhia uas tham txog yuav rub lub tsev qiv ntawv li cas hauv qib 3:

lossis tshawb hauv youtube video yuav ua li cas rub lub tsev qiv ntawv arduino los ntawm GitHub

LINKS RAU LIRARIES:

Servo

ntiv tes sensor:

spi

rfid daim npav sensor

screen library 1

screen tsev qiv ntawv 2

Kauj Ruam 4: Teeb tsa Fingerprint Sensor thiab Rfid Card Sensor

Cov kauj ruam no tham txog yuav teeb tsa lub taub ntiv tes li cas thiab daim npav rfid sensor. Tshwj tsis yog tias koj twb tau siv koj lub taub ntiv tes lawm, koj yuav tsum qhia nws seb koj cov ntiv tes zoo li cas thiaj li tuaj yeem txuag nws hauv nws lub cim xeeb. Txawm hais tias koj tau siv nws ua ntej, koj yuav tsum tseem zaum ua cov kauj ruam no. Kuv yuav qhia koj yuav ua li cas luv luv, tab sis yog tias nws tsis nkag siab mus rau tib qho kev qhia txuas hauv kauj ruam kawg. Nws mus dhau nws zoo heev. Yooj yim tsuas yog qhib arduino lub tswv yim. Mus rau cov ntawv> piv txwv> adafruit tus ntiv tes ntsuas> rau npe. Tshaj tawm cov cai rau arduino, qhib cov ntawv saib, thiab ua raws cov theem nws qhia koj. Thaum nws qhia koj kom muab tus lej rau nws. Ntaus hauv 1#.

Tam sim no rau daim npav rfid, cov kauj ruam no yooj yim heev. Qhib arduino ide. Mus rau cov ntawv> piv txwv> mfrc522> nyeem cov ntaub ntawv tus kheej. Rub mus rau arduino thiab qhib cov saib txuas. Luam theej duab daim npav lossis keychain koj xav siv uas tuaj nrog koj lub ntsuas. Tom qab ntawd nws yuav muab qee cov ntaub ntawv rau koj. Nrhiav tus ID ntawm daim npav nws yuav yog 4 teev ntawm 2 tus lej. Tej yam zoo li no: AB 45 2Y 45 tab sis koj cov cai yuav txawv. Sau qhov no rau ntawm ib daim ntawv. Koj yuav xav tau nws dua tom qab. Ntawd yog rau cov kauj ruam no.

Kauj ruam 5: CODE

Qhov no yuav yog kauj ruam nyuaj rau koj feem ntau, tab sis nws yooj yim zoo nkauj. Ua ntej luam thiab paste cov cai rau hauv lub tswv yim arduino los ntawm hauv qab no. Qhov thib ob, kho 2 ntu uas hais EDIT CODE. 1 ntu yog rau daim npav scanner, 1 yog rau joystick. Cov kauj ruam no hla tsis tau. Thaum ua tiav, xa cov cai rau arduino!

#suav nrog #suav nrog Fingerprint.h>

#suav nrog

#suav nrog

#suav nrog

#suav nrog

LiquidCrystal_I2C lcd (0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);

#txhais RST_PIN 9

#define SS_PIN 10

MFRC522 mfrc522 (SS_PIN, RST_PIN);

SoftwareSerial mySerial (2, 3);

Adafruit_Fingerprint ntiv tes = Adafruit_Fingerprint (& mySerial);

Servo tsav;

cev d1;.

cev d2;.

cev d3;.

cev d4;.

void teeb tsa () {

servo.attach (6);

servo.write (170); cov.

lcd.begin (20, 4);

Serial.begin (9600);

thaum (! Serial);

SPI.begin ();

mfrc522. PCD_Init ();

ncua (4);

mfrc522. PCD_DumpVersionToSerial ();

ncua (100);

Serial.println ("\ n / n Adafruit ntiv tes kuaj pom");

ntiv tes.begin (57600);

ncua (5);

yog (finger.verifyPassword ()) {

Serial.println ("Txhua lub tshuab ua haujlwm,");

lcd.clear ();

lcd.setCursor (1,0);

lcd.print ("Thov luam ntiv tes");

lwm yam {

Serial.println ("YOOJ YIM: Finger print sensor not found!");

lcd.setCursor (0, 0);

lcd.print ("YOOJ YIM: Finger print");

lcd.setCursor (1, 1);

lcd.print ("tsis pom lub sensor!");

thaum (1) {ncua (1); }

}

ntiv tes.getTemplateCount ();

Serial.print ("Sensor muaj"); Serial.print (ntiv tes.templateCount); Serial.println ("qauv"); Serial.println ("Tos kom siv tau tus ntiv tes …"); }

void (* resetFunc) (tsis muaj dab tsi) = 0;

void voj () {

getFingerprintIDez ();

ncua (50);

}

uint8_t getFingerprintID () {

uint8_t p = ntiv tes.getImage ();

hloov (p) {

rooj plaub FINGERPRINT_OK:

Serial.println ("Duab coj");

tawg;

rooj FINGERPRINT_NOFINGER:

Serial.println ("Tsis pom ntiv tes");

rov p;

rooj plaub FINGERPRINT_PACKETRECIEVEERR:

Serial.println ("Kev sib txuas lus yuam kev");

rov p;

rooj plaub FINGERPRINT_IMAGEFAIL:

Serial.println ("Ua yuam kev duab");

rov p;

neej ntawd hais:

Serial.println ("Tsis paub yuam kev");

rov p;

}

p = ntiv tes.image2Tz ();

hloov (p) {

rooj plaub FINGERPRINT_OK:

Serial.println ("Duab hloov dua siab tshiab");

tawg;

rooj plaub FINGERPRINT_IMAGEMESS:

Serial.println ("Duab tsis meej");

rov p;

rooj plaub FINGERPRINT_PACKETRECIEVEERR:

Serial.println ("Kev sib txuas lus yuam kev");

rov p;

rooj plaub FINGERPRINT_FEATUREFAIL:

Serial.println ("Tsis tuaj yeem pom cov ntiv tes nta");

rov p;

rooj plaub FINGERPRINT_INVALIDIMAGE:

Serial.println ("Tsis tuaj yeem pom cov ntiv tes nta");

rov p;

neej ntawd hais:

Serial.println ("Tsis paub yuam kev");

rov p;

}

p = ntiv tes.fingerFastSearch ();

yog (p == FINGERPRINT_OK) {

Serial.println ("Pom cov ntawv sib dhos!");

} lwm tus yog (p == FINGERPRINT_PACKETRECIEVEERR) {Serial.println ("Kev sib txuas lus yuam kev");

rov p;

} lwm yog (p == FINGERPRINT_NOTFOUND) {

Serial.println ("Tsis pom qhov sib phim");

rov p;

lwm yam {

Serial.println ("Tsis paub yuam kev");

rov p;

}

Serial.print ("Pom ID #"); Serial.print (ntiv tes.fingerID);

Serial.print ("nrog kev ntseeg siab ntawm"); Serial.println (ntiv tes.confidence);

rov qab ntiv tes.fingerID;

}

int tauFingerprintIDez () {

uint8_t p = ntiv tes.getImage ();

yog (p! = FINGERPRINT_OK) rov qab -1;

p = ntiv tes.image2Tz ();

yog (p! = FINGERPRINT_OK) rov qab -1;

p = ntiv tes.fingerFastSearch ();

yog (p! = FINGERPRINT_OK) rov qab -1;

Serial.print ("Pom ID #"); Serial.print (ntiv tes.fingerID);

Serial.print ("nrog kev ntseeg siab ntawm"); Serial.println (ntiv tes.confidence);

yog (finger.fingerID == 1) {

lcd.clear ();

lcd.setCursor (2, 0);

lcd.print ("Txais ntiv tes,");

lcd.setCursor (2, 0);

lcd.print ("tam sim no luam daim npav …");

lcd.setCursor (0, 3);

lcd.print ("===================>");

thaum (! mfrc522. PICC_IsNewCardPresent ());

thaum (! mfrc522. PICC_ReadCardSerial ());

yog (mfrc522.uid.uidByte [0] == 0x92 && // ======================== EDIT CODE ======== ============== Ua tsaug

mfrc522.uid.uidByte [1] == 0xAB && // Nqa daim ntawv ntawd nrog daim ID ntawm nws, muaj 4 teev ntawm 2 tus lej

mfrc522.uid.uidByte [2] == 0x90 && // Saib los ntawm cov cai, saib qhov twg nws hais tias 0x92, 0xAB, 0x90, 0x1c? Nkag mus rau txhua tus

mfrc522.uid.uidByte [3] == 0x1C) {// ntawm ntu 2 tus lej tom qab 0x. Piv txwv li, ntu ntawm daim ID hais

lcd.clear (); // 3E, tom qab ntawd nkag mus rau 3E tom qab 0x ua 0x3E. Ua qhov no rau txhua ntu

lcd.setCursor (3, 0);

lcd.print ("Thaum kawg, nkag mus");

lcd.setCursor (1, 1);

lcd.print ("lo lus zais joystick");

thaum (analogRead (A2)> = 100 &&

analogRead (A2) <= 670 &&

analogRead (A3)> = 100 &&

analogRead (A3) <= 670) {

}

lcd.setCursor (8, 4);

lcd.print ("*"); yog (analogRead (A2) <= 100) {

d1 = L;

}

yog (analogRead (A2)> = 670) {

d1 = R;

}

yog (analogRead (A3) <= 100) {

d1 = ua;

}

yog (analogRead (A3)> = 670) {

d1 = D;

}

ncua (500);

thaum (analogRead (A2)> = 100 &&

analogRead (A2) <= 670 &&

analogRead (A3)> = 100 &&

analogRead (A3) <= 670) {

}

lcd.print ("*");

yog (analogRead (A2) <= 100) {

d2 = L;

}

yog (analogRead (A2)> = 670) {

d2 = R;

}

yog (analogRead (A3) <= 100) {

d2 = ua;

}

yog (analogRead (A3)> = 670) {

d2 = D;

}

ncua (500);

thaum (analogRead (A2)> = 100 &&

analogRead (A2) <= 670 &&

analogRead (A3)> = 100 &&

analogRead (A3) <= 670) {

}

lcd.print ("*");

yog (analogRead (A2) <= 100) {

d3 = L;

}

yog (analogRead (A2)> = 670) {

d3 = R;

}

yog (analogRead (A3) <= 100) {

d3 = ua;

}

yog (analogRead (A3)> = 670) {

d3 = D;

}

ncua (500);

thaum (analogRead (A2)> = 10 &&

analogRead (A2) <= 670 &&

analogRead (A3)> = 100 &&

analogRead (A3) <= 670) {

}

lcd.print ("*");

yog (analogRead (A2) <= 100) {

d4 = L;

}

yog (analogRead (A2)> = 670) {

d4 = R;

}

yog (analogRead (A3) <= 100) {

d4 = ua;

}

yog (analogRead (A3)> = 670) {

d4 = yog;

}

ncua (500);

yog (d1 == L && d2 == U && d3 == L && d4 == R) {// ================= EDIT CODE ====== ================

lcd.clear (); // Tshooj lus no yog koj tuaj yeem hloov tus password nrog tus joystick

lcd.setCursor (2, 0); // tus password tau teeb rau sab laug, sab laug, sab xis. Yog koj xav hloov

lcd.print ("Tau txais kev pom zoo!"); // nws, muab L rau sab laug, R rau sab xis, U rau nce, lossis D rau hauv ib qho ntawm cov

lcd.setCursor (2, 1); // 4 ntu nrog tsab ntawv tom qab == cov cim.

lcd.print ("Lub tub rau khoom qhib.");

lcd.setCursor (2, 2);

lcd.print ("Thaum ua tiav, txav mus");

lcd.setCursor (1, 3);

lcd.print ("joystick rau relock");

servo.write (90); cov.

thaum (analogRead (A2)> = 100 &&

analogRead (A2) <= 670 &&

analogRead (A3)> = 100 &&

analogRead (A3) <= 670);

servo.write (170); cov.

lcd.setCursor (3, 0);

lcd.print ("Lub tub rau khoom xauv");

ncua (3000);

rov pib dua ();

lwm yam {

lcd.clear ();

lcd.setCursor (2, 0);

lcd.print ("ACCESS DENIED !!!");

lcd.setCursor (0, 2);

lcd.print ("Rov pib dua lub system …");

ncua (3000);

rov pib dua ();

}

lwm yam {

lcd.clear ();

lcd.setCursor (2, 0);

lcd.print ("ACCESS DENIED !!!");

lcd.setCursor (0, 2);

lcd.print ("Rov pib dua lub system …");

ncua (3000);

rov pib dua ();

}

lwm yam {

lcd.clear ();

lcd.setCursor (2, 0);

lcd.print ("ACCESS DENIED !!!");

lcd.setCursor (0, 2);

lcd.print ("Rov pib dua lub system …");

ncua (3000);

rov pib dua ();

}

rov qab ntiv tes.fingerID; }

Kauj ruam 6: Ua tiav

Ib yam kuv tsis nco qab qhia koj, zoo 2 yam yog tias kuv tsim qhov no ua ntej kuv thaij duab, yog li kuv tsis tuaj yeem qhia koj tias kuv tsim lub thawv li cas. Lwm qhov yog tias nws tau pom zoo kom ntswj cov ntu servo mus rau ntu uas tig. Yog tias koj tsis ua, ib tus neeg tuaj yeem rub lub tub rau khoom thaum nws xauv thiab rub daim tawm. Tab sis ua ntej koj ntsia nws, nrhiav qhov chaw zoo uas yuav muab tso rau vim tias servo tig mus rau qee qib. Lossis koj tuaj yeem hloov pauv nws hauv txoj cai. Yog tias qee cov khoom siv hluav taws xob ua rau luag ntxhi, koj yuav xav nrhiav lwm txoj hauv kev kom tau 5V rau qee qhov ntawm lawv. Kuv pom thaum kuv lub tshuab ntsuas ntiv tes flashed, lub vijtsam yuav ntsais me ntsis nrog nws, thiab servo yuav ua suab nrov. Thaum lub servo txav mus, lub vijtsam yuav ploj mus. Kuv vam tias koj nyiam qhov project! Yog tias koj muaj lus nug, tawm hauv lawv cov lus. Kuv tsis nyob ntawm kev qhia ntau, tab sis kuv yuav teb lawv sai li kuv tuaj yeem ua tau!

Pom zoo: