Skip to content

AM2301/AM2302 (DHT21/DHT22) temperature and humidity sensor~

This feature is included only in tasmota-sensors.bin

AM2301 driver supports AM2301 (DHT21), AM2302 (DHT22) and AM2321 temperature and humidity sensors. Introduced in Tasmota through Sonoff AM2301 accessory for Sonoff TH.

This driver is ONLY for single wire implementations of the sensor.

Configuration~

Wiring~

AM2301 ESP266
- GND
OUT GPIOx
+ 3.3V

Tasmota Settings~

In the Configuration -> Configure Module page assign: - GPIOx to AM2301 (2)

After a reboot webUI will display temperature and humidity measured.

image

Sensor sends a tele/%topic%/SENSOR JSON reponse:

{
  "Time": "2019-01-01T00:00:00",
  "AM2301": {
    "Temperature": 24.6,
    "Humidity": 58.2
  },
  "TempUnit": "C"
}

Commands~

TempOffset can be used for calibrating the measured temperature. This setting affects all temperature sensors on the device.

Wemos DHT Shield~

Like the Wemos DHT11 shield specs the DATA OUT pin of Wemos DHT22 is connected to D4 of the Wemos.

image

Tasmota Settings~

In the Configuration -> Configure Module page assign:

  1. GPIO2 to AM2301 (2)

Sensors~

Read more about differences between sensors.

image