Cov txheej txheem:

Kev Saib Xyuas Huab Cua Siv Raspberry Pi3 thiab DHT11 Sensor: 4 Cov Kauj Ruam
Kev Saib Xyuas Huab Cua Siv Raspberry Pi3 thiab DHT11 Sensor: 4 Cov Kauj Ruam

Video: Kev Saib Xyuas Huab Cua Siv Raspberry Pi3 thiab DHT11 Sensor: 4 Cov Kauj Ruam

Video: Kev Saib Xyuas Huab Cua Siv Raspberry Pi3 thiab DHT11 Sensor: 4 Cov Kauj Ruam
Video: Saib Mis paub Poj niam (hluas nkauj) tus yam ntxwv lub siab 2024, Hlis ntuj nqeg
Anonim
Kev Saib Xyuas Huab Cua Siv Raspberry Pi3 thiab DHT11 Sensor
Kev Saib Xyuas Huab Cua Siv Raspberry Pi3 thiab DHT11 Sensor

Hauv qhov kev qhia no, Kuv yuav qhia koj yuav ua li cas txuas DHT11 rau Raspberry Pi thiab tso tawm cov av noo thiab ntsuas kub mus rau LCD.

DHT11 qhov ntsuas kub thiab av noo yog qhov zoo me me uas muab cov ntsuas kub thiab av noo nyeem. Nws yooj yim heev los teeb tsa, thiab tsuas yog xav tau ib lub xaim rau cov ntaub ntawv teeb liab. Cov ntsuas no tau nrov rau siv hauv cov chaw huab cua nyob deb, saib hauv av, thiab tshuab hauv tsev

Txuas DHT11 rau Raspberry Pi

Muaj ob qhov sib txawv ntawm DHT11 koj yuav zoo li tuaj hla. Ib qho yog peb tus pin PCB mounted module thiab lwm qhov yog plaub tus pin sawv ntsug ib leeg. Tus pinout sib txawv rau txhua tus, yog li txuas DHT11 raws li qhov koj muaj:

Tsis tas li, qee qhov PCB teeb tsa cov qauv yuav muaj qhov sib txawv pinout dua li ib qho saum toj no, yog li nco ntsoov xyuas koj lub ntsuas pa rau ib daim ntawv qhia uas tus pin yog Vcc, hauv av lossis teeb liab.

Kauj Ruam 1: Cov Cheeb Tsam Yuav Tsum Tau

Cov Cheeb Tsam Yuav Tsum Tau
Cov Cheeb Tsam Yuav Tsum Tau

1. Raspberry Pi 3 Model B+:-Raspberry Pi 3 Model B+ yog cov khoom lag luam tshiab tshaj plaws hauv Raspberry Pi 3 ntau yam, khav theeb 64-ntsis quad core processor khiav ntawm 1.4GHz, dual-band 2.4GHz thiab 5GHz wireless LAN, Bluetooth 4.2/BLE, Ethernet sai dua, thiab muaj peev xwm PoE ntawm cais cais PoE HAT.

2. DHT11 Vaum/ Kub Sensor:- Qhov ntsuas no muaj qhov ntsuas ntsuas cov teeb liab digital nrog qhov ntsuas kub thiab av noo. Nws tau koom ua ke nrog kev ua haujlwm siab 8-ntsis microcontroller. Qhov ntsuas no suav nrog lub hauv paus tiv thaiv thiab lub ntsuas rau ntub NTC ntsuas cov ntsuas kub. Nws muaj qhov ua tau zoo tshaj plaws, teb tau sai, muaj peev xwm tiv thaiv kev cuam tshuam thiab ua haujlwm tau zoo.

3. 16x2 LCD Zaub (Ntsuab BackLight):- Lub 16 × 2 LCD zaub yog ib qho qauv yooj yim heev uas nquag siv hauv DIYs thiab kab hluav taws xob. 16 × 2 txhais lus o tso saib 16 tus cim ib kab hauv 2 kab ntawv ntawd. Hauv LCD no txhua tus cim tau tshwm rau hauv 5 × 7 pixel matrix.

4. Poj niam rau Poj Niam Jumper Wires.

Kauj ruam 2: Txhim Kho Lub Tsev Qiv Ntawv

Peb yuav siv Adafruit DHT11 Python lub tsev qiv ntawv. Koj tuaj yeem rub tawm lub tsev qiv ntawv siv Git, yog li yog tias koj tsis muaj Git teeb tsa ntawm koj Pi lawm, sau qhov no ntawm qhov hais kom ua sai sai:

sudo apt-tau nruab git-core

Nco tseg: Yog tias koj tau txais qhov yuam kev txhim kho Git, khiav sudo apt-tau hloov tshiab thiab sim nws dua.

Txhawm rau teeb tsa Adafruit DHT11 lub tsev qiv ntawv:

1. Sau qhov no ntawm qhov hais kom sai kom rub lub tsev qiv ntawv:

git clone

2. Hloov cov npe nrog: cd Adafruit_Python_DHT

3. Tam sim no sau qhov no: sudo apt-get install build-essential sej-dev

4. Tom qab ntawd teeb tsa lub tsev qiv ntawv nrog: sudo python3 setup.py install

Txhawm rau teeb tsa Adafruit Char LCD lub tsev qiv ntawv:

1. Sau qhov no ntawm qhov hais kom sai kom rub lub tsev qiv ntawv:

git clone

2. Hloov cov npe nrog: cd Adafruit_Python_CharLCD

3. Tom qab ntawd teeb tsa lub tsev qiv ntawv nrog: sudo python3 setup.py install

Kauj Ruam 3: Txuas Cov Txheej Txheem Ua Ke

Txuas Cov Khoom Siv Ua Ke
Txuas Cov Khoom Siv Ua Ke

LCD PIN_RS ------------------ 40 ntawm Raspberry Pi

LCD PIN_RW ------------------ 6 ntawm Raspberry Pi

LCD PIN_EN ------------------- 38 ntawm Raspberry Pi

LCD PIN_D0 ------------------- NC

LCD PIN_D1 ------------------- NC

LCD PIN_D2 ------------------- NC

LCD PIN_D3 ------------------- NC

LCD PIN_D4 ------------------- 36 ntawm Raspberry Pi

LCD PIN_D5 ------------------- 32 ntawm Raspberry Pi

LCD PIN_D6 ------------------- 24 ntawm Raspberry Pi

LCD PIN_D7 ------------------- 26 ntawm Raspberry Pi

LCD PIN_VSS ------------------ 9 ntawm Raspberry Pi

LCD PIN_VDD ------------------ 4 ntawm Raspberry Pi

DHT PIN_OUT ------------------ 7 ntawm Raspberry Pi

DHT PIN_VCC ------------------ 2 ntawm Raspberry Pi

DHT PIN_GND ------------------ 14 ntawm Raspberry Pi

Kauj ruam 4: Txoj Cai

Rub tawm cov cai txuas ntawm no thiab muab tso rau hauv koj lub rooj tsavxwm, thiab xaim txhua yam raws li qhia hauv daim duab yav dhau los.

Rub tawm tus lej:

Qhov ntawd yuav tsum hais txog npog feem ntau ntawm yam koj yuav xav tau kom DHT11 nce thiab khiav ntawm koj li Raspberry Pi. Vam tias qhov no ua rau koj yooj yim dua. Nco ntsoov sau npe yog tias koj nyiam kab lus no thiab pom nws muaj txiaj ntsig, thiab yog tias koj muaj lus nug lossis xav tau kev pab nrog dab tsi, tsuas yog tawm lus tawm hauv qab no …

Pom zoo: