Cov txheej txheem:

ESP32 IoT Dej Rhaub: 12 Kauj Ruam
ESP32 IoT Dej Rhaub: 12 Kauj Ruam

Video: ESP32 IoT Dej Rhaub: 12 Kauj Ruam

Video: ESP32 IoT Dej Rhaub: 12 Kauj Ruam
Video: Top 3 Mind-Blowing ESP32 IoT Projects 2024, Hlis ntuj nqeg
Anonim
ESP32 IoT Dej Rhaub
ESP32 IoT Dej Rhaub

Cayenne IoT geyser (Tank Dej Kub hauv Asmeskas) yog lub zog txuag hluav taws xob uas yuav pab koj saib xyuas thiab tswj hwm koj tsev neeg cov dej kub, txawm tias thaum koj tsis nyob hauv tsev. Nws yuav tso cai rau koj hloov koj lub geyser rau thiab tawm, teem sijhawm nws hloov/tawm ntawm qee lub sijhawm, ntsuas qhov ntsuas kub ntawm geyser, teeb tsa qhov siab tshaj plaws kub thiab lwm yam. Nws tuaj yeem hloov kho tau yooj yim rau lwm qhov geyser teeb tsa zoo li lub siab, ob lub ntsiab lus thiab lwm yam. Kuv lub geyser kuj tau teeb tsa ntsug.

Txog kev nyab xeeb, Kuv khaws kuv cov ntsuas cua sov hauv nws lub raj. Kuv ntsuas cov dej kub nrog ob lub DS18B20 ntsuas lub ntsuas cua, ib qho txuas rau hauv qab ntawm kuv lub ntsuas cua, hauv qab ntawm lub hauv paus, lwm qhov txuas nrog lub qhov dej kub. Koj yuav tsum tsis txhob tshem koj lub tshuab ntsuas cua sov kom ruaj ntseg. Kev hloov lub tshuab ntsuas cua sov nrog lub tshuab hluav taws xob tuaj yeem ua rau muaj kev phom sij, vim tias lub ntsuas hluav taws xob lossis lub ntsuas hluav taws xob me me (kho vajtse lossis software tuaj yeem ua haujlwm tsis zoo) thiab ua rau cov pa tawg uas tuaj yeem tua tib neeg.

Txoj haujlwm no cuam tshuam nrog kev sib txuas ntawm Solid State Relay hauv qhov hnyav nrog koj cov geyser. Koj yuav xav tau tus kws kho hluav taws xob tsim nyog los ua nws (Raws Li Txoj Cai). Tsis txhob ua haujlwm ntawm koj AC (Mains) yog tias koj tsis paub meej txog nws.

Koj ESP32 yuav tshaj tawm cov ntaub ntawv rau kev pabcuam hu ua Cayenne IoT Cloud ntawm MQTT. Koj yuav tuaj yeem siv Cayenne lub dashboard los tshuaj xyuas thiab tswj hwm koj lub geyser thiab teem sijhawm ua kom sov.

Khoom siv:

  • ESP32 Wemos lolin lossis lwm yam ESP32. ESP8266 tseem yuav ua haujlwm tab sis kov tus lej ua haujlwm yuav tsis ua haujlwm. Arduino nrog WiFi yuav tsum ua
  • Solid State relay (SSR), ntsuas 30 amp lossis ntau dua
  • Heatsink rau SSR
  • 3 (2 yuav ua tau) Dalas semiconductor kub sensor, DS18B20.
  • Casing
  • Qee cov jumper cables
  • Cov xov hluav taws xob tsim nyog rau tam sim no ntawm koj qhov geyser
  • Terminal thaiv
  • USB fais fab mov rau ESP32
  • Lithium roj teeb kom muaj zog rau ESP32 yog lub hauv paus yog.

Kauj Ruam 1: Xav Tau Txuj Ci

ESP32 Programing hauv Arduino IDE, txhim kho tsev qiv ntawv

Cov khoom siv hluav taws xob yooj yim

Kev paub txog lub ntsiab (Feem ntau AC 110 - 240 volt)

Qee qhov kev paub ntawm cayenne.mydevices.com

Kauj Ruam 2: Thermo Profile ntawm Geysers thiab Sensor Placement

Thermo Profile ntawm Geysers thiab Kev Tso Npe Sensor
Thermo Profile ntawm Geysers thiab Kev Tso Npe Sensor
Thermo Profile ntawm Geysers thiab Kev Tso Npe Sensor
Thermo Profile ntawm Geysers thiab Kev Tso Npe Sensor
Thermo Profile ntawm Geysers thiab Kev Tso Npe Sensor
Thermo Profile ntawm Geysers thiab Kev Tso Npe Sensor

Dej kub muaj qhov ntom qis dua dej txias. Yog li cov dej nyob saum lub tank yuav kub dua li cov dej nyob hauv qab ntawm lub tank txij li cov dej kub yuav nce. Qhov hluav taws xob geyser kuj ib txwm nyob rau sab saum toj thiab nkag mus rau hauv qab uas txuas ntxiv ua rau cov cua sov profile.

Hauv kuv qhov haujlwm, kuv siv peb qhov ntsuas kub. Ib qho hauv qab, ib qho nyob rau sab saum toj thiab ib puag ncig ntsuas kub. Raws li ob peb qhov kev sim, kuv txiav txim siab siv lub ntsuas kub hauv qab raws li kuv qhov taw qhia tias lub tank kub. Qhov teeb meem nrog lub ntsuas cua sab saum toj yog tias nws yuav nce nrog ob peb qib thaum lub sijhawm tab kub tau qhib rau ob peb feeb thiab yuav tsuas muaj dej kub me ntsis tso rau saum lub tank. Koj tuaj yeem txiav txim siab siv qee qhov nruab nrab nruab nrab ntawm ob lub ntsuas.

Kauj Ruam 3: Tsim Koj Cov Khoos Phis Tawj

Txuas SSR rau tus lej 15 thiab GND

Txuas txhua 3 DS18B20 sensor: Daj rau PIN 16, Dub rau GND, Liab rau 3.3volt. Siv 4.7KOhms rub cov neeg tawm tsam ntawm tus lej PIN 16 thiab 3.3volt. (Nco ntsoov, DS18B20 yog ib lub tshuab xaim, thiab tso cai siv ntau lub xaim ntawm ib lub npav lossis tus pin).

Txuas koj lub xov tooj rov pib dua xaim mus rau thiab rov pib xaim rau T2

Tsis tau txuas koj qhov txuas mus rau lub ntsiab (AC). Tseem tsis tau xa cov ntsuas mus rau koj li Geyser. Ua ntej koj yuav tsum txiav txim siab lub sensor twg yuav tsum mus rau txoj haujlwm twg.

Kauj Ruam 4: Sau Npe Ua Tus Cayenne Tus Neeg Siv

Nov tsis yog cayenne.mydevices.com qhia. Cayenne yog tus nqi xoom version ntawm mydevices.com

Yog tias koj tsis paub nrog cayenne, muaj cov ntaub ntawv ntau ntxiv ntawm

Koj thawj zaug yuav tsum sau npe ntawm cayenne.mydevices.com thiab tau txais tus ID nkag mus thiab tus password.

Xav paub ntau ntxiv txog cayenne muaj nyob ntawm

Nws tseem ceeb heev uas yuav tsum nyeem

developers.mydevices.com/cayenne/docs/cayenne-mqtt-api/#cayenne-mqtt-api-using-arduino-mqtt ntxiv lub tsev qiv ntawv cayenne rau Arduino ID

Kauj Ruam 5: Txhim Kho Lub Tsev Qiv Ntawv Xav Tau hauv Arduino IDE

WiFiManager

ArduinoJson version 6.9.0

CayenneMQTT

OneWire

DallasTemperature

ArduinoOTA

Kauj Ruam 6: Thauj ESP32 Sketch

ESP32 Sketch muaj ntau tus lej. Nws suav nrog cov cai rau

  1. https://github.com/tzapu/WiFiManager. Tus tswj hwm WiFi tau siv los qhia rau koj ESP32 paub tias koj li WiFi nkag tau cov ntsiab lus nkag mus lub peev xwm yog dab tsi. Nws yog siv txuas ntxiv txhawm rau txhawm rau CayenneMQTT cov ntsiab lus, ntsuas kub rau geyser thiab txuas 3 Lub ntsuas kub rau nws qhov chaw (Sab saum toj, hauv qab lossis ib puag ncig)
  2. Code rau Cayenne API
  3. OTA (Tshaj tawm cov huab cua hloov tshiab). Koj yuav tuaj yeem hloov kho firmware ntawm WiFi. Koj yuav tsum tau nyob ntawm koj lub WiFi hauv zos, siv tib lub khoos phis tawj uas koj siv los rub koj daim duab qub.
  4. DS18B20 ntsuas kub.

ArduinoIDE Sketch muaj nyob ntawm:

Kauj Ruam 7: Ntxiv Koj ESP32 rau Cayenne

Ntxiv Koj ESP32 rau Cayenne
Ntxiv Koj ESP32 rau Cayenne

Tam sim no koj tuaj yeem ntxiv lub cuab yeej tshiab.

Nkag mus rau cayenne.mydevices.com. Ntawm koj sab laug koj yuav pom cov ntawv qhia zaub mov Ntxiv Tshiab …… Xaiv Ntaus/Widget. Ib nplooj ntawv yuav qhib yog koj xav tau xaiv nqa koj tus kheej. Ib nplooj ntawv tshiab yuav qhib nrog koj cov ntsiab lus MQTT. Sau koj li MQTT USERNAME, MQTT PASSWORD, CLIENT ID. Koj yuav xav tau qhov no los tham nrog Cayenne MQTT Broker (Server). Koj tus MQTT USERNAME thiab MQTT PASSWORD yuav zoo ib yam, tab sis CLIENT ID yuav txawv rau txhua lub cuab yeej tshiab zoo li lwm ESP32, Arduino lossis Raspberry PI.

Koj tseem tuaj yeem muab koj lub cuab yeej lub npe rau ntawm daim ntawv no.

Kauj Ruam 8: Khiav Koj Daim Duab

Khiav Koj Sketch
Khiav Koj Sketch
Khiav Koj Sketch
Khiav Koj Sketch

Rov pib ESP32

Tam sim no koj yuav tsum pom qhov WiFi nkag tshiab hu ua "Slim_Geyser_DEV". (ESP 32 yuav nyob rau hauv hom kev nkag mus/ Ad-hoc lossis hom hotspot) siv koj lub khoos phis tawj WiFi tshawb/ tshawb.

Nkag mus rau qhov chaw nkag tshiab no. Tus password/Tus Kheej Ruaj Ntseg yog tus password.

Koj tus browser yuav tsum mus rau nplooj ntawv tsaws "192.168.4.1", yog tias tsis yog, ua nws phau ntawv.

Mus rau Configure WiFi

Cov nplooj ntawv teeb tsa yuav tsum qhib tam sim no. Nws yuav tsum tau luam theej duab rau koj li internet nkag siv, xaiv nws, ntaus tus password, Cayenne MQTT cov ntsiab lus. Tawm qhov seem tib yam. Txhua qhov ntsuas kub yog ntsuas (Deg Celcius).

Nias txuag. Tam sim no ESP32 yuav sim txuas rau koj lub wifi thiab Cayenne server.

Txiav tawm los ntawm "Slim_Geyser_DEV" thiab txuas koj lub khoos phis tawj mus rau koj lub tsev nkag.

Kauj Ruam 9: Tsim Koj Tus Cayenne Dashboard

Tsim Koj Tus Cayenne Dashboard
Tsim Koj Tus Cayenne Dashboard
Tsim Koj Cayenne Dashboard
Tsim Koj Cayenne Dashboard
Tsim Koj Cayenne Dashboard
Tsim Koj Cayenne Dashboard

Tam sim no koj yuav tsum nkag mus rau cayenne.mydevices.com siv koj daim ntawv pov thawj cayenne.

Koj lub cuab yeej yuav tsum tau teev nyob rau ntawm kab ntawv qhia zaub mov sab laug (Kuv yog Geyser_DEV).

Tam sim no koj tuaj yeem ntxiv tag nrho koj lub ntsuas pa thiab xa tawm (lossis raws) rau koj lub dashboard los ntawm txhaj rau cov cim ntxiv.

Ntawm tus channel 0 Icon, nyem qhov chaw thiab hloov lub npe mus rau "Geyser Qab TEMP". Xaiv lub Icon uas tsim nyog (Ntsuas Kub) thiab xaiv tus lej zauv raws li 1. Ua tib yam rau channel 1, 2, 5, 6

Rau Channel 4 thiab 8, hloov tus lej ntawm zauv mus rau 0 thiab npe lawv "** Geyser Status (1 = ON, O = OFF) **"

thiab "*Hom Cua Kub Pib (0 = Phau Ntawv, 1 = Pib)*" feem.

Channel 3 thiab 7 yuav tsum yog cov nyees khawm

Mus Ntxiv Ntxiv cov ntawv qhia zaub mov tshiab ntawm cov ntawv qhia zaub mov sab laug, mus rau Ntaus/Widget> Custom Widgets> Khawm

Npe Lub Npe "Hloov Geyser rau/tawm", Xaiv Lub Npe Ntaus Ntawv (Geyser_DEV), DATA = Digital actuator, Channel 3, Unit = Digital I/O, Icon = toggle switch. Nyem ntxiv Widget.

Ua tib yam rau Channel 7

Channel 9 yuav tsum hloov pauv mus rau qhov swb

Mus rau Ntxiv Cov ntawv qhia zaub mov tshiab ntawm cov ntawv qhia zaub mov sab laug, mus rau Ntaus/Widget> Custom Widgets> Slider thiab xaiv qhov tsim nyog muaj txiaj ntsig zoo li hauv daim duab.

Tam sim no koj tuaj yeem txav koj cov widget ncig.

Kauj Ruam 10: Txheeb Tawm Txoj Haujlwm ntawm Cov Kuaj

Txij li peb lub Temp sensors txuas nrog tib tus pin (Ib Lub Tsheb Npav), koj yuav tsum txiav txim siab seb lub sensor yuav tsum mus qhov twg.

Txheeb xyuas koj lub Cayenne dashboard thiab nco txog peb qhov kub thiab txias. Lawv yuav tsum ntau dua lossis tsawg dua ib yam. Ua kom sov nrog dej sov lossis koj txhais tes. Nco ntsoov lub sensor uas ua kom sov ntawm lub dashboard. Sau koj lub sensor kom haum. Ua qhov no rau lwm 2 sensors.

Kauj Ruam 11: Ua Si Ib Leeg (Xeem) Koj Lub Dashboard

Ua Si Ib Leeg (Xeem) Koj Lub Dashboard
Ua Si Ib Leeg (Xeem) Koj Lub Dashboard
Ua Si Ib Leeg (Xeem) Koj Lub Dashboard
Ua Si Ib Leeg (Xeem) Koj Lub Dashboard

Ua si ib puag ncig nrog kev tswj hwm ntawm lub dashboard. Toggle qhov qhib/tawm thiab pom tias SSR coj yog teeb pom kev zoo. Kuj tseem hloov ntawm Hom pib cua sov, ua kom sov lub ntsuas cua hauv qab thiab pom tias SSR hloov ntawm thaum lub ntsuas kub xav tau mus txog.

Tam sim no koj tuaj yeem txuas 2 Sensors rau geyser thiab qhov ntsuas kub ib puag ncig mus rau txoj haujlwm tsim nyog. Koj tseem tuaj yeem txuas SSR rau koj lub ntsiab lus.

Kauj Ruam 12: Teem Sijhawm Koj Geyser

Teem Sijhawm Koj Geyser
Teem Sijhawm Koj Geyser
Teem Sijhawm Koj Geyser
Teem Sijhawm Koj Geyser

Tam sim no koj tuaj yeem teem sijhawm rau/ tawm cov xwm txheej nrog koj Geyser

Ntawm Dashboard, xaiv Ntxiv Tshiab> Txheej Txheem

Pom zoo: