목차
디지털 온습도 센서 특징
- Model : DHT11
- Power supply : 3 ~ 5.5V
- Output signal : digital signal via single-bus
- Sensing element : Polymer resistor
- Measuring range : humidity 20-90%RH; temperature 0-50 Celsius
- Accuracy : humidity +-4%RH (Max +-5%RH); temperature +-2.0Celsius
- Resolution orsensitivity : humidity 1%RH; temperature 0.1Celsius
- Repeatability : humidity +-1%RH; temperature +-1Celsius
- Humidity hysteresis : +-1%RH
- Long-term Stability : +-0.5%RH/year
- Sensing period : Average: 2s
- Interchangeability : fully interchangeable
- Dimensions size : 12*15.5*5.5mm
사이즈

데이터시트
DHT11 디지털 온습도 센서 모듈로 온도, 습도를 읽어 올수 있습니다.
형태1

| 번호 | 핀명 | I/O | 기능 |
|---|---|---|---|
| 1 | S | Sensor Output | 센서 디지털 출력 |
| 2 | + | VCC | VCC |
| 3 | – | GND | GND |
형태2

| 핀명 | I/O | 기능 |
|---|---|---|
| GND | GND | GND |
| DATA | Sensor Output | 센서 디지털 출력 |
| VCC | VCC | VCC |
실험
핀 연결
| 번호 | UNO R3 |
|---|---|
| 1 | 2 |
| 2 | 5V |
| 3 | GND |

소스코드
최신 소스코드는 [파일]=>[예제]=> [WhiteAT UNO]=> [Starter] => [13_DHT11] 에 있으며
라이브러리는 아두이노 개발환경 을 참조하세요

/*
알찬 아두이노 세트(입문자용) 중
UNO 와 디지털 온도 센서 예제입니다.
알찬 아두이노 세트(입문자용): https://kit128.com/goods/view?no=133
개별 부품
.UNO R3 : https://kit128.com/goods/view?no=337
.DHT11 - 아두이노 디지털온습도 센서 모듈 : https://kit128.com/goods/view?no=132
출처: http://whiteat.com/Arduino
*/
#include <DHT11.h>
int DHT_DATA_PIN = PA_0;
Dht11 dht11(DHT_DATA_PIN);
int err;
float temp, humi;
// 프로그램 시작 - 초기화 작업
void setup()
{
Serial.begin(115200); // 시리얼 통신 초기화
Serial.println("Arduino Examples - Digital Temperature/Humidity Sensor");
Serial.println(" https://docs.whiteat.com/?p=2294");
}
// 계속 실행할 무한 루프
void loop()
{
if ((err = dht11.read(humi, temp)) == 0)
{
Serial.print("Humidity (%): ");
Serial.println(humi);
Serial.print("Temperature (C): ");
Serial.println(temp);
}
else
{
Serial.println();
Serial.print("Error No :");
Serial.print(err);
Serial.println();
}
delay(DHT11_RETRY_DELAY);
}
결과 화면

제품 구매
알찬 아두이노 키트는 https://kit128.com/goods/view?no=133 에서 구매하실 수 있습니다.
.
