[Carved] Lord to learn programming Arduino DIY (55) - DHT11 temperature and humidity sensors

Paragraph 37 and reference sensor module, widely circulated on the Internet, in fact, compatible with Arduino sensor module must be more than 37 species. Since I am on hand accumulated a number of sensors and modules, in accordance with the practice (try hands) the idea of ​​true knowledge, learning and communication for the purpose, one by one here ready to do some experiments, regardless of success, will be recorded --- small progress or do not weigh the issue, hoping to initiate. 

[Arduino] 168 kinds of sensor module series of experiments (data + Code + graphics + simulation)

Experimental fifty-five: DHT11 complex temperature and humidity sensor module (single digital communication bus)

temperature

Measure physical quantities of hot and cold objects, it is one of the seven fundamental physical quantities in the International System of Units. The temperature is between the object molecule kinetic energy level of a form. The faster the molecular motion, i.e. the higher the temperature, the more heat the object; molecular motion more slowly, i.e. the lower the temperature, the more cold objects. From the kinetic theory point of view, the object temperature is the average kinetic energy of molecular motion signs, temperature is the collective performance of thermal motion of molecules containing statistical significance. In the production and scientific research, many physical phenomena and chemical processes are carried out at a certain temperature, people's lives and it is also closely related.

humidity

Humidity long time ago there is a close relationship with life, but with a number to indicate more difficult. There humidity representation of absolute humidity, relative humidity, dew point ratio, moisture and dry gas (volume or weight) and the like. The most commonly used in daily life represents the relative humidity of the humidity of the air quantity. Expressed in% RH. On the export quantities of relative humidity and temperature are closely related. A volume of the sealed gas, the higher the temperature the lower the relative humidity, the lower the temperature, the higher the relative humidity. Involving complex thermal engineering knowledge.

The relationship between temperature and humidity with people's lives

Such as: the winter temperature of 18 to 25 ℃, humidity of 30-80%; temperature in summer 23 to 28 ℃, humidity of 30-60%. Feel comfortable in this range accounted for more than 95%. In the air-conditioned room at room temperature 19 to 24 ℃, humidity is 40-50%, people will feel most comfortable. If you take into account the effects of temperature and humidity on the human thinking activity, optimum room temperature should be high efficiency. 18 ℃, humidity should be 40 to 60%, this time, people good mental state, sharpest.

DHT11
是一款含有已校准数字信号输出的温湿度复合传感器。它应用专用的数字模块采集技术和温湿度传感技术,确保产品具有极高的可靠性与卓越的长期稳定性。传感器包括一个电阻式感湿元件和一个NTC测温元件,并与一个高性能8位单片机相连接。因此该产品具有品质卓越、超快响应、抗干扰能力强、性价比极高等优点。每个DHT11传感器都在极为精确的湿度校验室中进行校准。校准系数以程序的形式储存在OTP内存中,传感器内部在检测信号的处理过程中要调用这些校准系数。单线制串行接口,使系统集成变得简易快捷。超小的体积、极低的功耗,信号传输距离可达20米以上,使其成为各类应用甚至最为苛刻的应用场合的最佳选则。产品为4针单排引脚封装。连接方便,特殊封装形式可根据用户需求而提供。

 

 

 

模块参数

供电电压: 3.3~5.5V DC

输 出: 单总线数字信号

测量范围: 湿度 20-90%RH, 温度 0~50℃

测量精度: 湿度+-5%RH, 温度+-2℃

分 辨 率: 湿度 1%RH, 温度 1℃

长期稳定性: <±1%RH/年

 

注意事项

1、避免在结露情况下使用

2、长期保存温度 10-40℃,湿度 60%以下

3、使用时电源和地接法要正确,以免损坏传感器

 

模块电原理图

模块描述
1、可以检测周围环境的湿度和温度
2、传感器采用DHT11
3、湿度测量范围:20%-95%(0度-50度范围)湿度测量误差:+-5%
4、温度测量范围:0度-50度 温度测量误差:+-2度
5、工作电压3.3V-5V
6、输出形式 数字输出         
7、设有固定螺栓孔,方便安装
8、小板PCB尺寸:3.2cm*1.4cm
9、电源指示灯(红色)
10、每套重量约为8g

模块接口说明(3线制)
1 VCC 外接3.3V-5V
2 GND 外接GND
3 DO  小板开关数字量输出接口 接单片机IO口

模块使用事项

传感器包括一个电阻式感湿元件和一个NTC测温元件,并与一个高性能8位单片机相连接。因此该产品具有品质卓越、超快响应、抗干扰能力强、性价比极高等优点。单线制串行接口,使系统集成变得简易快捷。超小的体积、极低的功耗,信号传输距离可达20米以上,使其成为各类应用甚至最为苛刻的应用场合的最佳选则。产品连接方便,可直接插接到Arduino传感器扩展板上。

/*

【Arduino】168种传感器模块系列实验(55)

实验五十五:DHT11 温湿度复合传感器模块(数字型单总线通信)

*/

 

#include "DHT.h"  

 

#define DHTPIN 8 

#define DHTTYPE DHT11

DHT dht(DHTPIN, DHTTYPE);

 

void setup() {

  Serial.begin(9600);

  dht.begin(); 

}

 

void loop() {

  delay(2000);

  float h = dht.readHumidity();

  float t = dht.readTemperature();

  Serial.print("Humidity: ");

  Serial.println(h);

  Serial.print("Temperature: ");

  Serial.print(t);

  Serial.println(" ℃ ");

}

  

/*

【Arduino】168种传感器模块系列实验(55)

实验五十五:DHT11 温湿度复合传感器模块(数字型单总线通信)

实验程序之二

*/

#include "DHT.h"

#define DHTPIN 2     

#define DHTTYPE DHT11   

DHT dht(DHTPIN, DHTTYPE);

void setup() {

Serial.begin(9600);

Serial.println("DHTxx test!");

  dht.begin();

}

void loop() {



delay(2000);

floath = dht.readHumidity();

floatt = dht.readTemperature();

floatf = dht.readTemperature(true);



if(isnan(h) || isnan(t) || isnan(f)) {

Serial.println("Failed to read from DHT sensor!");

return;

  }

floathi = dht.computeHeatIndex(f, h);

Serial.print("Humidity: ");

  Serial.print(h);

Serial.print(" %");

Serial.print("\t");

Serial.print("Temperature: ");

  Serial.print(t);

Serial.println(" *C ");



}

  

 

 

Guess you like

Origin www.cnblogs.com/eagler8/p/12148403.html