> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/wokwi/wokwi-docs/llms.txt
> Use this file to discover all available pages before exploring further.

# DHT22 Temperature & Humidity Sensor

> Digital Humidity and Temperature sensor

Digital Humidity and Temperature sensor.

## Pin names

<ParamField path="VCC" type="Power">
  Positive voltage
</ParamField>

<ParamField path="SDA" type="Digital I/O">
  Digital data pin (input/output)
</ParamField>

<ParamField path="NC" type="Not Connected">
  Not connected
</ParamField>

<ParamField path="GND" type="Ground">
  Ground
</ParamField>

## Attributes

<ParamField path="temperature" type="string" default="24">
  Initial temperature value (celsius)
</ParamField>

<ParamField path="humidity" type="string" default="40">
  Initial relative humidity value (percentage)
</ParamField>

## Controlling the temperature

You can change the temperature and humidity values while the simulation is running.
Click on the DHT22 sensor and a small popup window will open. Use the temperature and
humidity sliders to change the values. Click "Hide" to close the popup window.

<Warning>
  If you are trying to read this sensor from the ESP32, use the "DHT sensor library for ESPx" library. Other DHT22 libraries may not work reliably on the ESP32. You can use this [example project](https://wokwi.com/projects/322410731508073042) as a starting point.
</Warning>

## Simulator examples

* [DHTlib example](https://wokwi.com/projects/344892337559700051)
* [DHT-sensor-library examples](https://wokwi.com/projects/344892587898831442)
* [DHT22 on the ESP32](https://wokwi.com/projects/322410731508073042)
