About Lesson
The DHT22 (also known as the AM2302) is a digital sensor used to measure temperature and humidity. It is widely used in electronics projects, especially with microcontrollers like Arduino, Raspberry Pi, and ESP8266, due to its ease of use and affordability. Here’s a breakdown of its features and functionality:
3-Pin DHT22:
- Pin 1: VCC – Power supply (3.3V to 5V).
- Pin 2: DATA – Data signal (communicates with the microcontroller).
- Pin 3: GND – Ground (connected to the common ground of the circuit).
- Internal Pull-up Resistor: In the 3-pin version, the pull-up resistor for the data line is usually built into the sensor, meaning you don’t need an external one to pull the data pin to a high state.
4-Pin DHT22:
- Pin 1: VCC – Power supply (3.3V to 5V).
- Pin 2: DATA – Data signal (communicates with the microcontroller).
- Pin 3: NC (No Connection) – This pin is not used.
- Pin 4: GND – Ground (connected to the common ground of the circuit).
- External Pull-up Resistor: The 4-pin version generally requires an external pull-up resistor (typically 4.7kΩ to 10kΩ) between the data pin and the VCC to ensure stable data transmission.
Key Differences:
- The 3-pin DHT22 has the pull-up resistor integrated, which simplifies wiring.
- The 4-pin DHT22 requires an external pull-up resistor for the data pin, and one of the pins is unused.
In most cases, functionality and performance are the same, but the wiring configuration differs slightly based on whether the pull-up resistor is internal or external.