Cov txheej txheem:

MOS - IoT: Koj Cov Kev Sib Txuas Fogponic: 4 Cov Kauj Ruam
MOS - IoT: Koj Cov Kev Sib Txuas Fogponic: 4 Cov Kauj Ruam

Video: MOS - IoT: Koj Cov Kev Sib Txuas Fogponic: 4 Cov Kauj Ruam

Video: MOS - IoT: Koj Cov Kev Sib Txuas Fogponic: 4 Cov Kauj Ruam
Video: Plab Plab Ntswg..(Pluav Pluav Ntswg) Maiv Twm New Song 2023-2024 2024, Hlis ntuj nqeg
Anonim
MOS - IoT: Koj Cov Kev Sib Txuas Fogponic
MOS - IoT: Koj Cov Kev Sib Txuas Fogponic

Kev txo qhov poob siab los ntawm Superflux: Peb lub vev xaib

Cov Lus Qhia no yog qhov txuas ntxiv ntawm Fogponic System ib. Ntawm no, koj yuav tuaj yeem muaj kev xaiv ntau dua los ntsuas cov ntaub ntawv los ntawm koj lub khoos phis tawj tsev xog paj thiab tswj ntau txoj haujlwm xws li lub twj tso kua dej ntws, teeb lub sijhawm, kiv cua siv zog, lub tshuab huab cua thiab txhua lwm yam kev tswj hwm uas koj xav tau ntxiv rau koj Fogponic txoj haujlwm

Kauj Ruam 1: Nruab ESP 8266-01 Wifi Shield ntawm Arduino

Nruab ESP 8266-01 Wifi Shield ntawm Arduino
Nruab ESP 8266-01 Wifi Shield ntawm Arduino

Yam tsawg kawg nkaus cov khoom xav tau:

  • Arduino MEGA 2560
  • ESP 8266-01 Shield
  • Smartphone
  • Kev txuas Wi-nkaus

Kev sib txuas:

  • ARDUINO --- ESP 8266
  • 3 V --- VCC
  • 3V --- CH_PD
  • GND --- NCO
  • RX0 --- TX
  • TX0-0

Kauj Ruam 2: Teeb ESP8266-12 Shield

Ob peb kauj ruam ua raws:

  1. Tom qab txuas ESP866-91 daim thaiv rau Arduino koj yuav tsum tso qhov piv txwv Bareminimum txhawm rau tshem tawm cov cai dhau los hauv koj pawg thawj coj.
  2. Tshaj tawm cov cai rau Arduino, qhib Serial monitor, teeb tsa Baudrate rau 115200 thiab teeb tsa NL thiab CR.
  3. Ntawm Serial Monitor, ntaus cov lus txib hauv qab no: AT. Feem ntau, koj yuav tsum tau txais cov lus "OK". Yog tias tsis yog, thov sib pauv cov xov hlau hauv qab no: RX thiab TX ntawm Arduino. Nyob ntawm daim ntaub thaiv, txoj haujlwm ntawm tus txais yuav txawv.
  4. Koj yuav tsum teeb tsa MODE ntawm koj daim thaiv npog. Nws muaj 3 qhov sib txawv: Chaw Nres Tsheb (1) AP Hom (2) thiab AP+Chaw Nres Tsheb (3). Rau MOS peb tsuas yog xav tau hom rst, ntaus cov lus txib hauv qab no: AT+CWMODE = 1. Yog tias daim ntaub thaiv tau teeb tsa zoo, koj yuav tau txais cov lus "OK". Koj tuaj yeem paub hauv MODE twg koj tab tom ntaus: AR+CWMODE?
  5. Txhawm rau txuas koj li ESP8266-01 rau koj hom Wi-nkaus txuas: AT+CWJAP = "Wi-nkaus network", "Password"
  6. Ua tau zoo! MOS tsab ntawv txuas nrog Is Taws Nem. Tam sim no peb yuav tsum txuas ESP8266 mus rau App.

Kauj ruam 3: Teeb Wifi Txuas

#include #define BLYNK_PRINT Serial2 #include #include #define EspSerial Serial2 ESP8266 wifi (EspSerial); char auth = «b02cfbbfd2b34fd1826ec0718613306c»; #ncig #ncig

void teeb tsa () {

Serial2.begin (9600); ncua (10); EspSerial.begin (115200); ncua (10); Blynk.begin (auth, wifi, «USERNAME», »PASSEWORD»); timer.setInterval (3000L, xa tuaj-sijhawm); }

void sendUptime () {

Blynk.virtualWrite (V1, DHT.temperature); Blynk.virtualWrite (V2, DHT.humidity); Blynk.virtualWrite (23, m); }

void lub voj ()

{rtc.begin (); timer.run (); Blynk.run ();

}

  1. Rub tawm thiab teeb tsa lub tsev qiv ntawv Blynk kawg hauv lub tsev qiv ntawv nplaub tshev ntawm koj qhov program Arduino.
  2. Rub tawm thiab teeb tsa Blynk ESP8266 lub tsev qiv ntawv kawg hauv lub tsev qiv ntawv tais ceev tseg. Nws yog qhov ua tau uas koj xav tau hloov esp8226.cp nrog lwm qhov hloov tshiab.
  3. Nruab BLYNK app ntawm Appstore lossis Google play store thiab tsim txoj haujlwm tshiab.
  4. Luam/paste cov cai saum toj no ntawm Arduino Sketch tshiab. Koj yuav tsum tau hloov daim ntawv pov thawj hlob nrog tus yuam sij lees paub los ntawm koj li haujlwm BLYNK. Tam sim no MOS app tus yuam sij yog «b02cfbbfd2b34fd1826ec0718613306c».
  5. Sau koj tus lej wi thiab koj tus password rau kab hauv qab no: Blynk.begin (auth, wifi, «???», «???»);.
  6. Khiav Arduino kos duab thiab qhib Serial Monitor. Tsis txhob hnov qab hloov pauv Baudrate rau 115200 thiab kab kab cim rau «Ob NL thiab CR».
  7. Tom qab ob peb feeb, MOS Arduino yuav nquag txuas nrog internet. Tam sim no nws yog lub sijhawm los tsim peb MOS Blynk App!

Kauj Ruam 4: Kawm thiab Thov Lus BLYNK

Blynk tau yoog tau zoo rau cov lus Arduino. Ib qho ntawm qhov tshwj xeeb ntawm Blynk yog qhov uas siv Digital, Analog tab sis kuj tseem siv tus lej Virtual. Nyob ntawm tus tswj, ntsuas lossis fader koj yuav xav tau sau kab virtual ntawm koj li Arduino daim duab kos.

  • Piv txwv ntawm Kev sau Virtual ntawm Arduino kos duab: Blynk.virtualWrite (tus pin, nqis tes ua);
  • Koj tuaj yeem ntxiv txhua qhov widgets koj xav tau rau hauv app los ntawm kev ua raws cov kauj ruam saum toj no.
  • Tab sis yuav tsum paub tias qee qhov kev ntsuas yuav xav tau qee qhov hloov pauv ntawm tus lej qub los cuam tshuam nrog BLYNK app.

Piv txwv, DHT-11 + BLYNK:

  1. Nco ntsoov tsis txhob ncua sijhawm ntawm qhov tsis muaj teeb meem teeb tsa tom qab ncua sijhawm kawg (10); Timer.setInterval (1000, Senduptime) siv raws li ncua rau ESP8266-01 daim ntaub thaiv thiab tsis yog rau Serial monitor. Koj yuav tsum tso qhov tsawg kawg ntawm 1000 milliseconds rau qhov ncua sijhawm no lossis ESP daim thaiv yuav tawm tsam nrog kev xa thiab txais cov ntaub ntawv.
  2. Koj yuav tsum tau hloov kho DHT lub tsev qiv ntawv rau Blynk app. Txog qhov ntawd, koj tuaj yeem rub tawm lub tsev qiv ntawv DHT tshiab los ntawm kev ntaus DHT.h thiab DHT11.h hauv google. Muaj qee qhov zoo Github repertory nrog DHT lub tsev qiv ntawv sab hauv.
  3. Qhov kev hloov pauv loj yog nyob ntawm qhov tsis muaj qhov xa tawm lub sijhawm () nrog lub tsev qiv ntawv DHT tshiab koj tsuas yog yuav tsum teeb tus pin virtual uas koj xav tau nrog qhov xwm txheej koj xav tau: ntsuas kub lossis av noo. Yog li, cia saib ib qho piv txwv ntawm kab koj tuaj yeem sau xa cov ntaub ntawv huab cua lossis qhov kub mus rau Blynk app: Blynk.virtualWrite (V1, DHT.temperature); Blynk.virtualWrite (tus pin virtual, ntsuas).
  4. Lub voj void () tau txais ob qhov xwm txheej tshiab uas yog: Blynk.run (); thiab timer.run (); Tab sis kuj, txawm tias koj hu rau DHT hauv qhov khoob hauv qab no uas ua haujlwm raws li lub voj void () koj kuj tseem yuav tsum tau hu lub sensor hauv qhov khoob kawg.

#suav nrog dht11 DHT; #define DHT11_PIN A0 #suav nrog SimpleTimer timer; #include #define BLYNK_PRINT Serial #include #include #de ne EspSerial Serial ESP8266 wi (EspSerial); char auth = «b02cfbbfd2b34fd1826ec0718613306c»; #ncig #ncig

void teeb tsa () {

Serial2.begin (9600); ncua (10); EspSerial.begin (115200); ncua (10); timer.setInterval (1000, xa lub sijhawm); }

void sendUptime ()

{Blynk.virtualWrite (V1, DHT.temperature); Blynk.virtualWrite (V2, DHT.humidity); }

void voj () {

int chk = DHT.read (DHT11_PIN); timer.run (); Blynk.run ();

}

Pom zoo: