Cov txheej txheem:
- Kauj Ruam 1: Yam Koj Xav Tau
- Kauj ruam 2: Circuit Court
- Kauj Ruam 3: Tau txais Cov Tsev Qiv Ntawv
- Kauj ruam 4: Code
- Kauj ruam 5: Tau tus IP
- Kauj Ruam 6: Txheeb Xyuas Koj Qhov Kub & Vaum ntawm Browser
Video: ESP8266 Nodemcu Kev Ntsuas Kub Siv DHT11 ntawm Lub Vev Xaib Hauv Zos - Tau Chav Kub & Vaum ntawm Koj Tus Kheej: 6 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:26
Nyob zoo cov menyuam hnub no peb yuav ua qhov ntsuas qhov ntsuas kub thiab txias siv ESP 8266 NODEMCU & DHT11 ntsuas kub. Kub thiab av noo yuav tau los ntawm DHT11 Sensor & nws tuaj yeem pom ntawm qhov browser uas lub vev xaib yuav raug tswj hwm los ntawm esp 8266 los ntawm kev tuav nws ntawm lub vev xaib hauv zos.
Kauj Ruam 1: Yam Koj Xav Tau
Koj xav tau cov khoom hauv qab no rau txoj haujlwm no: 1x ESP 8266 Nodemcu:
1x DHT11: https://www.utsource.net/itm/p/8831706.html1x breadboard:.:
Ob peb dhia:
Kauj ruam 2: Circuit Court
Lub Circuit Court yog qhov yooj yim heev txuas txhua yam Raws li qhia hauv schmatics
Kauj Ruam 3: Tau txais Cov Tsev Qiv Ntawv
Qhib koj Arduino IDE thiab mus rau Sketch> suav nrog Tsev Kawm Ntawv> Tswj Tsev Qiv. Tus Thawj Saib Xyuas Tsev Qiv Ntawv yuav tsum qhib. Tshawb nrhiav "DHT" ntawm lub npov Tshawb nrhiav thiab teeb tsa DHT lub tsev qiv ntawv los ntawm Adafruit. Qhib txhua txoj hauv kev kom pom lub tsev qiv ntawv thiab nruab nws Tom qab txhim kho cov tsev qiv ntawv, rov pib dua koj li Arduino IDE.
Kauj ruam 4: Code
Tom qab ua cov saum toj no upload cov cai hauv qab no rau ESP8266 nodemcu (thov xaiv qhov chaw nres nkoj & pawg kom raug) & ua ntej rub tawm cov cai thov tso ssid & tus password ntawm koj lub wifi hauv tus lej: // Xws li ESP8266 WiFi lub tsev qiv ntawv #suav nrog #suav nrog "DHT. h "// Tsis pom zoo ib qho ntawm kab hauv qab no rau yam DHT sensor yam koj tab tom siv!#txhais DHTTYPE DHT11 // DHT 11 //#txhais DHTTYPE DHT21 // DHT 21 (AM2301) //#txhais DHTTYPE DHT22 // DHT 22 (AM2302), AM2321 // Hloov nrog koj cov ntsiab lus network sib txuas char* ssid = "YOUR_NETWORK_NAME"; const char* password = "YOUR_NETWORK_PASSWORD"; // Web Server ntawm chaw nres nkoj 80WiFiServer server (80); // DHT Sensorconst int DHTPin = 5; // Initialize DHT sensor. DHT dht (DHTPin, DHTTYPE); // Temporary variablesstatic char c CelsiusTemp [7]; static char fahrenheitTemp [7]; zoo li qub char humidityTemp [7]; // tsuas yog khiav ib zaug ntawm kev teeb tsa bootvoid () { // Initializing serial chaw nres nkoj rau debugging lub hom phiaj Serial.begin (115200); ncua (10); dht.begin (); // Txuas rau WiFi network Serial.println (); Serial.print ("Txuas rau"); Serial.println (ssid); WiFi.begin (ssid, password); thaum (WiFi.status ()! = WL_CONNECTED) {ncua (500); Serial.print ("."); } Serial.println (""); Serial.println ("Txuas nrog WiFi"); // Pib lub web server server.begin (); Serial.println ("Web server khiav. Tos rau ESP IP …"); ncua (10000); // Luam tawm ESP IP chaw nyob Serial.println (WiFi.localIP ());} // sau ntau thiab ntau dua tsis muaj lub voj () {// Mloog rau cov neeg siv tshiab WiFiClient tus neeg siv = server.available (); yog (tus neeg siv khoom) {Serial.println ("Tus neeg siv khoom tshiab"); // bolean mus nrhiav thaum http thov xaus boolean blank_line = tseeb; thaum (client.connected ()) {yog (client.available ()) {char c = client.read (); yog (c == '\ n' && blank_line) {// 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 (lub neej ntawd) ntab t = dht.readTemperature (); // Nyeem kub li Fahrenheit (isFahrenheit = true) 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!"); strcpy (c CelsiusTemp, "Ua tsis tau tejyam"); strcpy (fahrenheitTemp, "Ua tsis tau"); strcpy (humidityTemp, "Ua tsis tau tej yam"); } lwm qhov {// Suav qhov ntsuas kub hauv Celsius + Fahrenheit thiab Vaum ntab hic = dht.computeHeatIndex (t, h, cuav); dtostrf (hic, 6, 2, c CelsiusTemp); ntab hif = dht.computeHeatIndex (f, h); dtostrf (hif, 6, 2, fahrenheitTemp); dtostrf (h, 6, 2, humidityTemp); // Koj tuaj yeem tshem tawm cov Serial.print's hauv qab no, nws tsuas yog siv rau lub hom phiaj debugging Serial.print ("Vaum:"); Serial.print (h); Serial.print (" %\ t Kub:"); Serial.print (t); Serial.print (" *C"); Serial.print (f); Serial.print (" *F / t Kub ntsuas:"); Serial.print (hic); Serial.print (" *C"); Serial.print (hif); Serial.print (" *F"); Serial.print ("Vaum:"); Serial.print (h); Serial.print (" %\ t Kub:"); Serial.print (t); Serial.print (" *C"); Serial.print (f); Serial.print (" *F / t Kub ntsuas:"); Serial.print (hic); Serial.print (" *C"); Serial.print (hif); Serial.println (" *F"); } client.println ("HTTP/1.1 200 OK"); client.println ("Cov ntsiab lus-Hom: ntawv/html"); client.println ("Kev sib txuas: kaw"); client.println (); cov. // koj lub vev xaib tiag uas qhia txog qhov kub thiab txias cov neeg siv khoom
Kauj ruam 5: Tau tus IP
Koj saib qhov ntsuas kub & av noo peb xav tau kom tau IP ntawm nplooj ntawv webpage. Yog li rau qhov ntawd kom ntseeg tau tias koj tus esp8266 txuas nrog koj lub PC thiab tom qab ntawd qhib lub vijtsam saib thiab ntawm lub vijtsam saib koj tuaj yeem pom tus IP ntawm koj ESP8266 webserver webpage.
Kauj Ruam 6: Txheeb Xyuas Koj Qhov Kub & Vaum ntawm Browser
Yog li tom qab tau txais IP ntawm koj ESP8266 nodemcu, tsuas yog qhib browser hauv PC lossis Txawb tab sis xyuas kom tseeb tias koj lub PC/mobile tau txuas nrog tib lub network zoo li koj Nodemcu/ESP8266 thiab tom qab ntawd mus rau koj tus browser (yog tias koj siv mobile thov siv browser ua ntej piv txwv li rau Android siv chrome) thiab tom qab ntawd ntaus tus IP peb tau txais hauv cov kauj ruam dhau los thiab lub vev xaib hauv cheeb tsam yuav b tso tawm nrog cov av noo & kub raws li kuv tau qhia hauv duab.
Pom zoo:
Siv Smartphone Raws Li Tsis Siv Tus Kheej Ntsuas Kub / Tus Ntsuas Ntsuas Kub: 8 Kauj Ruam (nrog Duab)
Siv Smartphone Raws Li Tsis Siv Tus Kws Ntsuas Kub / Tus Ntsuas Kub Portable: Ntsuas lub cev kub nrog qhov tsis sib cuag / tsis sib cuag zoo li rab phom thermo. Kuv tsim txoj haujlwm no vim tias Thermo Gun tam sim no kim heev, yog li kuv yuav tsum tau txais lwm txoj hauv kev los ua DIY. Thiab lub hom phiaj yog ua nrog cov peev txheej qis .SuppliesMLX90614Ardu
Yuav Ua Li Cas Tsim Kev Tswj Tus Kheej 3D Luam Tus Kheej Tus Kheej Tus Kheej: 9 Kauj Ruam (nrog Duab)
Yuav Ua Li Cas Tsim Kev Tswj Tus Kheej 3D Luam Tus Kheej Tus Kheej Tus Kheej: Qhov no yog kev hloov pauv ntawm B-neeg hlau ua ntej. 100% Qhib QHOV CHAW / Arduino neeg hlau. CODE, 3D ntu thiab khoom siv hluav taws xob tau qhib yog li xav hloov kho nws lossis tsim qhov loj ntawm tus neeg hlau. Yog tias koj muaj kev ua xyem xyav, tswv yim lossis xav tau kev pab ua rau
Yuav Ntsuas Li Cas Ntsuas Kev Siv Lub Hwj Chim ntawm Kev Sib Txuas Lus Wireless hauv Era ntawm Kev Siv Hluav Taws Xob?: 6 Cov Kauj Ruam
Yuav Ua Li Cas Ntsuas Kom Tau Txais Kev Siv Lub Hwj Huam ntawm Kev Sib Txuas Lus Wireless hauv Era ntawm Kev Siv Hluav Taws Xob? Feem ntau IoT nodes yuav tsum tau siv lub roj teeb. Tsuas yog los ntawm kev ntsuas ntsuas lub zog siv ntawm lub wireless wireless peb tuaj yeem kwv yees kwv yees ntau npaum li cas roj teeb kuv
Txhua Yam Txog Kev Tsim Lub Vev Xaib Lub Vev Xaib: 5 Kauj Ruam
Txhua Yam Txog Kev Tsim Lub Vev Xaib Lub Vev Xaib: Lub vev xaib pub dawb no yog daim ntawv uas koj siv los npaj phiaj xwm kev tsim kho cov ntsiab lus zoo ua kom pom tseeb cov ntsiab lus lub vev xaib. Daim qauv txheej txheem no tau tsim nrog kev yooj yim siv cov khoom siv hauv Microsoft Excel txawm hais tias muaj ntau yam software sib txawv
Lub hauv paus tseem ceeb ntawm Lub Vev Xaib-raws li Lub Vev Xaib: 7 Kauj Ruam
Cov Hauv Paus Ntawm Lub Vev Xaib-raws li Lub Vev Xaib: Cov lus qhia no yuav qhia koj cov hauv paus ntawm kev tsim lub vev xaib nrog divs li cas. Vim tias cov ntxhuav siv rau kev teeb tsa yog qhov phem!: PTo kom nkag siab cov lus qhia no, koj yuav tsum paub qhov yooj yim html thiab css. Yog tias koj tsis nkag siab qee yam, xav tias dawb rau