Same-day dispatch before 2 PM · Free delivery over ₹999 · GST invoices Get the appPrices incl. GST
Geekobot
Snap & SendNEWGeeko AIWhere's myOrder
Log in
Products
  • Projects
    • Component guidesHow parts work, with code you can run
    • Learning pathsFrom your first LED to your first robot
    • Workshops & eventsOnline sessions for makers and classes
    • ElectrolarkFree guided builds, simulator and certificates
    • Students & teachersStudent discount and classroom help
    • CommunityShare builds and ask other makers
    • CalculatorsOhm's law, LED resistor, 555 and 100+ more
    • Circuit builderWire parts and run the circuit, powered by Electrolark
    • Geeko AIAsk what to buy or how to wire it
    • Snap & SendPhotograph a part or list, we find it
    • Part finderAnswer a few questions, get the right part
    • Compatibility checkWill these two parts work together?
    • Compare partsSpecs side by side
    • Business & bulk ordersGST invoices, credit and volume prices
    • Request a quotationSend your list, get a quote
    • Classroom kitsPer-student kits and lab bundles
    • Gift cardsFor students, teams and events
  • Atal Tinkering Lab
BOM to cart
Geekobot

Components, kits and know-how for makers, students, engineers, labs and businesses across India.

Ask Geeko AIOrders, parts and projects, any timeEmail supportReply within 1 working dayGet the Geekobot appAdd it to your home screen, free

Follow us

Shop

  • Boards & SBCs
  • Sensors & Modules
  • IoT & Wireless
  • Drone & FPV
  • 3D Printing
  • Filaments & Resins
  • Motors & Drivers
  • Power & Batteries
  • Semiconductors
  • Passive
  • Displays & LEDs
  • Switches & Relays
  • Wires & Cables
  • Prototyping
  • Tools & Test
  • Robotics
  • STEM Kits
  • Atal Tinkering Lab
  • Mechanical Parts
  • Audio

Orders

  • Track your order
  • Help & support
  • Shipping and delivery
  • Refunds and cancellation
  • Contact us

Learn

  • Projects
  • Geeko AI project assistant
  • Learning paths
  • Guides
  • Calculators
  • Electrolark: free guided builds

Part tools

  • Part finder
  • Compare parts
  • Will it work with my board?

Institutions

  • Classroom kits
  • Atal Tinkering Lab
  • Students & teachers
  • Workshops & Events

Business

  • Business & education
  • Request a quotation
  • BOM bulk upload
  • Quick order by SKU

Company

  • About Geekobot
  • Community
  • Gift cards
  • Terms & conditions
  • Privacy policy
  • Product directory
  • Sitemap

© 2026 Geekobot, a trade name of OLatus Systems Private Limited. All rights reserved.

20, 1st Floor, Neeladri Complex, 10th Cross, Sampige Rd, 2nd Main, Malleshwaram, Bengaluru, Karnataka 560003 · GSTIN 29AACCO0462F1ZM

+91 91810 15607 · connect@geekobot.in · Monday to Saturday, 10 AM to 2 PM IST

UPI · CARDS · NETBANKING · GST INVOICES

ShopProjectsGeeko AIGuides
Compare 0 parts →
Log in

Shop by category

Shop all components
  • Boards & SBCs1,910 products
    • Alternative Single Board Computers
    • Arduino Ecosystem
    • FPGA & Logic Boards
    • Microcontroller & Wireless Boards
    View all
  • Sensors & Modules4,701 products
    • Biomedical & Heart Rate
    • Current, Voltage & Power
    • Force, Weight & Pressure
    • Gas, Weather & Environmental
    View all
  • IoT & Wireless2,314 products
    • RF Modules
    • RFID & NFC
    • Antennas & RF Accessories
    • Cameras & Smart Vision
    View all
  • Drone & FPV3,558 products
    • Flight Control & Navigation
    • FPV Video & Optics
    • Frames & Structural Parts
    • Motors & Propulsion
    View all
  • 3D Printing2,204 products
    • 3D Printers
    • 3D Scanners & Digitizers
    • Laser Engravers & Cutters
    • Material Management & Upgrades
    View all
  • Filaments & Resins1,472 products
    • Filaments
    • Photopolymer Resins
    View all
  • Motors & Drivers463 products
    • BLDC Motor Drivers
    • DC & Geared Motors
    • DC Motor Drivers
    • Linear Actuators & Solenoids
    View all
  • Power & Batteries557 products
    • Battery Holders & Connectors
    • Breadboard Power
    • Chargers & BMS
    • DC-DC Converters
    View all
  • Semiconductors295 products
    • Diodes & Rectifiers
    • Interface & RF Encoder ICs
    • Logic ICs (74xx)
    • Logic ICs (CD4000)
    View all
  • Passive67 products
    • Capacitors
    • Circuit Protection
    • Crystals & Oscillators
    • Inductors
    View all
  • Displays & LEDs572 products
    • 7-Segment & Dot Matrix
    • Addressable LEDs
    • Character LCDs
    • Graphic LCDs
    View all
  • Switches & Relays184 products
    • Keypads & Touch
    • Push Buttons & Tactile
    • Relay Modules
    • Relays
    View all
  • Wires & Cables233 products
    • Board-to-Wire Connectors
    • Crimp & Splice
    • Headers & Dupont
    • Heat Shrink & Sleeving
    View all
  • Prototyping101 products
    • Breadboards
    • Interface Modules
    • PCBs & Perfboards
    View all
  • Tools & Test717 products
    • Bench Power Supplies
    • Hand Tools
    • Measuring Tools
    • Meters & Testers
    View all
  • Robotics180 products
    • Humanoid & Legged Robots
    • Robot Chassis & Platforms
    • Robotic Arms & Grippers
    • Wheels & Casters
    View all
  • STEM Kits268 products
    • Arduino Learning Kits
    • Coding & IoT Kits
    • Early Coding (Ages 3-8)
    • Invention Kits
    View all
  • Atal Tinkering Lab196 products
    • Package 1: Electronics, Robotics, IoT and Sensors
    • Package 2: Rapid Prototyping Tools
    • Package 3: Mechanical, Electrical and Measurement Tools
    • Package 4: Power Supply, Accessories and Safety Equipment
    View all
  • Mechanical Parts212 products
    • Bearings
    • Brackets & Mounts
    • Couplers
    • Fasteners & Standoffs
    View all
  • Audio109 products
    • Amplifier Modules
    • Buzzers & Sirens
    • Speakers
    View all
  1. Home
  2. ›Guides
  3. ›Sensors
  4. ›Asair AM2301 (DHT21), AM2305, AM2315C, AM2322

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

I'm using
Wiring, code and the Run it panels follow your board.
On this page
Short answerWhat the AM2301, AM2305, AM2315C and AM2322 sensors isAM2301, AM2305, AM2315C and AM2322 sensors pinoutWiring the AM2301, AM2305, AM2315C and AM2322 sensorsExample codeSetup and tuningWhat you needAlternatives and when to choose themCommon mistakesFAQsParts and next steps
Short answer

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
01

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.

02

AM2301, AM2305, AM2315C and AM2322 sensors pinout

The pins on the AM2301, AM2305, AM2315C and AM2322 sensors and what each one does.

PinFunction
RedVCC
BlackGND
YellowData (single-bus) or SDA
WhiteSCL (I2C versions only)
PinFunction
Red
VCC
Black
GND
Yellow
Data (single-bus) or SDA
White
SCL (I2C versions only)
03

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 pinArduino UnoESP32
Red (VCC)5 V3.3 V
Black (GND)GNDGND
Yellow (data)D2 with 10 k to VCCGPIO 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)
04

Example code

For the AM2315C, AM2301B and AM2108 use the AHT20 code from the AHT guide instead.

Read an AM2301 (DHT21) on one wire · Arduino C++Verify & upload in Electrolark
#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);
}
05

Setup and tuning

Pick the protocol

AM2301 and AM2305 use the DHT single-wire protocol; AM2315C, AM2301B and AM2108 use I2C at 0x38.

Pull-up

add a 4.7 to 10 kΩ pull-up on the single-wire data line, smaller for long cables.

Read rate

read at most once every 2 seconds, or the sensor returns stale or failed data.

Cable length

single-wire sensors work up to a few metres; for long runs lower the pull-up value or use an RS485 sensor.

Mounting

for outdoor use, put the sensor in a vented radiation shield away from direct sun and rain.

06

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
07

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.
08

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.
09

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

  • Asair AM2301 Capacitive Digital Temperature & Humidity Sensor – Digital 1-Wire Output
    ₹359View
  • Asair AM2301B Temperature & Humidity Sensor -40~+80°C, 0~100% RH
    ₹373View
  • AM2305 Digital Temperature and Humidity Sensor – Capacitive, Single-Wire Interface
    ₹1,589View
  • Asair AM2305B Digital Temperature and Humidity Sensor – 3.3-5.5V Digital Interface
    ₹1,349View
  • Asair AM2315C Temperature & Humidity Sensor -40~+80°C – I2C Digital Output
    ₹889View
  • Asair AM2322 Digital Temperature & Humidity Sensor – I2C & Single-Bus Interface
    ₹499View
  • Asair AM2108 Temperature & Humidity Sensor Module – I2C Digital Output
    ₹239View
  • Winsen ZS03 Temperature & Humidity Sensor Module – Digital SIP4 Interface
    ₹112View
  • Winsen ZS05 Temperature and Humidity Sensor Module – Digital I2C/Single-Bus SIP4
    ₹112View
  • Uno R3 Development Board (No Cable)
    ₹359View
  • ESP32-WROOM-32 38-Pin Development Board
    ₹389View
  • Resistor Assortment Kit (30 Values)
    ₹33View
  • DHT22 AM2302 Digital Temperature & Humidity Sensor
    ₹114View
  • 16×2 LCD with I2C (RG1602A)
    ₹179View
Shop Temperature & Thermal SensorsShop Humidity & Dew Point Sensors

Keep learning

ComparisonBeginnerDHT11 vs DHT22DHT11 vs DHT22 compared: accuracy, range and sampling rate, plus wiring, pull-up, Arduino/ESP32 code and when to pick a BME280 or SHT31.3 min read · SensorsComponent guideBeginnerAHT30, AHT21, AHT25, DHT20 and WHT20 I2C TemperatureThe AHT30, AHT21, AHT25 and DHT20 are small calibrated I2C temperature and humidity sensors from the same family as the AHT20.4 min read · SensorsComponent guideIntermediateHumidity and Temperature TransmittersA humidity transmitter measures relative humidity and often temperature, then outputs a 4-20 mA or 0-10 V signal for a PLC, controller or data logger.3 min read · SensorsComponent guideBeginnerSonoff TH10, TH16 and THR320DSonoff TH switches are Wi-Fi relays with a jack for a temperature or humidity sensor, so they can run a heater, fan, dehumidifier, aquarium heater or incubator by reading, not just by schedule.3 min read · IoT & Wireless

Sources

  • Asair AM2301, AM2305, AM2315C and AM2322 datasheets
  • Winsen ZS05 datasheet

Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.

On this page
Short answerWhat the AM2301, AM2305, AM2315C and AM2322 sensors isAM2301, AM2305, AM2315C and AM2322 sensors pinoutWiring the AM2301, AM2305, AM2315C and AM2322 sensorsExample codeSetup and tuningWhat you needAlternatives and when to choose themCommon mistakesFAQsParts and next steps
Need a hand?Ask Geeko AI which part fits your project, or talk to the Geekobot team.Ask Geeko AIHelp & support

Parts for this guide (Arduino Uno)6 items · ₹1,059

Asair AM2301 Capacitive Digital Temperature & Humidity Sensor – Digital 1-Wire Output · Asair AM2108 Temperature & Humidity Sensor Module – I2C Digital Output · Winsen ZS03 Temperature & Humidity Sensor Module – Digital SIP4 Interface · Winsen ZS05 Temperature and Humidity Sensor Module – Digital I2C/Single-Bus SIP4 · Resistor Assortment Kit (30 Values) · Uno R3 CH340G ATmega328p Compatible Development Board

Run itChange the inputs and watch the output

DHT21 timing: read no faster than every 2 s. A missing pull-up gives Read failed.

Serial monitor115200 baud
27.3 C  61.0 %RH

A simulation of the sketch above, so you know what to expect. Real readings vary with your parts and wiring.

Ask the Community

Ask a question