DHT11 Humidity temperature Sensor

3 years ago 1915
  • Description
  • Documents
  • BOM
  • Attachments
  • Members
  • Comments

Description

Arduino drive the temperature and humidity sensor DHT11

Available as both a plain component or an Electronic Brick.

The photos Electronic Brick: Voltage,Signal, Ground

dht11

10k pullup resistor needed

Needs 4.7K to 10K pullup resistor from +5V to Signal pin. Connect to Arduino MEGA 2560 Digital pin 3, not Analog pin.: When the connecting cable is shorter than 20 metres, a 5K pull-up resistor is recommended; when the connecting cable is longer than 20 metres, choose a appropriate pull-up resistor as needed.

DHT11 Specifications:

Humidity measuring range: 20% ~ 9 0% RH (0-50 ? temperature compensation) Temperature measuring range: 0 ~ +50 ?C ; Humidity measuring accuracy: 5.0% RH Temperature measurement accuracy: 2.0 C Response time: (Updated by Rob Tillaart: now < 50 ms) Low power consumption

Features

single wire digital interface ( the most simple system integration, ultra-low prices ) ultra-small size ( 12X15.5X5.5 mm ) high reliability optimized long-term stability

arduino drive the DHT11

Under the article is the library

arduino code


#include 

dht DHT;

#define DHT11_PIN 3

void setup()
{
  Serial.begin(9600);
  Serial.println("DHT TEST PROGRAM ");
  Serial.print("LIBRARY VERSION: ");
  Serial.println(DHT_LIB_VERSION);
  Serial.println();
  Serial.println("Type,\tstatus,\tHumidity (%),\tTemperature (C)");
}

void loop()
{
  // READ DATA
  Serial.print("DHT11, \t");
  int chk = DHT.read11(DHT11_PIN);
  switch (chk)
  {
    case DHTLIB_OK:  
                Serial.print("OK,\t"); 
                break;
    case DHTLIB_ERROR_CHECKSUM: 
                Serial.print("Checksum error,\t"); 
                break;
    case DHTLIB_ERROR_TIMEOUT: 
                Serial.print("Time out error,\t"); 
                break;
    case DHTLIB_ERROR_CONNECT:
        Serial.print("Connect error,\t");
        break;
    case DHTLIB_ERROR_ACK_L:
        Serial.print("Ack Low error,\t");
        break;
    case DHTLIB_ERROR_ACK_H:
        Serial.print("Ack High error,\t");
        break;
    default: 
                Serial.print("Unknown error,\t"); 
                break;
  }
  // DISPLAY DATA
  Serial.print(DHT.humidity, 1);
  Serial.print(",\t");
  Serial.println(DHT.temperature, 1);

  delay(2000);
}

The output from this program to the Serial Monitor will be something like this:

DGT11 serial

Documents

DHT11 Humidity temperature Sensor

BOM

ID Name Designator Footprint Quantity
1 DHT11 U1 SNR4-2.54-15.5X12.0X5.5MM 1
2 Arduino MEGA 2560 U2 DIP 1
3 1k R1 R3 1
4 LED D1 LED3MM 1

Attachments

Filename Download
DHTlib.rar

Members

Success
The owner does not allow comments in this project now

Comments (0)

goToTop
你现在访问的是EasyEDA海外版,使用建立访问速度更快的国内版 https://lceda.cn(需要重新注册)
如果需要转移工程请在个人中心 - 工程 - 工程高级设置 - 下载工程,下载后在https://lceda.cn/editor 打开保存即可。
有问题联系QQ 3001956291 不再提醒
svg-battery svg-battery-wifi svg-books svg-more svg-paste svg-pencil svg-plant svg-ruler svg-share svg-user svg-logo-cn svg-double-arrow
We use cookies to offer you a better experience. Detailed information on the use of cookies on this website is provided in our Privacy Policy. By using this site, you consent to the use of our cookies.