Cov txheej txheem:

Lub Suab Tswj Lub Teeb Los Ntawm Txhua Qhov Chaw Nrog Jason: 7 Kauj Ruam
Lub Suab Tswj Lub Teeb Los Ntawm Txhua Qhov Chaw Nrog Jason: 7 Kauj Ruam

Video: Lub Suab Tswj Lub Teeb Los Ntawm Txhua Qhov Chaw Nrog Jason: 7 Kauj Ruam

Video: Lub Suab Tswj Lub Teeb Los Ntawm Txhua Qhov Chaw Nrog Jason: 7 Kauj Ruam
Video: Tswv Yexus lub neej thaum pib txug thaum xaus 2024, Kaum ib hlis
Anonim
Lub suab tswj lub teeb los ntawm Txhua Qhov Chaw Nrog Jason
Lub suab tswj lub teeb los ntawm Txhua Qhov Chaw Nrog Jason

AC teeb uas tau tswj los ntawm txhua qhov chaw nrog kev siv internet siv NodeMCU (ESP8266) thiab Jason (Android App).

Jason yog lub suab tswj tus pab cuam app uas kuv tau sau rau Android cov cuab yeej los tswj lub xeev hluav taws xob ntawm cov khoom siv AC, txog tam sim no nws tuaj yeem tswj teeb. Koj tuaj yeem tswj lub teeb los ntawm txhua qhov chaw hauv ntiaj teb no tsuav koj muaj internet txuas. Qhov no tuaj yeem ua tau los ntawm kev siv IoT broker, qhov no peb siv Ubidots.

Txhawm rau siv nws koj yuav tsum tsim lub khoos phis tawj khoos phis tawj uas txuas rau lub teeb pom kev, (cov lus qhia hauv qhov kev qhia no) thiab koj tseem yuav xav tsim tus lej Ubidots.

Yog li cia peb pib…

Kauj ruam 1: Teem Ubidots Account

Teem Ubidots Account
Teem Ubidots Account
Teem Ubidots Account
Teem Ubidots Account
Teem Ubidots Account
Teem Ubidots Account

Thawj qhov koj yuav tsum tau ua yog mus rau Ubidots rau Kev Kawm Ntawv lub vev xaib thiab tsim tus as khauj. Koj tuaj yeem kos npe ncaj qha yog tias koj twb muaj Twitter, Github, Google lossis Facebook account.

Thaum koj tau tsim koj tus as khauj lawm koj yuav nkag mus rau koj tus lej cim, nyem rau ntawm koj lub npe siv nyob rau sab xis saum toj thiab nyem rau ntawm API Cov Ntawv Pov Thawj. Txuag koj cov cim, raws li peb yuav siv tom qab.

Kauj ruam 2: Jason App

App Cov Ntaub Ntawv ntawm Jason
App Cov Ntaub Ntawv ntawm Jason
App Cov Ntaub Ntawv ntawm Jason
App Cov Ntaub Ntawv ntawm Jason
App Cov Ntaub Ntawv ntawm Jason
App Cov Ntaub Ntawv ntawm Jason
App Cov Ntaub Ntawv ntawm Jason
App Cov Ntaub Ntawv ntawm Jason

Lub app tuaj yeem rub tawm los ntawm Play Store, nws muaj ua lus Askiv thiab lus Mev.

Luam koj daim ntawv Ubidots token rau hauv app, los ntawm kev coj mus rhaub cov chaw teeb tsa, muab nws tso rau hauv Ubidots qhov chaw tseem ceeb thiab coj mus rhaub khawm txuag.

Tam sim no peb yuav tsum teeb tsa lub cuab yeej, mus rau lub cuab yeej tab, thiab coj mus rhaub khawm ntxiv. Sau lub npe, nyiam dua lub npe ntawm thaj chaw uas lub teeb nyob, yog li koj tuaj yeem hais "Qhib lub teeb chav ua noj". Ntawm ESP32 I/O Pin xaiv "5", uas yuav yog NodeMCU (sab hauv ESP8266) tus pin txuas nrog txuas. Thiab coj mus rhaub tseg.

Kauj Ruam 3: Kev Nyab Xeeb Ua Ntej

Kev Nyab Xeeb Ua Ntej
Kev Nyab Xeeb Ua Ntej

Hauv txoj haujlwm no peb tab tom ua haujlwm nrog lub zog hluav taws xob (A/C voltage) uas yog qhov txaus ntshai yog tias koj tsis paub tias koj tab tom ua dab tsi, ceev faj heev. TSIS TXHOB kov ib feem ntawm lub Circuit Court lossis ua haujlwm nrog nws yog tias nws txuas nrog lub zog ntawm phab ntsa. Yog tias koj tsis paub koj tab tom ua dab tsi, nres ntawm no lossis tau txais kev pab los ntawm cov kws tshaj lij.

Kuv tsuas yog tshaj tawm cov ntawv qhia kev kawm no thiab kuv tsis txhais tau tias yog lub luag haujlwm rau kev raug mob lossis kev puas tsuaj uas koj yuav ua rau.

Kauj ruam 4: Schematics

Schematics
Schematics
  • Hwj chim NodeMCU los ntawm txuas VIN rau VCC (5V) thiab GND tus pin rau GND.
  • Txuas D8 mus rau ib qho kawg ntawm qhov hloov pauv thiab mus rau 2.2K Ohm resistor txuas rau GND.
  • Txuas lwm qhov kawg ntawm kev hloov mus rau 3.3V raws li NodeMCU tuaj yeem tsuas yog tswj qhov hluav taws xob hauv nws I/O Pins.
  • D1 rau 2.2k Ohm resistor rau lub hauv paus ntawm NPN transistor
  • Tsis zoo DC ntawm kev xa mus rau lub colector ntawm transistor.
  • Transistor emitter rau GND.
  • PositiveDC ntawm qhov txuas mus rau 5V.
  • Qhov tsis zoo ntawm lub teeb pom kev zoo rau ib tus pin AC ntawm qhov txuas.
  • Qhov zoo ntawm lub teeb rau AC Nyob (AC Zoo).
  • Lwm tus pin AC ntawm kev xa mus rau Neutral (AC Negative)

NCO TSEG: VCC 5V yuav tau muab los ntawm usb cable txuas nrog lub xov tooj hloov pauv tau yooj yim.

Kauj ruam 5: Breadboard

Cov qhob cij
Cov qhob cij
Cov qhob cij
Cov qhob cij
Cov qhob cij
Cov qhob cij
Cov qhob cij
Cov qhob cij

Qhov hloov pauv tuaj yeem yog qhov hloov pauv yooj yim lossis hloov pauv phab ntsa, nws tsuas yog xav tau txhawm rau txheeb xyuas yog tias tus neeg siv hloov nws lub xeev yog li peb tseem tuaj yeem tswj lub teeb nrog qhov hloov pauv ib txwm muaj.

Qhov hloov pauv uas kuv siv tau muab pov ob zaug, peb tsuas xav tau ib qho, yog li kuv txuas nws tus pin 1 txog 3V ntawm NodeMCU thiab tus pin 2 ntawm kev hloov mus rau NodeMCU tus pin D8.

Lub hwj chim yuav yog lub xov tooj phab ntsa them nyiaj ntawm 5V nrog ib txoj hlua usb.

Los ntawm kev tswj cov av txuas nrog kev xa tawm peb tuaj yeem tswj hwm AC xwm txheej ntawm lub teeb.

Kauj ruam 6: Code

Ua ntej koj siv qhov chaws, koj yuav tsum rub qee lub tsev qiv ntawv:

  • Arduino core rau ESP8266 (Nyeem qhov "Txhim Kho nrog Tus Thawj Saib Xyuas Haujlwm" kauj ruam)
  • Ubidots ESP MQTT

Nco tseg: Yog tias koj tsis paub yuav ntxiv cov tsev qiv ntawv rau arduino IDE li cas, koj tuaj yeem ua raws cov lus qhia yooj yim no.

Teeb koj lub rooj tsav xwm txhim kho rau NodeMCU 1.0 (ESP-12E Module). Koj yuav tsum hloov qee qhov hloov pauv hauv cov cai:

  • Koj tus SSID (Lub npe ntawm koj lub tsev Wi-nkaus network)
  • Tus password ntawm koj lub network Wi-nkaus
  • Koj tus Ubidots tokenAnd thaum kawg rub koj cov cai rau hauv pawg thawj coj.

Thiab thaum kawg rub koj cov cai rau hauv pawg thawj coj.

Kauj ruam 7: Demo

Nws ua haujlwm!

Pom zoo: