描述
DHT11 溫度傳感器
溫度 / 濕度感應器
Raspberry Pi, Arduino, Micro:Bit 適用
尺寸:長28mm x 寬12mm x 高7.2mm
傳感器型號:奧松DHT11溫濕度傳感器
工作電壓:直流5V
特點:
1、濕度測量範圍:20—90%RH
2、濕度測量精度:±5%RH
3、溫度測量範圍:0—50℃
4、溫度測量精度:±2℃
5、工作電壓:DC5V/3.3V
6、數字信號輸出
7、數據端口帶上拉電阻
8、帶3mm固定螺絲孔,方便安裝
溫馨提示:切勿將VCC與GND接反,接反必燒!
五、接線方法:
VCC → 3.3V/5V電源正極
GND →電源負極
DATA →D3

Tutorial:
http://www.instructables.com/id/DHT11-and-Arduino-UNOThe-EASIEST-INSTRUCTABLE/
Library
https://drive.google.com/file/d/0B3b3PW7n8tipNlAyazI4MnBDUzQ/view
Sample Code To Display in Serial Monitor:
#include<dht.h>
dht DHT;
// if you require to change the pin number, Edit the pin with your arduino pin.
#define DHT11_PIN 3
void setup() {
Serial.begin(9600);
Serial.println("welcome to TechPonder Humidity and temperature Detector"); }
void loop() { // READ DATA
int chk = DHT.read11(DHT11_PIN);
Serial.println(" Humidity " );
Serial.println(DHT.humidity, 1);
Serial.println(" Temparature ");
Serial.println(DHT.temperature, 1);
delay(2000);
}
Sample Code to Display Humidity and Temparature using LCD 1602 I2C
#include <dht.h>
#include <LiquidCrystal_I2C.h>
#define DHT11_PIN 3
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); // 設定 LCD I2C 位址
dht DHT;
// if you require to change the pin number, Edit the pin with your arduino pin.
void setup() {
//Initial Serial Monitor
Serial.begin(9600);
Serial.println("HK STEM CLUB");
//Initial I2C LCD 1602
lcd.begin(16, 2); // 初始化 LCD,一行 16 的字元,共 2 行,預設開啟背光
lcd.setCursor(0, 0); // 設定游標位置在第一行行首
lcd.print("HK STEM CLUB");
lcd.setCursor(0, 1); // 設定游標位置在第二行行首
lcd.print("hkstem.club");
for(int i = 0; i < 1; i++) {
lcd.backlight(); // 開啟背光
delay(250);
lcd.noBacklight(); // 關閉背光
delay(250);
}
lcd.backlight();
}
void loop() { // READ DATA
int chk = DHT.read11(DHT11_PIN);
//Display Serial Monitor
Serial.println("Humidity " );
Serial.println(DHT.humidity, 1);
Serial.println("Temparature ");
Serial.println(DHT.temperature, 1);
//Display LCD
lcd.clear();
lcd.setCursor(0, 0); // 設定游標位置在第一行行首
lcd.print("Humidity ");
lcd.print(DHT.humidity, 1);
lcd.setCursor(0, 1); // 設定游標位置在第二行行首
lcd.print("Temparature ");
lcd.print(DHT.temperature, 1);
delay(2000);
}
micro:bit tutorial: https://sites.google.com/jes.mlc.edu.tw/ljj/microbit%E9%96%8B%E7%99%BC%E6%9D%BF/microbit%E6%84%9F%E6%87%89%E5%99%A8%E7%A9%8D%E6%9C%A8
micro:bit library:
https://github.com/lioujj/pxt-sensors
https://github.com/MonadnockSystems/pxt-dht11
micro:bit sample code
商品評價
目前沒有評價。