Cov txheej txheem:

DHT 11 Siv Siv Arduino: 5 Kauj Ruam
DHT 11 Siv Siv Arduino: 5 Kauj Ruam

Video: DHT 11 Siv Siv Arduino: 5 Kauj Ruam

Video: DHT 11 Siv Siv Arduino: 5 Kauj Ruam
Video: Basic IoT Ecosystem Security 2024, Kaum ib hlis
Anonim
DHT 11 Siv Siv Arduino
DHT 11 Siv Siv Arduino

Hais, Hauv cov lus qhia no peb yuav ua DHT 11 siv arduino thiab saib xyuas ntu. DHT11 yog lub hauv paus, tus nqi qis heev cov ntsuas kub thiab cov av noo. Nws siv lub ntsuas hluav taws xob muaj peev xwm thiab lub ntsuas cua ntsuas cua ib puag ncig, thiab ntuav tawm lub teeb liab digital ntawm cov ntaub ntawv tus pin (tsis xav tau cov tswv yim sib txuas pins xav tau). Nws yooj yim siv, tab sis yuav tsum tau ua tib zoo siv sijhawm txhawm rau khaws cov ntaub ntawv. Cov ntsuas no tau nrov heev rau cov nyiam siv hluav taws xob vim tias muaj pheej yig heev tab sis tseem muab kev ua tau zoo.

Kauj Ruam 1: Yam Yuav Tsum Tau

Yam Yuav Tsum Tau
Yam Yuav Tsum Tau
Yam Yuav Tsum Tau
Yam Yuav Tsum Tau
Yam Yuav Tsum Tau
Yam Yuav Tsum Tau

Arduino. (qhov no kuv siv arduino uno r3)

DHT 11 sensor.

Ob peb ntawm cov xov hlau.

Kauj ruam 2: Txuas Txuas

Txuas Txuas!
Txuas Txuas!
Xov Tooj!
Xov Tooj!

Txuas DHT 11 rau arduino los ntawm kev siv cov lej no. Nco ntsoov tias koj tab tom txuas rau tus pin sab xis ntawm DHT 11.

Kauj ruam 3: Code

Code
Code

#suav nrog

dht DHT;

// yog tias koj xav hloov tus lej tus lej, Kho tus pin nrog koj tus pin arduino.

#define DHT11_PIN 2

void teeb tsa () {

Serial.begin (9600);

Serial.println ("Pib Txheeb Xyuas"); }

void loop () {// NYEEM DATA

int chk = DHT.read11 (DHT11_PIN);

Serial.println ("Vaum");

Serial.println (DHT.humidity, 1);

Serial.println ("Temparature");

Serial.println (DHT.temperature, 1);

ncua (2000); }

Kauj Ruam 4: Nruab Dht Library

yam tsis txhim kho tsev qiv ntawv dht nws yuav tsis ua haujlwm yog li rub tawm cov ntawv zip thiab;

* Mus rau arduino IDE

*Kos duab

*Suav nrog tsev qiv ntawv

*Ntxiv zip file

*xaiv cov ntawv zip

Kauj Ruam 5: Xaus

Xaus
Xaus

Yog tias koj tau txuas koj li Dht11 thiab arduino kom raug, koj yuav muaj nyeem hauv cov duab saum toj no.

Kuv vam tias koj txhua tus hlub kuv cov lus qhia.

Pom zoo: