Cov txheej txheem:

ESP8266 Kev Tswj Kub Kub: 9 Kauj Ruam (nrog Duab)
ESP8266 Kev Tswj Kub Kub: 9 Kauj Ruam (nrog Duab)

Video: ESP8266 Kev Tswj Kub Kub: 9 Kauj Ruam (nrog Duab)

Video: ESP8266 Kev Tswj Kub Kub: 9 Kauj Ruam (nrog Duab)
Video: PART 1 Intro & Hardware - The Ultimate DIY Home Security System - ESP8266 (trigBoard) + 4G LTE Modem 2024, Hlis ntuj nqeg
Anonim
Image
Image

Ib tus phooj ywg ntawm kuv yog tus kws tshawb fawb uas ua kev sim uas cuam tshuam rau huab cua kub thiab av noo. Chav ua kom sov muaj lub tshuab rhaub dej kub me me tab sis lub rhaub dej kub tsis zoo li yuav luag txaus, tsuas yog tuaj yeem tswj qhov kub hauv 10-15 degrees.

Cov cuab yeej ua lag luam uas ntsuas kub thiab av noo tuaj yeem kim heev, thiab tau txais cov ntaub ntawv los ntawm lub cuab yeej tuaj yeem nyuaj. Ntxiv rau, lawv tsis tuaj yeem tswj qhov ntsuas kub, tsuas yog sau cov ntaub ntawv. Nws nug tias yuav nyuaj npaum li cas los tsim ib lub cuab yeej uas tuaj yeem tswj lub rhaub kom raug los ntawm kev xa tawm thaum nkag mus ntsuas qhov kub thiab txias. Suab yooj yim txaus.

Mus nqa ESP8266, xa mus, DHT22, thiab qee qhov online IoT platform, peb tawm mus.

Kauj Ruam 1: Cov khoom siv

Txoj haujlwm no siv cov khoom siv puv tes, txhua yam uas zoo nkauj heev thiab koj tuaj yeem muaj lawv nyob ntawm no hnub no. Nov yog cov npe tag nrho ntawm qhov kuv tau siv, xav tias yuav hloov kho raws li xav tau kom tau raws li koj qhov kev xav tau.

  • ESP8266 ESP-01 (lossis zoo li ESP8266 board)
  • DHT-22 Kub thiab Vaum sensor
  • LM317 tus ntsuas hluav taws xob sib txawv (lossis tus qauv 3.3V tus tswj hwm yuav yooj yim dua)
  • 5V High relay tam sim no (Kuv pib nrog 10A tab sis tau tshuab nws tawm hauv 2-hnub)
  • Ntau yam resistors thiab capacitors
  • Jumper xov hlau
  • Txheem qhov hluav taws xob thiab npog
  • Electric Gang lub thawv
  • Qub USB ntsaws nrog adapter
  • Qub hluav taws xob ntsaws

Hauv kev rov qab saib dua, siv NodeMCU hloov ntawm ESP-01 yuav ua rau muaj kev nkag siab ntau dua. Kuv tsis muaj ib lub sijhawm yog li kuv tau ua nrog yam kuv muaj ntawm tes.

Kauj Ruam 2: Kev Tsim Tawm

Kev Tsim Tawm
Kev Tsim Tawm

Thaum kuv tau pib ua haujlwm nrog tus tswj hwm micro thiab tus lej, nws ua rau pom kev pib nrog AC qhov hluav taws xob ua ntej. Txog qhov haujlwm no, Kuv tau siv ib lub thawv rau ib pab laib, tus qauv 2-ntsaws qhov hluav taws xob, thiab lub hwj huam qaum los ntawm cov kab hluav taws xob qub.

Lub qhov hluav taws xob tau txuas nrog ob lub xov hlau dawb txuas ua ke thiab ob lub xov hlau hauv av sib koom ua ke. Ob txoj hlua dub dhau los ntawm sab-siab ntawm kev xa xov. Ua kom ntseeg tau tias koj tau txais cov kab hluav taws xob ntswj kom zoo thiab tsis muaj ib txoj hlua txuas yuav luv luv, Kuv tau muab me ntsis tso rau ntawm cov xov hlau kom cov sawv ntsug nyob ua ke.

Ceev faj nrog qhov hluav taws xob siab thiab ntsuas ob zaug txhua qhov txuas. Nws yog lub tswv yim zoo los muab daim kab xev hluav taws xob tso rau ntawm koj lub ntsws lub ntsws kom lawv tsis txhob xoob xoob

Kauj Ruam 3: Curciut Tsim

Curciut Tsim
Curciut Tsim
Curciut Tsim
Curciut Tsim

Lub Circuit Court yog qhov yooj yim tab sis yog tias koj siv ESP-01 ib yam li kuv tau ua, koj yuav tsum ntxiv tus tswj hluav taws xob kom tau txais 3.3V. Kev xa tawm tus qauv xav tau 5V yog li koj yuav xav tau 3.3V thiab 5.0V kev tsheb nqaj hlau.

Kuv lub Circuit Court siv LM317 tus tswj hluav taws xob nrog cov txheej txheem tiv thaiv kom tau txais qhov 3.3V kev tsheb nqaj hlau tas li, Kuv tau siv lub USB 5V txhawm rau txuas lub zog txuas. Muaj 3.3V xa tawm tab sis tsis yog rau kev xa hluav taws xob tam sim no xav tau yog tias koj yuav siv lub tshuab rhaub dej me me.

DHT22 xav tau 4.7k rub tawm tus neeg tawm tsam.

Kauj Ruam 4: Rhuav Lub Rooj Tsav Xwm

Solder Pawg Thawj Coj
Solder Pawg Thawj Coj
Solder Pawg Thawj Coj
Solder Pawg Thawj Coj
Solder Pawg Thawj Coj
Solder Pawg Thawj Coj
Solder Pawg Thawj Coj
Solder Pawg Thawj Coj

Layout thiab solder tag nrho cov khoom. Qhov no tuaj yeem nyuaj me ntsis tab sis npaj ua ntej cov kab nrog ib daim ntawv teev kab yuav pab.

Kuv siv lub USB pawg thawj coj rau lub hwj chim ntsaws tab sis nws zoo nkauj tsis muaj zog thiab hloov nws nrog ob lub taub hau taub hau hloov. Kuv siv ob tus poj niam lub taub hau ntawm lub rooj tsavxwm thiab muab ob tus txiv neej-taub hau pins ncaj qha rau lub qub USB ntsaws. Qhov no ua pov thawj kom ntseeg tau thiab ruaj khov. Cov xim xov hlau USB yog:

Dub avRed 5V

Kuv kuj tseem siv txiv neej lub taub hau los nthuav tawm DHT22 thiab Relay pins ntawm kuv lub perfboard txhawm rau txuas lawv nrog cov xov hluav taws xob txheem.

Nco ntsoov tias koj daim ntawv lo rau txhua tus pin, lub zog, thiab cov khoom sib txuas hauv av yog tias nws tsis txuas tom qab.

Kauj Ruam 5: Mount Circuit Board

Mount lub Circuit Board
Mount lub Circuit Board
Mount lub Circuit Board
Mount lub Circuit Board
Mount lub Circuit Board
Mount lub Circuit Board

Ntawm ib sab ntawm pawg neeg laib, teeb tsa lub rooj tsav xwm txheej nrog cov ntsia hlau thiab/lossis kub-kua nplaum. Xyuas kom tseeb tias qhov kev tso nkag tau ua kom cov hlua txuas txuas mus txog ib puag ncig rau koj lub chaw xa khoom sab hauv lub thawv, thiab koj tuaj yeem ntsaws tau yooj yim hauv koj lub hwj chim txuas.

Ntxiv jumper xaim nrog cua sov ntsws rau koj DHT22 sensor nrog qhov ntev uas tsim nyog rau koj qhov xwm txheej. Kuv li ntev li 8 ntiv tes. Kuv siv qee qhov CAT5 cable hloov pauv kom cov coj tuaj yeem khoov me ntsis rau hauv txoj haujlwm thiab yuav tsis sawv dawb.

Kauj Ruam 6: Arudino Code

Arudino Txoj Cai
Arudino Txoj Cai

Arduino code siv kuv chav kawm SensorBase, uas muaj nyob ntawm kuv nplooj Github. Koj tsis tas yuav siv kuv tus lej SensorBase. Koj tuaj yeem sau ncaj qha rau MQTT server thiab Thingspeak.

Txoj haujlwm no muaj peb yam tseem ceeb ntawm cov software:

  1. Ib lub vev xaib hauv zos los teeb tsa thiab saib qhov tseem ceeb
  2. Tej thaj chaw deb MQTT server xa thiab khaws cov ntaub ntawv
  3. Thingspeak dashboard rau teeb duab cov ntaub ntawv

Koj tuaj yeem siv ib lossis ntau qhov ntawm cov yam ntxwv no. Tsuas yog kho cov cai raws li qhov tsim nyog. Nov yog cov txheej txheem tshwj xeeb uas kuv tau siv. Koj yuav tsum tau hloov kho tus password thiab tus yuam sij API.

  • Sensor-base code ntawm Github.
  • Lab code ntawm Github.

Kauj ruam 7: Thingspeak Dashboard

Thingspeak Dashboard
Thingspeak Dashboard
Thingspeak Dashboard
Thingspeak Dashboard

Teeb ib tus as khauj Thingspeak pub dawb thiab txhais lub dashboard tshiab. Koj yuav tsum tau siv tib qho kev txiav txim ntawm cov khoom raws li kuv tau teev tseg hauv qab no, cov npe tsis muaj teeb meem, tab sis qhov kev txiav txim ua.

Yog tias koj xav ntxiv lossis tshem tawm cov khoom, kho qhov Thingspeak tsis nyob hauv Arduino code. Nws yog qhov zoo nkauj ncaj nraim thiab sau tau zoo ntawm lawv lub vev xaib.

Kauj Ruam 8: teeb tsa CloudMQTT

CloudMQTT Teeb
CloudMQTT Teeb
CloudMQTT Teeb
CloudMQTT Teeb
CloudMQTT Teeb
CloudMQTT Teeb

Ib qho kev pabcuam MQTT, lossis kev pabcuam IoT zoo li Blynk, yuav ua haujlwm, tabsis kuv xaiv siv CloudMQTT rau txoj haujlwm no. Kuv tau siv CloudeMQTT rau ntau qhov haujlwm yav dhau los, thiab txij li txoj haujlwm no yuav raug xa mus rau tus phooj ywg, nws ua rau muaj kev nkag siab los tsim tus as khauj tshiab uas tseem tuaj yeem xa mus.

Tsim CloudMQTT tus account thiab tom qab ntawd tsim qhov tshiab "piv txwv," xaiv qhov "Cute Cat" loj vim peb tsuas yog siv nws rau kev tswj hwm, tsis muaj kev nkag mus. CloudMQTT yuav muab koj lub npe server, username, password, thiab tus lej chaw nres nkoj. (Nco ntsoov tias tus lej chaw nres nkoj tsis yog tus qauv MQTT chaw nres nkoj). Hloov tag nrho cov txiaj ntsig no mus rau koj tus lej ESP8266 hauv qhov chaw sib xws, ua kom ntseeg tau tias rooj plaub raug. (tiag, luam/muab tshuaj qhov tseem ceeb)

Koj tuaj yeem siv "Websocket UI" vaj huam sib luag ntawm CloudMQTT kom pom koj lub cuab yeej sib txuas, khawm thawb, thiab, hauv qhov xwm txheej txawv txawv, uas koj tau txais qhov yuam kev, cov lus yuam kev.

Koj Yuav Tsum xav tau cov kev teeb tsa no thaum teeb tsa Android MQTT tus neeg siv khoom ib yam, yog li nco ntsoov qhov muaj txiaj ntsig yog tias koj xav tau. Vam tias, koj tus password tsis nyuab heev rau ntaus hauv koj lub xov tooj. Koj tsis tuaj yeem teeb tsa qhov ntawd hauv CloudMQTT.

Kauj Ruam 9: Xeem Kawg

Xeem Kawg
Xeem Kawg

Tam sim no peb yuav tsum ntsuas lub cuab yeej kawg.

Ua ntej koj sim ib yam dab tsi, ntsuas ob zaug ib lub xaim thiab siv koj lub ntsuas cua hauv qhov txuas txuas mus kom taug qab txhua cov xov hlau. Xyuas kom txhua yam txuas nrog qhov koj xav tias nws txuas nrog. Vim tias qhov kev xa tawm cais cov hluav taws xob siab los ntawm qhov qis-voltage, koj tsis tas yuav txhawj xeeb txog kev luv luv ntawm koj lub microcontroller.

Kuv siv tus kws kho hluav taws xob yooj yim lub ntsuas hluav taws xob txhawm rau txheeb xyuas txhua yam tau txuas rau ntawm qhov hluav taws xob siab, thiab nws kuj tseem ua haujlwm zoo los sim kuv qhov kev xa tawm.

Ntxiv koj ESP2866 rau koj lub network wifi los ntawm kev txuas rau lub cuab yeej los ntawm koj lub xov tooj lossis laptop. Qhov no siv tus txheej txheem WifiManager lub tsev qiv ntawv, thiab nws muaj txhua yam ntaub ntawv tsim nyog ntawm nws nplooj Github.

Siv lub teeb pom kev zoo, Kuv tso kuv lub DHT22 lub ntsej muag nyob ib sab ntawm lub teeb thiab ntsaws lub teeb rau hauv qhov hluav taws xob. Qhov no tso cai rau qhov kub kom sov sai, ua rau muaj kev sib txuas kom tua lub teeb thiab rov ua cov txheej txheem. Qhov no tau txais txiaj ntsig zoo los sim txhua yam, suav nrog kuv qhov kev sib txuas wifi.

Koj lub cuab yeej yuav tsum qhib qhov txuas kom raug thaum qhov ntsuas kub qis dhau thiab tua nws thaum qhov ntsuas kub nce mus txog tus nqi siab. Hauv kuv qhov kev sim, qhov no tuaj yeem khaws peb qhov chaw ntsuas kub hauv 1 degree Celcius 24/teev nyob rau ib hnub.

Pom zoo: