Cov txheej txheem:

Project 3: SonarDuino: 9 Kauj Ruam
Project 3: SonarDuino: 9 Kauj Ruam

Video: Project 3: SonarDuino: 9 Kauj Ruam

Video: Project 3: SonarDuino: 9 Kauj Ruam
Video: Mob Txaus Lawm - Txhaij Lauj Ft. Tijlaug Xab Thoj (Special Project) 2024, Hlis ntuj nqeg
Anonim
Image
Image

Nyob zoo cov phooj ywg Hobbyist, Hauv txoj haujlwm no peb yuav tshawb xyuas qhov muaj peev xwm ntawm 360 degrees radar system txhawm rau txheeb xyuas qhov khoom. Muaj qhov txheej txheem teeb tsa no cais yuav tso cai rau koj cov neeg hlau txav mus los txhawm rau txheeb xyuas thaj tsam ntawm nws ib puag ncig. Nws tseem tuaj yeem ua haujlwm ua cov cuab yeej taug kev ntawm qhov tsaus ntuj, tab sis tsuas yog thaum koj taug kev qeeb txaus; p

Kauj Ruam 1: Yam Koj Yuav Tsum Tau

Npaj Ultrasonic Sensor Support
Npaj Ultrasonic Sensor Support

Txhawm rau ua qhov kev tsim no koj yuav tsum yuav cov hauv qab no:

Arduino Nano: https://www.ebay.com/itm/USB-Nano-V3-0-ATmega328-16M-5V-Micro-controller-CH340G-board-For-Arduino/201601613488?hash=item2ef0647eb0:g:DkoAAOSwvYZZpOl0 rk: 2: npw: 0

Pawg Thawj Coj: https://www.ebay.com/itm/20pcs-set-4Size-Double-Side-Protoboard-Circuit-Universal-DIY-Prototype-PCB-Board/192076517108?epid=506557101&hash=item2cb8a70ef4:g:cQ4AA ~ Zbl232: rk: 13: pf: 0

Servo Motors: https://www.ebay.com/itm/5pcs-POP-9G-SG90-Micro-Servo-motor-RC-Robot- Helicopter-Airplane-Control-Car-Boat/142931003420?hash=item21475a081c:rk 16: pf: 0 ua

Ultrasonic Sensors: https://www.ebay.com/itm/5PCS-Ultrasonic-Sensor-Module-HC-SR04-Distance-Measuring-Sensor-for-arduino-SR04/170897438205?epid=18020663283&hash=item27ca47f5fd: g: w ~ IAAOSw-xbD5Fp: rk: 2: pf: 0

Kauj ruam 2: Cov ntaub ntawv

Raws li qee tus ntawm koj yuav paub qhov no, txoj haujlwm no tau tshoov siab los ntawm lwm qhov haujlwm qhib hu ua "Arduino Radar Project" ua los ntawm Dejan los ntawm "Yuav Ua Li Cas Mechatronics" @ qhov txuas hauv qab no: https://howtomechatronics.com/projects/arduino -radar-qhov project/

Lwm lub ntsiab lus uas xav tau cov ntaub ntawv yog rub ob lub tsev qiv ntawv hauv qab no rau hauv koj ib puag ncig kev txhim kho:

Adafruit-GFX-Library:

Adafruit_SSD1306:

Qhov no tau hais, kom nkag siab C tus lej koj yuav tsum tau ua qee cov ntaub ntawv ntawm ob lub tsev qiv ntawv saum toj no. Tsis tas li ntawd, cov haujlwm uas kuv siv hauv kuv tus lej muaj cov npe uas qhia rau lawv tias lawv ua dab tsi.

Kauj Ruam 3: Npaj Ultrasonic Sensor Support

Npaj Ultrasonic Sensor Support
Npaj Ultrasonic Sensor Support
Npaj Ultrasonic Sensor Support
Npaj Ultrasonic Sensor Support
Npaj Ultrasonic Sensor Support
Npaj Ultrasonic Sensor Support

Nqa ib qho ntawm cov duab los qhia thiab txiav nws raws li qhov ntev ntawm cov kab sib txuas uas txuas rau lub ntsuas hluav taws xob raws li qhia hauv daim duab thawj. Tom qab ntawd, khawm qhov kawg no thiab lo nws rau qhov kev pabcuam servo motor. Thaum uas ua tiav, lo ob lub ultrasonic ntsuas raws li daim duab kawg. Nco ntsoov tias lub taub hau ntawm lub ntsuas cua yuav tsum tau muab tso rau hauv txoj hauv kev kom cov kab hluav taws xob tawm mus sab xub ntiag ntawm lub sensor. Qhov no yuav tso cai rau cov xaim hluav taws xob tsis txhob cuam tshuam nrog ib leeg thaum kev hloov pauv 360 degrees.

Kauj Ruam 4: Mount Txhua Yam Rau Hauv Pawg Thawj Coj

Mount Txhua Yam Rau Hauv Pawg Thawj Coj
Mount Txhua Yam Rau Hauv Pawg Thawj Coj
Mount Txhua Yam Rau Hauv Pawg Thawj Coj
Mount Txhua Yam Rau Hauv Pawg Thawj Coj
Mount Txhua Yam Rau Hauv Pawg Thawj Coj
Mount Txhua Yam Rau Hauv Pawg Thawj Coj

Hauv cov kauj ruam no koj yuav pib los ntawm kev teeb tsa lub taub hau tau npaj tseg hauv cov kauj ruam dhau los rau hauv nws cov kev pabcuam servo. Thaum lub tshuab servo tau ua tib zoo siv, koj yuav ua txhua yam ua ke rau hauv pawg thawj coj. Koj yuav pib los ntawm soldering Arduino Nano tom qab ntawd los ntawm gluing servo txoj cai ib sab ntawm nws. Thaum kawg koj yuav muab cov OLED me me tso rau ntawm lwm sab ntawm lub rooj tsavxwm.

Kauj Ruam 5: Ua Qhov Kev Sib Txuas zaum kawg

Ua Qhov Kev Sib Txuas zaum kawg
Ua Qhov Kev Sib Txuas zaum kawg
Ua Qhov Kev Sib Txuas zaum kawg
Ua Qhov Kev Sib Txuas zaum kawg
Ua Qhov Kev Sib Txuas zaum kawg
Ua Qhov Kev Sib Txuas zaum kawg

Cov kauj ruam no yuav xaus qhov kho vajtse sab ntawm qhov haujlwm no. Koj yuav tsum tau ua raws cov txheej txheem muab los tsim txhua qhov kev xav tau sib txuas.

Kauj Ruam 6: Pib qhov program

Booting qhov kev zov me nyuam
Booting qhov kev zov me nyuam

Muaj Ob Txoj Cai uas koj yuav tsum tau khau raj

Arduino (C):

Ua (java):

Thaum khiav cov cai, koj yuav muaj ob txoj kev xaiv los ntawm:

Qhov Xaiv 1: Siv OLED Display, rau qhov koj yuav tsum teeb tsa tus qauv sib txawv hauv C code rau 0.

Qhov Xaiv 2: Siv Koj Tus Kheej, rau qhov koj yuav tsum tau teeb tsa MODE sib txawv hauv C code rau 1. Ntxiv rau, koj yuav tsum rub tawm thiab teeb tsa Kev txhim kho ib puag ncig ib puag ncig thiab rub cov ntawv radar los ntawm qhov txuas no: https:// github.com/lastralab/ArduinoRadar/blob/ma…

Thiab ntxiv cov ntaub ntawv ntawd rau koj cov lej ua cov ntaub ntawv kom koj tus lej java yuav lees paub tus ntawv thaum hu.

Kauj Ruam 7: Nkag Siab C Code

Nkag siab C Code
Nkag siab C Code

Cov cai muaj feem ntau ntawm ob 'rau' loops. Ib qho yog cuam tshuam nrog kev hla mus tom ntej thaum lwm qhov yog nrog daim npav rov qab. Sab hauv ob ntawm lawv, lub luag haujlwm tseem ceeb kos_scanner (), uas yuav kos kab ntawm radar mus rau lub vijtsam, hu ua ntau zaus. Tom qab kuaj ntau yam teeb tsa, kuv tau los xaus qhov uas peb xav tau sau dua cov kab dawb radar ntawm lub sijhawm t nrog cov kab radar zoo ib yam hauv cov xim dub ntawm lub sijhawm t+1 txhawm rau tshem tawm lawv. Yog tias tsis yog, flickering yuav tshwm sim txhua lub sijhawm koj ntxuav cov zaub siv lub luag haujlwm "clearDisplay ()" ua ntej thawb lub pixel tshiab. Raws li kuv tab tom cuam tshuam nrog 7 kab- rau lub hom phiaj tsim- Kuv yuav tsum khaws kev txuag thiab hla cov lej sib xyaw ntawm 7 lub ntsiab lus, qhov twg txhua lub ntsiab lus sawv rau lub vojvoog nruab nrab ntawm nruab nrab ntawm lub radar mus rau cov khoom pom, yog tias muaj. Nrog rau qhov no hauv siab, tus so ntawm txoj cai yuav tsum ncaj nraim rau kev nkag siab.

Kauj Ruam 8: Nkag Siab Java Code

Hauv Kev Ua, Kuv yuav tsum hla txoj haujlwm hu rau serialEvent (), uas ua haujlwm nkaus xwb nrog cov chaw nres nkoj npe hu ua COM. Raws li kuv tau ua haujlwm ntawm Mac, kuv cov chaw nres nkoj txuas hauv qab lub npe txawv. Uas tau hais tias, Kuv tau ntim lub luag haujlwm ntawd rau hauv lub luag haujlwm tseem ceeb hauv kev ua "kos ()". Hais txog txhua yam ntxiv, Kuv tau hloov kho daim ntawv thov kom tau raws li kev hloov pauv tag nrho. Thaum kawg, Kuv hloov kho txhua daim duab kos thiab cov ntawv nrog kev hwm rau qhov dav ntawm lub vijtsam kom cov khoom kawg yuav haum rau kev tshuaj ntsuam sib txawv. Kuv tau tus kheej sim nws rau ob qho tib si 1000X1000 thiab 500X500 kev daws teeb meem, thiab nws ua haujlwm tau zoo:).

Kauj Ruam 9: Xaus

Txoj haujlwm no tuaj yeem hloov kho kom muaj 3 Ultrasonic sensors, txhua qhov npog 120 lub kaum sab xis, lossis txawm tias 4 lub ntsuas (90 degrees*4) -> nrawm dua 360 deg. luam theej duab.

Koj tseem tuaj yeem txuas ntxiv qhov ntau ntawm radar los ntawm 40 cm mus rau 60 cm lossis txawm tias 80 cm. Kuv tus kheej tau sim ua haujlwm pulseIn thiab hloov kho TIMEOUT sib txawv nrog kev hwm txog 40 cm. Qhov sib txawv no nyob ntawm ntau yam, suav nrog qhov ntev ntawm kev xa cov mem tes thiab saum npoo ntawm qhov khoom uas qhov mem tes tau pom.

Thaum kawg raws li tau hais ua ntej, cov kauj ruam tom ntej yog koom nrog radarDuino nrog cov neeg hlau txav chaw txhawm rau txheeb xyuas thaj tsam ib puag ncig.

Pom zoo: