Cov txheej txheem:

ESP32 Lub Koob Yees Duab Neeg Hlau - FPV: 6 Kauj Ruam
ESP32 Lub Koob Yees Duab Neeg Hlau - FPV: 6 Kauj Ruam

Video: ESP32 Lub Koob Yees Duab Neeg Hlau - FPV: 6 Kauj Ruam

Video: ESP32 Lub Koob Yees Duab Neeg Hlau - FPV: 6 Kauj Ruam
Video: Wb tsis yeem swb By DA LEE HER Ft. LEE KONG XIONG (officiol music) nkauj tawm tshiab 2022 2024, Kaum ib hlis
Anonim
Image
Image
ESP32 Lub Koob Yees Duab Neeg Hlau - FPV
ESP32 Lub Koob Yees Duab Neeg Hlau - FPV
ESP32 Lub Koob Yees Duab Neeg Hlau - FPV
ESP32 Lub Koob Yees Duab Neeg Hlau - FPV

ESP32 Lub Koob Yees Duab module yog qhov pheej yig thiab muaj zog PLC. Nws txawm suav nrog kev lees paub lub ntsej muag!

Cia peb tsim Thawj Tus Neeg Saib Xyuas Neeg Hlau uas koj tsav hla lub vev xaib hauv lub rooj sib tham!

Txoj haujlwm no siv Geekcreit ESP32 module nrog OV2640 Lub Koob Yees Duab. Nws yog raws AIThinker module.

Muaj ntau qhov sib txawv ESP32 Lub Koob Yees Duab clones tawm muaj. Qee qhov ua haujlwm, qee qhov tsis ua. Kuv xav qhia koj siv tib tus qauv uas kuv tau ua yog li koj muaj lub sijhawm zoo los ua tiav.

Neeg hlau ua haujlwm raws li hauv qab no.

ESP32 tshaj tawm lub vev xaib URL rau koj lub network uas nthuav tawm cov vis dis aus nyob nrog qee lub npov rau ua haujlwm qee lub luag haujlwm ntawm lub koob yees duab. Nws tseem tau txais cov ntawv tseem ceeb xa mus rau lub vev xaib los ntawm cov keyboard uas yog cov lus qhia rau tus neeg hlau. Koj tuaj yeem xav tsim lub USB joystick daim thaiv kom koj tuaj yeem tsav tus neeg hlau nrog lub joystick ntau dua li ntaus cov lus txib keyboard.

Thaum ESP32 tau txais qhov tseem ceeb nias, nws xa cov bytes mus rau Arduino Nano uas tom qab ntawd tsav lub cav kom ua rau neeg hlau txav mus.

Txoj haujlwm no yog qhov nyuaj me ntsis-siab. Thov siv koj lub sijhawm.

Cia peb pib!

Khoom siv

  • ESP -32 Lub Koob Yees Duab nrog OV2640 Lub Koob Yees Duab - Kuv xav kom Geekcreit khoom
  • Sab nraud snap-on kav hlau txais xov rau ESP-32 txhawm rau ua kom lub teeb liab muaj zog tshaj plaws
  • Arduino Nano Cov
  • Arduino Leonardo rau Joystick module (peb xav tau USB keyboard ua raws los ntawm Leonardo)
  • Generic Joystick module
  • L293D Quad H-choj nti
  • DC-DC Buck Coverter nrog 5V tso zis rau lub zog ESP32
  • FTDI Serial Adapter rau kev ua haujlwm ESP32
  • Ib tus neeg hlau dav hlau chassis nrog ob lub cav uas muaj zog - txhua lub chassis yuav ua haujlwm. 3 txog 6V lub cev muaj zog tau pom zoo
  • 2 x 7.4V 1300mAh LiPo roj teeb (lossis zoo sib xws) kom muaj zog ESP32 thiab lub cev muaj zog
  • 1 x 9V roj teeb kom muaj zog rau Arduino Nano

Kauj Ruam 1: Kho lub ESP32 Lub Koob Yees Duab

Program lub ESP32 Lub Koob Yees Duab
Program lub ESP32 Lub Koob Yees Duab
Program lub ESP32 Lub Koob Yees Duab
Program lub ESP32 Lub Koob Yees Duab

Siv lub khob cij, txuas koj lub ESP32 Lub Koob Yees Duab rau FTDI adapter raws li hauv qab no:

FTDI ESP32

3.3V ----------- 3.3V

GND -------------- NCO

TX ----------- U0R

Rx ----------- U0T

Ib qho ntxiv, txuas tus pin IO0 ("qhov muag-oh-xoom") rau GND. Koj yuav tsum ua qhov no txhawm rau muab ESP32 rau hauv hom phiaj ua haujlwm.

Unzip cov ntaub ntawv esp32CameraWebRobotforInstructable.zip.

Muaj 4 cov ntaub ntawv hauv qhov haujlwm no:

esp32CameraWebRobotforInstructable.ino yog daim duab Arduino.

ap_httpd.cpp yog tus lej uas tswj hwm lub vev xaib thiab cuam tshuam nrog teeb tsa lub ntsej muag lub ntsej muag los ntawm nplooj ntawv web thiab tau txais qhov tseem ceeb nias los ntawm nplooj ntawv web.

camera_index.h muaj HTML/JavaScript code rau lub vev xaib thov ua byte arrays. Kev hloov kho daim ntawv thov web yog qhov zoo tshaj qhov ua haujlwm ntawm txoj haujlwm no. Kuv yuav suav nrog qhov txuas rau yuav hloov kho HTML/JavaScript tom qab li cas.

camera_pins.h yog cov ntawv header ntsig txog tus pin teeb tsa ntawm ESP32 lub koob yees duab.

Txhawm rau muab ESP32 rau hauv Hom Kev Kawm, koj yuav tsum txuas IO0 ("qhov muag-oh-xoom") rau hauv av.

Tua tawm koj li Arduino IDE thiab mus rau Cov Cuab Yeej/Boards/Boards Manager. Tshawb nrhiav esp32 thiab teeb tsa lub tsev qiv ntawv esp32.

Qhib qhov haujlwm hauv koj Arduino IDE.

Muab koj tus router lub network ID thiab koj tus password rau hauv kab uas hais hauv daim duab saum toj no. Txuag txoj haujlwm.

Mus rau Cov cuab yeej ntawv qhia zaub mov thiab xaiv qhov raws li pom hauv daim duab saum toj no.

Pawg: ESP32 Wrover

Upload Ceev: 115200

Partition Scheme: "APP loj loj (3MB tsis muaj OTA)"

thiab xaiv qhov chaw nres nkoj uas koj FTDI adapter txuas nrog.

Nyem rau "Upload" khawm.

Tam sim no, qee zaum, ESP32 yuav tsis pib rub tawm. Yog li npaj kom nias lub RESET khawm nyob tom qab ntawm ESP32 thaum koj pib pom lub… ---… cov cim tshwm hauv lub console thaum rub tawm. Tom qab ntawd nws yuav pib rub tawm.

Thaum koj pom 'nias RST' ntawm lub console, rub tawm tiav.

DISCONNECT IO0 los ntawm Av. Tshem tawm txoj kab 3.3V ntawm FTDI adapter thiab ESP32.

Lub Koob Yees Duab ESP32 xav tau ntau qhov tam sim no kom ua haujlwm tau zoo. Txuas 5V 2A lub zog hloov pauv mus rau 5V thiab GND pins ntawm ESP32.

Qhib Serial Monitor, teeb tsa baud tus nqi rau 115200 thiab tom qab ntawd saib raws li ESP32 rov pib dua. Thaum kawg, koj yuav pom qhov URL rau tus neeg rau zaub mov.

Mus rau koj tus browser thiab sau qhov URL. Thaum lub vev xaib thauj khoom, nyem lub pob 'Pib Tshaj Tawm' thiab cov vis dis aus nyob yuav tsum pib. Yog tias koj nyem rau ntawm lub cim 'Floodlight', ntawm lub teeb nyem LED yuav tsum teeb. Saib xyuas! Nws yog qhov kaj!

Kauj Ruam 2: Tsim Tus Neeg Hlau

Tsim Neeg Hlau
Tsim Neeg Hlau

Koj xav tau ob lub log neeg hlau chassis. Ib tus twg yuav ua. Sib dhos lub chassis raws li cov chaw tsim khoom qhia.

Tom qab ntawd xaim tus neeg hlau raws li daim duab qhia tseg.

L293D yog siv los tswj lub cav. Daim ntawv ceeb toom tias ib nrab-nqis siab ntawm lub nti yog TOWARDS ESP32.

Feem ntau, xav tau 6 tus pin ntawm Arduino los tswj ob lub cav.

Tus neeg hlau no tsuas xav tau 4 tus pin thiab tseem ua haujlwm tau zoo.

Pins 1 thiab 9 txuas nrog 5V qhov chaw ntawm Arduino yog li lawv nyob ruaj khov. Kev xaim tus neeg hlau li no txhais tau tias peb xav tau ob tus pin tsawg dua ntawm Arduino los tswj lub cav.

Hauv ntej cov lus qhia, INPUT pins tau teeb tsa LOW thiab lub cev muaj zog Pulse Wave Modulation pins tau teeb tsa qhov tseem ceeb ntawm 0 thiab 255 nrog 0 lub ntsiab lus OFF thiab 255 lub ntsiab lus siab tshaj plaws.

Hauv cov lus qhia rov qab, INPUT pins tau teeb tsa HIGH thiab PWM qhov tseem ceeb tau thim rov qab. 0 txhais tau tias qhov siab tshaj plaws thiab 255 txhais tau tias tawm.

Unzip thiab upload ArduinoMotorControl kos duab rau Arduino Nano.

Kauj ruam 3: HEEV! Tos ib pliag! Vim Li Cas Kuv Xav Tau Arduino Nano?

Tej zaum koj yuav xav tias, "Hav! Muaj tsawg kawg 4 IO pins muaj nyob ntawm ESP32 lub koob yees duab. Vim li cas kuv thiaj siv tsis tau lawv los tswj lub cav?"

Zoo, nws muaj tseeb, muaj pins ntawm ESP32 raws li hauv qab no:

IO0 - xav tau rau kev tso ESP32 hauv hom phiaj ua haujlwm

IO2 - muaj

IO4 - Flash LED

IO12, IO13, IO14, IO15, IO16 - ntxiv GPIO pins.

Yog tias koj tsuas yog rub cov duab kos yooj yim mus rau ESP32 los tswj cov pins nrog PWM cov lus txib, lawv ua haujlwm.

YUAV UA LI CAS, thaum koj qhib CAMERA cov tsev qiv ntawv hauv koj daim duab, cov koob no tsis muaj lawm.

Yog li qhov yooj yim tshaj plaws los ua yog tsuas yog siv Nano los tswj lub cav ntawm PWM thiab xa cov lus txib los ntawm ESP32 los ntawm kev sib txuas lus txuas ib kab (ESP32 U0T rau Arduino Rx0) thiab GND. Yooj yim heev.

Kauj Ruam 4: Hlau Up USB Joystick (Xaiv tau)

Koj tuaj yeem tsav tus neeg hlau los ntawm kev xa tus yuam sij rau lub vev xaib raws li hauv qab no:

8 - Mus tom ntej

9 - Mus Rau Txoj Cai

7 - Forward Sab laug

4 - Tig sab laug

5 - Nres

1 - Rov qab Sab laug

2 - Rov qab

3 - Rov Qab Txoj Cai.

Lub USB joystick kos duab txhais cov joystick nkag mus rau qhov tseem ceeb nias thiab xa lawv mus rau lub vev xaib sib txuas uas xa lawv mus rau Arduino kom tsav neeg hlau.

Txuas tus joystick rau Arduino LEONARDO raws li hauv qab no:

Leonardo Joystick

5 V ---------- VCC

GND ---------- NCO

A0 ---------- VRx

A1 ---------- VRy

Qhib usbJoyStick kos duab, xaiv Arduino Leonardo ua lub rooj tsavxwm thiab xa nws mus rau Leonardo.

Yog tias koj xav sim nws, tsuas yog qhib cov ntawv sau ntawm koj lub khoos phis tawj, nyem nas hauv lub qhov rais thiab pib txav lub joystick. Koj yuav tsum pom qhov tseem ceeb ntawm 1 txog 9 qhia hauv lub qhov rai

Kauj Ruam 5: TUS NEEG Caij

Siv sijhawm me ntsis thiab hla koj cov thaiv kom paub tseeb tias txhua yam raug.

Tom ntej no, txuas koj lub roj teeb raws li hauv qab no.

1. Hwj chim ESP32 Lub Koob Yees Duab. Nws xav tau ob peb feeb los pib lub web server.

2. Hwj chim rau Arduino Nano.

3. Hwj chim lub cev muaj zog.

Tua tawm koj tus browser thiab mus rau URL rau ESP32.

Nyem rau Start Streaming khawm.

Nyem koj tus nas ib qho ntawm qhov browser browser kom lub vijtsam tam sim no yog qhov ua kom pom tseeb.

Pib tsav koj tus neeg hlau nrog tus joystick (lossis keyboard).

Kuv tau pom tias lub thav duab me me ua haujlwm zoo rau kev tshaj tawm cov vis dis aus nyob ncaj ncees ua haujlwm dhau WiFi. Txawm li cas los xij thaum koj nce cov duab thav duab, cov kwj dej yuav dhau mus zuj zus vim tias koj tab tom sim tshaj tawm cov duab loj dua.

Nov yog qhov haujlwm nyuaj uas muab sijhawm rau koj kom pib ua haujlwm nrog cov vis dis aus nyob thiab tsav tus neeg hlau hla WiFi. Kuv vam tias koj pom nws lom zem!

Tam sim no mus thiab ua ib yam dab tsi zoo heev!

Lub Ib Hlis 2020 Hloov Kho Tshiab - Cov duab kawg qhia txog qhov kawg ntawm tus neeg hlau, nyuaj muag thiab txhim kho kom ruaj ntseg rau ntawm lub chassis.

Peb qhov hloov pauv pem hauv ntej yog raws li hauv qab no:

Sab laug - Lub cev muaj zog roj teeb

Chaw - Arduino roj teeb

Txoj cai - ESP32 Lub Koob Yees Duab Roj Teeb

Kuv tuaj yeem siv lub roj teeb loj nrog qee qhov hloov pauv hloov pauv (Kuv siv ib qho rau ESP32-nws nyob rau sab xis sab xis ntawm daim duab saib ua ntej), tab sis rau qhov yooj yim, kuv tsuas yog khaws 3 lub roj teeb.

Neeg hlau tam sim no ntawm Access Point

Kuv pom nws nyuaj rau qhia tus neeg hlau no sab nraum kuv lub tsev vim tias kuv lub tsev kawm ntawv kev lag luam network tsis tso cai rau kuv txuas cov neeg hlau web server rau nws. Raws li kev daws teeb meem, Kuv tau tshawb fawb txog kev siv Access Point feature ntawm ESP32 web server. Nws yuav siv qee qhov haujlwm, tab sis yuav tsum muaj kev hloov pauv me me rau lub ntsiab neeg hlau ua kom ESP32 tshaj tawm nws tus kheej tus IP chaw nyob. Nws tsis muaj zog npaum li kev mob siab rau siab wifi lub hub (qee zaum dai yog tias koj txav nrawm dhau), tab sis nws ua haujlwm tau zoo heev thiab tam sim no kuv tuaj yeem pom tus neeg hlau nyob txhua qhov chaw kuv xav tau yam tsis tas txuas nws mus rau lub network! Thaum koj tau txais tus neeg hlau ua haujlwm, sim hloov nws mus rau Access Point koj tus kheej!

Kauj Ruam 6: Cov Lus Qhia Yuav Hloov Li Cas HTML/Javascript Code rau Lub Vev Xaib

Qhov no tsis tsim nyog, tab sis kuv tau thov qee qhov.

Kuv tau muab qhov Google Doc no nrog cov ntsiab lus yuav siv CyberChef hloov pauv mus los ntawm HTML/Javascript thiab cov byte array sawv cev hauv cov ntaub ntawv camera_index.h.

Pom zoo: