Cov txheej txheem:

DHT Kev Ntsuas Kub thiab Vaum Siv ESP8266 thiab AskSensors IoT Platform: 8 Cov Kauj Ruam
DHT Kev Ntsuas Kub thiab Vaum Siv ESP8266 thiab AskSensors IoT Platform: 8 Cov Kauj Ruam

Video: DHT Kev Ntsuas Kub thiab Vaum Siv ESP8266 thiab AskSensors IoT Platform: 8 Cov Kauj Ruam

Video: DHT Kev Ntsuas Kub thiab Vaum Siv ESP8266 thiab AskSensors IoT Platform: 8 Cov Kauj Ruam
Video: Dab Neeg Tub Xob (Part136) Tub Tsheej Vaj Thiab Nkauj Lag 30/09/2021 2024, Hlis ntuj nqeg
Anonim
DHT Kev Ntsuas Kub thiab Vaum Siv ESP8266 thiab AskSensors IoT Platform
DHT Kev Ntsuas Kub thiab Vaum Siv ESP8266 thiab AskSensors IoT Platform

Hauv cov lus qhia yav dhau los, Kuv nthuav qhia ib qib zuj zus qhia kom pib nrog ESP8266 nodeMCU thiab AskSensors IoT platform.

Hauv qhov kev qhia no, Kuv tab tom txuas lub DHT11 sensor mus rau ntawm MCU ntawm. DHT11 feem ntau yog siv Cov ntsuas kub thiab av noo rau cov qauv pov thawj saib xyuas qhov kub thiab txias nyob ib puag ncig.

Lub ntsuas ntsuas tuaj yeem ntsuas kub ntawm 0 ° C txog 50 ° C nrog qhov raug ntawm ± 2 ° C thiab cov av noo los ntawm 20% txog 90% nrog qhov tseeb ntawm ± 5% RH.

DHT11 Kev Qhia Tshwj Xeeb:

  • Kev Ua Haujlwm Voltage: 3.5V txog 5.5V
  • Kev khiav hauj lwm tam sim no: 0.3mA (ntsuas) 60uA (standby)
  • Cov Zis: Cov ntaub ntawv xov xwm
  • Kub ntau: 0 ° C txog 50 ° C.
  • Vaum Ntau: 20% txog 90%
  • Kev daws teeb meem: Kub thiab Vaum ob qho tib si yog 16-ntsis
  • Qhov tseeb: ± 2 ° C thiab ± 5%

Kauj Ruam 1: Nqi Khoom

Cov ntaub ntawv xav tau yog tsim los ntawm:

  1. ESP8266 nodeMCU, tab sis xav tias siv ESP8266 sib txawv sib txawv.
  2. DHT11 sensor, DHT22 kuj yog lwm txoj hauv kev.
  3. USB Micro cable txuas lub nodeMCU rau koj lub khoos phis tawj.
  4. Cov xov hlau rau kev sib txuas ntawm DHT11 thiab nodeMCU.

Kauj ruam 2: Pinout thiab Kev Sib Txuas

Pinout thiab Kev Sib Txuas
Pinout thiab Kev Sib Txuas

Koj tuaj yeem pom DHT11 sensor hauv ob qhov sib txawv pinout teeb tsa:

DHT sensor nrog 3 tus pin:

  1. Fais fab mov 3.5V txog 5.5V
  2. Cov Ntaub Ntawv, Tso Tawm Kub thiab Vaum los ntawm cov ntaub ntawv xov xwm
  3. Av, Txuas nrog rau hauv av ntawm Circuit Court

DHT sensor nrog 4 tus pin:

  1. Fais fab mov 3.5V txog 5.5V
  2. Cov Ntaub Ntawv, Tso Tawm Kub thiab Vaum los ntawm cov ntaub ntawv xov xwm
  3. NC, Tsis muaj Kev Sib Txuas thiab yog li tsis siv
  4. Av, Txuas nrog rau hauv av ntawm Circuit Court

NCO TSEG: Hauv qhov kev ua piv txwv no, peb yuav siv DHT sensor nrog 3 tus pin, teeb tsa rau hauv PCB me me thiab suav nrog qhov yuav tsum tau teeb tsa sab saum toj rub tawm tus tiv thaiv rau Cov Ntaub Ntawv kab.

Kev xaim DHT11 BCB teeb tsa rau NodeMCU yog qhov yooj yim heev:

  • Lub hwj chim muab tus pin ntawm DHT11 rau 3V ntawm lub node MCU.
  • Cov ntaub ntawv tus pin rau GPIO2 (D4)
  • Av rau hauv av

Kauj Ruam 3: Tsim Tus Kheej AskSensors Account

Koj yuav tsum tsim tus as khauj AskSensors tus account.

Tau txais nyiaj dawb ntawm askensors.com.

Kauj ruam 4: Tsim Sensor

  1. Tsim lub ntsuas tshiab kom xa cov ntaub ntawv mus rau.
  2. Hauv qhov kev nthuav qhia no, peb yuav tsum ntxiv tsawg kawg ob qhov qauv: Thawj qhov ntsuas kub thiab qhov thib ob rau qhov av noo. Xa mus rau qhov kev qhia no rau ib qib los ntawm phau ntawv qhia pab yuav ua li cas thiaj tsim lub ntsuas thiab cov qauv ntawm AskSensors platform.

Tsis txhob hnov qab luam koj li 'Api Key In', Nws yog qhov yuav tsum tau ua rau cov kauj ruam tom ntej

Kauj Ruam 5: Sau Txoj Cai

Kuv xav tias koj tab tom teeb tsa tus qauv siv Arduino IDE teeb tsa (version 1.6.7 lossis tshiab dua) raws li tau piav qhia ntawm no, thiab koj twb tau tsim cov lus qhia no, yog li koj muaj ESP8266 cov tub ntxhais thiab cov tsev qiv ntawv tau teeb tsa, thiab koj muaj peev xwm txuas tau koj lub nodeMCU rau internet los ntawm WiFi.

  1. Tam sim no, qhib Arduino IDE thiab nkag mus rau tus thawj tswj tsev qiv ntawv.
  2. Nruab DHT lub tsev qiv ntawv (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)
  3. Qhov piv txwv piv txwv no nyeem qhov kub thiab av noo los ntawm DHT11 sensor thiab xa nws AskSensors siv HTPPS GET Thov. Tau nws los ntawm github thiab hloov kho cov hauv qab no:
  • Teem koj lub WiFi SSID thiab tus password.
  • Teeb tsa API Qhov Ntsuas Hauv muab los ntawm AskSensors xa cov ntaub ntawv mus rau.

Hloov peb kab no hauv txoj cai:

// neeg siv teeb tsa: TODO

const char* wifi_ssid = "………."; // SSID const char* wifi_password = "………"; // WIFI const char* apiKeyIn = "………"; // API KEY IN

Los ntawm lub neej ntawd, cov cai tau nyeem DHT ntsuas thiab xa nws mus rau AskSensors platform txhua 25 vib nas this. Koj tuaj yeem hloov nws los ntawm kev hloov kab hauv qab no:

ncua (25000); // ncua hauv msec

Kauj Ruam 6: Khiav Txoj Cai

Khiav Txoj Cai
Khiav Txoj Cai
  1. Txuas ESP8266 nodeMCU rau koj lub computer los ntawm USB cable.
  2. Khiav cov cai.
  3. Qhib lub davhlau ya nyob twg.
  4. Koj yuav tsum pom koj li ESP8266 txuas rau internet los ntawm WiFi,
  5. Tom qab ntawd, ESP8266 yuav nyeem qhov ntsuas kub thiab qhov av tas mus li thiab xa mus rau tus Ntsuas Saib Xyuas.

Kauj Ruam 7: Pom Koj Cov Ntaub Ntawv hauv Huab

Pom koj cov ntaub ntawv hauv huab
Pom koj cov ntaub ntawv hauv huab
Pom koj cov ntaub ntawv hauv huab
Pom koj cov ntaub ntawv hauv huab

Tam sim no, rov qab mus rau AskSensors thiab pom koj cov ntaub ntawv cov qauv hauv kab duab. Yog tias xav tau, koj kuj tseem muaj qhov kev xaiv xa koj cov ntaub ntawv hauv CSV cov ntaub ntawv uas koj tuaj yeem ua tiav siv lwm yam cuab yeej.

Kauj ruam 8: Ua tau zoo

Kuv vam tias qhov kev qhia no tau pab koj tsim koj li kev ntsuas kub thiab av noo nrog ESP8266 thiab AskSensors huab.

Koj tuaj yeem pom ntau cov lus qhia ntawm no.

Pom zoo: