DHT11 vs DHT22 Temperature Humidity Sensor Choice: Accuracy, Wiring, and Limits
Pick the DHT22 temperature humidity sensor when accuracy and range matter, and pick the DHT11 only for simple indoor indicators where a rough reading is enough. The DHT22 listing states plus or minus 0.5 degrees C and plus or minus 2 percent RH over a wider range, while the DHT11 listing states a narrower range with no accuracy figure. Both wire over one data pin.
All prices in this guide were checked November 18, 2026. Prices can change, so check the listing before you order. Shipped fast and securely from our secure facility in New York, providing fast, high quality USA shipping.
What each temperature humidity sensor actually measures
A DHT11 or DHT22 module reports two numbers: air temperature and relative humidity. Both use a single digital data pin, so the microcontroller asks for a reading and the sensor answers with a digital packet. That simplicity is the reason these modules show up in weather stations, plant monitors, room monitors, and classroom builds. The difference between the two is not the wiring. It is how wide the measurement range is, how close the reading sits to the true value, and how often you can ask for a new reading.
The DHT11 Temperature and Humidity Sensor Module, 3.3V to 5V ($2.99) listing states a humidity range of 20 to 90 percent RH and a temperature range of 0 to 50 degrees C, with digital output on a single data pin and an operating voltage of 3.3V to 5V. The listing includes wires and states compatibility with Arduino, ESP32, ESP8266, and Raspberry Pi. The listing does not state an accuracy figure, so do not assume one from the price. Published datasheet summaries put the DHT11 at about plus or minus 2 degrees C and plus or minus 5 percent RH, with 1 degree and 1 percent steps. Treat those as published figures from the sources below, not as figures from the listing.
The DHT22 / AM2302 Digital Temperature & Humidity Sensor Module ($6.99, regular $8.99) listing states humidity from 0 to 100 percent RH at plus or minus 2 percent accuracy and temperature from minus 40 to 80 degrees C at plus or minus 0.5 degrees C accuracy, on 3 to 5.5V with a single-bus digital output. That is a wider range on both measurements and a tighter accuracy figure on both, straight from the listing. The DHT22 is also sold under the AM2302 name. If a tutorial says AM2302, it means the same sensor family, and the wiring and code approach match.
DHT11 vs DHT22 comparison table
| Item | DHT11 listing | DHT22 listing |
|---|---|---|
| Temperature range | 0 to 50 degrees C | Minus 40 to 80 degrees C |
| Humidity range | 20 to 90 percent RH | 0 to 100 percent RH |
| Temperature accuracy | Not stated in listing; published summaries say about plus or minus 2 degrees C | Plus or minus 0.5 degrees C |
| Humidity accuracy | Not stated in listing; published summaries say about plus or minus 5 percent RH | Plus or minus 2 percent RH |
| Operating voltage | 3.3V to 5V | 3 to 5.5V |
| Output | Digital, single data pin | Digital, single-bus, one data pin |
| Price checked November 18, 2026 | $2.99 | $6.99 |
One range note needs care. The DHT11 listing states 20 to 90 percent RH, while several published datasheet summaries state 20 to 80 percent RH. Both agree the DHT11 is an indoor-range part. Do not build a control decision on a DHT11 reading near either edge of its range. If the reading sits near 20 percent or near 80 percent, treat it as indicative and confirm with a better sensor before acting on it.
Sampling rate: how often you can read
Published guides state the DHT11 can be read about once per second (1 Hz) and the DHT22 about once every two seconds (0.5 Hz). Code that polls faster than that gets stale or failed reads, not fresher data. Build the wait into the loop: read, wait the full interval, then read again. If a project needs fast air readings, neither DHT part is the right pick. A bus sensor such as the BME280 below answers over I2C or SPI and fits polling loops better, though it answers a different question because it adds pressure.
Failed reads are normal with single-wire timing sensors. Good code checks the return value, retries once after the full interval, and keeps the last good reading instead of printing a zero or a wild value. A sensor that fails every read is usually a wiring or pull-up problem, not a bad sensor. Check power, ground, the data pin, and the pull-up resistor before swapping parts.
Wiring a temperature humidity sensor to Arduino, ESP32, and Pico
Both modules need three connections: power, ground, and one data pin. Power the module from a voltage inside its stated range. The DHT11 listing states 3.3V to 5V and the DHT22 listing states 3 to 5.5V, so either module can run from the 3.3V rail on an ESP32 or Pico board and from the 5V rail on a 5V Arduino board. Keep the data line at the logic level of the board that reads it. If the module is powered at 5V while the board runs 3.3V logic, check the module and the board documentation before connecting the data pin directly, because a 5V data signal can exceed a 3.3V input rating. Powering the module from the board 3.3V rail removes that question on 3.3V boards.
Bare DHT sensors need a pull-up resistor on the data line, commonly 4.7k ohm to 10k ohm between DATA and the supply rail, per the guides in Sources. Some modules include the resistor on the board and some do not. The DHT11 listing in this guide states the module ships with wires and does not state a built-in pull-up resistor, so inspect the module you receive and add the resistor if the data line floats or reads fail. The DS18B20 Waterproof Temperature Sensor Probe, 1M Cable, with Resistor ($2.99) is a useful contrast: its listing states one 4.7k ohm pull-up resistor is included, which removes the guesswork for that part.
| Connection | UNO R3 / Nano (5V boards) | ESP32 / Pico (3.3V boards) |
|---|---|---|
| Module VCC | 5V rail | 3.3V rail |
| Module GND | GND | GND |
| Module DATA | Any digital pin | Any digital pin |
| Pull-up | 4.7k to 10k ohm DATA to VCC if the module lacks one | 4.7k to 10k ohm DATA to 3.3V if the module lacks one |
Keep the data wire short. Single-wire timing is sensitive to noise, and long unshielded runs invite failed reads. For a first build, use the Solderless Breadboard Kit 4-Pack, 2 x 830-Point + 2 x 400-Point Prototype Boards ($13.99) and the ELEGOO Dupont Jumper Wire Set 120-Piece, M-F M-M F-F Multicolored for Breadboard ($13.99) so the sensor sits close to the board. Move to a soldered connection only after the bench readings look stable.
Placement matters more than the part number
A temperature humidity sensor measures the air touching it, not the room average. Mount it away from heat sources: keep it off the microcontroller board, away from voltage regulators, motors, and direct sun through a window. A sensor taped to a warm board reads the board, not the air. Give it airflow and shade, and keep it away from drafts that swing the reading. For humidity work, keep the sensor out of condensing damp and out of direct spray. These modules measure air humidity. They are not waterproof probes. If the sensing point is wet, use the DS18B20 waterproof probe for temperature and keep the humidity module dry.
Let the sensor settle after power-up. Published guides note a short stabilization period before readings steady out. Log readings for several minutes on the bench and compare against a known reference, such as a second sensor or a household thermometer and hygrometer, before trusting the numbers in a control loop. A constant offset between two sensors at the same spot usually means one of them sits in a warm pocket or a draft, not that one of them is broken.
When to step up to BME280, BMP280, or DS18B20
The DHT parts answer one question: temperature and humidity over one wire. Three nearby listings answer nearby questions better when the project needs them.
The BME280 Temperature, Humidity and Barometric Pressure Sensor Module, 5V, I2C and SPI ($8.99, regular $10.99) adds barometric pressure on the same breakout and talks over I2C or SPI. Its listing states pressure accuracy of plus or minus 1 hPa, temperature accuracy of plus or minus 1.0 degrees C, and altimeter accuracy of plus or minus 1 meter. The listing advises I2C for simple wiring and SPI when several sensors share a bus and I2C address collisions are a concern. Pick the BME280 when the project needs pressure or altitude estimates alongside temperature and humidity. Note the listing states a 5V operating voltage, so check the bus voltage against a 3.3V board before wiring it directly.
The BMP280 Barometric Pressure Sensor Module, Single / 3-Pack / 5-Pack / 10-Pack, 3.3V and 5V (from $3.99 for a single 3.3V module; 3-pack 3.3V $8.79, 5-pack 3.3V $10.99, 10-pack 3.3V $21.99, 10-pack 5V $24.99) measures pressure and temperature only. It has no humidity sensing. Its listing states 300 to 1100 hPa at plus or minus 1 hPa absolute accuracy and temperature from minus 40 to plus 85 degrees C at plus or minus 1.0 degrees C, over I2C and SPI. Pick the BMP280 for altitude and weather pressure work, and pair it with a DHT22 when humidity is also needed. A dedicated project post, Build a Weather Station with DHT22, BMP280, and OLED, shows that pairing in a full build.
The DS18B20 probe ($2.99) measures temperature only, from minus 55 to plus 125 degrees C at plus or minus 0.5 degrees C, over a digital OneWire output, with a sealed stainless steel probe on a 1 meter cable. Pick it for water, soil, and damp environments where a DHT module must never go. It includes the 4.7k ohm pull-up resistor, and its listing states 9 to 12 bit adjustable resolution.
Boards that fit this temperature humidity sensor guide
Any board with one free digital pin can read a DHT module. The ELEGOO UNO R3 Microcontroller Board, ATmega328P + ATmega16U2, with USB Cable ($21.99, regular $26.99) suits a first bench build: 14 digital I/O pins, 6 analog inputs, and a USB cable in the box. The ESP32 DevKit V1 Development Board, 30-Pin WROOM-32, WiFi + Bluetooth, Dual-Core ($13.99, regular $16.99) suits a WiFi logger that reports readings to a dashboard, and the ESP32-S2 Mini Development Board, WiFi, 4MB Flash, 2MB PSRAM, USB-C ($7.99, regular $9.99) suits a small WiFi sensor node with no Bluetooth radio. The RP2040-Zero Microcontroller Board, Pico-Compatible, USB-C, 2MB Flash, 1-Pack / 3-Pack (1-pack $4.99, 3-pack $14.99) suits a compact USB logger. For board choice across wireless, voltage, and size, see Microcontroller Picker: Tables for ESP32, Arduino, Pico. For display pairings, see I2C OLED Display Guide: Wire the SSD1306 to Arduino or ESP32 and the 0.96 Inch OLED Display Module, SSD1306, I2C, 128×64, for Arduino / ESP32 / ESP8266 ($7.49).
Selection checklist for a temperature humidity sensor
- Decide the accuracy you need. If plus or minus 2 degrees C is too loose, the DHT22 listing figure of plus or minus 0.5 degrees C is the pick.
- Check the range. Below 0 degrees C or above 50 degrees C rules out the DHT11 listing range. Below freezing or condensing damp needs a different part or a protected mount.
- Check the sampling rate. One reading per second (DHT11) or one per two seconds (DHT22) must fit the control loop. Faster loops need a bus sensor.
- Confirm the pull-up. Inspect the module for a built-in resistor. Add 4.7k to 10k ohm on DATA if reads fail or the line floats.
- Match the data voltage to the board. Power the module from the board logic rail where the listing range allows it.
- Plan placement before mounting. Airflow, shade, distance from heat sources, and a dry spot matter more than the part number.
- Decide if pressure is needed. If yes, add the BME280 or BMP280 instead of forcing a DHT part to answer a pressure question.
- Decide if the sensing point is wet. If yes, use the DS18B20 probe for temperature and keep humidity modules dry.
Products in this guide, checked November 18, 2026
Prices are the effective listing prices checked November 18, 2026. Check the listing before you order. Shipped fast and securely from our secure facility in New York, providing fast, high quality USA shipping.
- DHT11 Temperature and Humidity Sensor Module, 3.3V to 5V: $2.99
- DHT22 / AM2302 Digital Temperature & Humidity Sensor Module: $6.99
- BME280 Temperature, Humidity and Barometric Pressure Sensor Module, 5V, I2C and SPI: $8.99
- BMP280 Barometric Pressure Sensor Module, Single / 3-Pack / 5-Pack / 10-Pack, 3.3V and 5V: from $3.99
- DS18B20 Waterproof Temperature Sensor Probe, 1M Cable, with Resistor: $2.99
- ELEGOO UNO R3 Microcontroller Board, ATmega328P + ATmega16U2, with USB Cable: $21.99
- ESP32 DevKit V1 Development Board, 30-Pin WROOM-32, WiFi + Bluetooth, Dual-Core: $13.99
- ESP32-S2 Mini Development Board, WiFi, 4MB Flash, 2MB PSRAM, USB-C: $7.99
- RP2040-Zero Microcontroller Board, Pico-Compatible, USB-C, 2MB Flash, 1-Pack / 3-Pack: from $4.99
- 0.96 Inch OLED Display Module, SSD1306, I2C, 128×64, for Arduino / ESP32 / ESP8266: $7.49
- Solderless Breadboard Kit 4-Pack, 2 x 830-Point + 2 x 400-Point Prototype Boards: $13.99
- ELEGOO Dupont Jumper Wire Set 120-Piece, M-F M-M F-F Multicolored for Breadboard: $13.99
Browse related categories: Sensor Modules, Robot Sensors, Microcontrollers & Development, Displays & Screens.
Frequently asked questions
Is the DHT22 worth the extra cost over the DHT11?
Yes, when the reading drives a decision. The DHT22 listing states plus or minus 0.5 degrees C and plus or minus 2 percent RH over minus 40 to 80 degrees C and 0 to 100 percent RH. The DHT11 listing states a narrower range and no accuracy figure. For a display-only room indicator, the DHT11 is fine. For logging, control, or outdoor-adjacent work, the DHT22 is the safer pick.
Can I read a DHT sensor faster than once per second?
No. Published guides state about 1 Hz for the DHT11 and about 0.5 Hz for the DHT22. Polling faster returns stale or failed reads. Wait the full interval between reads and handle failed reads in code instead of printing them.
Do I need a pull-up resistor for a DHT module?
Bare DHT sensors need one, commonly 4.7k to 10k ohm from DATA to the supply rail. Some modules include it on the board. The DHT11 listing here does not state a built-in pull-up, so inspect the module and add the resistor if reads fail. The DS18B20 probe listing states its resistor is included.
Can a DHT sensor go outside or in water?
No. DHT modules measure air humidity and must stay dry. For outdoor temperature in a sheltered, shaded mount, the DHT22 range fits better than the DHT11 range, but the module still needs protection from rain and condensation. For water or soil temperature, use the DS18B20 waterproof probe.
Why do two DHT sensors in the same room disagree?
Placement and accuracy both play a part. A sensor near a warm board, a vent, or sun reads its own microclimate. Two DHT11 modules can also sit up to about 4 degrees C apart if each sits at the edge of its published accuracy band. Put both sensors in the same shaded airflow, wait for them to settle, then compare.
Should I use a DHT sensor or a BME280?
Use a DHT part for a simple one-wire temperature and humidity reading. Use the BME280 when the project also needs barometric pressure or altitude estimates, or when an I2C or SPI bus fits the wiring better. The BME280 listing states 5V operation, so check bus voltage on 3.3V boards.
