Cov txheej txheem:
- Kauj ruam 1: Zaj dab neeg
- Kauj Ruam 2: Txoj Kev Xav thiab Txoj Kev
- Kauj Ruam 3: Teeb Kho Vajtse
- Kauj ruam 4: Teeb Software
- Kauj ruam 5: Troubleshooting
- Kauj Ruam 6: Arduino Code
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:24
Cov ntawv qhia no qhia yuav ua li cas ua kom yooj yim radar system siv HC-SR04 sensor thiab Microbit dev board nrog ua thiab Arduino IDE's.
Khoom siv:
- SG90 Micro-servo motor
- Jumper xov hlau (generic)
- Breadboard (generic)
- Magicbit
- USB-A rau Micro-USB Cable
- Ultrasonic Sensor - HC -SR04 (Generic)
Kauj ruam 1: Zaj dab neeg
Hauv qhov kev qhia no peb yuav kawm paub yuav ua li cas kom yooj yim radar system siv Magicbit core dev board. Rau lub hom phiaj no peb siv HC-SR04 ultrasonic sensor thiab nthuav tawm cov ntaub ntawv, peb siv ua ib puag ncig. Cia peb pib.
Kauj Ruam 2: Txoj Kev Xav thiab Txoj Kev
Ua ntej, cia tham txog qhov no ua haujlwm li cas. Lub hauv paus yog yooj yim heev. Ua ntej peb tig peb lub sensor nyob ib puag ncig ntsug hauv 180 degree ntau yam tsis tu ncua. Thaum lub sijhawm txav ntawd peb coj cov ntaub ntawv hais txog kev nrug mus rau qhov khoom ze tshaj plaws los ntawm ultrasonic sensor ntawm txhua lub kaum ntse ntse. Rau cov txheej txheem no peb siv Magicbit core board. Tom qab, peb yuav tsum tsim kom muaj kev sib txuas nrog ua ib puag ncig los qhia peb cov ntaub ntawv. Yog li peb siv cov txheej txheem kev sib txuas lus txuas nrog tus nqi tsim nyog. Tom qab ntawd peb tsim peb lub radar system interface los ntawm kev siv ua IDE. Hauv IDE ntawd peb teeb tsa peb cov kev sib txuas lus hauv xov tooj cua kom tau txais cov ntaub ntawv ntawm lub sijhawm tiag. Yog li peb ua lub sijhawm sib tham nrog Magicbit thiab qhia cov ntaub ntawv uas xa los ntawm Magicbit mus rau kev ua IDE.
Kauj Ruam 3: Teeb Kho Vajtse
Rau qhov haujlwm no peb feem ntau siv peb ntu kho vajtse. Lawv yog Magicbit, servo motor thiab ultrasonic sensor. Qhov kev sib txuas ntawm txhua ntu no tau qhia nyob hauv Daim Duab saum toj no.
Ultrasonic sensor siv 3.3 v rau lub zog nce. Yog li peb siv txoj cai qis dua chaw nres nkoj ntawm Magicbit pawg los txuas ultrasonic sensor rau Magicbit. Tab sis servo lub cev muaj zog siv 5V rau kev ua haujlwm kom raug, Yog li peb tau siv sab laug chaw nres nkoj los txuas servo lub cev muaj zog nrog Magicbit. Hauv qhov no, peb siv Magic ntsis servo connector module. Tab sis yog tias koj tsis muaj qhov module koj tuaj yeem siv peb lub xov hlau txuas txuas 5V rau 5V, Gnd rau Gnd thiab teeb liab tus pin rau 26 tus pin ntawm magicbit.
Tom qab tsim lub Circuit Court peb muaj cov tshuab me me los tsim. teeb ib sab servo txuas rau servo lub cev siv cov txiv ntoo me. Tom qab ntawd txhim kho lub ntsuas hluav taws xob ntawm qhov txuas uas siv qee tus qauv L zoo lossis txoj hauv kev raug. Tom qab tag nrho cov kab ke peb kho rau ntawm daim ntawv tais. Tab sis koj tuaj yeem siv lwm qhov chaw los teeb tsa servo thiab Magicbit.
Kauj ruam 4: Teeb Software
Sab software yog me ntsis nyuaj. Txhawm rau nkag siab kom raug koj tuaj yeem xa cov kab ntawv txuas hauv qab no mus ua ntej txav mus rau ntu tom ntej.
magicbit-arduino.readthedocs.io/en/latest/
hello.processing.org/editor/
Cia peb saib Arduino IDE code thiab qhov chaws ntawd ua haujlwm li cas.
Rau kev tsav tsheb servo peb siv ESP32 servo library. Lub tsev qiv ntawv no yuav luag suav nrog tus thawj tswj hwm khawv koob me ntsis hauv Arduino IDE. Txhawm rau cuam tshuam nrog lub ntsuas hluav taws xob ultrasonic peb siv lub tsev qiv ntawv tshiabPing. Qhov no tuaj yeem rub tawm los ntawm kab ntawv txuas hauv qab no.
bitbucket.org/teckel12/arduino-new-ping/do…
Rub tawm cov ntawv zip thiab mus rau cov cuab yeej> suav nrog tsev qiv ntawv> ntxiv Zip tsev qiv ntawv hauv Arduino. tam sim no xaiv koj rub tawm zip cov ntaub ntawv ntawm lub tsev qiv ntawv tus pin tshiab. Txog kev sib txuas lus nrog kev ua haujlwm peb siv kev sib txuas lus txuas nrog 115200 baud tus nqi. Qhov no yog qhov tsim nyog tshaj plaws rau ESP32. Ntawm txhua lub kaum peb xa peb cov ntaub ntawv mus rau lub computer siv cov txheej txheem no. Kev nrug deb mus rau qhov khoom ze tshaj plaws ntawm lub sensor, kev taw qhia ntawm kev sib hloov thiab tig lub kaum ntse ntse tau suav nrog hauv cov ntaub ntawv no. Siv ob lub loops peb tig peb cov servo hauv ob txoj kev. Thaum ib qib kev sib hloov peb xa cov ntaub ntawv xov xwm ntawm 4 zaug. Qhov laj thawj rau qhov uas koj tuaj yeem nkag siab hauv kev ua ntu lus piav qhia.
Tam sim no nws yog lub sijhawm los saib xyuas ib puag ncig. Nov yog java based programming software. Peb tuaj yeem sau cov duab kos ntawm peb cov haujlwm hauv daim duab no hauv kev ua IDE. Peb tseem tuaj yeem tsim qhov muag pom los ntawm kev ua haujlwm peb qhov program. Tsis tas li koj tuaj yeem nqa cov khoom ua 2D thiab 3d khoom. Tsis tas li ntawd, qhov no tuaj yeem siv rau kev ua duab thiab ntau yam ntxiv.
Hauv kev kos duab ua ntej peb tsim peb cov ntaub ntawv tso saib ua ke siv cov duab yooj yooj yim. Thaum pib ntawm txoj cai peb tsim peb cov kev sib txuas lus txuas nrog los ntawm suav nrog cov tsev qiv ntawv. Hauv kev teeb tsa ua haujlwm koj yuav tsum tau hloov qee qhov raws li USB chaw nres nkoj koj siv los txuas Magicbit nrog lub khoos phis tawj. koj tuaj yeem tshawb xyuas koj qhov chaw nres nkoj siv Arduino IDE thaum koj teeb tsa Arduino IDE kom xa cov cai. Tom qab ntawd hloov com lub npe chaw nres nkoj hauv teeb tsa ib feem hauv kev kos duab. thaum muaj cov ntaub ntawv xov xwm muaj, Serialevent ua haujlwm tau txiav tawm. Yog li lub ntsiab lus tseem ceeb ntawm cov cai yog suav nrog hauv cov xwm txheej tshwm sim los tiv thaiv cov ces kaum thiab cov ntaub ntawv ploj lawm. thaum muaj cov ntaub ntawv tshiab, peb kos kab hauv qhov screen raws li peb lub kaum sab xis. Lub sijhawm ntawd yog tias tsis muaj qhov ntsuas pom, tom qab ntawv tag nrho kab yog xim ntsuab. Yog tias tsis yog qee qhov ntawm kab yuav liab raws qhov deb ntawm lub sensor mus rau yam khoom. Tsis tas li ntawd raws li kev taw qhia peb kos lwm 200 kab nyob ze rau kab ntawd nrog qib qis ntawm cov xim ntsuab. nruab nrab ntawm txhua qhov Main peb muaj 0.25 degree sib txawv. Yog li peb tau txais 4 nyeem ib lub sijhawm los ntawm Magicbit hauv txhua qib kev sib hloov. Vim li ntawd peb tuaj yeem tsim tes zoo nkauj tshawb hauv lub vijtsam.
Tom qab rub tawm cov cai ua tiav rau kev ua khawv koob thiab teeb tsa kho vajtse ib feem ua tiav qhib kev ua IDE thiab ua raws txoj cai los ntawm kev nyem khawm. Tam sim no koj muaj cov kab ke radar yooj yim heev.
Koj tuaj yeem hloov kho cov lej raws li koj xav tau yam koj xav pom.
Kauj ruam 5: Troubleshooting
Ua cov duab kos tsis tau khiav.
- Tos qee lub sijhawm. Vim tias pib lub sijhawm yog nyob ntawm koj lub PC thiab GPU kev ua tau zoo.
- Txheeb tus lej naj npawb chaw nres nkoj yog qhov raug ntawm kev kos duab.
- Txheeb xyuas USB kev sib txuas raug kho kom raug.
- Txheeb xyuas qhov sib txuas ntawm ultrasonic sensor thiab Magicbit.
- Qhib cov ntawv saib xyuas thiab txheeb xyuas cov ntaub ntawv los ntawm Arduino. Yog tias tsis yog, qhov teeb meem yog koj tus lej Arduino lossis ntawm koj li USB txuas.
Servo tsis ua haujlwm.
- Txheeb xyuas USB kev sib txuas raug kho kom raug.
- Txheeb xyuas cov xov hlau.
- Txheeb xyuas qhov servo zoo.
Kauj Ruam 6: Arduino Code
#suav nrog
#define TRIGGER_PIN 21 #define ECHO_PIN 22 #define MAX_DISTANCE 200 NewPing sonar (TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE); #suav nrog // suav nrog servo library int nrug; Kev pabcuam RadarServo; teeb tsa tsis muaj dab tsi () {Serial.begin (115200); RadarServo.attach (26); // Txhais qhov tus pin twg yog servo motor txuas qeeb (3000); } void loop () {// tig lub servo motor los ntawm 15 txog 165 degrees rau (int i = 0; i <= 180; i ++) {RadarServo.write (i); ncua (50); nrug = sonar.ping_cm (); // Hu rau lub luag haujlwm rau xam qhov deb ntsuas los ntawm Ultrasonic sensor rau txhua qib rau (int j = 0; j0) {so; } Serial.print (kuv); // Xa daim ntawv kawm tam sim no rau hauv Serial Port Serial.print (","); // Xa cov cim ntxiv nyob ib sab ntawm tus nqi yav dhau los xav tau tom qab hauv Kev Ua IDE rau kev ua lej Serial.print (j); // Xa daim ntawv kawm tam sim no rau hauv Serial Port Serial.print ("*"); Serial.print (1); // Xa tus nqi nrug mus rau hauv Serial Port Serial.print ("/"); // Xa cov cim ntxiv rau sab xis mus rau tus nqi yav dhau los xav tau tom qab hauv Kev Ua IDE rau kev txheeb xyuas Serial.print (nrug); // Xa tus nqi nrug mus rau hauv Serial Port Serial.print ("."); // Xa cov cim ntxiv rau tom ntej ntawm tus nqi yav dhau los xav tau tom qab hauv Kev Ua IDE rau kev ntsuas ntsuas}} // Rov ua dua cov kab dhau los ntawm 165 txog 15 degrees rau (int i = 180; i> = 0; i-) {RadarServo.write (kuv); ncua (50); nrug = sonar.ping_cm (); rau (int j = 75; j> = 0; j- = 25) {yog (i == 180 && (j == 75 || j == 50 || j == 25)) {txuas ntxiv; } Serial.print (kuv); // Xa daim ntawv kawm tiav tam sim no rau hauv Serial Port Serial.print (","); // Xa cov cim ntxiv nyob ib sab ntawm tus nqi yav dhau los xav tau tom qab hauv Kev Ua IDE rau kev ua lej Serial.print (j); // Xa daim ntawv kawm tam sim no rau hauv Serial Port Serial.print ("*"); Serial.print (-1); // Xa tus nqi nrug mus rau hauv Serial Port Serial.print ("/"); // Xa cov cim ntxiv rau sab xis mus rau tus nqi yav dhau los xav tau tom qab hauv Kev Ua IDE rau kev txheeb xyuas Serial.print (nrug); // Xa tus nqi nrug mus rau hauv Serial Port Serial.print ("."); // Xa cov cim ntxiv nyob ib sab ntawm tus nqi yav dhau los xav tau tom qab hauv Kev Ua Haujlwm IDE rau kev ntsuas ntsuas}}
}
Pom zoo:
D.I.Y YOOJ YIM YOOJ YIM YOOJ YIM YOOJ YIM YOOJ YIM LOS NTAWM SCRAPS: 4 Cov Kauj Ruam (nrog Duab)
D.I.Y YOOJ YIM YOOJ YIM YOOJ YIM YOOJ YIM LOS NTAWM SCRAPS: Hnub no kuv xav qhia yuav ua li cas kom pom lub teeb pom kev zoo los ntawm lub zog xa hluav taws xob tsis siv hluav taws xob los ntawm tus txhuam txhuam hniav thiab lub tshuab solenoid valve coils uas tau khaws los ntawm scrapyard.Ua ntej pib, thov saib cov vis dis aus hauv qab no:
Txoj Kev Yooj Yim thiab Yooj Yim Los Hloov Koj Lub Xauv Screen hauv 6 Cov Kauj Ruam Yooj Yim (Windows 8-10): 7 Kauj Ruam
Txoj Kev Yooj Yim thiab Yooj Yim Los Hloov Koj Lub Xauv Screen hauv 6 Cov Kauj Ruam Yooj Yim (Windows 8-10): Xav hloov pauv yam ntawm koj lub laptop lossis PC? Xav tau kev hloov pauv hauv koj qhov chaw? Ua raws cov kauj ruam no yooj yim thiab yooj yim kom ua tiav koj tus kheej lub computer ntsuas phoo
YUAV UA LI CAS YOOJ YIM YOOJ YIM YOOJ YIM YOOJ YIM YOOJ YIM TSHAJ PLAWS YOOJ YIM: 4 Cov Kauj Ruam
YUAV UA LI CAS YOOJ YIM YOOJ YIM YOOJ YIM YOOJ YIM YOOJ YIM TSHAJ PLAWS: Nyob zoo txhua tus hauv cov lus qhia no kuv yuav qhia koj yuav ua li cas kom yooj yim " SOIL DRYNESS SENSOR ". Qhuav ntawm cov av tau txheeb xyuas siv qhov taw qhia coj. Lub teeb ci wi
Ib qho yooj yim heev/yooj yim/Tsis yooj yim txoj hauv kev kom tib neeg/tib neeg/tsiaj/neeg hlau zoo li lawv muaj txias tiag tiag/Lub zeem muag tshav kub kub (Xim ntawm Koj Xaiv) Siv GIMP: 4 Cov Kauj Ruam
Ib qho yooj yim heev/yooj yim/Tsis yooj yim txoj hauv kev kom tib neeg/tib neeg/tsiaj/neeg hlau zoo li lawv muaj txias tiag tiag/Lub zeem muag tshav kub kub (Xim ntawm Koj Xaiv) Siv GIMP: Nyeem … lub npe
YOOJ YIM YOOJ YIM TSHAJ PLAWS COMPACT LIGHT !! 3 KAUJ RUAM YOOJ YIM !!: 3 Kauj Ruam
YOOJ YIM YOOJ YIM TSHAJ PLAWS COMPACT LIGHT !! 3 KAUJ RUAM YOOJ YIM !!: Koj Yuav Tsum Tau Li Cas - Tin ntawv ci 1 AA roj teeb (qee lub roj teeb AAA yuav ua haujlwm) 1 Mini Lub Teeb Pom Kev (lub teeb siv rau feem ntau lub teeb nyem; xa mus rau daim duab) Tus Tswj (yog xav tau)