Cov txheej txheem:

Chav Kub & Ntsuas Xyuas Nrog ESP32 thiab AskSensors Huab: 6 Kauj Ruam
Chav Kub & Ntsuas Xyuas Nrog ESP32 thiab AskSensors Huab: 6 Kauj Ruam

Video: Chav Kub & Ntsuas Xyuas Nrog ESP32 thiab AskSensors Huab: 6 Kauj Ruam

Video: Chav Kub & Ntsuas Xyuas Nrog ESP32 thiab AskSensors Huab: 6 Kauj Ruam
Video: Plab Plab Ntswg..(Pluav Pluav Ntswg) Maiv Twm New Song 2023-2024 2024, Kaum ib hlis
Anonim
Chav Kub & Ntsuas Xyuas Nrog ESP32 thiab AskSensors Huab
Chav Kub & Ntsuas Xyuas Nrog ESP32 thiab AskSensors Huab

Hauv qhov kev qhia no koj yuav kawm paub saib xyuas qhov kub thiab txias ntawm koj chav lossis lub rooj siv DHT11 thiab ESP32 txuas nrog huab.

Peb cov ntawv qhia hloov tshiab tuaj yeem pom ntawm no.

DHT11 Cov Lus Qhia:

DHT11 sensor muaj peev xwm ntsuas kub ntawm 0 ° C txog 50 ° C (qhov tseeb ± 2 ° C) thiab cov av noo los ntawm 20% txog 90% (qhov tseeb ± 5%). Lub ntsuas hluav taws xob xav tau 5V los ua haujlwm kom raug thiab tso tawm qhov kub thiab txias hauv cov ntaub ntawv xov xwm.

Yog li cia peb pib!

Kauj Ruam 1: Yuav Tsum Tau Kho Vajtse

Yuav tsum tau kho vajtse
Yuav tsum tau kho vajtse

Cov ntaub ntawv:

Hauv qhov demo no peb yuav xav tau:

  • ESP32 WiFi module.
  • Lub computer siv Arduino IDE.
  • Cov qhob cij
  • DHT11 lossis DHT22
  • 47K Cov neeg tiv taus
  • Cov xov hlau rau kev sib txuas ntawm DHT11 thiab ESP32.
  • USB Micro cable txuas ESP32 rau koj lub computer.

Kev Sib Txuas:

Cov kev sib txuas yog yooj yim zoo nkauj, txuas cov pins hauv qab no raws li qhia hauv daim duab saum toj no:

  • DHT VCC rau ESP32 5V.
  • DHT Av rau ESP32 Av.
  • DHT Cov Ntaub Ntawv rau ESP32 IO4 (teev nyob hauv txoj cai).
  • Txuas Cov Ntaub Ntawv (IO4) tus pin thiab 5V nrog 47K lossis 10K rub tawm tus tiv thaiv.

Kauj ruam 2: Software Yuav Tsum Tau

AskSensors tus account

Sau npe rau tus as khauj dawb hauv AskSensors IoT platforms (nws nrawm heev!). Tom qab ntawd koj yuav tuaj yeem khaws koj cov ntaub ntawv hauv huab, nkag mus rau lawv nyob deb hauv is taws nem thiab tau txais ntau yam zoo li pom koj cov ntaub ntawv hauv kab duab, xa tawm hauv CSV cov ntaub ntawv thiab teeb tsa email ceeb toom …

Tsim lub ntsuas tshiab nrog ob tus qauv raws li tau piav qhia hauv qhov no pib qhia. Tsis txhob hnov qab luam koj li 'Api Key In', Nws yog qhov yuav tsum tau ua rau cov kauj ruam tom ntej.

Nruab ESP32 hauv arduino IDE

Yog tias qhov no yog thawj zaug koj ua haujlwm nrog ESP32, thov xa mus rau qhov kev qhia no uas kuv tau qhia koj ib qib zuj zus qhia txog yuav ua li cas teeb tsa koj li ESP32 hauv Arduino IDE thiab txuas nws mus rau huab.

Nruab cov tsev qiv ntawv

Nruab DHT lub tsev qiv ntawv los ntawm github (Koj tseem tuaj yeem nruab nws los ntawm kev mus rau Sketch> suav nrog Tsev Qiv Ntawv> Tswj Tsev Qiv Ntawv, thiab tshawb rau adafruit dht tsev qiv ntawv)

Kauj Ruam 3: Sau Txoj Cai

Rub tawm qhov demo no los ntawm AskSensors Github nplooj ntawv thiab decompress nws.

Cov duab kos nyeem qhov kub thiab txias los ntawm DHT11 sensor thiab xa nws AskSensors siv HTTP GET Thov.

Txhua yam koj xav tau yog hloov kho cov hauv qab no:

const char* ssid = "……………"; // Wifi SSID

const char* lo lus zais = "……………"; // Wifi Password const char* apiKeyIn = "……………."; // API Ntsiab

Nco ntsoov tias DHT Cov ntaub ntawv tus pin txuas nrog ESP32 IO4 tus pin. yog xav tau, koj tuaj yeem hloov nws ntawm no:

// DHT teeb tsa. #define DHTPIN 4 // Pin uas txuas nrog DHT sensor.

Kauj Ruam 4: Khiav Kev Xeem

Khiav Kev Xeem
Khiav Kev Xeem
Khiav Kev Xeem
Khiav Kev Xeem
  1. Txuas ESP32 rau koj lub computer los ntawm USB cable.
  2. Qhib Arduino IDE thiab xa cov cai.
  3. Qhib lub davhlau ya nyob twg. Koj yuav tsum pom koj li ESP32 txuas rau internet los ntawm WiFi, Tom qab ntawd, ESP32 yuav nyeem qhov ntsuas kub thiab qhov av tas mus li thiab xa mus rau AskSensors.

Kauj Ruam 5: Cov txiaj ntsig

Cov txiaj ntsig
Cov txiaj ntsig
Cov txiaj ntsig
Cov txiaj ntsig

Tam sim no, rov qab mus rau AskSensors.

  1. Nkag mus rau hauv thiab qhib koj lub Sensor dashboard.
  2. Nyem rau ntawm Cov Qauv thiab ntxiv kab kos rau Module 1 thiab Module 2.
  3. Koj yuav tsum pom koj cov ntaub ntawv nthuav tawm hauv kab ntawv raws li qhia hauv cov duab saum toj no.

Nco tseg: Kuv tau siv lub tshuab ziab plaub hau kom pom qhov txawv ntawm qhov kub thiab txias;-)

Kauj ruam 6: Tsaug

Koj Puas Muaj Lus Nug lossis Lus Qhia? Tsuas yog tawm tswv yim, peb yuav zoo siab heev pom koj cov lus teb!

Cov ntawv qhia no puas tau pab koj txhua txoj kev? Thov ua rau lub plawv me me ntawd:-)

Pom zoo: