Cov txheej txheem:

Esp32 Huab Cua Saib: 6 Kauj Ruam
Esp32 Huab Cua Saib: 6 Kauj Ruam

Video: Esp32 Huab Cua Saib: 6 Kauj Ruam

Video: Esp32 Huab Cua Saib: 6 Kauj Ruam
Video: IOTA + TRUSTPAD CRYPTO EVENT AIRDROP 2022 | CLAIM IOTA 500$ COIN! 2024, Hlis ntuj nqeg
Anonim
Esp32 Huab Cua Saib
Esp32 Huab Cua Saib

Hauv qhov kev qhia no, koj yuav tsim lub ntsuas cua uas saib xyuas huab cua kub, av noo thiab siab, txhua tus siv Blynk, esp32, DHT22 thiab BMP180.

Khoom siv

  • esp32 Microcontroller
  • TSH 22
  • NPE 180

Kauj ruam 1: Teeb Blynk

Koj yuav xav tau Blynk rau txoj haujlwm no kom koj tuaj yeem pom cov txiaj ntsig hauv lub sijhawm tiag tiag nyob txhua qhov chaw hauv ntiaj teb. Koj tuaj yeem pom yuav teeb tsa Blynk hauv kuv qhov kev qhia yav dhau los.

Kauj ruam 2: Nruab Lub Tsev Qiv Ntawv

Thawj lub tsev qiv ntawv koj yuav tsum tau teeb tsa yog SparkFun RHT03 Arduino Library, koj tuaj yeem rub tawm qhov no los ntawm https://learn.sparkfun.com/tutorials/rht03-dht22-humidity-and-temperature-sensor-hookup-guide?_ga= 2.53575016.1755727564.1559404402-688583549.1496066940#tsev qiv ntawv-teeb tsa. Tom qab rub tawm nws qhib Arduino IDE thiab nkag mus rau Sketch> suav nrog Tsev qiv ntawv> Ntxiv. ZIP Library … thiab xaiv cov ntaub ntawv.zip koj nyuam qhuav rub tawm.

Lub tsev qiv ntawv thib ob uas koj xav tau los teeb tsa yog Adafruit BMP085 Lub Tsev Qiv Ntawv, koj tuaj yeem teeb tsa qhov no los ntawm kev mus rau hauv Sketch> suav nrog Lub Tsev Qiv Ntawv> Tswj Cov Tsev Qiv Ntawv… tom qab ntawd tshawb rau 'BMP085'.

Kauj Ruam 3: Txhim Kho Cov Hluav Taws Xob

Txhim kho lub Circuit Court
Txhim kho lub Circuit Court
Txhim kho lub Circuit Court
Txhim kho lub Circuit Court

Tam sim no koj yuav tsum tau xaim lub Circuit Court, nws yog ib qho yooj yim Circuit Court. Saib cov duab hluav taws xob saum toj no.

Kauj Ruam 4: Tsim Daim Ntawv Thov rau Blynk

Tsim Daim Ntawv Thov rau Blynk
Tsim Daim Ntawv Thov rau Blynk
Tsim Daim Ntawv Thov rau Blynk
Tsim Daim Ntawv Thov rau Blynk
Tsim Daim Ntawv Thov rau Blynk
Tsim Daim Ntawv Thov rau Blynk
Tsim Daim Ntawv Thov rau Blynk
Tsim Daim Ntawv Thov rau Blynk

Koj yuav xav tau daim ntawv thov hauv Blynk kom koj tuaj yeem tau txais cov ntaub ntawv thiab muab nws qhia rau koj hauv app, duab. Txhawm rau tsim nws siv cov duab saum toj no.

Widgets:

  • 2x Gaug
  • 1x Kab rov tav

Kev ntsuas qhov ntsuas kub:

  • Lub Npe: Kub
  • Xim: Txiv kab ntxwv/daj
  • Cov tswv yim: V5 0-100
  • Daim ntawv lo: /tus pin /° C.
  • Lub sijhawm ncua sijhawm tshiab: 1sec

Qhov Chaw Ntsuas Cov Ntsuas:

  • Lub Npe: Vaum
  • Xim: Lub teeb xiav
  • Tswv yim V6 0-100
  • Label: /tus pin /%
  • Lub sijhawm ncua sijhawm tshiab: 1sec

Cov Qib Siab Siab

  • Lub Npe: Siab
  • Xim: Txiv kab ntxwv/daj
  • Cov tswv yim: V7 950-1050
  • Tig Axis: Tawm
  • Lub sijhawm ncua sijhawm tshiab: 1sec

Kauj ruam 5: Upload Code

Tam sim no peb tau npaj rau txoj cai. Ua ntej xa cov cai koj yuav tsum tau hloov qee qhov, nrhiav kab char auth = "YourAuthToken"; thiab hloov YourAuthToken nrog Auth Token koj tau sau ua ntej thiab yog tias koj siv wifi nrhiav kab char ssid = "YourNetworkName"; thiab hloov YourNetworkName nrog koj lub npe network thiab nrhiav kab kab hla = "YourPassword"; thiab hloov YourPassword nrog koj tus password Wifi. Tom qab ua qhov no tam sim no koj tuaj yeem xa cov cai.

#define BLYNK_PRINT Serial #suav nrog

#suav nrog

#suav nrog

#suav nrog

#suav nrog

#suav nrog

/////////////////////

// Pin Definitions // ///////////////////// const int DHT22_DATA_PIN = 27; // DHT22 data pin const int FLAME_SENSOR_DATA_PIN = 32; // Nplaim Sensor cov ntaub ntawv tus pin ///////////////////////////// // RHT03 Lub Hom Phiaj Tsim // ////////// /////////////////// RHT03 rht; // Qhov no tsim cov khoom RTH03, uas peb yuav siv los cuam tshuam nrog lub sensor /////////////////////////// // BMP180/BMP085 Lub Hom Phiaj Tsim // /////////////////////////// Adafruit_BMP085 bmp; // Koj yuav tsum tau txais Auth Token hauv Blynk App. // Mus rau Qhov Chaw Haujlwm (icon txiv ntoo). char auth = "YourAuthToken"; // Koj li ntawv pov thawj WiFi. // Teeb tus password rau "" rau qhib tes hauj lwm. char ssid = "YourNetworkName"; char pass = "YourPassword"; BlynkTimer timer; void sendSensor () {int updateRet = rht.update (); yog (updateRet == 1) {// Cov av noo (), tempC (), thiab tempF () kev ua haujlwm tuaj yeem hu ua - tom qab // hloov pauv tau zoo () - kom tau txais cov av noo kawg thiab kub // tus nqi ntab latestHumidity = rht.humidity (); ntab latestTempC = rht.tempC (); ntab latestTempF = rht.tempF (); ntab latest Siab = bmp.readPressure ()/100; Blynk.virtualWrite (V5, latestTempC); Blynk.virtualWrite (V6, latestHumidity); Blynk.virtualWrite (V7, Qhov tseeb tshaj plaws); } lwm { / Yog tias qhov hloov tshiab tsis ua tiav, sim ncua rau RHT_READ_INTERVAL_MS ms ua ntej // sim dua. ncua (RHT_READ_INTERVAL_MS); }} void teeb () {// Debug console Serial.begin (9600); Blynk.begin (auth, ssid, dhau); // Koj tseem tuaj yeem hais qhia server: //Blynk.begin(auth, ssid, pass, "blynk-cloud.com", 80); //Blynk.begin(auth, ssid, dhau, IPAddress (192, 168, 1, 100), 8080); rht.begin (DHT22_DATA_PIN); yog (! bmp.begin ()) {Serial.println ("Tsis tuaj yeem pom qhov siv tau BMP085/BMP180 sensor, kos thaiv!"); thaum (1) {}} // Teeb tsa lub luag haujlwm kom raug hu ua txhua lub sijhawm timer.setInterval (1000L, sendSensor); } tsis muaj dab tsi voj () {Blynk.run (); timer.run (); }

Kauj ruam 6: Tiav lawm

Tiav lawm
Tiav lawm
Tiav lawm
Tiav lawm
Tiav lawm
Tiav lawm

Ua tau zoo, tam sim no kev ua haujlwm tau tiav thiab tam sim no tuaj yeem tso rau hauv qhov chaw uas nws tau siv zog thiab yuav xa cov ntsuas kub, av noo thiab cov ntaub ntawv siab rau koj lub xov tooj!

Pom zoo: