Cov txheej txheem:

Wi-Fi Tswj 4-Wheeled Robot: 6 Kauj Ruam
Wi-Fi Tswj 4-Wheeled Robot: 6 Kauj Ruam

Video: Wi-Fi Tswj 4-Wheeled Robot: 6 Kauj Ruam

Video: Wi-Fi Tswj 4-Wheeled Robot: 6 Kauj Ruam
Video: 20 MOMENTS YOU WOULDN'T BELIEVE IF NOT FILMED 2024, Hlis ntuj nqeg
Anonim
Wi-nkaus Tswj 4-Wheeled Robot
Wi-nkaus Tswj 4-Wheeled Robot

Txog qhov haujlwm no, peb yuav tsim kho 4-Wheeled Robot siv ESP8266 uas yuav tswj hwm ntawm Wi-nkaus Network. Tus neeg hlau tuaj yeem tswj tau los ntawm kev siv internet zoo ib yam, siv tus qauv tsim HTML lossis tseem los ntawm daim ntawv thov mobile hauv. ESP8266 nti yog lub zog loj & pheej yig microcontroller, uas tsis yog tsuas yog siv tau yooj yim tab sis kuj los nrog onboard Wi-nkaus txuas. Qhov no tsuas yog lub zoo meej nti los tswj cov neeg hlau nyob deb ntawm koj lub khoos phis tawj lossis lub xov tooj ntawm tes.

Txhawm rau koom nrog cov nti no rau hauv peb txoj haujlwm peb tuaj yeem siv ntau yam kev txhim kho cov laug cam raws li lub microcontroller no.

1. Adafruit Feather Huzzah - Nws yog tsim los ntawm Adafruit thiab muaj cov lus qhia yooj yim thiab txhawb nqa. Nws muaj lub roj teeb li-po them ntawm lub rooj tsavxwm nws tus kheej, yog li nws yuav tuaj yeem siv tau yooj yim hauv cov phiaj xwm nqa khoom.

2. NodeMCU ESP8266 - Pawg thawj coj tau qhib qhov chaw thiab muaj cov ntaub ntawv zoo heev yog li nws yuav yooj yim heev rau pib.

3. Sparkfun ESP8266 - Nws zoo li Huzzah nrog kev hloov pauv lub zog thiab lub kav hlau txais xov sab nraud kom ntev dua Wi -nkaus.

4. Wemos D1 Mini - Nws yog qhov tsawg tshaj plaws ntawm txhua lub laug cam tab sis qhov no tsis muaj qhov cuam tshuam rau kev ua tau zoo.

Rau kuv qhov haujlwm, Kuv tab tom siv Wemos D1 Mini los ua Wi-Fi Tswj 4-Wheeled Robot. Tab sis koj tuaj yeem siv ib qho ESP8266 pawg thawj coj txhim kho thiab siv tib Arduino code yam tsis muaj kev hloov pauv xav tau. Kuv tau tsim PCB rau txoj haujlwm no tab sis koj tuaj yeem siv dot pcb pawg thawj coj los ua haujlwm hauv Circuit lossis txawm tsim koj tus kheej pcb.

Thiab peb yuav siv 4WD Robotic Chassis Kit raws li qhia hauv daim duab saum toj no raws li nws yog qhov zoo rau DIY thiab yog cov khoom lag luam zoo tshaj plaws neeg hlau tsheb nrog cov qauv siv tshuab yooj yim.

Nta ntawm cov khoom siv no:-

1. Los nrog plaub cais BO yas lub cev muaj zog nrog lub gearbox nws yog qhov zoo rau kev txav tau yooj yim.

2. Loj, khov kho acrylic chassis tso cai ua kom nthuav dav rau koj rau DIY.

3. Plaub lub log tsav ntse lub tsheb chassis cov khoom siv. Yooj yim rau nruab, tsuas yog ntxiv cov tswj hwm me me (xws li Arduino), thiab cov qauv ntsuas los tsim kom muaj cov neeg hlau muaj kev ywj pheej.

Kauj Ruam 1: Daim Ntawv Teev Npe

Daim Ntawv Teev Npe
Daim Ntawv Teev Npe
Daim Ntawv Teev Npe
Daim Ntawv Teev Npe
Daim Ntawv Teev Npe
Daim Ntawv Teev Npe

Wemos D1 Mini [Quantity - 1]

L293d Tsav Tsheb Tsav IC [Quantity - 2]

PCF8574 Chaw Nres Nkoj Expander IC [Quantity - 1]

12V Lithium Ion Roj teeb [Quantity - 1]

Wi-nkaus Tswj Neeg Hlau PCB [Quantity-1]

4WD Neeg Hlau Ntse Tsheb Tsheb Chassis Kit [Quantity - 1]

Kauj Ruam 2: Lub Hlwb ntawm Txoj Haujlwm - ESP8266 Pawg Neeg Loj Hlob (Wemos D1 Mini)

Lub hlwb ntawm Txoj Haujlwm - ESP8266 Pawg Neeg Saib Xyuas Kev Txhim Kho (Wemos D1 Mini)
Lub hlwb ntawm Txoj Haujlwm - ESP8266 Pawg Neeg Saib Xyuas Kev Txhim Kho (Wemos D1 Mini)

Wemos D1 Mini yog lub khoos phis tawj txhim kho Wi-nkaus nrog 4MB nyem raws li ESP-8266 Chip.

  • Muaj 11 digital input/output pins, txhua tus pin tau cuam tshuam/pwm/I2C/ib-xaim txhawb (tshwj tsis yog D0)
  • Muaj 1 analog input (3.2V max input)
  • Muaj lub Micro USB txuas rau kev ua haujlwm nrog rau lub zog siv.

Pawg thawj coj no raws li ESP8266 li no yog Arduino IDE sib xws, yog li nws tuaj yeem tsim kho kom siv tau Arduino lossis tseem tuaj yeem ua haujlwm siv Lua compiler. Nws kuj tseem txhawb nqa ob qho kev ua haujlwm thiab OTA.

Peb yuav npaj lub Wemos D1 Mini siv Arduino IDE. Txhawm rau teeb tsa pawg thawj coj siv Arduino IDE raws li qhov xav tau yuav tsum tau ua kom tiav.

Yuav tsum tau:-

  • CH340G tsav tsheb
  • Nruab Qhov Tseeb Arduino IDE los ntawm Arduino lub vev xaib.
  • Ib lub micro usb cable rau lub cajmeem

Tom qab teeb tsa tus tsav tsheb thiab software arduino koj yuav tsum teeb tsa "Arduino core rau ESP8266 WiFi nti" sab hauv Arduino IDE kom peb tuaj yeem ua haujlwm ESP8266 nti los ntawm Arduino ib puag ncig. Qhov ESP8266 Arduino core tso cai rau koj sau cov duab kos siv cov paub Arduino lub luag haujlwm thiab cov tsev qiv ntawv, thiab khiav ncaj qha rau ESP8266, tsis xav tau microcontroller sab nraud xav tau.

ESP8266 Arduino core los nrog cov tsev qiv ntawv sib txuas lus dhau WiFi siv TCP thiab UDP, teeb tsa HTTP, mDNS, SSDP, thiab DNS servers, ua OTA hloov tshiab, siv cov ntaub ntawv kaw lus hauv flash nco, ua haujlwm nrog SD daim npav, servos, SPI thiab I2C cov khoom siv txuas ntxiv.

Rub tawm cov ntawv hauv qab no kom tau txais lub tswv yim hais txog yuav nruab Esp8266 arduino core li cas.

Kauj Ruam 3: Tsav Tsheb - L293d

Tsav Tsheb - L293d
Tsav Tsheb - L293d
Tsav Tsheb - L293d
Tsav Tsheb - L293d
Tsav Tsheb - L293d
Tsav Tsheb - L293d

Tus Tsav Tsheb Tsav Tsheb yog IC rau lub cav uas tso cai rau koj los tswj kev ua haujlwm nrawm thiab kev taw qhia ntawm ob lub cav ib txhij.

L293d tau tsim los muab ob txoj kev tsav tam sim no ntawm qhov hluav taws xob los ntawm 5 V txog 36 V. L293D tuaj yeem tsav 2 DC motors ib txhij.

L293D yog 16 Pin Tsav Tsav Tsav IC. Muaj 4 INPUT pins, 4 OUTPUT pins thiab 2 ENABLE tus pin rau txhua lub cav.

L293D Nta:

600mA tso zis tam sim no muaj peev xwm ib channel

Clock thiab Anti-clockwise kev taw qhia kev tswj hwm rau tus kheej

Pin piav qhia ntawm L293d:

  • Tus Pin 1: Thaum Enable1 yog HIGH, Sab laug ntawm IC yuav ua haujlwm, piv txwv li lub cav txuas nrog tus pin 3 thiab tus pin 6 yuav tig.
  • Tus Pin 2: Cov tswv yim 1, thaum tus pin no HIGH tam sim no yuav ntws txawm tias tso tawm 1.
  • Pin 3: Cov zis 1, tus pin no txuas nrog ib lub davhlau ya nyob twg ntawm lub cev muaj zog.
  • Pin 4/5: GND pins
  • Pin 6: Cov zis 2, tus pin no txuas nrog ib lub davhlau ya nyob twg ntawm lub cev muaj zog.
  • Tus Pin 7: Cov tswv yim 2, thaum tus pin no HIGH tam sim no yuav ntws txawm tias tso tawm 2.
  • Tus Pin 8: VCC2, tus pin no tau siv los muab lub zog txuas rau lub tshuab txuas nrog los ntawm 5V txog 36V siab tshaj nyob ntawm Tsav txuas nrog.
  • Tus Pin 9: Thaum Pab Tau 2 yog HIGH, Txoj cai ntawm IC yuav ua haujlwm, piv txwv li lub cav txuas nrog tus pin 11 thiab tus pin 14 yuav tig.
  • Tus Pin 10: Cov tswv yim 4, thaum tus pin no HIGH tam sim no yuav ntws txawm tias tso tawm 4.
  • Pin 11: Cov zis 4, tus pin no txuas nrog ib lub dav hlau ntawm lub cev muaj zog.
  • Pin 12/13: GND pins
  • Pin 14: Cov zis 3, tus pin no txuas nrog ib lub davhlau ya nyob twg ntawm lub cev muaj zog.
  • Tus Pin 15: Cov tswv yim 3, thaum tus pin no HIGH tam sim no yuav ntws txawm tias tso tawm 3.
  • Tus Pin 16: VCC1, rau cov laj thawj muab lub zog rau IC piv txwv li 5V.

Yog li, koj tuaj yeem pom koj xav tau 3 tus lej digital los tswj txhua lub cav (ib tus pin rau kev tswj ceev thiab ob tus pin rau kev tswj). Yog tias L293d tswj ob lub DC motors ces peb yuav xav tau ob L293d IC los tswj plaub DC Motors. Peb tab tom yuav siv yas BO Motors rau txoj haujlwm no. Yog li, koj pom peb yuav xav tau 12 tus lej digital txhawm rau tswj hwm tag nrho plaub DC motors ntawm nws tus kheej nrog ob qho nrawm thiab kev tswj.

Tab sis yog tias koj pom Wemos D1 mini tsuas muaj 11 Digital I/O pins thiab 1 Pin analog. Txhawm rau daws qhov teeb meem no peb yuav txuas plaub tus pab kom tus pin (ob pab tau tus pin ntawm thawj L293d thiab ob pab kom pins ntawm lwm L293d) rau Wemos Digital pins ncaj qha thaum tag nrho yim nkag pins (plaub ntawm thawj L293d thiab plaub ntawm lwm L293d) siv PCF8574 (Ib qho chaw nthuav dav I/O) ntawm I2C.

Kauj Ruam 4: PCF8574 - I/O Port Expander

PCF8574 - I/O Port Expander
PCF8574 - I/O Port Expander
PCF8574 - I/O Port Expander
PCF8574 - I/O Port Expander

Wemos D1 Mini (piv txwv li ESP8266) muaj qhov tsis txaus ntawm cov tswv yim/tso tawm pins. Peb tuaj yeem nce tus lej nkag/tso tawm digital siv I/O expander IC zoo li PCF8574, uas yog 8 ntsis I/O nthuav dav.

Ib qhov zoo ntawm kev siv PCF8574A I/O expander yog nws siv I2C npav, uas xav tau ob kab ntawv xwb, lawv yog moos (SCK) thiab cov ntaub ntawv (SDA). Yog li, nrog ob kab no, koj tuaj yeem tswj tau txog yim tus pin ntawm tib lub nti. Los ntawm kev hloov pauv peb tus lej chaw nyob ntawm txhua PCF8574 peb tuaj yeem tswj tau tag nrho 64 pins.

Qhov 8-ntsis nkag/tawm (I/O) nthuav dav rau ob txoj kab tsheb npav ob tog (I2C) tau tsim los rau kev ua haujlwm 2.5V txog 6V VCC. PCF8574 lub cuab yeej muab cov hom phiaj dav dav I/O nthuav dav rau feem ntau cov tsev neeg tswj hwm microcontroller los ntawm txoj kev ntawm I2C interface [moos moos (SCL), cov ntaub ntawv xov xwm (SDA)].

Cov cuab yeej muaj qhov 8-ntsis quasi-bidirectional I/O chaw nres nkoj (P0 – P7), suav nrog kaw qhov tso tawm nrog lub peev xwm tsav tam sim no rau tsav ncaj qha LEDs. Txhua qhov quasi-bidirectional I/O tuaj yeem siv los ua tswv yim lossis tso tawm yam tsis siv cov ntaub ntawv-taw qhia tswj lub teeb liab. Thaum fais fab tuag, I/Os yog siab.

Saib cov ntawv hauv qab no "PCF8574_With_L293d" pdf cov ntaub ntawv txuas rau PCF8574 nrog ob L293d IC's

Kauj ruam 5: Schematics

Schematics
Schematics
Schematics
Schematics

Kuv tau siv Kicad rau PCB tsim.

Rub tawm cov kab ntawv hauv qab no pdf los tsim koj tus kheej pcb lossis siv nws ntawm dot pcb board.

Kauj ruam 6: Code

Txuas mus rau Wi-nkaus Access Point hauv qab no:-

// Tus Neeg Siv Kev Txheeb Xyuas Network Credentialsconst char* ssid = "WiFi_Robot";

const char* password = "Automate@111";

Tom qab txuas mus rau qhov chaw nkag saum toj mus rau hauv qab txuas hauv qhov web browser:-

192.168.4.1

Koj yuav tau txais cov lus hauv qab no:-

"Nyob zoo los ntawm Robot!"

192.168.4.1/fw

Nws yuav ua rau tus neeg hlau txav mus rau tom ntej

192.168.4.1/bk

Nws yuav ua rau tus neeg hlau txav rov qab

192.168.4.1/lt

Nws yuav ua rau tus neeg hlau txav mus rau sab laug

192.168.4.1/rt

Nws yuav ua rau tus neeg hlau txav mus rau sab xis

192.168.4.1/st

Nws yuav ua rau tus neeg hlau nres

Yog tias koj xav tau koj tseem tuaj yeem tswj tus neeg hlau ntawm Android app ua los ntawm Robo Is Nrias teb.

{Tshawb nrhiav "WiFi Robot Controller" android app ntawm playstore ua los ntawm Robo Is Nrias teb}

[Nco tseg: Txhua txoj hauv kev kuv tsis txuas nrog Robo Is Nrias teb thiab qhov no tsis yog rau kev tshaj tawm, qhov no yog kuv tus kheej txoj haujlwm!]

Ua Haujlwm Yees Duab ntawm Txoj Haujlwm:-

Pom zoo: