Cov txheej txheem:

Tswj Txog 68 Cov Ntsiab Lus Nrog Arduino Mega thiab ESP8266: 14 Cov Kauj Ruam
Tswj Txog 68 Cov Ntsiab Lus Nrog Arduino Mega thiab ESP8266: 14 Cov Kauj Ruam

Video: Tswj Txog 68 Cov Ntsiab Lus Nrog Arduino Mega thiab ESP8266: 14 Cov Kauj Ruam

Video: Tswj Txog 68 Cov Ntsiab Lus Nrog Arduino Mega thiab ESP8266: 14 Cov Kauj Ruam
Video: KX. Txawj Teev Vaj. Xib Fwb Cuav Cov Lus Qhia 2024, Hlis ntuj nqeg
Anonim
Image
Image
Fais fab Scheme
Fais fab Scheme

Los ntawm kev siv cov txheej txheem hluav taws xob Kuv tau muaj nyob hauv PDF hom, hauv txoj haujlwm niaj hnub no, Arduino Mega txuas nrog ESP8266 kom ua haujlwm WiFi. Tus thawj tswj hwm rau cov neeg siv khoom nyob ib leeg, lub Circuit Court tseem ua haujlwm nrog Bluetooth, thiab txuas nrog ob qhov txuas thiab ob lub teeb. Txhawm rau txhua qhov no kom tshwm sim, peb yuav tsum ua kom muaj kev tswj hwm txog li 68 lub zog ntsiab lus. Qhov no yuav tshwm sim los ntawm APP, Labkit, nkag los ntawm lub xov tooj lossis ntsiav tshuaj Android. Hauv kev sib dhos no, koj yuav tsis xav tau program Arduino lossis ESP8266. Peb tseem yuav pib siv AT cov lus txib. Saib cov yees duab:

Kauj Ruam 1: Cov Qauv Hluav Taws Xob

Mega WiFi Circuit nrog Relays Ntawm no hauv cov phiaj xwm hluav taws xob, koj tuaj yeem pom kuv siv Arduino Mega txuas nrog ESP8266 los ua haujlwm WiFi. Nws yog qhov muaj txiaj ntsig kom nco ntsoov tias lub voj voog no tseem tuaj yeem ua haujlwm nrog Bluetooth. Hauv qhov piv txwv no, Kuv kuj txuas ob lub txuas thiab ob lub teeb. Kuv hais meej tias ntawm lub rooj tsavxwm nrog ob txoj kev xa mus, koj tuaj yeem txuas lwm 34 pawg nrog ob lossis yim qhov txuas, raws li koj nyiam. Tom qab ntawv, kuv yuav piav qhia meej yuav ua li cas.

Kauj Ruam 2: Cov Neeg Nyob Hauv Tsev Nrog Txog 68 Lub Ntsiab Lus

Cov Neeg Nyob Hauv Tsev Nrog Txog 68 Lub Ntsiab Lus
Cov Neeg Nyob Hauv Tsev Nrog Txog 68 Lub Ntsiab Lus

Peb siv Labkit thaum peb ua haujlwm. Cov App no tau tsim los tswj cov cuab yeej txuas nrog Arduino Uno lossis Mega. Los ntawm Bluetooth module lossis ESP8266 txuas nrog Arduino, peb tuaj yeem sib txuas lus nrog cov khoom siv los ntawm lub xov tooj lossis ntsiav tshuaj Android.

Kauj Ruam 3: Cov Cuab Yeej Siv

Cov Cuab Yeej Siv
Cov Cuab Yeej Siv

Hauv txoj haujlwm no, peb siv ESP8266 thiab Arduino Mega, ntxiv rau peb txoj haujlwm thiab ob daim ntawv. Raws li tau sau tseg nyob rau sab laug ntawm daim duab, Flash Download Tools program yuav ua haujlwm Firmware AT file, uas yuav dhau mus rau ESP8266. Hauv qhov ua ntu zus, koj yuav muaj Termite, uas yog, lub davhlau ya nyob twg rau koj tham nrog AT hom, uas yuav tau txais koj cov lus txib thiab xa teeb tsa mus rau ESP8266.

Hauv ib feem koom nrog Arduino Mega, uas tshwm rau ntawm sab xis ntawm daim duab, peb tseem thauj cov firmware Labkit HEX cov ntaub ntawv, los ntawm XLoader program.

Kauj Ruam 4: Sib dhos ESP01 thiab FTDI

Sib dhos ESP01 thiab FTDI
Sib dhos ESP01 thiab FTDI

Txhawm rau muab ESP01 rau hauv hom kaw rau nruab AT firmware, yooj yim ua raws li kev sib dhos no.

CEEB TOOM: Txhawm rau siv AT cov lus txib ntawm Termite, tshem tawm qhov kev sib txuas ntawm GPIO0 thiab GND.

Kauj Ruam 5: Thauj Hex Rau Hauv Arduino

Load Hex rau hauv Arduino
Load Hex rau hauv Arduino

Txhawm rau siv daim ntawv thov no, nws yog qhov tsim nyog los thauj Arduino nrog cov ntawv hex, uas yog cov lej twb tau sau ua ke uas peb ua kom muaj. Txhawm rau nruab hex hauv Arduino, peb xub xav tau qhov program hu ua XLoader uas tuaj yeem rub tawm los ntawm qhov txuas no.

Qhov cuam tshuam ntawm XLoader program yog qhov no hauv daim duab.

Kauj Ruam 6: Nruab Hex ntawm Arduino

  • Hauv Hex cov ntaub ntawv, yuav tsum muaj txoj hauv kev rau hex, uas tuaj yeem rub tawm los ntawm qhov txuas no mus rau Arduino Mega thiab qhov txuas no rau Arduino Uno.
  • Cov cuab yeej yog tus qauv Arduino. Xaiv qhov Arduino siv.
  • COM chaw nres nkoj yog qhov chaw nres nkoj uas Arduino tau txuas rau hauv lub khoos phis tawj, thiab cov npe yuav tshwm nrog cov chaw nres nkoj siv. Xaiv ib qho uas phim koj Arduino.
  • Tus nqi baud tau txiav tawm ncaj qha rau txhua hom cuab yeej.
  • Tom qab txhua qhov chaw tau teeb tsa, tsuas yog nyem Upload thiab tos kom cov txheej txheem ua tiav.

Kauj Ruam 7: ESP8266 hauv AT Hom

ESP8266 hauv AT Hom
ESP8266 hauv AT Hom

. Hex uas peb muab tso rau hauv Arduino yuav sib tham nrog ESP los ntawm AT raws tu qauv. Txog qhov no, nws yog qhov tsim nyog tias ESP muaj AT firmware nruab. Qhov version ntawm SDK peb siv yog esp_iot_sdk_v1.5.0_15_11_27.

Txhawm rau txheeb xyuas qhov firmware version uas koj ESP tab tom siv acess Qhov Kev Pab Cuam:

Nrog rau Termite qhib, ntaus AT+GMR hauv cov ntawv nkag teb hauv qab no.

Kauj Ruam 8: Txhim Kho AT Firmware hauv ESP

Txhim kho AT Firmware hauv ESP
Txhim kho AT Firmware hauv ESP
Txhim kho AT Firmware hauv ESP
Txhim kho AT Firmware hauv ESP
Txhim kho AT Firmware hauv ESP
Txhim kho AT Firmware hauv ESP

Yog tias nws tsis nyob hauv cov qauv uas peb siv, koj tuaj yeem rub tawm AT firmware ntawm ESP uas peb siv ntawm no.

Txhawm rau teeb tsa lub firmware, koj yuav tsum rub Flash Rub Cov Cuab Yeej los ntawm qhov txuas no.

Txhawm rau teeb tsa lub khoos phis tawj ntawm ESP01, koj tuaj yeem siv FTDI nrog kev sib dhos hauv daim duab.

Cov kauj ruam:

Unzip cov ntaub ntawv esp_iot_sdk_v1.5.0_15_11_27, thiab qhib Flash Download Tools program.

Txheeb xyuas SpiAutoSet kev xaiv.

Hauv txhua qhov haujlwm, xaiv cov ntaub ntawv ntawm lub nplaub tshev uncompressed hauv qhov kev txiav txim no:

bin / esp_init_data_default.bin

bin / blank.bin cov

bin / boot_v1.4 (b1).bin

bin / ntawm / 512+512 / user1.1024.new.2.bin

Rau txhua daim ntawv, hloov ADDR teb hauv qhov kev txiav txim no:

0x7c0 ib

0 txf0

0x0000 ua

0x1000 ua

Saib daim duab

Nws yuav tsum zoo li daim duab

Xaiv COM PORT uas yog koj li ESP thiab tus nqi baud ntawm 115200, thiab nyem lub pob pib.

Kauj Ruam 9: Kho ESP

Tam sim no cia teeb tsa ESP01 txuas rau peb lub network. Qhib lub Termite thiab ntaus:

AT+CWMODE_DEF = 1 (tso ESP hauv chaw nres tsheb hom)

AT+CWJAP_DEF = "TestSP", "87654321" (hloov nrog SSID thiab password rau koj lub network)

AT+CIPSTA_DEF = "192.168.2.11" (hloov nrog tus IP koj xav siv)

AT+CIPSTA? (Txhawm rau txheeb xyuas tias koj muaj tus IP raug)

Kauj ruam 10: Piv txwv

Piv txwv
Piv txwv

Ntawm no peb muaj qhov tshwm sim ntawm Termite. Qhov no qhia txog cov version thiab seb puas yog lossis tsis yog txhua cov lus txib koj ua yog tsis ua li cas, ntawm lwm cov ntsiab lus.

Kauj Ruam 11: Lwm Yam Piv Txwv

Lwm Yam Piv Txwv
Lwm Yam Piv Txwv
Lwm Yam Piv Txwv
Lwm Yam Piv Txwv
Lwm Yam Piv Txwv
Lwm Yam Piv Txwv
Lwm Yam Piv Txwv
Lwm Yam Piv Txwv

Ntawm no kuv tso cov lej nrog Uno thiab Mega Arduinos, nrog qib hloov pauv, HC-05, ob qho tib si muaj peev xwm siv nrog WiFi lossis Bluetooth. Hauv peb qhov piv txwv niaj hnub no, peb siv Mega nrog WiFi, ntxiv rau ob lub resistors hloov pauv qib. Tab sis ntawm no peb qhia lwm qhov xwm txheej, vim tias software tso cai rau lwm qhov kev sib txuas ua ke.

Uno Bluetooth Circuit

Siv Wifi Circuit

Mega Bluetooth Circuit

Mega WiFi Circuit

Kauj ruam 12: Rub tawm App

Lub app nyob hauv Google Play Store ntawm:

play.google.com/store/apps/details?id=br.com.appsis.controleautomacao

Kauj Ruam 13: Pair Bluetooth

Pair Bluetooth
Pair Bluetooth

Yog tias koj yuav siv Bluetooth module, nco ntsoov tias koj tau qhib Bluetooth thiab ua ke nrog lub xov tooj ntawm tes hauv cov txheej txheem teeb tsa.

Kauj Ruam 14: Labkit Automation Control

Labkit Automation Tswj
Labkit Automation Tswj
Labkit Automation Tswj
Labkit Automation Tswj
Labkit Automation Tswj
Labkit Automation Tswj

- Thaum koj qhib daim ntawv thov thawj zaug, koj yuav pom lub vijtsam xiav LABkit.

- Nyem lub pob nyob rau ntawm kaum sab saud, thiab lub app yuav nug seb hom Arduino koj tab tom siv.

- Tom qab xaiv hom Arduino, lub app yuav nug tus qauv twg uas koj siv los txuas.

- Yog tias koj tau xaiv WiFi, nkag mus rau tus IP hauv daim teb uas tshwm.

- Yog tias koj xaiv Bluetooth, koj yuav tsum nkag mus rau lub npe qauv.

- Thaum txuas, lub app yuav qhia lub pob kom ntxiv cov haujlwm tshiab hauv kaum sab xis.

- Los ntawm kev nyem lub pob no, lub vijtsam yuav tshwm rau koj xaiv tus pin Arduino, thiab lub npe ntawm qhov ua.

- Thaum ntxiv qhov kev txiav txim tshiab, nws yuav tsum tshwm nyob rau hauv daim ntawv raws li hauv cov duab hauv qab no.

- Nyem lub pob yuav teeb nws ntsuab, thiab tus pin ntawm Arduino koj xaiv yuav tsum mus siab.

- Txhawm rau tshem tawm qhov kev txiav txim, tsuas yog kov thiab tuav rau ntawm lub pob

Pom zoo: