Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minutePC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
Use an ESP32 development board, a supported temperature-and-humidity sensor, and ESPHome to send readings to Home Assistant. Configure the sensor in ESPHome, install the firmware, then connect Home Assistant through automatic discovery or the ESPHome integration. This guide uses a DHT22/AM2302 as its worked example and outlines supported I²C alternatives.
What you need
- An ESP32 development board.
- A DHT22/AM2302 temperature-and-humidity sensor, or a compatible alternative such as an SHT3x or AHT-series breakout.
- ESPHome to configure and install firmware on the board.
- For a DHT11 or DHT22, a data-line pull-up resistor. ESPHome recommends about 4.7 kΩ between DATA and 3.3 V; its documentation gives a workable range and notes that incorrect pull-up values or long cables can cause invalid readings. See the ESPHome DHT documentation.
Check the pin labels and electrical requirements for your particular board and sensor module before wiring. The ESPHome component documentation describes the sensor connection and configuration, but does not establish a universal enclosure or placement design.
Configure a DHT22 or AM2302 in ESPHome
ESPHome supports DHT11, DHT21/DHT22, AM2301/AM2302, and related models. Its DHT22 example exposes separate temperature and humidity readings and uses a 60-second update interval. Use the pin connected to the sensor’s DATA line and select the model that matches the sensor.
Free tools Windows power users keep installed
One-click scans. No signup required.
A configuration follows this pattern; replace the pin with the GPIO you actually wired to DATA and retain the rest of your device’s ESPHome configuration:
#1 Best Overall
- DHT11 digital temperature and humidity sensor is a digital signal output with a calibrated temperature and humidity combined sensor.
- It uses a dedicated digital modules and acquisition of temperature and humidity sensor technology to ensure that products with high reliability and excellent long term stability.
- Sensor consists of a resistive element and a sense of wet NTC temperature measurement devices, and with a high-performance 8-bit microcontroller connected.
- The product has excellent quality, fast response, anti-interference ability, high cost and other advantages.
- The single-wire wiring scheme makes it easy to be integrated to other applications.And the simple communication protocol greatly reduces the programming effort required.
sensor:
- platform: dht
pin: GPIO4
model: DHT22
temperature:
name: "Room Temperature"
humidity:
name: "Room Humidity"
update_interval: 60s
GPIO4 is an example, not a required pin. Check your ESP32 board’s pinout and avoid selecting a pin that conflicts with the board or another connected component. The example’s 60-second interval is a configuration choice, not a guarantee about readings or response time.
ESPHome documents zero decimal places as the default humidity accuracy for DHT11-derived configuration and allows other DHT sensors to be configured to one decimal place. Decimal places control displayed precision; they do not establish the assembled monitor’s measurement accuracy. Refer to the DHT component guide for model-specific settings and current syntax.
Rank #2
- Humidity measuring range: 20% -95% and humidity measurement error: + - 5%
- Temperature measuring range: 0 degrees -50 degrees
- Operating Voltage 3.3V-5V
- Weighs about 8g each
- temperature measurement error: + - 2 degrees
Wire and troubleshoot the DHT sensor
- Connect the sensor’s power and ground according to the module documentation, and connect DATA to the ESP32 GPIO selected in the configuration.
- For a DHT11 or DHT22, provide the external DATA pull-up described by ESPHome: about 4.7 kΩ between DATA and 3.3 V. Some breakouts may already include a resistor, so check the module before adding another.
- Install the ESPHome configuration on the ESP32 and inspect whether both named sensor entities produce readings.
- If readings are invalid or absent, verify the configured model and GPIO, inspect the pull-up value and wiring, and shorten the data cable if practical. ESPHome identifies incorrect pull-up values and long cables as possible causes.
Connect the ESP32 to Home Assistant
Home Assistant can discover ESPHome devices automatically. If the device does not appear, add it through Settings > Devices & services and select the ESPHome integration. Enter the device’s IP address or hostname and its native API port; the documented default is 6053. See the Home Assistant ESPHome integration page for setup details.
Home Assistant describes this as a persistent native API connection rather than polling for sensor values or device states. If manual setup cannot connect, confirm the ESP32 is reachable on the network and that the host and API port are correct.
Rank #3
- 【MIXED SENSOR BUNDLE (3x DHT22 + 3x DHT11)】Includes 3 DHT22 sensors for applications like weather stations or greenhouses, and 3 DHT11 sensors for basic indoor monitoring, organized in a storage container.
- 【CALIBRATED DIGITAL OUTPUT】Calibrated digital outputs for temperature and humidity readings — for ESP32, ESP8266, STM32, and other MCU-based DIY electronics.
- 【GOLD IMMERSION PLATING】Gold-plated contacts for corrosion resistance and signal integrity in humid environments. Lead-free, RoHS-compliant.
- 【WIDE COMPATIBILITY (3.3V–5V)】Works with microcontrollers operating on 3.3V to 5V (up to 6V for DHT22), using single-wire digital communication — no extra components needed for most projects like smart home automation or data logging.
- 【DHT22 vs DHT11 SPECS】DHT22: -40°C to 80°C, 0–100% RH, ±0.5°C/±2% accuracy for precise needs. DHT11: 0–50°C, 20–80% RH, ±2°C/±5% accuracy for basic monitoring. Choose based on your project.
Choose a sensor alternative
ESPHome also documents AHT10/AHT20/AHT30 and SHT31-D/SHT3x sensor families. The documentation establishes support and interface details, but does not provide a consistent head-to-head comparison of accuracy, reliability, price, or service life. Choose based on the breakout you have, the wiring interface, and the exact component configuration required.
| Sensor family | Documented interface or setup note | ESPHome documentation |
|---|---|---|
| DHT22 / AM2302 | DATA signal; ESPHome discusses an external pull-up and cable-related invalid readings. | DHT Temperature+Humidity Sensor |
| SHT31-D / SHT3x | I²C; the documented component includes the SHT85 family. | SHT3X-D Temperature+Humidity Sensor |
| AHT10 / AHT20 / AHT30 | I²C; ESPHome notes that a module marked AHT10 may need the AHT20 variant configured if data fetching fails. | AHT10 Temperature+Humidity Sensor |
Use the component page for the sensor family and module variant you own. A breakout’s label alone may not identify the configuration variant ESPHome needs.
Rank #4
- RELIABLE TEMPERATURE AND HUMIDITY SENSING – DHT11 module provides accurate and stable readings, ideal for monitoring environmental conditions in electronics and IoT projects.
- 2-PACK VALUE FOR MULTIPLE PROJECTS – Includes two modules for use in redundant setups, multiple builds, or classroom and prototyping environments.
- BUILT-IN RESISTOR FOR EASY CONNECTION – Simplifies wiring by allowing direct connection to Arduino, ESP32, ESP8266, or Raspberry Pi without a breadboard.
- COMPATIBLE WITH POPULAR MICROCONTROLLERS – Fully supported by widely available libraries and sample code for Arduino IDE, MicroPython, and more.
- ONLINE TUTORIALS AVAILABLE – Easy-to-follow tutorials for Arduino, Raspberry Pi, ESP32, and ESP8266 projects are available online by searching: DIYables DHT11 sensor.
Calibrate readings against a reference
If the monitor’s readings differ from a more accurate reference instrument, collect paired readings and use ESPHome’s calibration filter. Its documented method uses measured-to-truth data points and supports a least-squares fit or exact mapping, depending on configuration. Calibration can correct a measured offset or relationship represented by those data points; it does not demonstrate that the sensor will remain accurate over time. See the ESPHome Sensor Component documentation.
Sensor placement, enclosure design, heat from the ESP32, and long-term drift can affect a real build, but the cited component pages do not quantify those effects. Treat them as factors to evaluate in your installation rather than assuming the displayed decimal precision represents accuracy.
Quick Recap
Best Value
- 2pcs AHT30 High Precision Digital Temperature and Humidity Sensor Measurement Module I2C IIC Communication
- Digital temperature and humidity sensor, I2C master output, support simultaneous online access to multiple I2C electronic devices or modules.
- DC 2.0V-5V voltage can be used, voltage is easy to adapt, low power consumption, simple circuit, accurate temperature measurement point.
- Stable and fast transmission speed.
- 4P test line connection is adopted, which is convenient for users to use it quickly. Product parameters:
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

