Cov txheej txheem:

Ntse Lockbox: 7 Kauj Ruam
Ntse Lockbox: 7 Kauj Ruam

Video: Ntse Lockbox: 7 Kauj Ruam

Video: Ntse Lockbox: 7 Kauj Ruam
Video: 20 MOMENTS YOU WOULDN'T BELIEVE IF NOT FILMED 2024, Kaum ib hlis
Anonim
Ntse Lockbox
Ntse Lockbox

Hauv cov lus qhia no kuv yuav qhia koj yuav ua li cas thiaj ua tau lub lockbox ntse.

Lub xauv yog siv los ntawm Arduino (UNO) thiab siv RFID thiab lub tshuab servo los tswj kev nkag thaum taug qab cov ntaub ntawv nkag los ntawm cov ntsuas sib txawv. Keeb kwm cov ntaub ntawv yuav raug khaws cia hauv MYSQL database. lub Raspberry Pi.

Kauj Ruam 1: Cov Npe thiab Cov Khoom Siv rau Txoj Haujlwm

Khoos phis tawj/microcontroller:

  • Arduino UAS
  • RaspBerry Pi 4 Qauv B.

Qhov

  • LM35 ntsuas kub
  • GL5537 LDR sensor
  • VMA405 lossis RC522 RFID sensor nyeem ntawv nrog cim npe
  • MG 996R Servo lub cev muaj zog
  • DuPont Txiv neej-Poj niam jumper xov hlau
  • Creadboard xov hlau
  • Liab LED
  • Ntsuab LED
  • Active buzzer 5V
  • 1k Ω (ohm) resistor
  • 2 x 330 Ω (ohm) resistors

Vaj tse

Lub thawv tuaj yeem ua los ntawm koj cov khoom siv. Kuv yog ua los ntawm cov duab los qhia

Ntxiv

Kuv tau ua ntoo txuas rau tus neeg siv khoom (xaiv tau)

Software

Arduino IDE, Visual studio code - Raspberry Pi nrog SSH, MYSQL workbench

Txog kev kwv yees tus nqi, koj tuaj yeem tshawb xyuas BOM cov ntaub ntawv.

Kauj Ruam 2: Breadboard Circuit

Breadboard Circuit
Breadboard Circuit
Breadboard Circuit
Breadboard Circuit
Breadboard Circuit
Breadboard Circuit

RFID

  • Vcc 3.3. V ntawm Arduino
  • RST Digital 9 pin
  • Gnd Gnd ntawm Arduino
  • MISO Digital 12 pin
  • MOSI Digital 11 pin
  • SCK Digital 13 pin
  • NSS/SDA Digital 10 pin

Servomotor

  • 5V (Liab) (+) ntawm lub khob cij
  • Gnd (Xim av) Gnd ntawm lub khob cij
  • PWM (Orange) Digital 3 pin

LM35

  • Vin (+) (+) ntawm lub khob cij
  • Gnd Gnd ntawm lub khob cij
  • Vout Analog 1 pin

LDR

  • Vin (+) (+) ntawm lub khob cij
  • Gnd Gnd ntawm lub khob cij nrog 1K ohm resistor
  • Vout Analog 0 pin

Coj (Ntsuab)

  • Vin (+) Digital 4 tus pin nrog 330 ohm resistor
  • Gnd Gnd ntawm lub khob cij

Coj (Liab)

  • Vin (+) Digital 5 tus pin nrog 330 ohm resistor
  • Gnd Gnd ntawm lub khob cij

Lub suab nrov nrov

  • Vin (+) (+) ntawm lub khob cij
  • Gnd Gnd ntawm lub khob cij

Arduino rau breadboard

  • Arduino 5V (+) (+) ntawm lub khob cij
  • Arduino Gnd Gnd ntawm lub khob cij

Raspberry Pi rau Arduino

Yuav txuas nrog USB

Kauj ruam 3: Arduino

Arduino
Arduino

Cov xov hluav taws xob yuav tsum zoo ib yam li cov duab saum toj no.

Ua ntej txuas Arduino nrog lub khoos phis tawj txhawm rau kho qhov khoos phis tawj. Cov cai tseem ceeb yuav rub tawm hauv qab no tab sis tsis siv nws, ua ntej ua raws cov theem hauv qab no.

Tsev qiv ntawv

Peb yuav siv SPI thiab MFRC 522 lub tsev qiv ntawv los ua haujlwm nrog RFID sensor. Ua haujlwm nrog RFID

Rub tawm lub tsev qiv ntawv RFID ntawm no los ntawm Github ntawm miguelbalboa

Unpack lub zipfile.

Hauv Arduino IDE mus rau kos duab> suav nrog tsev qiv ntawv thiab xaiv zipfile koj nyuam qhuav rub tawm

Tom qab koj rub tawm cov ntawv zip, mus rau kos duab> suav nrog tsev qiv ntawv> tswj cov tsev qiv ntawv Hauv tus thawj tswj tsev qiv ntawv, tshawb rau "MFRC522". Nws yuav tsum hais tias lub tsev qiv ntawv tau teeb tsa.

Txheeb xyuas cov ntaub ntawv RFID

Mus rau cov ntaub ntawv> piv txwv> MFR522> dumpinfo thiab upload/pib cov cai hauv koj li IDE. Koj yuav pom tias txoj cai suav nrog MFR522.h thiab SPI.h lub tsev qiv ntawv. Ob leeg xav tau rau RFID.

Tam sim no qhib lub ntsuas saib (cov cuab yeej> serialmonitor) thiab luam theej duab koj daim paib thiab daim npav kom txog thaum txhua cov ntaub ntawv raug qhia.

Nco ntsoov sau UID vim tias koj yuav xav tau.

Tam sim no koj tuaj yeem rub tawm cov cai tseem ceeb (Arduino_code_lockbox) Hauv cov cai tseem ceeb, hloov koj tus kheej daim npav UID nrog tus lej los ntawm tus lej.

Tom qab khiav/xa cov cai hauv Arduino IDE, sim rfid scan. Yog tias nws ua haujlwm koj tuaj yeem txuas Arduino USB ntawm lub khoos phis tawj thiab txuas nrog Raspberry Pi.

Kauj ruam 4: Raspberry Pi

Raspberry Pi
Raspberry Pi

Nyeem cov ntaub ntawv los ntawm Arduino hauv Python

Nco ntsoov tias Arduino txuas nrog Raspberry Pi. Open app.py thiab khiav cov ntawv. Koj yuav pom cov ntaub ntawv tau txais los ntawm koj lub ntsuas cua los ntawm Arduino.

Txhawm rau nyeem cov ntaub ntawv koj yuav xav tau ntu ntu ntawm cov cai (saib duab).

MYSQL Database Tsim cov ntaub ntawv khaws cia qhov ntsuas qhov ntsuas ntawm koj lub ntsuas.

Backend Python

Ntxiv cov nab hab sej thiab hloov kho rau koj li MYSQL database raws li xa cov txiaj ntsig ntawm koj cov ntaub ntawv ntsuas mus rau koj tus kheej database.

Kauj Ruam 5: Lub Vev Xaib

Txheej txheem

Koj tuaj yeem siv cov ntaub ntawv los ntawm webrar.rarOr koj tuaj yeem tsim koj tus kheej lub vev xaib nrog html, css.

Qhia cov ntaub ntawv los ntawm database

Siv javascript kom tau txais thiab qhia cov ntaub ntawv los ntawm lub hauv paus rau koj lub vev xaib

Lub tsev qiv ntawv Chart.js yuav siv los teeb cov ntaub ntawv.

Kauj Ruam 6: Vaj Tsev

Vaj tse
Vaj tse

Sab nrauv

Rau sab hauv tsev kuv tau kaw qhov sib txawv ua ke. Qhov sab saum toj tau txiav hauv L-duab kom lub hauv paus ntawm L (sab xis ntawm daim duab) yuav khov dua.

Rau RFID sensor, txiav lub qhov rau hauv lub thawv yog nyob ntawm yeem. Nws yuav tsum muaj peev xwm luam theej duab los ntawm daim duab yog tias nws tsis tuab heev.

Tus servomotor yuav raug kaw rau sab nraud. Nws nyob ntawm seb koj tso raspberry sab hauv lub thawv, koj yuav tsum ua qhov me me rau kev sib txuas cable zoo li USB lossis ethernet cable.

Sab hauv

Rau sab hauv kuv tau ua ib txheej yog li kuv tuaj yeem cais ob lub cuab yeej thiab nws tau teeb tsa ntau dua. Raspberry Pi yuav nyob rau hauv qab ntawm lub thawv thiab Arduino nrog lub khob cij yuav nyob rau txheej sab saud.

Pom zoo: