Home / Wiki / Sensor / Environment


DHT11 Sensor has the function of measuring temperature and humidity, temperature & humidity sensor complex with a calibrated digital signal output. By using the exclusive digital-signal-acquisition technique and temperature & humidity sensing technology, it ensures high reliability and excellent long-term stability. This sensor includes a resistive-type humidity measurement component and an NTC temperature measurement component, and connects to a high-performance 8-bit microcontroller, offering excellent quality, fast response, anti-interference ability and cost-effectiveness.

Each DHT11 element is calibrated in the laboratory that is extremely accurate on humidity calibration. The calibration coefficients are stored as programs in the OTP memory, which are used by the sensor’s internal signal detecting process. The single-wire serial interface makes system integration quick and easy. Its small size, low power consumption and up-to-20 meters signal transmission making it the best choice for various applications, including those most demanding ones. The component is 4-pin single row pin package. It is convenient to connect and special packages can be provided according to users’ request.


Technical Data

VCC: 3.3 to 5V

Measuring range:

Humidity: 20% to 90% RH

Temperature: 0 to 50℃


Humidity: ±1%

Temperature: ±1℃

Signal collecting period: 2s

Sample cycle time: 2s




Resolution: 16-bit

Repeat: ±1%RH

Interchangeability: absolutely

Response time: 1/e(63%) 25 6s

1 m/s air: 6s

Relay: <±0.3% RH

Long term relay: <±0.5% RH/yr


Resolution: 16-bit

Repeat: ±1

Accuracy: 25 ±2

Response time: 1/e (63%) 10s



Connect data pin (pin 2) to Arduino’s pin 5



// Example testing sketch for various DHT humidity/temperature sensors


#include "DHT.h"


#define DHTPIN 5     // what pin we're connected to


// Uncomment whatever type you're using!

#define DHTTYPE DHT11   // DHT 11

//#define DHTTYPE DHT22   // DHT 22  (AM2302)

//#define DHTTYPE DHT21   // DHT 21 (AM2301)


// Connect pin 1 (on the left) of the sensor to +5V

// Connect pin 2 of the sensor to whatever your DHTPIN is

// Connect pin 4 (on the right) of the sensor to GROUND

// Connect a 10K resistor from pin 2 (data) to pin 1 (power) of the sensor




void setup() {


  Serial.println("DHTxx test!");





void loop() {

  // Reading temperature or humidity takes about 250 milliseconds!

  // Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)

  float h = dht.readHumidity();

  float t = dht.readTemperature();


  // check if returns are valid, if they are NaN (not a number) then something went wrong!

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

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

  } else {

    Serial.print("Humidity: ");


    Serial.print(" %\t");

    Serial.print("Temperature: ");


    Serial.println(" *C");