Arduino IDE | Examples | DHT22 Temperature & Humidity:
Pull-up resistor DAT pin
- Connect an external
3k3..10kpull-up resistor between theDATandVCCpins only when:- Using a AM2302 sensor without a DT22 breakout PCB and the MCU IO pin has no built-in or external pull-up resistor.
- The DHT22 breakout PCB contains a
3k3pull-up resistor betweenDATandVCC. - Please refer to the MCU datasheet or board schematic for more information about IO pin pull-up resistors.
External capacitor
- Tip: Connect a
100nFcapacitor between the sensor pinsVCCandGNDwhen read errors occurs. This may stabilize the power supply.
Connection DHT22 - ESP8266
Some ESP8266 boards uses Arduino pin 2 -> GPIO4 which is D4 text on the board. Make sure you're using the right pin.
| DHT22 | ESP8266 / WeMos D1 R2 / ESP12E / NodeMCU |
|---|---|
| GND | GND |
| VCC | 3.3V |
| DAT | D2 |
Other MCU's may work, but are not tested.