Ks0129 keyestudio EASY plug DHT11 Temperature and Humidity Sensor

From Keyestudio Wiki
Jump to navigation Jump to search

EASY plug DHT11 Temperature and Humidity Sensor


thumb

Introduction

This DHT11 Temperature and Humidity Sensor features a digital temperature and humidity sensor complex with a calibrated digital signal output. It can detect temperature and humidity of the surroundings. It has excellent quality, fast response, anti-interference ability and high cost performance advantages.
Note: this module needs to be used together with EASY plug control board.


Specification

  • Interface: Easy plug
  • Supply Voltage: +5 V
  • Temperature range: 0-50 °C error of ± 2 °C
  • Humidity: 20-90% RH ± 5% RH error
  • Interface: Digital
  • Size: 42*20mm
  • Weight: 6g


Connection Diagram


thumb


Sample Code

#include <dht11.h>
dht11 DHT;
#define DHT11_PIN 10 
void setup(){
 Serial.begin(9600);
 Serial.println("DHT TEST PROGRAM ");
 Serial.print("LIBRARY VERSION: ");
 Serial.println(DHT11LIB_VERSION);
 Serial.println();
 Serial.println("Type,\tstatus,\tHumidity (%),\tTemperature (C)");
}
void loop(){
 int chk;
 Serial.print("DHT11, \t");
 chk = DHT.read(DHT11_PIN);    // READ DATA
 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;
   default:
               Serial.print("Unknown error,\t");
               break;
 }
// DISPLAT DATA
 Serial.print(DHT.humidity,1);
 Serial.print(",\t");
 Serial.println(DHT.temperature,1);
 delay(1000);
}

Resources

Datasheet

https://drive.google.com/open?id=16c0ZfBYkPR77hy53iIoWxFF7lu-q7crj

Download the libraries of dht11

https://drive.google.com/open?id=1qY8b3_gpWn53gIKmSqr1kBF1kzFQSyMC

Buy from

Official Website

http://www.keyestudio.com/keyestudio-easy-plug-dht11-temperature-humidity-sensor-module-for-arduino.html