Same-day dispatch before 2 PM · Free delivery over ₹999 · GST invoices Get the appPrices incl. GST
Geekobot
Snap & SendNEWGeeko AIWhere's myOrder
Log in
Products
  • Projects
    • Component guidesHow parts work, with code you can run
    • Learning pathsFrom your first LED to your first robot
    • Workshops & eventsOnline sessions for makers and classes
    • ElectrolarkFree guided builds, simulator and certificates
    • Students & teachersStudent discount and classroom help
    • CommunityShare builds and ask other makers
    • CalculatorsOhm's law, LED resistor, 555 and 100+ more
    • Circuit builderWire parts and run the circuit, powered by Electrolark
    • Geeko AIAsk what to buy or how to wire it
    • Snap & SendPhotograph a part or list, we find it
    • Part finderAnswer a few questions, get the right part
    • Compatibility checkWill these two parts work together?
    • Compare partsSpecs side by side
    • Business & bulk ordersGST invoices, credit and volume prices
    • Request a quotationSend your list, get a quote
    • Classroom kitsPer-student kits and lab bundles
    • Gift cardsFor students, teams and events
  • Atal Tinkering Lab
BOM to cart
Geekobot

Components, kits and know-how for makers, students, engineers, labs and businesses across India.

Ask Geeko AIOrders, parts and projects, any timeEmail supportReply within 1 working dayGet the Geekobot appAdd it to your home screen, free

Follow us

Shop

  • Boards & SBCs
  • Sensors & Modules
  • IoT & Wireless
  • Drone & FPV
  • 3D Printing
  • Filaments & Resins
  • Motors & Drivers
  • Power & Batteries
  • Semiconductors
  • Passive
  • Displays & LEDs
  • Switches & Relays
  • Wires & Cables
  • Prototyping
  • Tools & Test
  • Robotics
  • STEM Kits
  • Atal Tinkering Lab
  • Mechanical Parts
  • Audio

Orders

  • Track your order
  • Help & support
  • Shipping and delivery
  • Refunds and cancellation
  • Contact us

Learn

  • Projects
  • Geeko AI project assistant
  • Learning paths
  • Guides
  • Calculators
  • Electrolark: free guided builds

Part tools

  • Part finder
  • Compare parts
  • Will it work with my board?

Institutions

  • Classroom kits
  • Atal Tinkering Lab
  • Students & teachers
  • Workshops & Events

Business

  • Business & education
  • Request a quotation
  • BOM bulk upload
  • Quick order by SKU

Company

  • About Geekobot
  • Community
  • Gift cards
  • Terms & conditions
  • Privacy policy
  • Product directory
  • Sitemap

© 2026 Geekobot, a trade name of OLatus Systems Private Limited. All rights reserved.

20, 1st Floor, Neeladri Complex, 10th Cross, Sampige Rd, 2nd Main, Malleshwaram, Bengaluru, Karnataka 560003 · GSTIN 29AACCO0462F1ZM

+91 91810 15607 · connect@geekobot.in · Monday to Saturday, 10 AM to 2 PM IST

UPI · CARDS · NETBANKING · GST INVOICES

ShopProjectsGeeko AIGuides
Compare 0 parts →
Log in

Shop by category

Shop all components
  • Boards & SBCs1,910 products
    • Alternative Single Board Computers
    • Arduino Ecosystem
    • FPGA & Logic Boards
    • Microcontroller & Wireless Boards
    View all
  • Sensors & Modules4,701 products
    • Biomedical & Heart Rate
    • Current, Voltage & Power
    • Force, Weight & Pressure
    • Gas, Weather & Environmental
    View all
  • IoT & Wireless2,314 products
    • RF Modules
    • RFID & NFC
    • Antennas & RF Accessories
    • Cameras & Smart Vision
    View all
  • Drone & FPV3,558 products
    • Flight Control & Navigation
    • FPV Video & Optics
    • Frames & Structural Parts
    • Motors & Propulsion
    View all
  • 3D Printing2,204 products
    • 3D Printers
    • 3D Scanners & Digitizers
    • Laser Engravers & Cutters
    • Material Management & Upgrades
    View all
  • Filaments & Resins1,472 products
    • Filaments
    • Photopolymer Resins
    View all
  • Motors & Drivers463 products
    • BLDC Motor Drivers
    • DC & Geared Motors
    • DC Motor Drivers
    • Linear Actuators & Solenoids
    View all
  • Power & Batteries557 products
    • Battery Holders & Connectors
    • Breadboard Power
    • Chargers & BMS
    • DC-DC Converters
    View all
  • Semiconductors295 products
    • Diodes & Rectifiers
    • Interface & RF Encoder ICs
    • Logic ICs (74xx)
    • Logic ICs (CD4000)
    View all
  • Passive67 products
    • Capacitors
    • Circuit Protection
    • Crystals & Oscillators
    • Inductors
    View all
  • Displays & LEDs572 products
    • 7-Segment & Dot Matrix
    • Addressable LEDs
    • Character LCDs
    • Graphic LCDs
    View all
  • Switches & Relays184 products
    • Keypads & Touch
    • Push Buttons & Tactile
    • Relay Modules
    • Relays
    View all
  • Wires & Cables233 products
    • Board-to-Wire Connectors
    • Crimp & Splice
    • Headers & Dupont
    • Heat Shrink & Sleeving
    View all
  • Prototyping101 products
    • Breadboards
    • Interface Modules
    • PCBs & Perfboards
    View all
  • Tools & Test717 products
    • Bench Power Supplies
    • Hand Tools
    • Measuring Tools
    • Meters & Testers
    View all
  • Robotics180 products
    • Humanoid & Legged Robots
    • Robot Chassis & Platforms
    • Robotic Arms & Grippers
    • Wheels & Casters
    View all
  • STEM Kits268 products
    • Arduino Learning Kits
    • Coding & IoT Kits
    • Early Coding (Ages 3-8)
    • Invention Kits
    View all
  • Atal Tinkering Lab196 products
    • Package 1: Electronics, Robotics, IoT and Sensors
    • Package 2: Rapid Prototyping Tools
    • Package 3: Mechanical, Electrical and Measurement Tools
    • Package 4: Power Supply, Accessories and Safety Equipment
    View all
  • Mechanical Parts212 products
    • Bearings
    • Brackets & Mounts
    • Couplers
    • Fasteners & Standoffs
    View all
  • Audio109 products
    • Amplifier Modules
    • Buzzers & Sirens
    • Speakers
    View all
  1. Home
  2. ›Guides
  3. ›Sensors
  4. ›DHT11 vs DHT22
Step 1 of 18 in Sensors and measurementPart of a learning path.
Next

Comparison · Beginner · 3 min read

DHT11 vs DHT22

Which Temperature and Humidity Sensor?

By Geekobot Learning Team · Updated 24 Oct 2026

On this page
Short answerDHT11 vs DHT22 comparison tableHow to wire a DHT11 or DHT22Read a DHT22 with Arduino or ESP32When to choose a BME280, SHT31 or AHT20 insteadCommon mistakesFAQsParts and next steps
Short answer

Choose the DHT22 (also sold as AM2302) for most projects: it measures -40 to 80 °C to ±0.5 °C and 0 to 100% humidity to about ±2 to 5%. The cheaper DHT11 covers only 0 to 50 °C at ±2 °C and 20 to 80% humidity, so it suits classroom demos. Both use one data pin with a 10 kΩ pull-up and run on 3.3 or 5 V.

Key specs at a glance

Interface
Single-wire digital (proprietary), one data pin
Supply
DHT11: 3 to 5.5 V; DHT22: 3.3 to 6 V
Pull-up
4.7 to 10 kΩ on DATA (included on most modules)
Read rate
DHT11: once per second; DHT22: once every 2 seconds
Library
DHT sensor library (Adafruit) for Arduino and ESP32; dht module in MicroPython
01

DHT11 vs DHT22 comparison table

DHT11DHT22 / AM2302
Temperature range0 to 50 °C-40 to 80 °C
Temperature accuracy±2 °C±0.5 °C
Humidity range20 to 80% RH (some datasheets 20 to 90%)0 to 100% RH
Humidity accuracy±5% RH±2% RH typical, ±5% max
Resolution1 °C, 1% RH0.1 °C, 0.1% RH
Sampling1 Hz0.5 Hz
Case colourBlueWhite
Best forLearning, rough indoor readingsWeather stations, greenhouses, incubators
Temperature range
DHT11:
0 to 50 °C
DHT22 / AM2302:
-40 to 80 °C
Temperature accuracy
DHT11:
±2 °C
DHT22 / AM2302:
±0.5 °C
Humidity range
DHT11:
20 to 80% RH (some datasheets 20 to 90%)
DHT22 / AM2302:
0 to 100% RH
Humidity accuracy
DHT11:
±5% RH
DHT22 / AM2302:
±2% RH typical, ±5% max
Resolution
DHT11:
1 °C, 1% RH
DHT22 / AM2302:
0.1 °C, 0.1% RH
Sampling
DHT11:
1 Hz
DHT22 / AM2302:
0.5 Hz
Case colour
DHT11:
Blue
DHT22 / AM2302:
White
Best for
DHT11:
Learning, rough indoor readings
DHT22 / AM2302:
Weather stations, greenhouses, incubators
02

How to wire a DHT11 or DHT22

Bare sensors have four pins; modules have three.

VCC

3.3 V or 5 V. Use 5 V on long cables for a stronger signal.

DATA

any digital pin, with a 10 kΩ pull-up to VCC (already fitted on three-pin modules).

NC

pin 3 on the bare sensor, not connected.

GND

ground.

On an ESP32 or Pico, power the sensor from 3.3 V so the data line never exceeds 3.3 V.

03

Read a DHT22 with Arduino or ESP32

Install DHT sensor library by Adafruit (it also installs Adafruit Unified Sensor), then:

DHT22 temperature and humidity · Arduino C++Verify & upload in Electrolark
#include <DHT.h>

#define DHTPIN 4        // data pin
#define DHTTYPE DHT22   // change to DHT11 if needed

DHT dht(DHTPIN, DHTTYPE);

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

void loop() {
  delay(2000);                       // DHT22 needs 2 s between reads
  float h = dht.readHumidity();
  float t = dht.readTemperature();   // Celsius
  if (isnan(h) || isnan(t)) {
    Serial.println("Read failed, check wiring");
    return;
  }
  Serial.printf("%.1f C  %.1f %%RH\n", t, h);   // ESP32; use print() on an Uno
}
04

When to choose a BME280, SHT31 or AHT20 instead

DHT sensors are cheap and simple, but their timing-sensitive protocol can fail on busy Wi-Fi boards, and they drift in very humid places. I2C sensors avoid both problems:

SensorMeasuresAccuracyInterface
AHT20Temperature, humidity±0.3 °C, ±2% RHI2C
SHT31Temperature, humidity±0.3 °C, ±2% RHI2C
BME280Temperature, humidity, pressure±1 °C, ±3% RH, ±1 hPaI2C or SPI
DS18B20Temperature only (waterproof probes)±0.5 °C1-Wire
AHT20
Measures:
Temperature, humidity
Accuracy:
±0.3 °C, ±2% RH
Interface:
I2C
SHT31
Measures:
Temperature, humidity
Accuracy:
±0.3 °C, ±2% RH
Interface:
I2C
BME280
Measures:
Temperature, humidity, pressure
Accuracy:
±1 °C, ±3% RH, ±1 hPa
Interface:
I2C or SPI
DS18B20
Measures:
Temperature only (waterproof probes)
Accuracy:
±0.5 °C
Interface:
1-Wire
05

Common mistakes to avoid

  • !Reading a DHT22 more often than every 2 seconds; it returns stale values or NaN.
  • !Choosing DHT22 in the code for a DHT11 (or the reverse); readings look plausible but wrong.
  • !Mounting the sensor next to the microcontroller or regulator, which warms it by 1 to 3 °C.
  • !Running long thin cables without a stronger pull-up or 5 V supply.
  • !Leaving it in direct sun or rain; it needs a ventilated radiation shield outdoors.
06

Frequently asked questions

Is DHT22 better than DHT11?

Yes, for accuracy and range. The DHT22 is about four times more accurate for temperature, covers sub-zero and full humidity ranges, and gives decimal readings. The DHT11 is cheaper and reads slightly faster.

Is AM2302 the same as DHT22?

Yes. AM2302 is the wired version of the same sensor from Aosong, usually supplied with leads and a built-in pull-up.

Does the DHT22 need a resistor?

Yes, a 4.7 to 10 kΩ pull-up between DATA and VCC. Three-pin modules already include it.

Can I use a DHT22 with an ESP32 at 3.3 V?

Yes. It is rated from 3.3 V. Keep the cable short, and power it from 3.3 V so the data line stays within the ESP32's limits.

How accurate is the DHT11 for humidity?

About ±5% RH between 20% and 80%, and it reads in 1% steps. It is fine for showing comfortable versus damp, not for lab-grade logging.

Parts for this guide

  • Resistor Assortment Kit (30 Values)
    ₹33View
Shop Gas & Weather Sensors

Terms in this guide

Pull-up resistorA resistor from a signal line to the supply that keeps the line high when nothing pulls it low.Relative humidityThe amount of water vapour in air as a percentage of the maximum it can hold at that temperature.I2CInter-Integrated Circuit: a two-wire bus (SDA and SCL) that connects many devices by address.GPIOGeneral-purpose input/output: a microcontroller pin that your code can read or drive.

Projects that use it

Put this into practice: 167 step-by-step builds in our project library use parts from this guide.

Beginner · 1–2 hoursTemperature-controlled fanView projectIntermediate · 2 hoursGreenhouse humidity controllerView projectBeginner · 1–2 hoursMini weather station with OLEDView project
Browse all 167 projects

Keep learning

Component guideBeginnerESP32 GuideThe ESP32 is a low-cost 3.3 V microcontroller from Espressif with built-in Wi-Fi and Bluetooth, used for IoT devices, smart-home controllers and web dashboards.5 min read · Boards & MicrocontrollersComponent guideBeginnerArduino UnoThe Arduino Uno is a beginner-friendly microcontroller board that reads sensors and controls LEDs, motors and relays using simple C++ programs called sketches.5 min read · Boards & MicrocontrollersConcept explainerIntermediateI2C ExplainedI2C is a two-wire bus that lets one microcontroller talk to many sensors and displays using a data line (SDA) and a clock line (SCL).4 min read · Electronics FundamentalsHow-toBeginnerSSD1306 OLED DisplayThe SSD1306 is the driver chip in most small monochrome OLED displays, such as the popular 0.96 inch 128x64 module.3 min read · Displays & LEDs

Sources

  • DHT11 humidity and temperature sensor datasheet (Aosong / Mouser)
  • AM2302 / DHT22 datasheet (Aosong)
  • BME280 datasheet (Bosch Sensortec)
  • SHT3x datasheet (Sensirion)

Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.

On this page
Short answerDHT11 vs DHT22 comparison tableHow to wire a DHT11 or DHT22Read a DHT22 with Arduino or ESP32When to choose a BME280, SHT31 or AHT20 insteadCommon mistakesFAQsParts and next steps
Need a hand?Ask Geeko AI which part fits your project, or talk to the Geekobot team.Ask Geeko AIHelp & support

Parts for this guide1 item · ₹33

Resistor Assortment Kit (30 Values)

Run itChange the inputs and watch the output
Serial monitor115200 baud
27.3 C  60.8 %RH

A simulation of the sketch above, so you know what to expect. Real readings vary with your parts and wiring.

Ask the Community

Ask a question