Cov txheej txheem:
- Kauj ruam 1: Cov ntaub ntawv
- Kauj Ruam 2: Node MCU yog dab tsi?
- Kauj Ruam 3: Pib Nrog NodeMcu
- Kauj Ruam 4: Yuav Ua Li Cas Rub Cov Ntaub Ntawv Los Ntawm Lub Vev Xaib
- Kauj Ruam 5: Qhia Cov Ntaub Ntawv
- Kauj Ruam 6: Tsim Lub Thawv
Video: Rub thiab Ambiently Zaub Cov Ntaub Ntawv Los Ntawm Ib Lub Vev Xaib Tshaj Wifi (Qhov Taw Qhia Sab Qaum Teeb) Nrog NodeMcu: 6 Cov Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:25
Kuv Kev Txhawb Siab: Kuv tau pom LOTS ntawm cov lus qhia ntawm kev teeb tsa/ siv NodeMCU (ua rau ntawm ESP8266 module) rau ua IoT (internet ntawm yam) cov haujlwm. Txawm li cas los xij, tsawg kawg ntawm cov kev qhia no tau muaj txhua cov ntsiab lus/ cov cai/ kab kos rau cov neeg tshiab kom ua raws li pib kom tiav, thiab tsis muaj leej twg ua tau raws nraim qhov kuv xav tau.
Qhov npog no yuav yog dab tsi?: Qhov no yuav npog txhua yam koj xav paub (thiab qhov kuv tsis tau ua), suav nrog:
- Cov ntaub ntawv (yam kuv siv, tshwj xeeb)
- Arduino, NodeMcu, ESP8266, qhov txawv yog dab tsi?
-
Pib nrog NodeMcu
- Teeb tsa software (Arduino IDE)
- Ua kom LED ntsais
- Cov kev xaiv rau lub zog NodeMcu
- Txuas rau hauv internet
-
Yuav ua li cas rub cov ntaub ntawv los ntawm lub vev xaib
- "Taw tes" rau cov ntaub ntawv koj xav tau hauv lub vev xaib
- Thingspeak/ ThingHTTP/ APIs (tsis txhob ntshai, tsis muaj coding tsim nyog)
- Nkag mus rau cov ntaub ntawv no los ntawm NodeMCU
-
Muab cov ntaub ntawv
- Kuv siv dab tsi (yuav ua li cas xaim 7 ntu zaub)
- Qee lub tswv yim/ yam kuv yuav tau ua nrog ntau lub sijhawm
- Yuav ua li cas tsim ib lub thawv kuv twv
DISCLAIMER: Kuv tau saib ntau cov vis dis aus los kawm paub yuav ua li cas, thiab yuav luag txhua txoj cai tau sib xyaw ua ke los ntawm lwm qhov chaw thiab kuv tsis tuaj yeem nco txhua tus. Lub hauv paus tseem ceeb ntawm kev tshoov siab yog tus txiv neej no uas yog qhov tseem ceeb ua tib yam uas kuv tau piav qhia, tab sis kuv pom sifting los ntawm dab tsi yog kov cov khoom screen thiab dab tsi tsis nkag siab. Kuv xav txog qhov kev qhia no ntau ntxiv txog kev qhia rau NodeMcu thiab sorta kinda IoT cov haujlwm ntau dua li cov khoom tshwj xeeb, tab sis qhov kev tshoov siab rau qhov tshwj xeeb no (Sab Nraud Teeb) qhov taw qhia yog qhov no qhia los ntawm 2008. Kuv nyiam txoj kev nws tau piav raws li "pluag" txiv neej qhov chaw nyob ib puag ncig ", tso tawm cov ntaub ntawv ib puag ncig zoo li cov khoom lag luam, saib hauv youtube, lossis huab cua yam tsis siv xov tooj lossis lwm yam kev cuam tshuam.
Kauj ruam 1: Cov ntaub ntawv
Koj yuav tsum tau cov no:
1. Pawg NodeMcu
2. Ib lub micro USB cable rau kev xa cov cai mus rau pawg thawj coj saib, thiab ua kom muaj zog cov khoom kawg yog tias koj xaiv.
3. LEDs, cov xov hluav taws xob (txiv neej-txiv neej, txiv neej-poj niam) thiab lub khob cij rau txuas yam khoom … qhov no yog qhov muab rau, tab sis xijpeem koj xav tau "tso tawm" (tso saib lossis ua raws cov ntaub ntawv) yuav xav tau kho vajtse. Yog tias koj xav rov tsim dua ib puag ncig ib puag ncig, lossis ua raws nraim qhov kuv tau ua, 7 ntu tso saib lossis qee qhov LEDs tsuas yog hloov maj mam txaus. Lub khob cij yog qhov tsim nyog rau "kev tsim qauv" ua ntej koj txuas cov khoom 4 qhov tseeb, thiab kuv yuav piav qhia lawv li cas ua haujlwm/ yuav ua li cas cov khoom txuas nrog hauv ntu uas cuam tshuam. Yog tias koj tsuas yog tus pib, tsuas yog tau txais cov khoom pib arduino, vim nws muaj ntau yam me me hauv nws (suav nrog txhua yam kuv tau siv), ntxiv rau arduino uno rau lwm qhov haujlwm.
Tej yam uas koj xav tau:
4. Ib qho khoom siv fais fab mov (Yog tias koj xav tau lub hwj chim NodeMcu nrog tus qauv siv hluav taws xob… Kuv yuav tsis ua qhov no vim tias koj tsuas tuaj yeem siv nws nrog lub micro USB, uas yog txoj hauv kev yooj yim dua. Yog tias koj xav ua koj txoj haujlwm wireless tag, ces tau kawg koj yuav xav tau lub roj teeb pob, tab sis kuv yuav hais qhov no hauv ntu fais fab.
5. 1/4 ntoo thuv rau lub lil 'lub thawv (yog tias koj xav tau)
6. Qee lub veneer los npog koj lub thawv, thiab/lossis ua tus diffuser rau koj li LED lossis tso saib
7. Super (CA) thiab/lossis ntoo nplaum los txuas 5. thiab 6.
Kauj Ruam 2: Node MCU yog dab tsi?
Yog tias koj yog tus pib siv hluav taws xob zoo li kuv yog, koj yuav xav tsis thoob qhov txawv ntawm Arduino board thiab NodeMcu board yog dab tsi, thiab tej zaum koj kuj tau hnov txog ESP8266 … qhov sib txawv ntawm cov no yog dab tsi?!?
Qhov no tsis yog txhais tau tias yog txuj ci, tab sis qhov no yog yam koj yuav tsum paub.
Arduino muaj peev xwm nyeem cov ntawv nkag los ntawm cov koob, "ua tej yam" siv cov tswv yim no, thiab tom qab ntawd tso tawm mus rau koob koob. Nws yog qhov tseem ceeb ntawm lub khoos phis tawj me. Arduino ua LOTS ntawm cov laug cam sib txawv, thiab ntau qhov "ntaub thaiv npog" uas txuas rau hauv cov laug cam los ua lwm yam ntxiv. Cov khoom lawv tam sim no muag uas txuas rau internet yog kim heev thiab tsis tau txais ntau ntawm zej zog ua raws lawv. Cov cai tau sau thiab muab tso rau hauv cov laug cam los ntawm "Arduino IDE" software, uas txhawb nqa C thiab C ++, nrog qee qhov tshwj xeeb kev nthuav tawm hauv. vwm ntau ntawm cov cai muaj nyob hauv online, tab sis qee qhov kev paub nrog cov phiaj xwm (tshwj xeeb yog yam xws li thaum thiab rau lub voj, kev tshaj tawm sib txawv thiab nthuav dav thiab lwm yam) pab ua kom nkag siab sai. Arduino IDE tseem muab ib qhov chaw rau rub tawm cov tsev qiv ntawv tsim nyog rau cov laug cam sib txawv (ntau ntxiv nyob rau tom qab, teeb tsa NodeMcu).
ESP8266 yog tus qauv Wi-nkaus pheej yig heev uas ib txwm ua rau internet-siv arduino daim ntaub thaiv tsis siv sijhawm (txawm hais tias koj tseem pom cov laug cam uas muaj wifi ua hauv). Cov zej zog DIY nyob ib puag ncig ESP8266 yog qhov loj heev uas nws yuav luag tsuas yog qhov kev xaiv muaj tswv yim los ua cov cuab yeej siv internet. Feem ntau nws tau siv ua ke nrog lub rooj sib tham arduino ntawm tus lej txuas (Rx thiab Tx), txawm hais tias kuv twv qee tus neeg siv lawv "sawv ib leeg", tab sis txij li microchip yog qhov me me thiab nyuaj rau cuam tshuam nrog (nws ib txwm muaj 6 tus pin: 2 rau cov lej (tham nrog yam), 2 rau lub zog (hauv av thiab VCC), thiab 2 GPIO (cov ntsiab lus dav dav tso tawm), ntxiv rau nws ua haujlwm ntawm 3.3V thiab yog li 5V yuav rhuav tshem nws) uas nws tau hloov pauv sai los ntawm …
NodeMcu, uas yog qhib qhov kev txhim kho pawg thawj coj zoo ib yam li Arduino, tshwj tsis yog tsim ntawm ESP8266. Koj tuaj yeem pom ESP8266 ua rau hauv NodeMcu pawg thawj coj ncig hauv cov duab kuv txuas. Lub rooj tsavxwm no zoo kawg nkaus tus phooj ywg rau program thiab cuam tshuam nrog, thiab yog qhov piv piv rau arduino nano. Nws muaj ntau tus lej ntxiv, thiab tuaj yeem tsim kho tau los ntawm USB ncaj qha los ntawm koj lub khoos phis tawj, tsis tas yuav hla dhau lwm lub rooj tsavxwm. Tsis tas li, txawm hais tias pawg thawj coj tseem ua haujlwm ntawm 3.3V lub tswv yim ntau dua li 5V cov laj thawj, nws tau tsim ua hauv daim phiaj los tswj qhov hluav taws xob no, yog li nws tuaj yeem siv tau zoo ib yam li koj cov arduino, txawm tias los ntawm USB lossis los ntawm VCC (qhov hluav taws xob hauv) pins. Yeej, rau txhua yam IoT, NodeMcu yog qhov zoo, yooj yim, ib pawg thawj coj los siv, thiab yog WiFi tau qhib … txawm hais tias nws yog qhov kev xaiv zoo rau cov haujlwm tsis yog wifi ib yam nkaus. Cov txheej txheem NodeMcu "tawm ntawm lub thawv" lus yog LUA, tab sis tom qab teeb tsa 1 zaug hauv Arduino IDE, koj yuav tuaj yeem ua haujlwm nws ib yam li koj xav tau lwm yam Arduino.
Kauj Ruam 3: Pib Nrog NodeMcu
Kuv siv cov vis dis aus hauv qab no los ua kuv thawj zaug pib nrog NodeMcu, thiab yog tias koj ua raws txhua qhov nws qhia raws nraim, txhua yam yuav tsum ua haujlwm zoo.
1. Teeb tsa software (Arduino IDE)
- Rub tawm Arduino IDE los ntawm qhov txuas saum toj no, thiab xaiv "tsuas yog rub tawm" yog tias koj tsis tuaj yeem ua nyiaj pub dawb
- Qhib Arduino IDE software
- Hauv Cov Ntaub Ntawv -> Nyiam, Tus Thawj Saib Xyuas Ntxiv URLs, muab qhov txuas hauv qab no "https://arduino.esp8266.com/versions/2.5.0-beta2/package_esp8266com_index.json"
- Hauv Cov Cuab Yeej -> Rooj Tswjhwm Saib -> Tus Thawj Saib Xyuas Lub Rooj (nyob rau saum toj) nqes mus rau hauv qab, lossis tshawb rau ESP8266, thiab nyem rau nruab
- Koj yuav xav tau rov pib dua Arduino IDE rau qhov no los tshwm, tab sis tam sim no nyem Cov Cuab Yeej-> Pawg, thiab xaiv pawg thawj coj uas koj tau txais, piv txwv li NodeMcu 1.0 ESP12-E module
- Koj yuav tsis xav tau ua cov kauj ruam no, tab sis txuas lub usb rau koj lub khoos phis tawj los ntawm koj li NodeMcu (teeb yuav ntsais), thiab mus rau Tswj Vaj Huam Sib Luag-> Tus Thawj Saib Xyuas Khoom -> Chaw Nres Nkoj -> thiab tom qab ntawd Nco tseg ntawm COM chaw nres nkoj uas muaj npe "Silicone Labs …" Nov yog qhov chaw nres nkoj COM uas NodeMcu siv
- Rov qab mus rau Arduino IDE thiab mus rau Tools-> Port: thiab xyuas kom meej tias qhov chaw nres nkoj no raug xaiv
- Txhua yam yuav tsum yog qhov zoo, tab sis xyuas kom meej tias nyob hauv Cov Cuab Yeej, qhov loj me yog 4 (tsis txhob txhawj xeeb txog SPIFFS, txhua yam uas tau xaiv yog qhov zoo), thiab qhov rub tawm nrawm yog 115200 Kuv twv … NodeMcu yeej siv tus nqi baud ntawm 9600 txhawm rau xa cov ntaub ntawv rov qab mus rau tus saib xyuas (yog tias koj tsis paub qhov no txhais li cas tsis txhob txhawj, nws yuav tshwm nyob rau hauv qhov piv txwv), tab sis yog tias nyob hauv cov cai thiab tom qab ntawd hauv lub saib xyuas, koj tau txais 9600, nws zoo.
2. Ua kom LED ntsais
Qhov no zoo li "Nyob Zoo Ntiaj Teb" (piv txwv li tus menyuam $ h1t) ntawm txoj haujlwm, tab sis nws cia koj paub txhua yam zoo nrog lub rooj tsavxwm, thiab yuav pab koj paub nrog Arduino IDE. Qhov no TSIS YOG qhia txog WiFi lub peev xwm ntawm pawg thawj coj (peb ua qhov ntawd hauv qhov piv txwv tom ntej), tsuas yog ua kom ntseeg tau tias nws tau txuas nrog thiab tuaj yeem ua haujlwm lwm yam.
- Qhib arduino IDE, kom koj NodeMcu ntsaws rau hauv
- Ua ntej ua dab tsi, ceeb toom tias muaj lub hauv paus rau txoj cai yooj yim tshaj plaws uas koj tuaj yeem sau rau koj cov arduino, nrog teeb tsa () lub voj uas khiav ib zaug, thiab lwm lub voj () uas yuav ua haujlwm tas mus li. Peb cov lej kawg yuav tau teeb tsa ib yam nkaus li qhov no, nrog ob peb yam ntxiv saum toj no, thiab ua haujlwm tau piav qhia hauv qab
- Cov Ntaub Ntawv-> Piv txwv-> (hauv qab NodeMcu 1.0 ntu) ESP8266-> Blink
- Qhov no yuav qhib qee qhov chaws nyob hauv lub qhov rais. Xav tias dawb los cawm nws qhov chaw.
- Hauv txoj cai no, teeb tsa () lub voj muaj cov lus txhais ntawm builtin LED ntawm lub rooj tsavxwm raws li qhov tsim tawm, thiab lub voj tawm tau siab thiab qis rau LED no. Nco ntsoov tias rau LED teeb tsa rau hauv pawg thawj coj (tsuas yog qhov no tsis yog qhov xwm txheej), "LOW" tso zis (0 volts) yuav ua rau nws qhib, vim nws tau ua los ntawm lub neej ntawd, thiab "HIGH" (3.3V hauv rooj plaub no kuv twv), yog tawm
- Yog tias txhua yam tau teeb tsa kom raug raws li tau hais tseg saum toj no, koj yuav tsum tuaj yeem nyem "Txheeb Xyuas" (kos cim hauv lub voj voos nyob rau sab saum toj sab laug) t sau nws, tab sis koj yuav!), Thiab thaum nws zoo tag nrho, "Upload" txoj cai ib sab ntawm nws
- Thaum koj nyem upload, koj yuav pom cov khoom nyeem tawm hauv thaj av dub hauv qab, thiab dots/ % ua tiav kev sau tawm
- Tsis txhob txhawj xeeb tias nws hais tias nws yuav siv sijhawm 33% ntawm lub cim xeeb … qhov ntawd yog qhov "tsau" cov nyiaj tau los ntawm txawm tias tus lej yooj yim tshaj plaws, qhov kuv tau sau tsuas yog siv li 1% ntxiv ntawm qhov chaw
- Koj yuav pom cov LED ntawm lub rooj tsavxwm pib ntsais muag (uas nws tau ua yav dhau los lawm), yog li xav tias hloov pauv ntau txhiab txhiab ntawm ob (milliseconds) nyob rau qhov ncua sijhawm ntawm tsab ntawv. Yog tias qhov no yog thawj zaug uas koj tau sau ua lub sijhawm, saib cov LED ntsais ntawm qhov sib txawv me ntsis yuav yog qhov kev lom zem tiag tiag
3. Kev xaiv rau lub zog NodeMcu
Kuv tsis paub tseeb tias vim li cas kuv thiaj tsis nkag siab qhov no thaum xub thawj, tab sis cov cai uas koj tso rau hauv pawg thawj coj yuav nyob ntawd, thiab yuav khiav mus ib txhis thiab puas tau sai li sai tau/ ntev li ntev tau muaj lub zog muab rau nws. Piv txwv li, tom qab ua tiav qib 2, yog tias koj yuav tsum tshem nws los ntawm koj lub khoos phis tawj, tom qab ntawd siv nws rau lwm qhov, nws yuav pib ntsais muag dua. Txoj hauv kev yooj yim tshaj plaws rau lub zog NodeMcu tsuas yog ntsaws lub micro USB rau hauv nws, thiab tom qab ntawd nkag mus rau lub tsub them ib yam li koj siv rau koj lub xov tooj ntawm tes hauv phab ntsa (5V 1A thaiv lossis txawm nws yuav yog dab tsi). Xav tias dawb los saib kuv lwm cov lus qhia rau yuav ua li cas lub zog khoom, polarity ntawm DC jacks, thiab lwm yam. ntau dua rau pawg thawj coj saib no thiab ib qho LED koj siv, piv txwv li), tab sis qhov hluav taws xob yuav tsum nyob hauv thaj tsam nruj heev rau txhua yam kom ua haujlwm raug. Ntawm NodeMcu, koj tuaj yeem siv lub zog xa hluav taws xob nrog txhua qhov hluav taws xob los ntawm 3.3V txog 20V yam xyuam xim, vim muaj tus tswj hwm ntawm lub rooj tsavxwm uas ua rau lub zog hluav taws xob poob qis (qhov no yog qhov zoo). Nrog amperage, mus dhau yog OK txij li lub rooj tsavxwm tsuas yog kos qhov nws xav tau, tab sis nrog qhov hluav taws xob, nws feem ntau muaj kev nyab xeeb dua los siv cov hluav taws xob kom ze rau, tsis tas yuav qis dua, qhov xav tau #, yog li ua haujlwm tsawg dua yuav tsum tau ua/ lub zog poob throttling qhov voltage cia. Yog tias koj xav siv lub roj teeb pob, lossis xav siv DC lub hwj chim txuas (tej zaum yog li koj tuaj yeem muaj lub xov tooj zoo ntev), cov pins siv yog VIN uas nyob ib sab hauv av pins.
4. Txuas rau hauv internet
Kuv tau muab txuas ua ib daim ntawv (rau cov xeeb leej xeeb ntxwv lub txiaj ntsig, yog tias cov vis dis aus ploj mus) cov cai los ntawm youtube video saum toj no, tab sis thov mus hauv youtube txuas thiab muab nws saib rau tus lej. Nws yog qhov tsim nyog rau koj lub sijhawm, nws piav qhia keeb kwm ntawm pawg thawj coj uas yog kev lom zem.
Qhib arduino code file hu ua "Wifi_connect" thiab hloov SSID thiab password rau koj tus kheej, tom qab ntawd mus
- Daim ntawv ceeb toom tias saum toj no cov loops muaj kab #suav nrog, uas yog qhia Arduino suav nrog lub tsev qiv ntawv uas muaj cov khoom siv WiFi rau ESP8266. Cov no yog cov hauv paus ntawm cov khoom siv hluav taws xob thiab cov khoom uas tau ua ke ua ke thiab cia koj ua qee yam tshwj xeeb uas yooj yim, siv cov khoom sau ua ntej muaj nyob hauv lub tsev qiv ntawv. Piv txwv li, yog tias koj yuav daim ntaub thaiv lossis ntxiv rau lub rooj tsavxwm, nws yuav muaj cov tsev qiv ntawv cuam tshuam nrog nws yog li koj tuaj yeem yooj yim cuam tshuam nrog nws.
- Cuab Yeej-> Serial Monitor
- Xyuas kom meej tias lub ntsuas saib tau teeb tsa los nyeem ntawm 9600. Yog tias nws tsis yog ntawm qhov nrawm, tus saib xyuas yuav nthuav tawm qhov tsis txaus ntseeg, yog li ntawd yog qhov qhia tau zoo tias koj lub xov tooj saib tsis zoo ib yam li cov lej tau teev tseg hauv txoj cai
- Nyem lees paub thiab khiav, thiab saib cov ntawv xov xwm raws li nws ua tiav … nws yuav qhia koj cov ntsiab lus ntawm kev sib txuas yog tias nws ua haujlwm, thiab qhia tau tias ESP8266 hauv NodeMcu muaj peev xwm txuas rau koj li WiFi! Nws tsis ua ib yam dab tsi, tab sis yog tias koj tau mus thiab ntsaws lub rooj tsavxwm no rau hauv phab ntsa qhov chaw, koj tuaj yeem tos 30 vib nas this thiab ntseeg ncaj ncees tias nws tsim kev sib txuas nrog internet uas tseem yuav zoo siab.
- Txhawm rau ntsuas koj tus kheej, sim ua ke ua ke "bllink" code thiab "wifi_connect" code kom muaj lub onboard LED qhib, lossis ntsais muag thaum nws txuas nrog internet. Nov yog txoj hauv kev zoo los kawm!
Yog tias koj tau ua txhua yam saum toj no, ua kev zoo siab! Koj tau qhia tias koj tuaj yeem tso cai rau NodeMCU, thiab tias NodeMcu tuaj yeem txuas rau koj li WiFi. Peb yuav siv txoj kev sib txawv me ntsis ntawm kev txuas mus rau WiFi, siv MultiWifi lub tsev qiv ntawv ntau dua li lub tsev qiv ntawv Wifi qub qub, vim nws tso cai rau koj yooj yim ntxiv cov npe ntawm WiFis thiab tsuas yog sim txuas mus rau qhov twg nws tuaj yeem ua tau.
Kauj Ruam 4: Yuav Ua Li Cas Rub Cov Ntaub Ntawv Los Ntawm Lub Vev Xaib
Cov ntaub ntawv hauv cov vev xaib raug khaws cia hauv txoj kev txaus ntshai heev. Lim qhov no mus rau hauv cov khoom koj xav tau, lossis "cais" rau nws yog qhov zoo sib xws, thiab sim ua qhov no yam tsis muaj kev paub tseem ceeb ntawm HTML tuaj yeem ua rau txaus ntshai … yog li lub hom phiaj yog kom tau txais cov ntaub ntawv koj xav tau tawm ntawm qhov chaw txaus ntshai mus rau hauv qhov chaw dawb huv thiab zoo siab heev. Ua haujlwm zoo qhov no txhais li cas yog mus los ntawm URL uas qhia tag nrho lub vev xaib, mus rau URL uas qhia tsuas yog ib qho ntawm cov ntaub ntawv koj xav tau.
1. "Taw tes" rau cov ntaub ntawv koj xav tau hauv lub vev xaib
Mus rau lub vev xaib uas koj xav tau, piv txwv li ntawm no
www.timeanddate.com/worldclock/canada/edmonton
tom qab ntawd mus rau cov ntaub ntawv koj xav tau, nyem rau nws, thiab xaiv "tshuaj xyuas". Nws yuav qhib qhov HTML saib hauv koj tus browser, thiab qhia koj cov ceg kawg ntawm tsob ntoo uas koj cov ntaub ntawv los ntawm. Kuv pom tias qhov browser yooj yim tshaj plaws los siv rau qhov no yog chrome, tab sis pom tias firefox muaj qee qhov txuas ntxiv uas ua rau nws zoo dua …
Ntawd yog qhov twg cov ntaub ntawv nyob. Qee lub sij hawm nws muaj tus ID nws tau hais los ntawm, qee zaum nws tsuas yog sau kom raug. Yog li peb yuav rho tawm qhov no li cas?
2. Thingspeak/ ThingHTTP/ APIs (tsis txhob ntshai, tsis muaj coding tsim nyog)
Kuv tseem tsis tau tham txog API's yog dab tsi thiab koj ua lawv li cas, tab sis koj tuaj yeem xav txog lawv li qhov kev sib txuas tiag lossis kev sib kis ntawm koj (koj qhov kev thov) thiab qhov twg yog yam uas koj tab tom thov txog. Cov piv txwv qub yog tus tos ntawm lub tsev noj mov. Txhawm rau ua qhov no yam tsis muaj coding, koj yuav siv qhov kev pabcuam dawb hu ua "ThingSpeak", thiab tshwj xeeb lawv daim ntawv thov "ThingHTTP". Tsuas yog ua tus account, thiab tom qab ntawd mus rau cov apps, thiab txoj hauv kev hauv qab, yamhttp, thiab tsim ib qho.
Tsuas yog qhov koj yuav tsum tau ua yog theej thiab muab tshuaj txhuam URL ntawm lub vev xaib, piv txwv li hnub thiab sijhawm lub vev xaib saum toj no, thiab tom qab ntawv nqes mus rau qhov kawg "Parse String". Nov yog txoj hauv kev rau cov ntaub ntawv koj xav tau.
Kuv twv txoj hauv kev no tuaj yeem muab ob peb txoj hauv kev, tab sis qhov yooj yim tshaj plaws thiab tsuas yog txoj hauv kev uas kuv paub yog los ntawm txoj cai txhaj cov ntawv ntawd raws li tau piav qhia saum toj no, tshuaj xyuas nws, thiab tom qab ntawd nyem rau kab uas tau hais meej sib haum rau cov ntaub ntawv ntawd hauv tus saib HTML, thiab mus rau Copy-> x path. Qhov no yog qhia hauv daim duab txuas.
Thaum koj ua tiav, sim mus rau qhov URL tsim rau koj thiab pom tias nws muaj cov ntaub ntawv koj xav tau hauv qee txoj hauv kev uas tsawg kawg tuaj yeem ua haujlwm nrog. Piv txwv li, kuv hais tias qhov ntsuas sov li "XX F" hloov ntawm tus lej degrees Celsius, tab sis cov chav thiab F ntawm qhov kawg tuaj yeem hloov pauv tau yooj yim hauv cov cai. Nws yog qhov tshwj xeeb kom tau txais qhov ua yuam kev uas nws tsis tuaj yeem ua rau mob. Yog tias qhov no tshwm sim, sim tshem qee cov ntawv hauv lub xpath, saib yog tias koj tuaj yeem pom cov ntaub ntawv nyob lwm qhov, lossis tham nrog lub rooj sab laj uas lawv tuaj yeem tuaj yeem txheeb xyuas qhov "tsis zoo" ntawm koj txoj hlua cais. Txoj hauv kev no yuav tsis ua haujlwm ntawm lub vev xaib uas tsis thauj cov ntaub ntawv xav tau hauv lub vev xaib, tab sis hloov (nws tus kheej) rub los ntawm qee qhov chaw sab nraud, uas yuav tsum siv sijhawm me ntsis los thauj khoom. Txawm li cas los xij, nws yuav tsum ua haujlwm zoo rau yam nyiam youtube khoom, huab cua, thiab lwm yam.
3. Nkag mus rau cov ntaub ntawv no los ntawm NodeMCU
Kuv twb tau sau ntau heev, yog li pom cov kab ntawv txuas, uas muaj ntau cov lus pom, thiab tam sim no tau teeb tsa los nyeem hauv aurora borealis muaj feem rau Edmonton AB, Canada (Tsuas yog!). Thawj qhov tweak koj yuav tsum tau ua yog tsuas yog hloov tawm URL (qhov tseeb tsuas yog 16 tus lej api qhov tseem ceeb ntawm URL) rau koj tus kheej li
Qhov thib ob uas koj yuav tsum tau tweak yog nyob hauv lub voj (), qhov twg qhov tseeb "tus nqi" tau coj los thiab khaws cia raws li qhov sib txawv "koj tus nqi", uas yog txoj hlua (ntawv). Nws tuaj yeem siv tau rau txhua qhov kev xav uas koj xav tau los ntawm qhov ntawd. Kuv tshem tawm cov cim feem pua, faib 2 tus lej ntawm % rau 2 qhov sib txawv (piv txwv li 14 % rau 1, 4), thiab muaj cov no khaws cia ua cov lej, tab sis nrog ob peb google tshawb nrawm lossis tawm lus ntawm no, koj yuav tsum muaj peev xwm txhawm rau rho tawm cov lej uas koj xav tau los ntawm cov khoom httphttp generated. Koj yuav xav tau tus lej txhawm rau tuaj yeem ua tej yam xws li txiav txim siab yog tias nws loj lossis me lossis faib tau-los-ib yam txaus los tig yam khoom lossis tso tawm lossis tso saib. Qhov seem ntawm cov cai los ntawm lub ntsiab lus ntawd, suav nrog kev ua haujlwm hauv qab hu ua xyaseg () tau siv los tso saib 2 tus lej.
Xav tias dawb nug cov lus nug txog tus lej, lossis yuav ua li cas koj tuaj yeem rho tawm lossis qhia yam khoom uas koj xav tau, lossis koj yuav siv cov lej no li cas, piv txwv li faib cov spectrum ntawm rgb LED thiab teeb duab sib txawv qhov sib txawv rau xim sib txawv.
Kauj Ruam 5: Qhia Cov Ntaub Ntawv
1. Kuv siv dab tsi (yuav ua li cas xaim 7 ntu zaub)
Kuv tau txais daim duab txuas/ ua raws cov kab lus piav qhia los ntawm lwm cov lus qhia no.
Kev txuas yog ncaj ncaj, tab sis yog tias koj tsis tau siv lub khob cij, tom qab ntawd nws tuaj yeem cuam tshuam dab tsi tshwm sim. Qhov tseem ceeb ntawm lub khob cij yog npaj ua kom sib txuas tau meej thiab ib ntus.
Txhua qhov kev piav qhia hauv qab no yuav muaj feem cuam tshuam nrog daim duab txuas: Lub khob cij tuaj yeem faib ua kab rov tav ua 2 ntu ib nrab, txhua qhov nrog 2 ntu sib txawv: kab rov tav - thiab + kab txuas qhov ntev ntawm lub khob cij (siv rau lub zog) thiab kab ntsug, uas yog tus lej, thiab suav nrog 5 qhov chaw ib kem uas tau siv rau cim kev sib txuas. Tom qab ntawd muaj qhov sib txawv me ntsis, thiab tom qab ntawd cov yam ntxwv zoo ib yam ob npaug ntawm lwm sab ntawm txoj kab kev xav sib faib. Txhua qhov chaw nyob hauv kab rov tav + kab txuas nrog ua ke, thiab txhua qhov kab rov tav - kab kab txuas tau txuas ua ke. Qhov no tso cai rau koj ntsaws lub hwj chim rau hauv ib qho kawg ntawm lub khob cij thiab tom qab ntawd tuaj yeem tuaj yeem ntsaws cov khoom mus rau txhua qhov chaw nrog rau + tshem lub zog tawm, ib yam li lub hwj chim ntev bar rau qhov hluav taws xob. Tib yam mus rau kab - kab, uas yog siv rau hauv av yam. Rau cov lej suav, txhua qhov chaw hauv kab ntawv suav nrog txuas rau lwm 4 qhov chaw. Nco ntsoov tias tsib qhov nyob hauv kab ntawv TSIS YOG txuas nrog tsib yam sib txawv ntawm txoj kev xav ib nrab txoj kab. Lub khob cij tuaj yeem txiav ntev thiab tsis muaj kev sib txuas hluav taws xob yuav raug txiav.
Lub NodeMcu hla ob qho ntawm ib sab ntawm lub khob cij ua kom zoo, nrog txhua tus pin sib xws rau lub zog lossis cov tswv yim/cov txiaj ntsig muaj cov lej suav rau nws tus kheej, yog li koj tuaj yeem ntsaws xov hlau rau hauv qhov chaw nkag tau yooj yim dua thiab txuas nws lwm qhov ntawm lub khob cij. Tib yam mus rau 7 ntu ntu qhia hauv daim duab. Piv txwv li, ua raws txoj hauv kev hauv av los ntawm pawg thawj coj mus rau 7 ntu ntu hauv daim duab.
- tus pin hauv av los ntawm NodeMcu tau txuas rau kab 2
- xaim los ntawm kab 2 mus rau -v kab rov tav fais fab kab (xaiv los ntawm thaj av convention)
- los ntawm kab hauv av (tus lej naj npawb tsis cuam tshuam, txij li tag nrho kab txuas nrog) mus rau kab 22 ntawm tus tiv thaiv
- rau hauv "hauv av" tus pin ntawm 7 ntu qhia uas tseem tau txuas rau kab 22
Lub hom phiaj ntawm tus tiv thaiv hauv daim duab yog qhov pib "tsau" qee qhov ntawm lub zog tso tawm mus rau LEDs, uas ua haujlwm ua haujlwm kom dim cov zaub. Koj yuav pom tias thaum "1" tau teeb pom kev zoo piv rau "8", 1 yog qhov ci dua, vim tias tsawg dua LEDs nyob. Qhov tsawg dua qhov koj siv LED, nws yuav ntev dua, yog li tus tiv thaiv yog qhov tsim nyog. Feem ntau daim duab rau 7 ntu qhia pom tau pom tias muaj tus tiv thaiv nyob rau hauv kab nrog rau txhua ntu ntawm tus kheej, tab sis qhov no zoo li ua haujlwm tau zoo. Kuv siv 1K ohm resistor.
Ua tib zoo paub txog cov pins sib raug rau tus pin ntawm cov zaub, txij li cov no tau teeb tsa hauv cov cai.
2. Qee lub tswv yim/ yam kuv yuav tau ua nrog sijhawm ntxiv
Qhov no yog qhov tseem ceeb uas kuv tau tso tseg, tab sis koj tuaj yeem xaiv ntau lwm yam los tso tawm raws li tus nqi ntawm koj cov ntaub ntawv xws li:
- rgb LED uas hloov xim nyob ntawm tus nqi, lossis npog qhov gradient, los ntawm ntsuab rau liab piv txwv
- puv LED zaub
- ib qho laj thawj rau/tawm dhau/hauv qhov tseeb/tsis tseeb LED uas tsuas yog qhib rau lossis tawm los qhia qee yam
- lub cev muaj zog uas tig mus rau lub sijhawm tshwj xeeb ntawm ib hnub, zoo li lub valve ntawm cov dej tso dej lossis tso kev kho rau koj tus dev … Kuv paub tseeb tias muaj ntau txoj hauv kev ua qhov no zoo dua li txhais lub sijhawm ntawm wifi tab sis nws yog qhov kev xaiv!
Cov kauj ruam tom ntej (uas muaj ntau qhov xav paub ntau ntxiv rau) yog tshaj tawm cov ntaub ntawv rau koj tus neeg rau zaub mov OWN (uas tseem tuaj yeem ua tiav los ntawm yam hais lus) thiab tom qab ntawd siv cov ntaub ntawv no (zoo li rau lub vaj tsev tsis siv neeg, lossis cov khoom ntse hauv tsev).
Kauj Ruam 6: Tsim Lub Thawv
Txhua qhov kev sib txuas ua los ntawm lub khob cij tuaj yeem ua tas mus li los ntawm kev siv cov xov hlau ncaj qha nruab nrab ntawm lub rooj tsavxwm thiab cov zis (zoo li LED), lossis los ntawm kev siv lub khob cij me me ntau dua, lossis PCB los sib txuas ntawm cov nplai uas tuaj yeem haum rau koj qhov project. Kuv tau xaiv los siv lub khob cij me me uas tuaj rau hauv cov khoom kuv txuas, thiab tsuas yog xav tau txhawm rau txhawm rau tiv thaiv qhov kawg ntawm xaim … tsis muaj zog, tab sis ua haujlwm tau!
Kuv txiav 4 daim ntawm 1/4 "x 3.5" ntoo thuv ntawm 3.5 "(ob sab) thiab ib qho ntawm 4" (sab saum toj), thiab tsuas yog butted lawv thiab glued lawv ua ke, ua kom ntseeg tau tias txhua lub ntsej muag zoo li lub xwmfab raws li ua tau kom txhua lub ntsej muag yaug kom ntau li ntau tau. Ua ntej gluing rau pem hauv ntej lossis thim rov qab kuv tau txiav tawm thaj chaw rau cov zaub thiab pawg thawj coj los tawm kom txaus kom pom/ ntsaws rau hauv feem. Cov ntawv me me kuv tau txais daim kab xev nplaum rau sab nraub qaum kom nws tuaj yeem ntsia tau rau ntawm ib sab ntawm phab ntsa, thiab 7 ntu ntu tuaj yeem tuav nyob rau hauv qhov chaw los ntawm thawj qhov dag qhov khoom ntawm cov kab xev, tso cov zaub ntawm daim kab xev no, thiab tom qab ntawd nphoo cov hmoov ci tshaj/rau hauv txhua qhov khoob. Tom qab ntawd kuv nchuav CA (super) kua nplaum rau hauv qhov khoob, uas, thaum sib cuag nrog cov dej qab zib ci, tam sim tawv tawv los tuav cov zaub nyob rau hauv qhov chaw, yaug tawm tsam lub hauv ntej ntawm thooj ntawv. Daim kab xev ntim khoom yog txhawm rau tiv thaiv cov kua nplaum los ntawm kev nkag los ntawm cov zaub thiab saum npoo nws lub ntsej muag nqes los tiv thaiv thiab ua kom nws qhuav ib zaug.
Kuv glued ntoo thuv veneer mus rau txhua sab (siv CA kua nplaum, uas ua haujlwm zoo dua li cov kua nplaum ntoo hauv kuv lub tswv yim) thiab txhuam cov ntug nrog txhua daim ntawv thov, ua kom nws zoo li qub/ zais lub pob tw pob qij txha/ ua raws li diffuser rau tso saib zoo li hauv daim video no.
Pom zoo:
Ua Cov Phiaj Xwm Zoo Los Ntawm Cov Ntaub Ntawv Nyob Arduino (thiab Txuag Cov Ntaub Ntawv rau Excel): 3 Cov Kauj Ruam
Ua Cov Phiaj Xwm Zoo Los Ntawm Cov Ntaub Ntawv Nyob Arduino (thiab Txuag Cov Ntaub Ntawv rau Excel): Peb txhua tus nyiam ua si nrog peb tus lej L … cov ntsiab lus tau ntxiv thiab nws tsis tshwj xeeb rau lub qhov muag. Arduino IDE cov phiaj xwm tsis
Xa Cov Ntaub Ntawv mus rau AskSensors IoT Platform Los Ntawm Lub Vev Xaib: 6 Cov Kauj Ruam
Xa Cov Ntaub Ntawv mus rau AskSensors IoT Platform Los ntawm Lub Vev Xaib: Kuv tau tshaj tawm tsis ntev los no cov lus qhia qhia ib qib zuj zus qhia kom txuas ESP8266 ntawm MCU rau AskSensors IoT Platform. Kuv tau txais qee cov lus tawm tswv yim los ntawm cov neeg xav paub ntau ntxiv hauv AskSensors platform, tab sis lawv tsis muaj lub node MCU hauv tes. Qhov no kuv
Arduino Neeg Hlau Nrog Kev Nyob, Kev Qhia thiab Qib Kev Sib Hloov (Sab Hnub Poob, Sab Hnub Poob, Sab Qaum Teb, Sab Qab Teb) Tswj los ntawm Lub Suab Siv Bluetooth Module thiab Kev Siv Tus Neeg Siv Hluav Taws Xob: 6 Kauj Ruam
Arduino Neeg Hlau Nrog Kev Nyob, Kev Qhia thiab Qib Kev Sib Hloov (Sab Hnub Poob, Sab Hnub Poob, Sab Qaum Teb, Sab Qab Teb) Tswj los ntawm Lub Suab Siv Bluetooth Module thiab Kev Siv Tus Neeg Siv Hluav Taws Xob: Cov lus qhia no piav qhia yuav ua li cas thiaj tsim tau Arduino Robot uas tuaj yeem txav mus raws qhov xav tau (Forward, Backward) , Sab laug, Txoj Cai, Sab Hnub Poob, Sab Hnub Poob, Sab Qaum Teb, Sab Qab Teb) xav tau Kev nrug deb hauv Centimeters siv lub suab hais kom ua. Neeg hlau kuj tseem tuaj yeem txav tau tus kheej
ESP8266 Huab Cua Chaw Nres Tsheb uas Qhia Cov Ntaub Ntawv ntawm Lub Vev Xaib: 7 Kauj Ruam
ESP8266 Huab Cua Chaw Nres Nkoj Uas Qhia Cov Ntaub Ntawv ntawm Lub Vev Xaib: Nco tseg: Ib feem ntawm qhov kev qhia no yuav muaj nyob hauv cov vis dis aus ntawm kuv li YouTube Channel - Tech Tribe. . Yog li, koj yuav xav tau koj tus kheej sau (Ex:
Lub hauv paus tseem ceeb ntawm Lub Vev Xaib-raws li Lub Vev Xaib: 7 Kauj Ruam
Cov Hauv Paus Ntawm Lub Vev Xaib-raws li Lub Vev Xaib: Cov lus qhia no yuav qhia koj cov hauv paus ntawm kev tsim lub vev xaib nrog divs li cas. Vim tias cov ntxhuav siv rau kev teeb tsa yog qhov phem!: PTo kom nkag siab cov lus qhia no, koj yuav tsum paub qhov yooj yim html thiab css. Yog tias koj tsis nkag siab qee yam, xav tias dawb rau