Cov txheej txheem:
- Kauj Ruam 1: Yam Koj Xav Tau
- Kauj ruam 2: Kev sib txuas
- Kauj Ruam 3: Nruab Arduino Library
- Kauj Ruam 4: Tshaj Tawm Txoj Cai rau Arduino Lub Tswv Yim
- Kauj Ruam 5: Tau Txais Qhov Kub & Vaum Hauv Serial Monitor
Video: Yuav Ua Li Cas Siv DHT11 Kub Sensor Nrog Arduino thiab Luam Kub Kub thiab Vaum: 5 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:26
DHT11 sensor siv los ntsuas qhov kub thiab txias. Lawv yog cov khoom siv hluav taws xob nrov tshaj plaws. Qhov DHT11 cov av noo thiab ntsuas kub ua rau nws yooj yim ntxiv cov av noo thiab ntsuas kub rau koj li DIY cov phiaj xwm hluav taws xob. Nws yog qhov zoo tshaj plaws rau cov chaw nyob huab cua nyob deb, kev tswj hwm ib puag ncig hauv tsev, thiab kev ua liaj ua teb lossis saib xyuas vaj tsev. Yog li hauv qhov kev qhia no peb yuav pom yuav siv DHT11 Cov ntsuas kub li cas nrog Arduino thiab luam tawm qhov ntsuas cua sov & cua sov ntawm qhov ntsuas ntawm arduino ide.
Kauj Ruam 1: Yam Koj Xav Tau
Yog li rau txoj haujlwm no koj xav tau cov khoom hauv qab no: 1x Arduino uno:
1x DHT11 Kub sensor: https://www.utsource.net/itm/p/9221601.htmlBreadboard & ob peb dhia
Kauj ruam 2: Kev sib txuas
Thov txuas txhua yam Raws li tau qhia hauv cov duab muab thiab ua mus rau kauj ruam tom ntej.
Kauj Ruam 3: Nruab Arduino Library
mus rau koj Arduino IDE tom qab ntawd mus rau Sketch> suav nrog Tsev Qiv Ntawv> Tswj Tsev Qiv. Tom qab txhim kho cov tsev qiv ntawv DHT no, ntaus "Adafruit Unified Sensor" hauv lub npov tshawb nrhiav thiab nqes mus. lub tsev qiv ntawv thiab teeb tsa nws thiab koj npaj txhij rau code.
Kauj Ruam 4: Tshaj Tawm Txoj Cai rau Arduino Lub Tswv Yim
Tom qab txhua yam ua tiav saum toj no tsuas yog theej cov cai hauv qab no & rub nws mus rau koj Arduino uno: #include "DHT.h" #define DHTPIN 7 // dab tsi tus pin peb txuas nrog rau // Tsis hais yam twg koj tab tom siv! txhais DHTTYPE DHT11 // DHT 11 //#txhais DHTTYPE DHT22 // DHT 22 (AM2302) //#txhais DHTTYPE DHT21 // DHT 21 (AM2301) // Pib DHT sensor rau qhov qub 16mhz ArduinoDHT dht (DHTPIN, DHTTYPE); teeb tsa () {Serial.begin (9600); Serial.println ("DHTxx xeem!"); dht.begin ();} void loop () {// Tos ob peb feeb ntawm kev ntsuas. ncua (2000); // Nyeem qhov ntsuas kub lossis av noo siv li 250 milliseconds! // Sensor nyeem ntawv kuj tseem tuaj yeem ntev txog 2 vib nas this 'qub' (nws lub sensor qeeb heev) ntab h = dht.readHumidity (); // Nyeem kub li Celsius ntab t = dht.readTemperature (); // Nyeem kub li Fahrenheit ntab f = dht.readTemperature (tseeb); // Txheeb xyuas yog tias ib qho twg nyeem tsis tau zoo thiab tawm ntxov (sim dua). yog (isnan (h) || isnan (t) || isnan (f)) {Serial.println ("Ua tsis tau tejyam nyeem los ntawm DHT sensor!"); rov qab; } // Txheeb xyuas qhov ntsuas cua sov // Yuav tsum xa cov ntsuas hauv Fahrenheit! ntab hi = dht.computeHeatIndex (f, h); Serial.print ("Vaum:"); Serial.print (h); Serial.print (" %\ t"); Serial.print ("Kub:"); Serial.print (t); Serial.print (" *C"); Serial.print (f); Serial.print (" *F / t"); Serial.print ("Cov ntsuas cua sov:"); Serial.print (nyob zoo); Serial.println (" *F");}
Kauj Ruam 5: Tau Txais Qhov Kub & Vaum Hauv Serial Monitor
Tom qab xa cov cai qhib qhov ntsuas tam sim no hauv arduino lub tswv yim thiab koj tuaj yeem pom qhov ntsuas kub, av noo & ntsuas cua sov ntawm koj ib puag ncig (uas koj lub ntsuas tam sim no tam sim no nyob hauv) ntawm koj lub xov tooj saib raws li kuv thiab koj tuaj yeem ua qhov no me ntsis ntxiv ib yam koj tuaj yeem siv cov ntsuas kub/av noo no hauv koj cov phiaj xwm xws li chaw nres tsheb huab cua, saib ib puag ncig thiab lwm yam.
Pom zoo:
Nws Pib Cua Txias Siv Servo thiab DHT11 Kub thiab Vaum Sensor Nrog Arduino: 8 Kauj Ruam
Auto Cooling Fan Siv Servo thiab DHT11 Kub thiab Vaum Sensor Nrog Arduino: Hauv qhov kev qhia no peb yuav kawm paub pib li cas & tig kiv cua thaum qhov kub nce siab tshaj ib qib
Yuav Ua Li Cas Siv DHT22 Vaum thiab Kub Sensor Nrog Arduino: 6 Kauj Ruam
Yuav Ua Li Cas Siv DHT22 Vaum thiab Kub Sensor Nrog Arduino: Hauv qhov kev qhia no peb yuav kawm paub siv DHT22 Vaum thiab Qhov Kub Kub Sensor nrog Arduino thiab tso tawm qhov txiaj ntsig ntawm OLED Display.Watch cov vis dis aus
Yuav Ua Li Cas Siv DHT12 I2C Vaum thiab Kub Sensor Nrog Arduino: 7 Kauj Ruam
Yuav Ua Li Cas Siv DHT12 I2C Vaum thiab Kub Sensor Nrog Arduino: Hauv qhov kev qhia no peb yuav kawm paub siv DHT12 I2C Vaum thiab Qhov Kub Kub Sensor nrog Arduino thiab tso tawm qhov txiaj ntsig ntawm OLED Zaub. Saib cov vis dis aus
Yuav Ua Li Cas Vaum Thiab Kub Tiag Tiag Cov Ntaub Ntawv Teev Npe Nrog Arduino UNO thiab SD-Card - DHT11 Cov ntaub ntawv-logger Simulation hauv Proteus: 5 Cov Kauj Ruam
Yuav Ua Li Cas Vaum Thiab Kub Tiag Tiag Cov Ntaub Ntawv Teev Npe Nrog Arduino UNO thiab SD-Card | DHT11 Cov ntaub ntawv-logger Simulation hauv Proteus: Taw qhia: nyob zoo, qhov no yog Liono Maker, ntawm no yog YouTube txuas. Peb tab tom tsim txoj haujlwm muaj tswv yim nrog Arduino thiab ua haujlwm ntawm cov kab ke. Cov ntaub ntawv-Logger: Cov ntaub ntawv logger (tseem cov ntaub ntawv-logger lossis cov ntaub ntawv kaw) yog cov cuab yeej siv hluav taws xob uas sau cov ntaub ntawv dhau sijhawm
ESP8266 NodeMCU Access Point (AP) rau Web Server Nrog DT11 Kub Sensor thiab Luam Ntawv Kub & Vaum Hauv Browser: 5 Kauj Ruam
ESP8266 NodeMCU Access Point (AP) rau Web Server Nrog DT11 Kub Sensor thiab Luam Ntawv Kub & Vaum Hauv Browser: Nyob zoo cov phooj ywg hauv feem ntau ntawm cov haujlwm peb siv ESP8266 thiab hauv feem ntau ntawm cov haujlwm peb siv ESP8266 ua lub vev xaib kom cov ntaub ntawv tuaj yeem nkag tau rau txhua lub cuab yeej hla wifi los ntawm kev nkag mus rau Webserver tuav los ntawm ESP8266 tab sis qhov teeb meem tsuas yog peb xav tau lub router ua haujlwm rau