DHT12 數字溫濕度感測器模組 單總線 和 I2C 通信 DHT11升級版
台灣智能感測科技官網, 購買更多關於 DHT11, Humidity, Temperature, 溫度, 溫度感測, 溫溼度, 溫溼度感測器, 濕度, 濕度感測器, 的產品




產品編號: SNT-002193
DHT12 數字溫濕度感測器模組 單總線 和 I2C 通信 DHT11升級版
DHT12 數字溫濕度感測器模組 是經典 DHT11 濕度溫度傳感器的升級版本,它完全向下兼容,更精確並增加了I2C接口。
1. 可以檢測周圍環境的濕度和溫度
2. 傳感器採用DHT12,支持單總線和I2C通訊
3. 濕度測量範圍:20%-95%(0度-50度範圍)濕度測量誤差:+-5%
4. 溫度測量範圍:0度-50度溫度測量誤差:+-2度
5. 工作電壓2.7V-5.5V
6. 輸出形式數字輸出
7. 設有固定螺栓孔,方便安裝
8. 小板PCB尺寸:2.1cm * 1.3cm
模塊接口說明(4線製)
1. VCC外接2.7V-5.5V
2. SDA串行數據,雙向口
3. GND外接GND
4. SCL串行時鐘,輸入口(單總線時接地)
特徵:
體積小巧
低功耗
低電壓工作
標準I2C和 1線 接口。
感應範圍
溫度:-20〜+ 60℃ 濕度:20-95 RH
濕度:分辨率:0.1%RH
重複: - + 1%RH
精度25℃@ - + 5RH
溫度:分辨率:0.1C
重複: - + 0.2C
精度: 25C @ - + 0.5C
功率:DC 2.7-5.5V
正常電流1mA
待機電流60uA
採樣週期:> 2秒
引腳接口:1. VDD 2. SDA 3. GND 4. SCL(作為1線使用時連接至GND)
如何將DHT12連接到Arduino Uno arduino和 dht12
DHT22 函數庫下載 https://github.com/xreef/DHT12_sensor_library
#include "Arduino.h"
#include <DHT12.h>
// Set dht12 i2c comunication on default Wire pin
DHT12 dht12;
void setup()
{
Serial.begin(112560);
// Start sensor handshake
dht12.begin();
}
int timeSinceLastRead = 0;
void loop()
{
// Report every 2 seconds.
if(timeSinceLastRead > 2000) {
// Reading temperature or humidity takes about 250 milliseconds!
// Read temperature as Celsius (the default)
float t12 = dht12.readTemperature();
// Read temperature as Fahrenheit (isFahrenheit = true)
float f12 = dht12.readTemperature(true);
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h12 = dht12.readHumidity();
bool dht12Read = true;
// Check if any reads failed and exit early (to try again).
if (isnan(h12) || isnan(t12) || isnan(f12)) {
Serial.println("Failed to read from DHT12 sensor!");
dht12Read = false;
}
if (dht12Read){
// Compute heat index in Fahrenheit (the default)
float hif12 = dht12.computeHeatIndex(f12, h12);
// Compute heat index in Celsius (isFahreheit = false)
float hic12 = dht12.computeHeatIndex(t12, h12, false);
// Compute dew point in Fahrenheit (the default)
float dpf12 = dht12.dewPoint(f12, h12);
// Compute dew point in Celsius (isFahreheit = false)
float dpc12 = dht12.dewPoint(t12, h12, false);
Serial.print("DHT12=> Humidity: ");
Serial.print(h12);
Serial.print(" %t");
Serial.print("Temperature: ");
Serial.print(t12);
Serial.print(" *C ");
Serial.print(f12);
Serial.print(" *Ft");
Serial.print(" Heat index: ");
Serial.print(hic12);
Serial.print(" *C ");
Serial.print(hi
更多關於 DHT12 數字溫濕度感測器模組 單總線 和 I2C 通信 DHT11升級版 的技術文件與範例