Cov txheej txheem:

ESP8266-01 IoT Ntse Timer rau Tsev Automation: 9 Kauj Ruam (nrog Duab)
ESP8266-01 IoT Ntse Timer rau Tsev Automation: 9 Kauj Ruam (nrog Duab)

Video: ESP8266-01 IoT Ntse Timer rau Tsev Automation: 9 Kauj Ruam (nrog Duab)

Video: ESP8266-01 IoT Ntse Timer rau Tsev Automation: 9 Kauj Ruam (nrog Duab)
Video: Nraug txuj kev hlub 2024, Kaum ib hlis
Anonim
ESP8266-01 IoT Ntse Timer rau Tsev Automation
ESP8266-01 IoT Ntse Timer rau Tsev Automation
ESP8266-01 IoT Ntse Timer rau Tsev Automation
ESP8266-01 IoT Ntse Timer rau Tsev Automation
ESP8266-01 IoT Ntse Timer rau Tsev Automation
ESP8266-01 IoT Ntse Timer rau Tsev Automation

Hloov tshiab

2018-09-30: Firmware Updated to Ver 1.09. Tam sim no nrog Sonoff Basic Support

2018-10-01: Firmware Version 1.10 sim rau kev sim ntawm ESP8266-01 nrog teeb meem

Nrog cov lus ntuas tshiab yog Internet Ntawm Yam (IoT) thiab Tsev Automation, Kuv txiav txim siab los saib cov khoom tam sim no hauv thiab ib puag ncig kuv lub tsev uas tau tswj los ntawm qee yam khoom siv. Cov khoom uas sawv tawm, yog cov hauv qab no:

  • Pas dej ua ke twj tso kua mis
  • Pas dej ua luam dej
  • Pas dej da thiab teeb ib puag ncig
  • TV/Kev lom zem system txee teeb

Cov khoom ib txwm siv los tswj cov cuab yeej no, yog cov txheej txheem phab ntsa ntsaws timers. Txhua lub cuab yeej haum nrog nws tus kheej lub sijhawm, thiab txhua qhov nyob hauv qhov chaw sib txawv. Yog li vim li cas kuv thiaj xaiv cov khoom no los pib nrog Internet of Things lossis Tsev Automation cov haujlwm, koj yuav nug?

Zoo, nyob hauv South Africa, txhais tau tias lub zog tsis ua haujlwm yog ib txwm muaj tshwm sim. Nrog txheeb cais ntawm kuv lub tsev, Kuv muaj 35 lub zog tsis ua tiav nyob rau xyoo dhau los, tag nrho 40 teev. Qhov no ib txwm tsis yog teeb meem, vim txhua lub sijhawm tam sim no tau teeb tsa nrog lub roj teeb rov qab rau lub sijhawm khaws cia thaum lub hwj chim tsis ua haujlwm. Tab sis muaj qee qhov teeb meem:

  • Cov roj teeb rov qab no tsuas yog ib xyoos lossis ob xyoos, tom qab ntawd lub sijhawm yuav tsum tau hloov. Cov timers tau tsim tsa xws li lub sijhawm yuav tsum tau raug rhuav tshem kom nkag tau mus rau sab hauv Ni-Cad roj teeb.
  • Txhua lub sijhawm fais fab tuag, lub sijhawm ua haujlwm nrog lub roj teeb tsis raug yuav tsum tau rov ua dua, thiab lub sijhawm teem tseg.
  • Qhov chaw nyob ntawm lub sijhawm, thaum ntsaws rau hauv lub qhov (socket), ua rau nws yuav luag tsis tuaj yeem nyeem cov lcd qhia saib lub timer los ntawm sab saud. Qhov no txhais tau tias lub sijhawm yuav tsum tau ntsaws, lossis kuv yuav tsum tau tso rau hauv pem teb kom teeb lossis kho lub sijhawm tom qab lub zog tsis ua haujlwm.

Vim yog cov laj thawj saum toj no, Kuv txiav txim siab sim ua qhov hloov pauv lub sijhawm nrog IoT Smart Timer, txuas nrog kuv lub network hauv tsev.

Lub tswv yim yog los tsim lub sijhawm nyob ib leeg, uas tuaj yeem:

  • Hloov kho lub sijhawm tam sim no siv internet (IoT)
  • Ua haujlwm yam tsis muaj tus neeg siv ua (Ntse)
  • Tig qhov tso tawm rau/Tawm raws li teev sijhawm (Timer)
  • Programmable thiab tswj tau ntawm network (Tsev Automation)

Kauj Ruam 1: ESP8266-01 Tsim

ESP8266-01 Tsim
ESP8266-01 Tsim
ESP8266-01 Tsim
ESP8266-01 Tsim

Kev tsim qauv tau ua tiav siv ESP8266-01 WiFi module, vim qhov no yog qhov kuv muaj. Hauv nws daim ntawv yooj yim tshaj plaws, ESP8266-01 muaj plaub I/O pins:

  • PIB 0
  • GPIO 2
  • TX
  • RX

ESP8266-01 Hwj chim -up Hom

Lub xeev qhov laj thawj ntawm I/O pins tau siv los txiav txim seb hom twg ESP8266-01 yuav khau raj. Thawj kauj ruam yog txiav txim siab qhov twg ntawm I/O pins tuaj yeem siv los tsav lub zog xa tawm.

  • Txog rau lub zog ib txwm muaj, GPIO0 thiab GPIO2 yuav tsum tau teeb tsa rau qhov laj thawj siab. Yog li nws pom tseeb tias ob tus pin no tsis tuaj yeem siv ua cov khoom siv digital.
  • Tus pin Tx tau teeb tsa ua qhov tso tawm ntawm lub zog nce, thiab cov zis tau teeb tsa siab. Tus Tx pin no tseem xa qee cov ntaub ntawv tseem ceeb thaum lub zog nce. Yog li, tus pin no kuj tseem tsis tuaj yeem siv ua qhov tso tawm.

Tsuas yog tus pin ntxiv yog Rx tus pin. Tus pin no tau teeb tsa ua lub zog nkag mus, thiab tsis tas yuav rub siab thaum lub zog nce. Tus pin no yog li qhov zoo tshaj plaws los siv ua tus pin tso tawm.

Boot-up

Txhawm rau kom ntseeg tau hom boot-up ntawm ESP8266-01 thaum lub zog nce, cov pins hauv qab no tau rub siab siv 10K resistors:

  • PIB 0
  • GPIO 2
  • RST
  • CH_PD

Qhov no ua kom ntseeg tau tias chav tsev khau khau kom raug txhua lub sijhawm.

Tawm Tawm Tawm

RX tsuas yog tus pin tsim nyog siv los ua qhov tso tawm. Tus pin no yog siv los tsav lub zog xa tawm ntawm NPN transistor. Tus qauv flywheel diode thiab transistor puag resistors tau ntxiv.

QAUV/SET Khawm

Lub pob txuas nrog GPIO2, thiab nrog khawm tso tawm, 10K tus tiv thaiv yuav rub GPIO2 siab. Nrog lub pob nyem, GPIO2 raug rub mus rau 0V.

Lub pob no tau siv rau ob txoj haujlwm:

  • Kev teeb tsa pib txhawm rau txuas lub tsev mus rau lub network WiFi hauv ib cheeb tsam
  • Txhawm rau tswj hwm qhov tso tawm thaum lub sijhawm ua haujlwm ib txwm

Qhov taw qhia LED

LED txuas nrog GPIO0, thiab qhia cov hauv qab no:

  • Thaum pib lub zog nce, ntsais sai rau qhia WiFi teeb hom
  • Flashes qeeb thaum lub sijhawm ntawm chav tsis tau teeb tsa
  • qhia qhov tso tawm relay On/Off xwm txheej

Kauj Ruam 2: Lub Hwj Huam Fais Fab

Lub Hwj Huam
Lub Hwj Huam
Lub Hwj Huam
Lub Hwj Huam
Lub Hwj Huam
Lub Hwj Huam

Kuv yuav siv IoT Smart Timer ntawm qib sib txawv ntawm qhov sib txawv, yog li ntawd muaj ob lub zog xaiv xaiv muaj:

12 - 24V DC

DC-DC hloov pauv siv yog tsim nyog rau cov khoom siv txog li 28V DC. Cov zis ntawm cov hloov pauv tau kho tau, thiab tau teeb tsa rau 5V. Qhov no yuav tsum tau ua ua ntej ESP8266 module txuas nrog.

Ib qho diode tau ntxiv los tiv thaiv tiv thaiv rov qab polarity ntawm cov khoom siv.

220V AC Rau qhov kev xaiv no, kuv tuaj yeem tau txais 220V/5V hloov me me rau lub zog hluav taws xob ntawm eBay.

Tsis hais txog qhov hluav taws xob nkag, IoT Smart Timer xav tau ob lub zog siv:

5 V Rail

Nrog ob qho kev xaiv, 5V DC tau txais los ntawm kev hloov pauv lub zog siv hluav taws xob, thiab tsis yog tus tswj kab tawm. Qhov no txhais tau tias muaj cua sov tsawg heev uas tsim los ntawm lub hwj chim. 5V yog siv los tsav lub zog xa tawm

3.3V Tsheb nqaj hlau

3.3V rau ESP8266-01 tau los ntawm ASM1117 3.3 tus tswj hwm. ASM1117 3.3 yog tus tswj kab, thiab tuaj yeem ua haujlwm tau txog 500mA. Txawm li cas los xij, cov cua sov uas tsim tawm yuav txiav txim siab los ntawm cov hluav taws xob nkag mus rau ASM1117. Txhawm rau txo cov cua sov, ASM1117 tau tsav los ntawm 5V txoj kev tsheb nqaj hlau.

Suab nrov lim

Txhawm rau txo qhov hluav taws xob ripple rau ESP8266-01, txoj kab tsheb 3.3V tau nruab nrog 100 - 1000uf capacitor. Ob txoj kab 5V thiab 3.3V tseem raug tiv thaiv los ntawm kev cuam tshuam ntau zaus los ntawm 0.1uf capacitors.

Kauj Ruam 3: Sib dhos PC Board

Sib dhos PC Board
Sib dhos PC Board
Sib dhos PC Board
Sib dhos PC Board
Sib dhos PC Board
Sib dhos PC Board

PC Board tau tsim los siv dawb version ntawm Eagle. Nws yog pawg thawj coj saib ib sab, uas tuaj yeem ua tau yooj yim hauv tsev siv cov txheej txheem hloov pauv toner.

Thaum lub Rooj Tswjhwm Saib PC tau ua, sib sau ua ke PC Board raws li hauv qab no:

  • Solder ASM1117 tus tswj hwm thiab peb 0.1uf SMD cov khoom siv rau sab laug ntawm lub rooj tsavxwm
  • Ntxiv ib lub jumper rau sab tivthaiv ntawm pawg thawj coj saib
  • Muab cov resistors thiab diodes tso rau hauv qhov chaw
  • Ntxiv lub taub hau rau ESP8266-01 tus qauv
  • Ntxiv cov header pins rau LED thiab khawm
  • Ntxiv cov ntsia hlau txuas
  • Siv tus pin header, txuas DC/DC hloov pauv mus rau lub rooj tsavxwm.
  • Solder lub relay rau hauv qhov chaw
  • Ua kom tiav lub rooj tsavxwm los ntawm kev siv cov transistor thiab 100uf capacitor.

Thaum tag nrho cov khoom sib txuas rau ntawm lub rooj tsavxwm, txheeb xyuas txhua lub ntsiab lus sib txuas, thiab xyuas kom tsis muaj qhov luv luv ntawm cov pawm.

! ! ! TSEEM CEEB TSHAJ! ! ! Txhawm rau kom ntseeg tau tias PC Board tuaj yeem tswj hwm cov dej ntws loj ntawm cov khoom sib txuas, thov siv tus nqi tsim nyog ntawm cov laug rau txoj kab nruab nrab ntawm kev sib txuas lus sib txuas thiab cov ntsia hlau txuas

Kauj Ruam 4: Kev Xeem ntawm PC Board

Kev Xeem ntawm PC Board
Kev Xeem ntawm PC Board

! ! ! Ua ntej thov lub zog! ! !

Tshem ESP8266-01 tus qauv los ntawm chav tsev. Qhov no yog txhawm rau tiv thaiv kev ua kom sov dhau ntawm ASM1117 tus tswj hwm ua ntej hloov kho 5V.

Tsis muaj ntau qhov kev sim uas tuaj yeem ua tau tom qab sib dhos. Cov kauj ruam tseem ceeb tshaj plaws yog kom ntseeg tau qhov ntsuas hluav taws xob raug.

  • Siv 12 - 24V DC rau chav nyob.
  • Ntsuas qhov hluav taws xob tso tawm ntawm DC/DC hloov pauv
  • Kho qhov tso tawm ntawm qhov hloov pauv ntawm 5.0 thiab 5.5V.
  • Tom ntej no, ntsuas 3.3V cov khoom siv.
  • Yog tias cov khoom siv tau zoo, tshem lub hwj chim los ntawm chav tsev

Tam sim no koj tuaj yeem ntxig ESP8266-01 tus qauv rau hauv lub hauv paus muab.

! ! ! Nco tseg!

Thaum koj tau sim IoT Timer thiab nws tau ua haujlwm, siv cov xim pleev xim kom npog rau sab laug ntawm PC Board. Qhov no yuav tiv thaiv kev oxidization ntawm cov ciav hlau, thiab muab cov rwb thaiv tsev ntxiv ntawm cov neeg sib txuas lus sib txuas thiab cov seem hauv Circuit Court

Kauj Ruam 5: Qhov Kev Ruaj Ntseg

Cov ntaub ntawv kaw
Cov ntaub ntawv kaw
Cov ntaub ntawv kaw
Cov ntaub ntawv kaw
Cov ntaub ntawv kaw
Cov ntaub ntawv kaw

Lub thawv ntawv tsis yog qhov tseem ceeb, tsuav yog PC lub rooj tsavxwm thiab txhua txoj hlua txuas haum zoo thiab nyab xeeb rau hauv.

Txhawm rau tsim kho kom yooj yim dua, Kuv tau tsim ib txoj hlua nrog LED thiab QAUV/teeb tsa khawm txuas nrog nws. Qhov no tau ua rau kuv hloov pauv tau yooj yim dua hauv kev teeb tsa LED thiab khawm rau lub thawv ntawv. Cov kab no yog tom qab txuas rau hauv kab ntawv ntawm lub PC Board.

Cov duab qhia pom ib qho ntawm 12V chav siv rau teeb LED.

Kauj Ruam 6: Ua Haujlwm ESP8266-01/NodeMCU

Programming ESP8266-01/NodeMCU
Programming ESP8266-01/NodeMCU
Programming ESP8266-01/NodeMCU
Programming ESP8266-01/NodeMCU
Programming ESP8266-01/NodeMCU
Programming ESP8266-01/NodeMCU

Txhawm rau program ESP8266-01, koj yuav tsum teeb tsa Arduino IDE ua ntej. Kuv tsis mus rau hauv cov ntsiab lus no, vim muaj ntau ntau Cov Ntawv Qhia Zoo muaj nyob hauv cov ncauj lus no. Kuv tau xaiv cov kab ntawv txuas hauv qab no ntawm Cov Ntawv Qhia rau siv, tsis muaj kev xaj tshwj xeeb rau tus kws sau ntawv. Ua tsaug rau lawv tus kheej Cov Lus Qhia

Ua raws li ESP8266 thiab Arduino IDE los teeb tsa Arduino IDE rau ESP8266 module.

Tom ntej no, koj yuav xav tau tus programmer los teeb tsa ESP8266. Nov yog ob qhov txuas:

Siv Arduino Uno

DIY Programming Board

Tsev qiv ntawv

Koj yuav tsum tau teeb tsa cov tsev qiv ntawv ntxiv kom muaj peev xwm los sau cov cai. Ib zaug ntxiv, xa mus rau Cov Lus Qhia no:

Nruab thiab Siv Arduino Libraries

Kuv nco tsis tau lub tsev qiv ntawv twg kuv yuav tsum tau teeb tsa, tab sis kuv paub WiFiManager yuav tsum rub tawm cais.. Kuv tau suav nrog cov no hauv Libraries.zip file.

Kauj Ruam 7: Thawj Lub Sijhawm Teeb

Thawj zaug teeb tsa
Thawj zaug teeb tsa
Thawj zaug teeb tsa
Thawj zaug teeb tsa
Thawj zaug teeb
Thawj zaug teeb

Thaum siv thawj zaug, IoT Smart Timer xav tau txuas nrog lub network WiFi. Txoj haujlwm no ua tiav siv lub tsev qiv ntawv WiFiManager, yog li tsis muaj SSID lossis tus lej cim xav tau ntaus rau hauv tus lej.

Ua raws ob peb kauj ruam no:

  • Hwj chim rau chav tsev
  • LED yuav pib nyem nrawm
  • Nias lub MODE/SETUP khawm
  • Thaum lub LED tua tawm, tso lub pob
  • Tos li ob peb feeb, tom qab ntawd qhib koj lub xov tooj ntawm tes lossis ntaus ntawv txuas WiFi
  • Qhov tshiab WiFi netword hu ua IoT Timer yuav pom
  • Xaiv qhov chaw nkag
  • Nkag mus rau IoT Timer (tsis xav tau tus password)
  • Tos kom txog thaum koj lub cuab yeej txuas nrog IoT Timer network
  • Qhib txhua lub browser internet
  • Hauv qhov chaw nyob bar, ntaus tus IP chaw nyob hauv qab no - 192.168.4.1
  • WiFiManager console yuav qhib
  • Xaiv Configure WiFi
  • Cov npe uas muaj cov ntsiab lus WiFi network yuav raug muab tso tawm
  • Xaiv qhov xav tau WiFi network, thiab ntaus tus password
  • Tom ntej no, nkag mus rau tus IP chaw koj xav siv los txuas rau IoT Timer
  • Nkag mus rau Default Gateway IP chaw nyob, ua raws daim npog qhov ncauj
  • Thaum txhua qhov chaw teeb tsa tiav, nyem rau ntawm Save khawm
  • Lub qhov rai tshiab yuav qhib kom paub meej tias daim ntawv pov thawj tshiab tau txais kev cawmdim
  • Kaw koj tus browser

Thaum tau txais kev cawmdim, IoT Timer network yuav kaw, thiab chav yuav sim txuas rau koj li Wi -nkaus network.

  • Txuas koj lub Smartphone lossis ntaus ntawv mus rau tib lub network WiFi raws li siv rau IoT Timer.
  • Qhib koj tus browser
  • Hauv qhov chaw nyob bar, ntaus tus IP chaw nyob ntawm koj li IoT Timer
  • Cov nplooj ntawv teeb tsa ntawm IoT Timer yuav qhib

Koj IoT Timer tam sim no tau npaj rau siv

Kauj Ruam 8: Teeb tsa IoT Timer

Teeb tsa IoT Timer
Teeb tsa IoT Timer
Teeb tsa IoT Timer
Teeb tsa IoT Timer
Teeb tsa IoT Timer
Teeb tsa IoT Timer
Teeb tsa IoT Timer
Teeb tsa IoT Timer

Lub vev xaib tsim ntawm IoT Timer suav nrog tsib ntu:

Xwm txheej

Qhov no qhia lub npe ntaus ntawv, nrog rau lub sijhawm tam sim no thiab cov xwm txheej ntawm lub sijhawm

Ib qho ntxiv, hom kev ua haujlwm ntawm lub sijhawm tau teev tseg hauv ntu no. Muaj peb hom:

  • Nws pib - Cov zis yuav raug tswj los ntawm cov phiaj xwm sib txawv
  • On - Cov zis raug yuam ON, thiab yuav nyob twj ywm kom txog thaum hom hloov
  • Tawm - Cov zis raug yuam OFF, thiab yuav nyob twj ywm kom txog thaum hom hloov.

Cov kev kawm

Ntu no suav nrog Lub Sijhawm On thiab OFF ntawm lub sijhawm. Muaj xya txoj haujlwm muaj, thiab txhua txoj haujlwm tuaj yeem teeb tsa tus kheej.

Ua ntej hloov qhov program tom ntej no, nyem lub pob SAVE kom txuag tau ib qho kev hloov pauv rau txoj haujlwm tam sim no.

Khawm Ua Haujlwm

QHOV TSEEB/SETUP khawm tuaj yeem siv los tswj cov zis tawm thaum lub sijhawm ua haujlwm ib txwm muaj. Ntawm no, xaiv qhov khawm yuav tsum ua thaum nias.

Zuam lub "Update Button Function" lub thawv ua ntej nias lub pob Txuag kom txuag qhov chaw tshiab.

Kev teeb tsa

Ntawm no, koj tuaj yeem hloov lub npe ntawm IoT Timer. Qhov no ua rau nws yooj yim los txheeb xyuas ntawm ntau lub sijhawm.

Lub sijhawm ntawm chav tsev tau txais los ntawm is taws nem ntawm NTP lub sijhawm server. Txhawm rau qhia lub sijhawm raug, thov hloov kho Lub Sijhawm rau koj cheeb tsam.

Koj yuav tsum xav siv lub sijhawm NTP sib txawv server, nkag mus rau tus IP tshiab nyob rau hauv qhov chaw muab.

Zuam lub "Hloov Kho Tshiab" lub thawv ua ntej nias lub pob Txuag kom txuag qhov chaw tshiab.

NCO TSEG

Thaum hloov Lub Sijhawm Thaj Tsam, lub sijhawm tshiab tsuas yog teeb tsa kom raug thaum lub sijhawm nug ntxiv. Chav tsev tau teeb tsa los hloov kho lub sijhawm txhua 5 feeb.

Sijhawm Kho

Qee zaum, nws tshwm sim tias NTP lub sijhawm server tsis teb rau txhua lub sijhawm nug. Yuav tsum nws siv sijhawm ntev heev rau lub sijhawm los teeb tsa ntawm NTP server, koj tuaj yeem nkag mus rau lub sijhawm thiab hnub tim tus kheej.

Zuam lub "Hloov Sijhawm" lub thawv ua ntej nias lub pob Txuag kom txuag lub sijhawm thiab hnub tshiab.

Sijhawm Synchronization

Qhov kawg ntawm nplooj ntawv qhia lub sijhawm thiab hnub tim thaum lub sijhawm kawg tau ua tiav ntawm NTP lub sijhawm server.

Pom zoo: