Bird
0
0
Arduinoprogramming~3 mins

Why Humidity and temperature (DHT11/DHT22) in Arduino? - Purpose & Use Cases

Choose your learning style9 modes available
The Big Idea

What if your project could 'feel' the air around it and act all by itself?

The Scenario

Imagine you want to measure the air temperature and humidity in your room using simple sensors. Without special tools, you might try guessing or using separate devices and writing down numbers by hand.

The Problem

Manually checking temperature and humidity is slow and can be inaccurate. Writing down numbers wastes time and can lead to mistakes. You can't easily track changes over time or react quickly to the environment.

The Solution

Using DHT11 or DHT22 sensors with Arduino lets you automatically read temperature and humidity values. The sensors send data directly to your program, which can display, log, or use it instantly without errors or delays.

Before vs After
Before
// No code, just guessing or writing numbers by hand
After
#include <DHT.h>
#define DHTPIN 2
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);

void setup() {
  Serial.begin(9600);
  dht.begin();
}

void loop() {
  float h = dht.readHumidity();
  float t = dht.readTemperature();
  Serial.print("Humidity: " + String(h) + "% Temperature: " + String(t) + "C");
  delay(2000);
}
What It Enables

You can build smart projects that sense and respond to the environment automatically and accurately.

Real Life Example

For example, a plant watering system that checks soil humidity and air temperature to water plants only when needed, saving water and keeping plants healthy.

Key Takeaways

Manual tracking of temperature and humidity is slow and error-prone.

DHT11/DHT22 sensors automate reading these values with Arduino.

This enables smart, responsive projects that react to real-world conditions.