Cov txheej txheem:
- Kauj Ruam 1: Cov Cheeb Tsam Yuav Tsum Tau
- Kauj Ruam 2: Txuas Yam
- Kauj Ruam 3: Txhim Kho Software
- Kauj Ruam 4: Yuav Ua Li Cas Nrog Qhov Tawm
Video: Raspberry Pi / DHT11 - Ntsuas Vaum thiab Kub: 4 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:27
Kuv xav ntsuas qhov ntsuas kub thiab av noo siv kuv Raspberry Pi. Kuv xaiv DHT11 sensor vim nws muaj zog thiab pheej yig. Kev teeb tsa nws kuj tseem yog cov ntaub ntawv zoo tab sis muaj ntau qhov tsis txaus ntseeg ntawm txoj kev uas kuv xav tsom mus rau.
DHT11 muaj 4 tus pin. Sab laug feem ntau yog rau Vcc lossis tus lej zoo (+) tus pin uas txuas nrog Raspberry Pi 3.3V tus pin. Tus pin tom ntej hla yog cov ntaub ntawv tus lej uas yuav tsum txuas nrog GPIO tus pin ntawm Raspberry Pi. Ob tus pin no yuav tsum txuas nrog siv 4.7K resistor.
Tus lej thib 3 ntawm sab laug tsis siv. Tus sab xis thiab tus pin thib plaub yog hauv av lossis tus pin tsis zoo uas yuav tsum txuas nrog rau ib qho ntawm tus pin hauv av ntawm Raspberry Pi.
Kauj Ruam 1: Cov Cheeb Tsam Yuav Tsum Tau
1. Raspberry Pi
2. DHT11
3. 4.7k resistor
4. Ntau yam xov tooj ntawm tes
5. Cov qhob cij
Kauj Ruam 2: Txuas Yam
Txuas Raspberry Pi thiab DHT11 raws li hauv qab no:
DHT11 (+ tus pin) RaspberryPi (3.3V tus pin)
DHT11 (tus lej tus lej) RaspberryPi (tus pin GPIO - Kuv siv GPIO22)
DHT11 (tus lej thib 3) Tsis muaj kev txuas
DHT11 (-tus pin) ------ Raspberry Pi (gnd pin)
Kauj Ruam 3: Txhim Kho Software
Los ntawm kab lus RaspberryPi, ua cov hauv qab no: (NCO TSEG, tsis txhob tso SUDO)
sudo git clone
Koj yuav tsum pom - Cloning rau 'Adafruit_Python_DHT' … tej thaj chaw deb: Suav cov khoom: 249, ua tiav. tej thaj chaw deb: Tag nrho 249 (delta 0), rov qab siv 0 (delta 0), ntim rov qab siv 249 Tau txais cov khoom: 100% (249/249), 77.01 KiB, ua tiav. Kev daws qhov deltas: 100% (142/142), ua tiav.
cd Adafruit_Python_DHT/
sudo apt-tau hloov tshiab sudo apt-tau nruab tsim-qhov tseem ceeb sej-dev python-openssl
ls ua
Koj yuav tsum pom - Adafruit_DHT piv txwv ez_setup.py LICENSE README.md setup.py source
cd Adafruit_DHT/
Koj yuav tsum pom -Beaglebone_Black.py common.py _init_.py platform_detect.py Raspberry_Pi_2.py Raspberry_Pi.py Test.py
sudo python setup.py nruab
(Nco tseg, yog tias koj hla cov kauj ruam no ces koj yuav pom qhov ua yuam kev - Traceback (hu xov tooj tsis ntev los no):
Cov ntaub ntawv "./AdafruitDHT.py", kab 24, hauv ntshuam Adafruit_DHT ImportError: Tsis muaj lub npe hu ua Adafruit_DHT)
cd piv txwv
sudo./AdafruitDHT.py 11 22 (11 = DHT11 thiab 22 = GPIO22 uas koj tau xaiv ua ntej)
Koj yuav tsum pom Temp = 18.0* Vaum = 46.0% (piv txwv li qhov kub thiab txias rau koj ib puag ncig)
Kauj Ruam 4: Yuav Ua Li Cas Nrog Qhov Tawm
Yog li, raws li peb tau pom, cov zis yog "Temp = 18.0* Vaum = 46.0%"
Muaj ntau txoj hauv kev uas koj tuaj yeem siv qhov outpu no, piv txwv li siv qhov kev xeem php file no, test_dht11.php file
Ua ntej tshaj, Kuv tau hloov tsab ntawv AdafruitDHT.py rau/var/www/.
Txhawm rau sim thiab khiav cov ntawv php, hloov mus rau /var /www ces sudo php test_dht11.php
Cov zis tso tawm ob tus lej sawv cev rau qhov kub thiab txias. Cov lej no tuaj yeem sau rau hauv lub database, lossis piv rau cov lus ceeb toom txwv thiab xa kev ceeb toom thiab lwm yam
// <? php // tsis pom zoo cov kab saum toj no - cov lus qhia tsis nyiam php pib hais kom ua //test_dht11.php
// ua tiav cov ntaub ntawv nab hab sej los nyeem DHT11 ntsuas kub
// thiab rho tawm qhov kub thiab txias qhov tseem ceeb $ kub = 0; $ vaum = 0; $ my_pos = 0; $ exec_msg = "sudo /var/www/AdafruitDHT.py 11 22 2> & 1"; $ sim = shell_exec ($ exec_msg); // rho tawm kub $ my_pos = strpos ($ test, "Temp =", 0); $ kub = substr ($ sim, $ my_pos+5, 4); ncha "\ n". $ kub; // rho tawm cov av noo $ my_pos = strpos ($ test, "Humidity =", $ my_pos); $ av noo = substr ($ sim, $ my_pos+9, 4); ncha "\ n". $ av noo; ?>
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 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
ESP32 Raws M5Stack M5stick C Huab Cua Saib Nrog DHT11 - Saib Xyuas Qhov Kub Kub & Qhov Kub Kub ntawm M5stick-C Nrog DHT11: 6 Cov Kauj Ruam
ESP32 Raws M5Stack M5stick C Huab Cua Saib Nrog DHT11 | Saib Xyuas Qhov Kub thiab Qhov Ntsuas Kub ntawm M5stick-C Nrog DHT11: Nyob zoo cov neeg, hauv cov lus qhia no peb yuav kawm paub yuav ua li cas cuam tshuam DHT11 ntsuas kub nrog m5stick-C (pawg tswj hwm kev txhim kho los ntawm m5stack) thiab tso tawm ntawm cov zaub ntawm m5stick-C. Yog li hauv qhov kev qhia no peb yuav nyeem qhov ntsuas kub, av noo & heat kuv
Yuav Ua Li Cas Siv DHT11 Kub Sensor Nrog Arduino thiab Luam Kub Kub thiab Vaum: 5 Kauj Ruam
Yuav Ua Li Cas Siv DHT11 Kub Sensor Nrog Arduino thiab Luam Kub Kub thiab Vaum: Lub DHT11 sensor tau siv los ntsuas kub thiab av noo. 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 rau
Kub thiab Vaum Zaub thiab Sau Cov Ntaub Ntawv Nrog Arduino thiab Ua: 13 Kauj Ruam (nrog Duab)
Kub thiab Vaum Zaub thiab Sau Cov Ntaub Ntawv Nrog Arduino thiab Ua: Intro: Qhov no yog Txoj Haujlwm uas siv Arduino board, Sensor (DHT11), lub khoos phis tawj Windows thiab Kev Ua Haujlwm (rub tawm dawb) program los tso saib Kub, Cov ntaub ntawv vaum hauv digital thiab bar kab ntawv, tso tawm lub sijhawm thiab hnub tim thiab suav lub sijhawm suav