Cov txheej txheem:

DHT11 Nrog Arduino: 4 Kauj Ruam
DHT11 Nrog Arduino: 4 Kauj Ruam

Video: DHT11 Nrog Arduino: 4 Kauj Ruam

Video: DHT11 Nrog Arduino: 4 Kauj Ruam
Video: КАК ИЗМЕРИТЬ ТЕМПЕРАТУРУ И ВЛАЖНОСТЬ. ДАТЧИКИ DHT11 И DHT22 [Уроки Ардуино #13] 2024, Kaum ib hlis
Anonim
DHT11 Nrog Arduino
DHT11 Nrog Arduino

DHT11 yog lub peev xwm ntsuas pom ya raws thiab huab cua ib puag ncig kub nrog kev ntsuas ntsuas digital. Qib ntawm qhov raug rau cov av noo ntawm kwv yees li 5% RH thiab qhov ntsuas qhov kub yog kwv yees li 2'C. DHT11 siv Ib Leeg-Hlau Ob-Txoj Kev sib txuas lus, uas yog ib tus pin uas tau siv rau 2 daim ntawm kev sib txuas lus tig.

Nov yog kev qhia ntawm DHT11 nrog Arduino.

Kauj Ruam 1: Cov Khoom Koj Xav Tau

Koj yuav xav tau:

  1. DHT11 Sensor Module
  2. Arduino Uno R3
  3. Jumper Hlau

Kauj ruam 2: Pin Out

Pin Tawm
Pin Tawm
  1. - DHT11 GND Arduino
  2. tawm DHT11 A0 Arduino
  3. + DHT11 + 5V Arduino

Koj tuaj yeem rub tawm lub tsev qiv ntawv ntawm DHT11 Sensor Module hauv qhov txuas no.

Kauj ruam 3: Code

Code
Code

#suav nrog

dht DHT11;

#define DHT11_PIN A0

void teeb tsa () {

Serial.begin (9600);

Serial.println ("DHT11 SFE Electronics");

}

void voj () {

int chk = DHT11.read11 (DHT11_PIN);

Serial.print ("Vaum");

Serial.print (DHT11.humidity, 1);

Serial.print ("");

Serial.print ("Temparature");

Serial.println (DHT11.temperature, 1);

ncua (2000);

}

Pom zoo: