How to Connect DHT11 Sensor with Arduino Uno | Temperature & Humidity Sensor Tutorial

Опубликовано: 18 Июнь 2026
на канале: khurafati Labs
36
1

Namaste Doston! 🛠️ Welcome back to Khurafati Labs.

Ever wondered exactly how hot or humid your room is? Today, we are integrating the DHT11 Digital Sensor with an Arduino Uno. Unlike simple analog sensors, the DHT11 sends a complex digital signal containing both Temperature and Humidity data!

What you will learn in this video:
✅ Identifying the pins of the DHT11 (VCC, Data, GND).
✅ Why we need a "Library" to talk to this digital sensor.
✅ Reading real-time Temperature in Celsius and Humidity in percentage (%).
✅ Monitoring the environment live on your Serial Monitor.

Want to build this yourself?
Get the complete Khurafati Robotics Starter Kit with 30+ components and free video guides!
🔗 Order Here: https://khurafatilabs.com/robotics-st...
🔗 Order from Amazon: https://www.amazon.in/Robotics-Beginn...

Follow us for more "Khurafati" projects:
Instagram:   / khurafatilabs  
Subscribe for the full Robotics Playlist!

#Arduino #DHT11 #WeatherStation #RoboticsIndia #KhurafatiLabs #STEM #IoT #DIYProjects #ElectronicsIndia #ArduinoTutorial #temperaturesensor

Circuit Connections:
VCC ⮕ Arduino 5V
GND ⮕ Arduino GND
Data Pin ⮕ Arduino Digital Pin 2

Code for the Project:
(Note: Please install the 'DHT sensor library' by Adafruit from the Library Manager first)

// DHT11 Integration - Khurafati Labs
#include "DHT.h"

#define DHTPIN 2
#define DHTTYPE DHT11

DHT dht(DHTPIN, DHTTYPE);

void setup() {
Serial.begin(9600);
Serial.println("Khurafati Labs: Initializing Weather Station...");
dht.begin();
}

void loop() {
// Wait 2 seconds between measurements as DHT11 is slow
delay(2000);

float h = dht.readHumidity();
float t = dht.readTemperature();

// Check if reading failed
if (isnan(h) || isnan(t)) {
Serial.println("Error: Could not read from sensor!");
return;
}

Serial.print("Humidity: ");
Serial.print(h);
Serial.print("% | Temperature: ");
Serial.print(t);
Serial.println("C");
}