uploaded 7 months ago


Driver for AM2302 (DHT22) Sensor (RMT backend)


# AM2302 (a.k.a. DHT22) Sensor Driver

[![Component Registry](](

## Reference Link

* [AM2302 Data Sheet](


## 1.0.0

- Initial driver version, with the RMT driver as backend controller

readme of get_started example

                                        # AM2302/DHT22 Example

This example demonstrates how to read the temperature and humidity by using the [am2302_rmt]( library.

## How to Use Example

### Hardware Required

* A development board with Espressif SoC
* A USB cable for Power supply and programming
* AM2302/DHT22 sensor

### Configure the Example

Before project configuration and build, be sure to set the correct chip target using ` set-target <chip_name>`. Then assign the proper GPIO in the [source file](main/am2302_example_main.c).

### Build and Flash

Run ` -p PORT build flash monitor` to build, flash and monitor the project.

(To exit the serial monitor, type ``Ctrl-]``.)

See the [Getting Started Guide]( for full steps to configure and use ESP-IDF to build projects.

## Example Output

I (314) main_task: Started on CPU0
I (324) main_task: Calling app_main()
I (324) gpio: GPIO[2]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (334) gpio: GPIO[2]| InputEn: 1| OutputEn: 1| OpenDrain: 1| Pullup: 1| Pulldown: 0| Intr:0
I (344) example: Start reading temperature and humidity from AM2302 sensor
I (2384) example: Temperature: 29.2 °C, Humidity: 89.3 %
I (4414) example: Temperature: 29.2 °C, Humidity: 88.1 %


Supports all targets

License: Apache-2.0

To add this component to your project, run: add-dependency "suda-morris/am2302_rmt^1.0.0"

or download archive


  • ESP-IDF >=5.0
  • Examples:


    more details


    • Downloaded in total
      Downloaded in total 102 times
    • Downloaded this version
      This version: 102 times


    suda-morris/am2302_rmt version: 1.0.0 |