Cov txheej txheem:

Kev Ruaj Ntseg Hauv Tsev Siv Sensor Fusion: 5 Kauj Ruam
Kev Ruaj Ntseg Hauv Tsev Siv Sensor Fusion: 5 Kauj Ruam

Video: Kev Ruaj Ntseg Hauv Tsev Siv Sensor Fusion: 5 Kauj Ruam

Video: Kev Ruaj Ntseg Hauv Tsev Siv Sensor Fusion: 5 Kauj Ruam
Video: Saib Pob Ntseg Qhia Tau Neeg Tus Yam Ntxwv! 2024, Hlis ntuj nqeg
Anonim
Kev Ruaj Ntseg Hauv Tsev Siv Sensor Fusion
Kev Ruaj Ntseg Hauv Tsev Siv Sensor Fusion

Lub tswv yim tom qab txoj haujlwm no yog tsim kom pheej yig thiab yooj yim los ua kom muaj kev ruaj ntseg uas tuaj yeem siv los ceeb toom koj thaum ib tus neeg hla nws. Lub hom phiaj tseem ceeb yog tsim kom muaj qee yam uas tuaj yeem ceeb toom rau kuv thaum ib tus neeg taug kev nce ntaiv tab sis kuv kuj siv nws ua lub ntsuas kev ruaj ntseg rau lub qhov rooj. Cov software muab hauv cov lus qhia no yog sib xws nrog macOS. Kev hloov pauv me ntsis yuav tsum tau ua rau nws ua haujlwm nrog Windows. Txog tag nrho cov cai rau ib qho ntawm cov ntawv sau no, xa mus rau GitHub repo no.

Khoom siv:

  1. Arduino Nano* Cov
  2. Ultrasonic HC-SR04 Sensor
  3. Bluetooth HC-05 Module
  4. OMRON Tactile Hloov
  5. 10 k Resistor
  6. Breadboard Hlau Khoom
  7. Cov qhob cij
  8. Fais fab txhab nyiaj

*Uno lossis mega kuj tseem tuaj yeem siv qhov chaw ntawm nano.

Kauj Ruam 1: Teeb Teeb

Teeb tsa Circuit
Teeb tsa Circuit

Ua raws cov phiaj xwm hluav taws xob raws li qhia saum toj no. Thaum koj xa daim duab Arduino mus rau nano, nco ntsoov tshem cov xov hlau los ntawm RX thiab TX pins ntawm nano. Nws tau pom tias kev xa mus rau Arduino tuaj yeem ua rau yuam kev yog tias cov pins txuas nrog lub bluetooth module. Rub tawm daim duab kos ua ntej thiab tom qab ntawd txuas cov pins mus rau bluetooth module.

Cov Cheeb Tsam Loj

  1. Arduino Nano - Microcontroller
  2. HC -SR04 - Ultrasonic Sensor
  3. HC -05 Module - Bluetooth Module
  4. OMRON Hloov - Khawm Siv Hloov Sensor On/Off

Kauj ruam 2: Software Teeb: Arduino

Teeb Software: Arduino
Teeb Software: Arduino
  1. Rub tawm Software Serial rau koj lub tsev qiv ntawv Arduino
  2. Nco ntsoov xaiv qhov chaw nres nkoj thiab pawg thawj coj saib uas haum koj li Arduino
  3. Rub tawm cov ntaub ntawv xov xwm muab thiab xa daim duab kos ib zaug koj paub tseeb tias RX/TX pins ntawm Arduino raug txiav tawm ntawm lub tshuab bluetooth.

Kauj Ruam 3: Software Teeb: Python

Teeb Software: Python
Teeb Software: Python

Txhawm rau ceeb toom koj ntawm koj lub khoos phis tawj kom zoo, koj yuav tsum tau khiav kab ntawv nab hab sej. Txog kev pab rub tawm nab hab sej thiab cov tsev qiv ntawv xav tau thov xa mus rau qhov qhia tau qhia los ntawm TalalKhalil.

Qhov muab cov ntawv nyeemValuesV2.py nyeem hauv qhov tseem ceeb xa los ntawm bluetooth module, txiav txim siab yog tias nws qhia tau tias ib tus neeg tau hla lub sensor thiab tsim kev ceeb toom ntawm koj lub laptop. Nws tseem tsim thiab khaws cov ntawv tais ceev tseg hauv phau ntawv teev npe nrog txhua qhov kev ntsuas nws nyeem txij li tsab ntawv pib nrog lub sijhawm thwj cim.

Ua:

  1. Rub tawm Python thiab txhua qhov kev cia siab. (Kuv siv pip nruab)
  2. Nco ntsoov qhib lub bluetooth ntawm koj lub laptop thiab txuas rau lub cuab yeej uas muaj npe hu ua HC-06. Koj yuav tsum pom nws tau teev tseg hauv qab lwm cov npe khoom hauv bluetooth ib feem ntawm koj li kev teeb tsa. Tus passcode rau tus qauv yog '1234'.
  3. Qhov sib txawv hu ua distance_wall yog qhov uas txiav txim siab thaum lub sensor tawm mus. Yog li nyob ntawm qhov chaw sensor, nco ntsoov hloov tus nqi no uas sawv cev hauv cms rau koj ib puag ncig.
  4. Txuas tus pin RX/TX ntawm tus qauv bluetooth thiab tam sim no khiav cov ntawv nyeemValuesV2. Nws yuav nug koj txog tus lej sau cia kom nws tuaj yeem tsim lub npe kom raug cov ntaub ntawv nws tsim tawm.

Nws zoo li koj yuav tsum tau ua ntau qhov debugging yog li xa mus rau ntu kawg hauv Cov Lus Qhia no rau kev pab ntxiv.

Kauj Ruam 4: Yuav Tsum Debugging Teeb Meem

Arduino

1) avrdude: stk500_getsync (): tsis sib xws: resp = 0x0: Qhov no feem ntau tshwm sim nrog thaum sim xa cov duab kos rau Arduino.

  • Xyuas kom tseeb tias qhov chaw nres nkoj COM raug thiab xaiv tau xaiv
  • Yog tias koj tab tom siv 'ATmega328P' sim 'ATmega328P (Old Bootloader)'
  • Nco ntsoov tias RX/TX tus pin ntawm Arduino raug kaw

2) Busy Comport yuam kev

Xyuas kom meej tias qhov chaw nres nkoj COM raug xaiv. Txij li koj tau sim xa cov duab kos mus rau Arduino, nco ntsoov tias tsab ntawv nab nab tsis ua haujlwm

Nab hab sej

1) [Errno 16] Cov khoom siv tsis khoom: '/dev/tty. HC-06-DevB': Qhov no tshwm sim thaum koj tsis txuas koj lub khoos phis tawj rau lub tshuab bluetooth

Txhawm rau daws qhov no koj yuav tsum ua kom ntseeg tau tias koj tau txuas HC tus qauv rau koj lub khoos phis tawj kom raug. Koj kuj yuav tsum xyuas kom meej tias cov qauv no tseem txuas nrog, nws yuav dhau los ua kev sib txuas tom qab koj ua tiav tsab ntawv

2) Qhov Tsis Zoo: Lub bluetooth module tsis txuas nrog

Nov yog qhov yuam kev pov tseg ntawm tus kheej yog tias Serial Port Connection nrog bluetooth module tsis txuas nrog

3) Python Packages Dependencies yuam kev

Kuv siv pip nruab los rub cov pob khoom xav tau rau nab hab sej. Xa mus rau pawg hla rau txhua qhov ua yuam kev uas tshwm tuaj ntawm qhov kawg

4) Ua yuam kev Vim OS

Kuv cia siab tias qee qhov yuam kev yuav tshwm tuaj yog tias os tau siv yog Windows. Qee qhov chaw uas yuav muaj teeb meem yog kev sau cov ntaub ntawv kaw thiab ceeb toom system ntawm koj lub laptop

5) serial.serialutil. SerialException: ntaus ntawv ceeb toom npaj kom nyeem tab sis rov qab tsis muaj cov ntaub ntawv

Qhov no qee zaum tshwm sim yog tias lub hwj chim raug muab tua. Qhov no tshwm sim rau kuv thaum kuv toggled lub cuab yeej tawm siv qhov hloov pauv

Kho vajtse

1) Ua kom ntseeg tau tias qhov hloov pauv tau zoo ntawm txoj kab sib faib ntawm lub khob cij kom tsis txhob sib txuas.

Kauj Ruam 5: Demoing the Complete Device

Demoing Qhov Ua Ntej Ua tiav
Demoing Qhov Ua Ntej Ua tiav
Demoing Qhov Ua Ntej Ua tiav
Demoing Qhov Ua Ntej Ua tiav
Demoing Qhov Ua Ntej Ua tiav
Demoing Qhov Ua Ntej Ua tiav

Thov ua siab zoo los tshawb xyuas cov vis dis aus kom pom lub cuab yeej ua haujlwm siv qhov txuas txuas lossis qhov txuas YouTube no: https://www.youtube.com/embed/Ab1wKr2ORbM. Zuag qhia tag nrho, qhov no yog qee yam uas kuv siv tsis tu ncua tam sim no thiab tau pom tias nws tsis tso lub zog hluav taws xob nrawm dhau lossis nyuaj siab kuv lub khoos phis tawj qub hais txog kev ua lub zog. Yog tias koj muaj teeb meem, xav tias tsim qhov teeb meem tshaj tawm ntawm qhov cuam tshuam GitHub repo rau txoj haujlwm no!

Pom zoo: