Cov txheej txheem:

Cov Hluav Taws Xob Hluav Taws Xob Me me Esp8266 MQTT IFTTT Tsev Automation: 4 Kauj Ruam
Cov Hluav Taws Xob Hluav Taws Xob Me me Esp8266 MQTT IFTTT Tsev Automation: 4 Kauj Ruam

Video: Cov Hluav Taws Xob Hluav Taws Xob Me me Esp8266 MQTT IFTTT Tsev Automation: 4 Kauj Ruam

Video: Cov Hluav Taws Xob Hluav Taws Xob Me me Esp8266 MQTT IFTTT Tsev Automation: 4 Kauj Ruam
Video: How I Made this Electric Car that can go Anywhere 2024, Hlis ntuj nqeg
Anonim
Cov Hluav Taws Xob Hluav Taws Xob Me me Esp8266 MQTT IFTTT Tsev Automation
Cov Hluav Taws Xob Hluav Taws Xob Me me Esp8266 MQTT IFTTT Tsev Automation

Kuv xav tshuaj xyuas seb kuv lub tsev kuaj pom cov pa luam yeeb hauv tsev puas tswb. Kuv muaj yim lub tshuab ntsuas pa nyob hauv kuv lub tsev thiab lawv tau cuam tshuam nrog. Yog tias ib tus neeg haus luam yeeb nyob hauv lub tswb, lwm tus tau txais lub teeb liab los ntawm kev sib txuas xov tooj cua. Kuv lub sensor nyeem cov xov txuas sib txuas thiab xa cov ntaub ntawv mus rau kuv lub tsev siv tshuab (Openhab2) ntawm MQTT thiab ua rau kuv ceeb toom ntawm IFTTT.

Cov lus qhia no tau tshoov siab los ntawm txoj haujlwm no

Kauj Ruam 1: Tsim

Tsim
Tsim
Tsim
Tsim
Tsim
Tsim

Ua ntej tshaj plaws, koj yuav tsum paub yuav ua li cas cov pa ntsuas pa sib txuas lus. Kuv muaj Ei146 ntes.

Cov pa luam yeeb tau txuas nrog ntawm kab "IC". Yog tias ib lub tshuab ntsuas pa tau qhib, nws tsim lub 6V - 8V teeb liab ntawm kab IC, saib daim duab ntawm lub vijtsam oscillope.

Kuv nyeem qhov hluav taws xob ntawm kab IC ntawm optocoupler (4N35), kom cais cov pa luam yeeb los ntawm kuv lub tsev siv tshuab kom nyab xeeb.

Lub tswb pa taws yog siv los ntawm qhov hluav taws xob tseem ceeb (220V AC), uas kuv tau siv los txhawb ESP-01 tus qauv

Hauv schematic koj tuaj yeem pom yuav ua li cas cov khoom txuas nrog. Kuv siv ESP-01 sinc nws me me thiab pheej yig.

Kauj Ruam 2: Tsim PCB

Tsim lub PCB
Tsim lub PCB
Tsim lub PCB
Tsim lub PCB
Tsim lub PCB
Tsim lub PCB

Hauv cov duab thiab cov lus hais hauv daim duab koj tuaj yeem pom tias PCB tau sib sau ua ke li cas.

Kuv ua qhov txheej txheem kom haum rau cov khoom siv ntawm PCB me me, ESP-01 dag dua lwm cov khoom. Kuv txuas ESP-01 ntawm tus poj niam lub taub hau kom ntseeg tau yooj yim ntawm lub programmer USB. Tom qab tus qauv tau sib sau ua ke, koj tuaj yeem nyem lub firmware tshiab hla Lub Cua (OTA) ntawm Arduino IDE lossis HTTPupdate (saib daim duab)

Kauj Ruam 3: Programming ESP8266

Kev ua haujlwm ESP8266
Kev ua haujlwm ESP8266
Kev ua haujlwm ESP8266
Kev ua haujlwm ESP8266

Saib kuv Github rau cov cai. Kuv siv txhua tus pin uas siv tau ntawm ESP-01 ua GPIO-pins, uas suav nrog GPIO1 (TX) thiab GPIO3 (RX). Yog li, kev sib txuas lus hauv xov tooj cua tsis tuaj yeem ua tau thiab yuav tsum tsis txhob pib ua ntej, txwv tsis pub tshaj tawm GPIO1 thiab GPIO3 ua tsis muaj dab tsi.

Nco tseg: tsis txhob rub GPIO0, GPIO1 lossis GPIO2 nqis thaum pib, vim tias koj qhov program tsis pib. Kuv pom tias GPIO03 tuaj yeem rub tawm thaum pib

Kuv program kuv EPS-01's ntawm qhov hloov pauv no.

Qhov kev zov me nyuam ua raws li hauv qab no:

  • Yog tias nyem lub pob nyem ntawm lub zog nce, tus qauv pib OTA hom.
  • HTTPupdate tau pib ua ntej.
  • Txuas mus rau WiFi thiab MQTT (lub teeb ntsuab qhib)
  • Nyeem tus nqi ntawm tus pin sensor (txuas rau IC tus pin ntawm cov pa taws tswb)
  • Yog tias pom hluav taws, tos kom debounce thiab tom qab ntawd tsa lub tswb (tseem teeb liab rau) ntawm

    • MQTT - MQTT cov lus tau nyeem ntawm Openhab thiab txoj cai tsim kev ceeb toom ntawm kuv app
    • IFTTT - 1 - ntawm IFTTT Webhook lub hauv paus tau pib uas xa ntawv ceeb toom.
    • IFTTT - 2 - ntawm IFTTT Webhook lub hauv paus tau pib uas xa SMS rau kuv tus poj niam
  • Yog tias MQTT kev sib txuas poob (lub teeb ntsuab tawm), LWT lus (ERROR) raug xa mus rau lub ncauj lus thiab tau nyeem los ntawm Openhab.

Kauj Ruam 4: Sib Sau Cov Qauv

Sib dhos Cov Qauv
Sib dhos Cov Qauv
Sib dhos Cov Qauv
Sib dhos Cov Qauv
Sib dhos Cov Qauv
Sib dhos Cov Qauv

Kuv tsim thiab 3D-luam tawm ib lub thawv uas zoo haum rau hauv cov tsis siv cable qhib tawm lub hauv paus phaj ntawm cov pa taws tswb, tsis xav tau cov ntsia hlau.

Kho kom raug: stl-files tau ntxiv.

Kuv glued LEDs thiab OTA hloov chaw nrog cov kua nplaum kub. Lub thawv raug kaw ntawm 4 tus ntsia hlau.

Hwj chim thiab npaj txhij!

Pom zoo: