DHT22 sensor overview

How the DHT22 humidity–temperature sensor works, its accuracy limits, and why it fits garage, workshop, and attic monitoring.

Aosong AM2302 DHT22 temperature and humidity sensor module on a black breakout board
The DHT22 (AM2302) is the digital humidity–temperature sensor used in many DIY space builds. Photo: Suyash Dwivedi. CC BY-SA 4.0

The DHT22 (also sold as AM2302) is the digital sensor at the heart of this garage build. It reports relative humidity and air temperature over a single data line, which keeps wiring simple when you need multiple zones. Understanding its behavior helps you interpret noisy readings and set realistic expectations compared with lab-grade equipment.

What the DHT22 measures

Each read returns humidity (0–100 %RH) and temperature (typically −40 to 80 °C spec range). The firmware converts values to Fahrenheit for JSON consumers while the LCD may show either scale. Readings represent the air pocket around the sensor body, not surface temperature of a pipe or concrete slab unless you mount the probe against that surface intentionally.

Datasheet accuracy is roughly ±0.5 °C and ±2–5 %RH under stable conditions. In drafty garages, rapid door openings can produce short spikes that are real air movement, not sensor failure. Compare with probe placement guidance before replacing hardware.

Timing and bus behavior

DHT22 sensors enforce a minimum interval between reads, often two seconds. The sketch polls on a timer and skips overlapping requests. Violating the interval returns stale or error values, which is why firmware includes retry logic described in DHT22 read errors and retries.

  • Power: 3.3–5 V DC; share ground with the Arduino.
  • Data: One GPIO per sensor with a pull-up resistor on the line.
  • Cable length: Keep runs modest; long unshielded wires pick up noise.
  • Enclosure: Ventilated housing avoids sun-heated stale air, see the mounting guide.

Where it fits in the stack

Probes feed the Arduino sketch, which publishes JSON consumed by the website. Follow the end-to-end data flow when debugging mismatches between LCD and web values. Pin-level wiring is documented in DHT22 data line wiring.

FAQ

How accurate is a DHT22 in a garage or workshop?
Roughly ±0.5 °C and a few percent RH in stable air. Drafts and door openings create real spikes, not always sensor error. Compare zones before replacing hardware.

How often should firmware poll the DHT22?
Respect at least a two-second gap between reads. Overlapping requests return stale or error values; sketches use timers and retries for that reason.

Can one DHT22 cover a whole garage, attic, or shop?
One sensor hides gradients. Door bays, north walls, and workbenches often differ by several degrees, use multiple probes when freeze risk or tools matter.