Component guide · Beginner · 4 min read
Asair AM2301 (DHT21), AM2305, AM2315C, AM2322

and Winsen ZS03 / ZS05 Humidity Sensors
By Geekobot Learning Team · Updated 29 Oct 2026
On this page
These are cased temperature and humidity sensors for walls, enclosures and outdoor shelters. The AM2301 is the DHT21, read with the same single-wire timing as the DHT22. The AM2305 is a larger outdoor version. The AM2315C, AM2301B and AM2108 use I2C at address 0x38 like the AHT20, while the AM2322 and Winsen ZS05 can talk either single-bus or I2C.
Key specs at a glance
- Supply
- 3.3 to 5.5 V
- Interface
- Single-bus (AM2301, AM2305) or I2C (AM2315C, AM2301B, AM2108)
- Humidity
- 0 to 100% RH, about plus or minus 2 to 3% RH
- Temperature
- -40 to 80 degrees C, about plus or minus 0.3 to 0.5 degrees C
- Read rate
- Once every 2 s
- Cable
- Wired lead on the cased versions
Models in this guide
These are alternatives. Pick the one that fits your project; you only need one.
Option 1Asair AM2301 Capacitive Digital Temperature & Humidity Sensor – Digital 1-Wire Output₹359
Option 2Asair AM2301B Temperature & Humidity Sensor -40~+80°C, 0~100% RH₹373
Option 3AM2305 Digital Temperature and Humidity Sensor – Capacitive, Single-Wire Interface₹1,589
Option 4Asair AM2305B Digital Temperature and Humidity Sensor – 3.3-5.5V Digital Interface₹1,349
Option 5Asair AM2315C Temperature & Humidity Sensor -40~+80°C – I2C Digital Output₹889
Option 6Asair AM2322 Digital Temperature & Humidity Sensor – I2C & Single-Bus Interface₹499
What the AM2301, AM2305, AM2315C and AM2322 sensors is
These are cased temperature and humidity sensors from Asair and Winsen, made for walls, cabinets and outdoor shelters rather than bare breadboard use.
Check the label before you wire: a version letter (B or C) usually means an I2C AHT-type chip inside, while the plain AM2301 and AM2305 use the single-bus protocol.
Single-bus parts need a pull-up (4.7 k to 10 k) on the data wire. Long cables need the lower value and a slower read rate.
AM2301, AM2305, AM2315C and AM2322 sensors pinout
The pins on the AM2301, AM2305, AM2315C and AM2322 sensors and what each one does.
| Pin | Function |
|---|---|
| Red | VCC |
| Black | GND |
| Yellow | Data (single-bus) or SDA |
| White | SCL (I2C versions only) |
- Red
- VCC
- Black
- GND
- Yellow
- Data (single-bus) or SDA
- White
- SCL (I2C versions only)
Wiring the AM2301, AM2305, AM2315C and AM2322 sensors
Wire colours vary between batches; confirm against the datasheet that came with your sensor.
| AM2301, AM2305, AM2315C and AM2322 sensors pin | Arduino Uno | ESP32 |
|---|---|---|
| Red (VCC) | 5 V | 3.3 V |
| Black (GND) | GND | GND |
| Yellow (data) | D2 with 10 k to VCC | GPIO 4 with 10 k to 3.3 V |
| White (SCL, I2C types) | A5 (yellow then goes to A4) | GPIO 22 (yellow to GPIO 21) |
- Red (VCC)
- Arduino Uno:
- 5 V
- ESP32:
- 3.3 V
- Black (GND)
- Arduino Uno:
- GND
- ESP32:
- GND
- Yellow (data)
- Arduino Uno:
- D2 with 10 k to VCC
- ESP32:
- GPIO 4 with 10 k to 3.3 V
- White (SCL, I2C types)
- Arduino Uno:
- A5 (yellow then goes to A4)
- ESP32:
- GPIO 22 (yellow to GPIO 21)
Example code
For the AM2315C, AM2301B and AM2108 use the AHT20 code from the AHT guide instead.
#include <DHT.h> // DHT sensor library by Adafruit
DHT dht(2, DHT21); // AM2301 = DHT21; AM2305 also reads as DHT22 type
void setup() { Serial.begin(115200); dht.begin(); }
void loop() {
float h = dht.readHumidity();
float t = dht.readTemperature();
if (isnan(h) || isnan(t)) Serial.println("Read failed");
else { Serial.print(t, 1); Serial.print(" C "); Serial.print(h, 1); Serial.println(" %RH"); }
delay(2500);
}Setup and tuning
AM2301 and AM2305 use the DHT single-wire protocol; AM2315C, AM2301B and AM2108 use I2C at 0x38.
add a 4.7 to 10 kΩ pull-up on the single-wire data line, smaller for long cables.
read at most once every 2 seconds, or the sensor returns stale or failed data.
single-wire sensors work up to a few metres; for long runs lower the pull-up value or use an RS485 sensor.
for outdoor use, put the sensor in a vented radiation shield away from direct sun and rain.
What you need
Shop this list13 of 14 found in our store · ₹6,236
Asair AM2301 Capacitive Digital Temperature & Humidity Sensor – Digital 1-Wire Output: the part this guide coversAsair AM2301 Capacitive Digital Temperature & Humidity Sensor – Digital 1-Wire Output₹359
Asair AM2301B Temperature & Humidity Sensor -40~+80°C, 0~100% RH: another version this guide coversAsair AM2301B Temperature & Humidity Sensor -40~+80°C, 0~100% RH₹373
AM2305 Digital Temperature and Humidity Sensor – Capacitive, Single-Wire Interface: another version this guide coversAM2305 Digital Temperature and Humidity Sensor – Capacitive, Single-Wire Interface₹1,589
Asair AM2305B Digital Temperature and Humidity Sensor – 3.3-5.5V Digital Interface: another version this guide coversAsair AM2305B Digital Temperature and Humidity Sensor – 3.3-5.5V Digital Interface₹1,349
Asair AM2315C Temperature & Humidity Sensor -40~+80°C – I2C Digital Output: another version this guide coversAsair AM2315C Temperature & Humidity Sensor -40~+80°C – I2C Digital Output₹889
Asair AM2322 Digital Temperature & Humidity Sensor – I2C & Single-Bus Interface: another version this guide coversAsair AM2322 Digital Temperature & Humidity Sensor – I2C & Single-Bus Interface₹499
Asair AM2108 Temperature & Humidity Sensor Module – I2C Digital Output: another version this guide coversAsair AM2108 Temperature & Humidity Sensor Module – I2C Digital Output₹239
Winsen ZS03 Temperature & Humidity Sensor Module – Digital SIP4 Interface: another version this guide coversWinsen ZS03 Temperature & Humidity Sensor Module – Digital SIP4 Interface₹112
Winsen ZS05 Temperature and Humidity Sensor Module – Digital I2C/Single-Bus SIP4: another version this guide coversWinsen ZS05 Temperature and Humidity Sensor Module – Digital I2C/Single-Bus SIP4₹112- Uno R3 development board: the controller used in the wiring tableFind this part
ESP32-WROOM-32 38-pin development board: for Wi-Fi logging and dashboardsESP32-WROOM-32 38-Pin Development Board₹389
Resistor assortment kit (30 values): pull-up and divider resistorsResistor Assortment Kit (30 Values)₹33
DHT22 AM2302 temperature and humidity sensor: the common single-wire alternativeDHT22 AM2302 Digital Temperature & Humidity Sensor₹114Closest match, check the specs
16x2 LCD with I2C: to show readings on a character display16×2 LCD with I2C (RG1602A)₹179Closest match, check the specs
Alternatives and when to choose them
- DHT11 vs DHT22: the same single-bus protocol in smaller packages.
- AHT30, AHT21 and DHT20: the I2C chips inside the B and C versions.
- Humidity transmitters: 4 to 20 mA and RS485 for long runs.
Common mistakes to avoid
- Choosing DHT22 in code for an AM2301, or the wrong sensor type.
- Reading faster than once every 2 seconds.
- Leaving out the data line pull-up resistor.
- Mounting the sensor in direct sun, which reads far too warm.
Frequently asked questions
Is the AM2301 the same as the DHT21?
Yes. The AM2301 is sold as the DHT21 and is read with the DHT library set to DHT21.
Which library reads the AM2315C?
The AM2315C uses the AHT20-style I2C commands at 0x38, so an AHT20 or AM2315C library works.
Can I run these sensors at 3.3 V?
Yes. They work from about 3.3 to 5.5 V; keep the data pull-up on the same voltage as your board's logic.
How long can the sensor cable be?
A few metres is fine for single-wire models with a good pull-up. Use I2C only for short runs.
Why does my sensor return NaN?
Check the wiring and pull-up, the sensor type in the code, and that you read no faster than every 2 seconds.
Parts for this guide
Keep learning
Sources
Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.

