Cov txheej txheem:

Tsis Siv Tshuaj Siv Tshuaj: 5 Kauj Ruam
Tsis Siv Tshuaj Siv Tshuaj: 5 Kauj Ruam

Video: Tsis Siv Tshuaj Siv Tshuaj: 5 Kauj Ruam

Video: Tsis Siv Tshuaj Siv Tshuaj: 5 Kauj Ruam
Video: Plab Plab Ntswg..(Pluav Pluav Ntswg) Maiv Twm New Song 2023-2024 2024, Hlis ntuj nqeg
Anonim
Tsis Siv Neeg Tshuaj Kho Mob
Tsis Siv Neeg Tshuaj Kho Mob

Txoj haujlwm no yog siv rau hauv kev kho mob, qhov twg cov neeg mob laus yuav tsum muaj txoj hauv kev ntseeg tau kom muaj kev faib tshuaj thiab faib tawm. Cov cuab yeej no tso cai siv tshuaj sib faib txog li 9 hnub ua ntej, thiab tau txiav tawm ncaj qha ntawm lub sijhawm xav tau. Lub hau tseem tuaj yeem kaw nrog lub cim RFID, ua kom ntseeg tau tias tsuas yog tus neeg saib xyuas tuaj yeem nkag mus rau cov tshuaj.

Khoom siv:

Muaj cov ntaub ntawv xav tau los tsim txoj haujlwm no:

  • Arduino UAS
  • Tsav Tsheb Tsav Tsheb
  • SG90 9G Servo Cov
  • Stepper Tsav
  • DS1302 RTC Module
  • Ntau cov xov hlau jumper
  • IIC 1602 LCD
  • Kev siv 3D tshuab luam ntawv
  • Ob txhais ceg xws li ntoo dowels
  • RFID Module thiab Tag
  • Ob lub laub khawm
  • Soldering hlau
  • Cov qhob cij
  • Super kua nplaum
  • Ntoo ntsia hlau
  • Ntoo Ntoo Tsis Tiav nrog Hinged Hau
  • Ob daim kab xev

Kauj Ruam 1: Hloov Kho Lub Thawv

Hloov Kho Lub Thawv
Hloov Kho Lub Thawv
Hloov Kho Lub Thawv
Hloov Kho Lub Thawv
Hloov Kho Lub Thawv
Hloov Kho Lub Thawv
Hloov Kho Lub Thawv
Hloov Kho Lub Thawv

Lub thawv yuav xub tau hloov kho. Muaj ntau lub qhov uas yuav tsum tau muab laum. Thawj lub qhov yuav nyob ntawm xub ntiag ntawm lub npov, qhov twg lub thawv tswj lub thawv tau luam tawm. Qhov thib ob yog nyob tom qab ntawm lub npov, kom USB cable hla dhau. Qhov kawg yog nyob hauv qab ntawm lub npov, qhov twg cov tshuaj yuav poob los ntawm ib zaug xa tawm. Thaum kawg, ob txhais ceg yuav tsum txuas rau hauv qab. Kuv siv ko taw roj hmab Kuv pom nyob ib puag ncig kuv lub tsev rau ob txhais ceg, tab sis ntoo dowels kuj tuaj yeem siv tau.

Kauj Ruam 2: 3D Luam Qhov Chaw

3D Luam Tshooj
3D Luam Tshooj
3D Luam Tshooj
3D Luam Tshooj
3D Luam Tshooj
3D Luam Tshooj

Muaj ntau qhov 3D luam tawm qhov xav tau rau txoj haujlwm no.

Lawv yog:

  • Carousel uas tuav tshuaj
  • Base rau carousel
  • Lub raj mis rau cov tshuaj
  • Caj npab rau servo motor kaw lub hau
  • Base rau servo motor
  • Latch rau servo caj npab
  • Tswj vaj huam sib luag
  • Khob rau cov tshuaj yuav muab faib rau hauv

Lub hauv paus rau carousel yog ua raws lub thawv nrog ob daim kab xev. Lub hauv paus rau lub cav servo thiab lub latch rau sab caj npab yog ob qho tib si ntsia rau hauv lub thawv nrog cov ntoo ntoo luv. Lub thawv tswj vaj huam sib luag tau muab tso rau sab xub ntiag ntawm lub npov nrog cov kua nplaum super, tom qab cov khoom tau muab tso rau.

Kauj ruam 3: Electronics

Electronics
Electronics

Tam sim no cov khoom siv hluav taws xob yuav tsum tau muab tso rau hauv lub thawv. Ua ntej, tus tsav lub cev muaj zog txuas nrog lub hauv paus carousel nrog M3 ntsia liaj qhov rooj thiab txiv ntoo. Qhov servo yog super glued rau nws lub hauv paus. Tom qab ntawd, tus tswj lub cev muaj zog, Arduino, breadboard, RFID module, thiab RTC module txhua tus tau txuas rau lub thawv nrog ob daim kab xev. Lub LCD tau tso rau hauv lub qhov hauv lub thawv tswj. Muaj qee qhov soldering uas yuav tsum tau ua. Rau cov nyees khawm thawb, cov hlua txuas txuas yuav tsum tau muab txuas rau cov hlua txuas. Rau tus nyeem ntawv RFID, cov pins yuav tsum tau muab pov rau ntawm lub rooj tsavxwm.

Kauj ruam 4: Code

Hauv qab no yog cov lus pom zoo:

Cov tsev qiv ntawv rau Servo, LCD, RTC, RFID, thiab Stepper motor tau suav nrog hauv cov cai no.

/////////////////// Cov tsev qiv ntawv thiab cov lej

#include #include // Arduino standard library #include #include virtuallyotixRTC myRTC (2, 3, 4); // Txhais pins #define servopin 8 const int buttonup = 6; const int hauv qab = 7; int hr = 0; int minn = 0; int tau = 0; int xeev = 0; int tau tshaj tawm = 0; int xeev = 0; int tos = 0; int locker = 0; // Teeb tsa servo servo servo; int kaum = 180; #suav nrog // siv hloov kho lub tsev qiv ntawv stepper nrog 1000/0100/0010/0001 sib nqus sib ntaus sib tua. Muab lub tsev qiv ntawv tso rau hauv koj phau ntawv tais ceev tseg. #define gearratio 64 // 1: 64 gear ratio const int stepsPerRevolution = 2048; // Arduino Kit lub cev muaj zog tau npaj tseg. Los ntawm kev sim kuv txiav txim siab tias 2048 cov kauj ruam tig lub taub hau ib puag ncig. int cov kauj ruam = 0; LiquidCrystal_I2C lcd (0x27, 16, 2); // instantiate 4-hlau stepper ntawm tus pin 8 txog 11: Stepper myStepper (stepsPerRevolution, A0, A1, A2, A3); #suav nrog #suav nrog #define SS_PIN 10 #define RST_PIN 9 MFRC522 mfrc522 (SS_PIN, RST_PIN); // Tsim qhov piv txwv MFRC522. int cov = 10; teeb tsa tsis muaj dabtsis () {lcd.init (); // pib lub lcd lcd.backlight (); // Kab hauv qab no yog siv los teeb tsa lub sijhawm tam sim no. Nws tsuas yog yuav tsum tau ua tiav ib zaug, thiab tom qab ntawv tus lej // yuav tsum tau muab tso dua nrog nws tawm tswv yim. //myRTC.setDS1302Time (40, 55, 11, 1, 7, 12, 2020); pinMode (khawm, INPUT_PULLUP); pinMode (buttondown, INPUT_PULLUP); Serial.begin (9600); // Pib kev sib txuas lus txuas txuas SPI.begin (); // Pib SPI npav mfrc522. PCD_Init (); // Pib MFRC522 myStepper.setSpeed (0.15*gearratio); // lub cev muaj zog zoo li tau hloov kho rau 1/64, txhais tau tias qhov nrawm yuav tsum tau teeb tsa 64x. // pib qhov chaw nres nkoj txuas: servo.attach (servopin); } void loop () {/////////////////// LCD Code // Hloov kho cov zaub nrog lub sijhawm tam sim no thiab lub sijhawm faib khoom. lcd.clear (); myRTC.updateTime (); lcd.setCursor (0, 0); lcd.print ("Sijhawm:"); lcd.setCursor (6, 0); lcd.print (myRTC.hours); lcd.print (":"); lcd.print (myRTC.minutes); lcd.setCursor (0, 1); lcd.print ("Dispense:"); lcd.setCursor (10, 1); lcd.print (teev); lcd.print (":"); lcd.print (minn); /////////////////// Nyeem Button States // Nyeem lub xeev ntawm cov nyees khawm kom hloov lub sijhawm faib khoom. stateup = digitalRead (khawm); tau tshaj tawm = digitalRead (hauv qab); ncua (100); /////////////////// Dispensing Logic // Yog tias lub sijhawm tam sim no zoo ib yam li lub sijhawm faib khoom xaiv, tig lub stepper motor. // Txhua txhua 9 zaug cov cuab yeej xa tawm, lub cav tig mus deb ntxiv kom ntseeg tau tias muaj kev sib hloov tag nrho. yog (myRTC.hours == hr && myRTC.minutes == minn && step <9) {myStepper.step (227); cov kauj ruam = kauj ruam +1; ncua (60100); myRTC.updateTime (); } lwm tus yog (myRTC.hours == hr && myRTC.minutes == minn && step == 9) {myStepper.step (232); cov kauj ruam = 0; ncua (60100); myRTC.updateTime (); ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// Mob ntshav qab zib // Lub sij hawm rov qab los xoom thaum teev tau mus txog 24 thiab feeb tau txais mus rau 60.} yog (stateup == LOW && hr <23) {hr = hr+1; ncua (50); } lwm yog (stateup == LOW && hr == 23) {hr = 0; ncua (50); } yog (hais tawm == LOW && minn <59) {minn = minn+1; ncua (50); } lwm tus yog (hais tawm == LOW && minn == 59) {minn = 0; ncua (50); } /////////////////// RFID Code // Nyeem RFID tag thaum nws nthuav tawm. yog (! mfrc522. PICC_IsNewCardPresent ()) {rov qab; } // Xaiv ib daim npav yog (! Mfrc522. PICC_ReadCardSerial ()) {rov qab; } Cov ntsiab lus hlua = ""; byte tsab ntawv; rau (byte i = 0; i <mfrc522.uid.size; i ++) {//Serial.println(mfrc522.uid.uidByte <0x10? "0": ""); //Serial.println(mfrc522.uid.uidByte, HEX); content.concat (Txoj hlua (mfrc522.uid.uidByte <0x10? "0": "")); content.concat (Txoj hlua (mfrc522.uid.uidByte , HEX)); lub thawv = 1; } cov ntsiab lus.toUpperCase (); ///////////////// LOCK CODE // Thaum nyeem RFID tag kom raug, txav servo mus qhib txoj haujlwm thaum nws raug kaw, // thiab txav servo mus kaw txoj haujlwm thaum nws yog qhib. thaum (locker == 1) {if (content.substring (1) == "3B 21 D6 22") {// hloov ntawm no UID ntawm daim npav/daim npav uas koj xav muab kev nkag mus (hloov (deg) {rooj plaub 180: servo.write (qib); deg = 10; lub thawv = 0; Serial.print ("tsiv"); ncua (1000); tawg; rooj plaub 10: servo.write (deg); deg = 180; lub thawv = 0; ncua (1000); tawg; }}} lwm {Serial.println ("Nkag mus tsis pom zoo"); ncua (1000); }}}

Kauj Ruam 5: Teeb Kawg

Kauj ruam kawg yog npaj qhov phiaj xwm rau kev siv. Ua ntej tshaj tawm cov cai nrog lub sijhawm teeb tsa kab tsis pom zoo, txhawm rau rub lub sijhawm tam sim no rau RTC. Tom qab ntawv tawm tswv yim tawm, thiab rov ua dua tus lej. Qhov no yuav ua kom ntseeg tau tias yog tias lub cuab yeej tsis txuas, nws tseem yuav khaws lub sijhawm kom raug. Tam sim no txhua yam koj yuav tsum tau ua yog tso cov tshuaj rau hauv lub qhov, tso lub khob rau hauv qab lub qhov dej faib, thiab teem sijhawm xa tawm. Cov cuab yeej yuav ntseeg tau faib tawm tib lub sijhawm txhua hnub.

Pom zoo: