How does work DHT 11 sensor with the Arduino

        Hello guys, Welcome back to another article from SriTu Hobby. Today we are going to talk about the DHT11 sensor. Let’s first see what is a DHT11 sensor. Primarily we can measure both temperature and humidity through this. You can use this sensor for home ecosystems, farm, and garden monitoring systems. 

Let us now see how this sensor works.

How to measure Temperature

The temperature is measured by a temperature gauge called NTC embedded in the DHT11 sensor.

How to measure Humidity

The DHT 11 sensor incorporates a substrate containing surface moisture and electrons to measure the humidity level. When water vapor is absorbed from the substrate, ions are released from the substrate, increasing the conductivity between the electrodes. The difference in resistance between the two electrodes is proportional to the relative humidity. Higher relative humidity reduces the resistance between the electrodes and lowers relative humidity increases the resistance between the electrodes. The amount of water vapor can be measured by the electrical resistance between the two electrodes.

DHT 11 sensor details

  • Humidity readings with 5% accuracy.
  • Temperature readings ±2°C accuracy.
  • Body size 15.5mm x 12mm x 5.5mm.
  • 2.5mA max current use.
  • Low cost.
We can see this DHT11 sensor in the market in two ways. We will identify these two types separately.
Here we can see four main pins. Of these, we only need three pins. This cannot be used directly for our project. A pull-up resistor should be used for that. For that, we can use a 10k resistor. The DATA pin must be connected to the VCC pin.
This is a module that incorporates a DHT11 sensor and is easy to use, as it does not require an external pull-up resistor.
Well now let’s test the functionality here using the sensor we first introduced. The accessories required for this are below. They can be easily purchased from the links below.
OK let’s do this project step by step.

Step 1

First, identify these components.

Arduino UNO board.

DHT11 sensor.

10k Resistor



Jumper wires.

Step 2

Now connect these components using the circuit diagram below. You can connect this sensor to any digital pin or analog pin.
How does work DHT 11 sensor with the Arduino

Step 3

Now let’s look at the code required for this. For this, we first need the DHT11 Library. Download it from this link and install it on the Arduino IDE.
The complete program of this project – Download
/*how to work DHT11 sensor.
  Serial monitor readings.
  created by the SriTu Tech team.
  Read the code below and use it for any of your creation
#include <DHT.h> DHT value(2,DHT11);
void setup() {   Serial.begin(9600);   value.begin(); } void loop() {   double h = value.readHumidity();//get humidity   double t = value.readTemperature();//get tempereture   Serial.print("Humidity = ");   Serial.print(h);//print humidity   Serial.print("t");//tab space   Serial.print("Temperature = ");   Serial.println(t);//print temperature   delay(1000);//delay }
In this code, the library is included first. We then create an object called “value” and enter the name of the sensor we are using and the pins associated with the sensor.
#include <DHT.h>
DHT value(2,DHT11);

After, this sensor and Serial monitor are begun in the VOID setup.

void setup() {

Next, read the temperature and humidity values of the Void loop and include those values into two double variables. Finally, the values are displayed on the serial monitor.

void loop() {
  double h = value.readHumidity();//get humidity
  double t = value.readTemperature();//get tempereture
  Serial.print(“Humidity = “);
  Serial.print(h);//print humidity
  Serial.print(“t”);//tab space
  Serial.print(“Temperature = “);
  Serial.println(t);//print temperature

Step 4

Now we have to upload this program to the Arduino board. After selecting the correct board and port, upload it. The full video guide is below.

How does work DHT 11 sensor with the Arduino

Leave a Comment

Your email address will not be published. Required fields are marked *

Shopping Cart
Scroll to Top