
Our earlier DHT-and-ESP32 article put temperature and humidity readings on a web page; this project keeps things simpler and standalone, reading the DHT22 with a basic Arduino Uno and showing the results directly on an LCD screen, no network involved.
Why the DHT22 over the DHT11
The DHT22 measures temperature from -40°C to 80°C with about 0.5°C accuracy, and humidity from 0 to 100% — a meaningfully wider range and better precision than the cheaper DHT11, at the cost of a slightly higher price and a marginally slower reading interval.
Components needed
An Arduino Uno, a DHT22 sensor, a 16x2 LCD display (with or without an I2C adapter — either works with the code adjusted accordingly), a 10kΩ pull-up resistor for the sensor's data line if it isn't already built into the specific module, and connecting wires.
Wiring it up
The DHT22's data pin connects to any digital pin on the Arduino, pulled up to 5V through the resistor. The LCD follows whichever wiring scheme matches the module in hand — direct 12-pin or the simpler 2-wire I2C setup covered in our LCD wiring comparison article.
Programming it
Use a library that explicitly supports the DHT22 and select the correct data pin. Do not poll faster than the sensor update rate; an interval of about two seconds is appropriate, and invalid/NaN readings should be rejected before updating the display. A bare sensor needs a data pull-up resistor, while many breakout modules already include one.
You can find DHT22 sensors and LCD displays at Juthour Tech.
Leave your comment