Cov txheej txheem:

Kev ntsuas kub thiab noo nyob deb nrog ESP8266 thiab Blynk App: 15 Kauj Ruam
Kev ntsuas kub thiab noo nyob deb nrog ESP8266 thiab Blynk App: 15 Kauj Ruam

Video: Kev ntsuas kub thiab noo nyob deb nrog ESP8266 thiab Blynk App: 15 Kauj Ruam

Video: Kev ntsuas kub thiab noo nyob deb nrog ESP8266 thiab Blynk App: 15 Kauj Ruam
Video: Kub Qav Kaws Vaj - Zaj Dab Neeg Hlub Tim Vaj Loog Tsua 2024, Hlis ntuj nqeg
Anonim
Kev ntsuas kub thiab noo nyob deb nrog ESP8266 thiab Blynk App
Kev ntsuas kub thiab noo nyob deb nrog ESP8266 thiab Blynk App

Nws yog kuv thawj qhov haujlwm nrog ESP8266 nti. Kuv nyuam qhuav tsim lub tsev tshiab nyob ze kuv lub tsev thiab nws tau nthuav rau kuv tias muaj dab tsi tshwm sim nyob ntawd ib hnub? Kuv txhais tau tias hloov pauv qhov kub thiab txias li cas? Puas yog lub tsev cog khoom cua txaus? Yog li kuv txiav txim siab tias ESP8266 nrog DHT22 sensor yog cov tshuaj zoo. Cov lus nug tom ntej yog, yuav ua li cas saib xyuas cov ntaub ntawv los ntawm cov ntsuas. Tom qab ib pliag, kuv pom tias Blynk yog lub app zoo tshaj tshwj xeeb tshaj yog rau cov pib tshiab lossis cov neeg tsis muaj txuj ci uas xav tsim txoj haujlwm rau Internet ntawm Yam (IoT).

Koj tuaj yeem nyeem ntxiv txog Blynk ntawm no.

Kauj ruam 1: Kho vajtse

Kho vajtse
Kho vajtse
Kho vajtse
Kho vajtse
Kho vajtse
Kho vajtse
Kho vajtse
Kho vajtse

Rau qhov haujlwm no koj xav tau:

1. ESP8266-01 module (yuav nws daim ntawv Aliexpress lossis ebuy)

2. TTL hloov lossis ua haujlwm rau lub rooj tsavxwm rau ESP8266. Kuv tabtom siv lub rooj tsavxwm

3. DHT22 (AM2302) - ntsuas kub thiab av noo:

4. Voltage converter. Rau ESP cov qauv yuav tsum tau siv hluav taws xob DC ntawm 3.0V-3.6V xav tau. Qhov zoo tshaj, 3.3V. ESP tuaj yeem siv tau los ntawm roj teeb lossis los ntawm lub network, los ntawm kev hloov AC 220V rau DC. Txawm li cas los xij, xav tau kev hloov pauv hluav taws xob ntxiv, los tswj 3.3V DC qhov hluav taws xob. Piv txwv li, them 18650 lithium-ion roj teeb uas them tag nrho rau peb txog 4.2 V. Xws li qhov hluav taws xob feem ntau yuav tua ESP module. Tias yog vim li cas peb xav tau tus hloov pauv.

Hauv qhov no kuv tab tom siv cov hloov pauv qis, uas tso cai rau kuv txo hwj chim muab hluav taws xob los ntawm 12V mus rau 3.3V.

5. Cov khoom siv hluav taws xob. Like li kuv tau hais los saum no Kuv tau siv 12V roj teeb ua kua qaub rau txoj haujlwm no. Nws tshwm sim tsuas yog vim tias kuv muaj ib lub roj teeb spare ntawm lub txee. Yog li ntawm chav kawm koj tuaj yeem siv cov khoom siv hluav taws xob uas koj xav tau. Tsuas yog nco hauv koj lub siab tias ESP chips lees txais qhov hluav taws xob los ntawm 3.0 txog, 3.6V.

Kauj ruam 2: Daim duab

Daim duab
Daim duab

Daim duab yog yooj yim heev. Tsuas yog txuas txhua yam zoo li nws tau qhia ntawm daim duab.

Kauj ruam 3: Software

Txhawm rau tsim txoj haujlwm, koj yuav tsum tau teeb tsa ntawm koj lub khoos phis tawj ntiag tug uas tso cai rau koj nyem qhov module. ARDUINO IDE yog qhov tsim nyog rau qhov no - kev txhim kho software ib puag ncig rau ARDUINO cov khoom. ESP8266 yog ARDUINO cov qauv siv tau, yog li koj tuaj yeem siv nws los ua haujlwm ARDUINO IDE.

Cov ntaub ntawv raug xa mus rau lub xov tooj los ntawm kev siv Blynk daim ntawv thov.

ARDUINO IDE

Rub tawm ARDUINO rau koj lub operating system. Kuv tab tom siv ARDUINO 1.8.3 ntawm kuv lub PC nrog Windows 10. Tom qab teeb tsa ARDUINO IDE, koj yuav tsum teeb tsa nws, rau siv nrog ESP8266 chips.

BLYNKNext peb yuav tsum teeb tsa Blynk tsev qiv ntawv rau Arduino IDE. Download tau nws los ntawm no. Yuav ua li cas rau nruab ntawm no.

Tom qab koj tau teeb tsa lub tsev qiv ntawv rau Blynk, koj yuav xav tau ib qho app rau koj lub xov tooj. Rub tawm thiab teeb tsa Blynk app los ntawm Google Ua Si rau Android, lossis los ntawm App Store rau iPhone. Tau kawg yuav tsum muaj koj tus lej nyiaj hauv Blynk siv nws.

Kauj Ruam 4: Kho Arduino IDE

Configure Arduino IDE
Configure Arduino IDE

1. Cov ntaub ntawv - Nyiam.

Hauv Preferences tab ntxiv qhov txuas:

arduino.esp8266.com/stable/package_esp8266c…

Txoj kev no, peb ntxiv ESP8266 rau cov npe khoom siv uas IDE ua haujlwm nrog.

Kauj Ruam 5: Kho Arduino IDE

Configure Arduino IDE
Configure Arduino IDE
Configure Arduino IDE
Configure Arduino IDE
Configure Arduino IDE
Configure Arduino IDE

2. Cov cuab yeej - Cov laug cam - Tus thawj tswj tuav

Hauv Pawg Thawj Coj saib xyuas qee yam xws li "ESP8266 los ntawm …". Nyem rau nruab.

Kauj Ruam 6: Kho Arduino IDE

Configure Arduino IDE
Configure Arduino IDE

3. Tam sim no peb tuaj yeem pom peb daim ntawv 8266 hauv daim ntawv teev npe. Xaiv nws los ntawm daim ntawv teev npe.

Kauj Ruam 7: Kho Arduino IDE

Configure Arduino IDE
Configure Arduino IDE

4. Xaiv qhov chaw nres nkoj uas peb yuav ua haujlwm

Yog, los ntawm txoj kev, hauv Cov Cuab Yeej xaiv upload nrawm 11520.

Kauj Ruam 8: Kho Arduino IDE

Configure Arduino IDE
Configure Arduino IDE

5. Nruab cov tsev qiv ntawv rau ESP thiab Blynk.

Sai li nws yuav rub tawm, unpack nws mus rau Arduino - Cov tsev qiv ntawv ntawv tais ceev tseg.

Kauj Ruam 9: Kho Blynk

Kho Blynk
Kho Blynk

Tom qab koj tau teeb tsa Blynk, nkag mus rau lub app thiab thawb "Tsim txoj haujlwm tshiab". Koj yuav tau txais hauv koj lub thawv ntawv hu ua "Auth token".

Kauj ruam 10: Kho Blynk

Kho Blynk
Kho Blynk
Kho Blynk
Kho Blynk
Kho Blynk
Kho Blynk

Tom ntej no, sau lub npe ntawm txoj haujlwm, piv txwv "ESP8266". Hauv qhov "Hardware model" teb, koj yuav tsum xaiv hom cuab yeej ua haujlwm nrog. Hauv peb qhov no yog ESP8266. Thiab qhov kawg uas koj yuav tsum nkag mus yog "Auth token".

Tus "Auth token" yog tus yuam sij zais cia uas tau siv thaum txuas nrog Blynk server. Yog li tsis txhob faib nws rau leej twg. Tom qab txhaj lub pob "Tsim", daim teb rau lub graphical interface ntawm koj daim ntawv thov yuav tshwm sim.

Nyem rau ntawm qhov kos npe ntxiv rau sab xis saum toj kawg nkaus - "Widget Box" toolbar yuav tshwm sim. Nws tso cai ntxiv cov widget rau koj lub vaj huam sib luag tswj.

Saib ua ntej, Kuv yuav hais tias peb txoj haujlwm yuav xav tau cov khoom siv: "Khawm", "LCD" thiab "Keeb Kwm Keeb Kwm". Txhua qhov no muaj txiaj ntsig zoo rau txhua qhov haujlwm ESP8266 / Blynk.

Kauj ruam 11: ARDUINO Sketch

ARDUINO kos duab
ARDUINO kos duab
ARDUINO kos duab
ARDUINO kos duab

Yog li cia sau ib daim duab. Txhawm rau ua qhov no, peb siv Arduino IDE uas tau hais yav dhau los.

Yog tias koj tab tom yuav lub zog ntaus ntawv los ntawm lub roj teeb, tom qab ntawd hauv kab 30, nws ua rau pom kev ua si nrog "ncua" tus nqi. Hauv qhov kos duab no, cov ntaub ntawv xa tawm txhua 2s. Ua kom lub sijhawm dealy ntawm kab 30, txhawm rau txhim kho roj teeb lub neej ntawm koj lub cuab yeej. Piv txwv li yog tias koj yuav tso 300 000 ntawm no, cov ntaub ntawv yuav raug xa tawm txhua 5 feeb.

Kauj ruam 12: Upload Sketch

Rub tawm Sketch
Rub tawm Sketch
Rub tawm Sketch
Rub tawm Sketch
Rub tawm Sketch
Rub tawm Sketch

Tom ntej no, ntsaws ESP8266 tus qauv rau hauv TTL hloov pauv raws li pom hauv daim duab hauv qab no, thiab txuas nws mus rau USB chaw nres nkoj. Yog tias koj muaj tus hloov pauv tib yam li kuv, tom qab ntawd los ntawm nws tus kheej koj yuav tsum hloov pauv mus rau "Prog" txoj haujlwm.

Khiav Arduino IDE, thiab xa cov duab kos: cov ntaub ntawv - qhib - koj daim duab.

Nyem rau khawm "upload" (hauv lub voj voog daj ntawm daim duab). Yog tias txheej txheem rub tawm cov software tau ua tiav, cov lus "Ua tiav rub tawm" tshwm hauv qab no. Tej zaum yuav muaj ntawv ceeb toom txog cov tsev qiv ntawv tsis raug, raws li hauv daim duab. Tab sis tom kawg kuv pom tias txhua yam ua haujlwm. Yog li cov lus qhia yog - upload lub firmware, kos - nws yuav zaum ua haujlwm.

Kauj Ruam 13: Ua Blynk Daim Ntawv Thov

Ua Daim Ntawv Thov Blynk
Ua Daim Ntawv Thov Blynk
Ua Daim Ntawv Thov Blynk
Ua Daim Ntawv Thov Blynk
Ua Daim Ntawv Thov Blynk
Ua Daim Ntawv Thov Blynk
Ua Daim Ntawv Thov Blynk
Ua Daim Ntawv Thov Blynk

Zoo, qib kawg, cia daim ntawv thov ntawm Blynk. So qhib Blynk, thiab hauv "Widget Box" toolbar, xaiv "Button" widget.

Lub pob virtual yuav tshwm ntawm daim ntawv thov desktop. Nyem rau nws, thiab nkag mus rau hauv cov chaw (saib daim duab).

Kuv tau teeb lub pob rau "Hloov". Nws txhais tau tias cov ntaub ntawv raug xa mus thaum lub khawm tau qhib. Sai li lub pob raug kaw, cov ntaub ntawv hloov chaw. Koj tuaj yeem pab "Push" hom. Hauv qhov no, cov ntaub ntawv yuav raug xa tawm thaum lub pob nyem nrog tus ntiv tes. V1 yog qhov chaw nres nkoj khawm virtual. Yuav tsum ua ke nrog qhov uas tau hais hauv daim duab. Koj kuj tseem tuaj yeem hais qhia cov ntawv uas yuav tshwm rau ntawm lub pob hauv txoj haujlwm. thiab tawm.

Tom ntej no, los ntawm cov khoom siv, xaiv lub LCD. Ib zaug ntxiv, mus rau qhov chaw.

Teeb tsa qhov ntsuas kub thiab av noo (V2 thiab V3) thiab PUSH hom. Tau kawg nws yog qhov txaus siab pom keeb kwm ntawm cov ntsuas. Ntawm no koj tuaj yeem siv cov cuab yeej los npaj - "Keeb Kwm Keeb Kwm".

Kauj ruam 14: Tiav lawm

Tiav lawm
Tiav lawm
Tiav lawm
Tiav lawm

Daim ntawv thov ua tiav zoo li nws nyob ntawm daim duab.

Nias daim duab peb sab hauv kaum sab xis, thiab yog txhua yam ua tiav kom raug, tom qab ob peb feeb yuav muaj nyeem los ntawm lub ntsuas cua, thiab tom qab ntawv cov duab yuav tshwm.

Ntawm daim duab thib ob, koj yuav pom cov khoom sib dhos.

Kauj ruam 15: Tsaug

Mus ntsib kuv Blog rau ntau txoj haujlwm txaus nyiam:

verysecretlab09.blogspot.com/

Youtube channel:

www.youtube.com/channel/UCl8RTfbWUWxgglcJM…

Pom zoo: