Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use AM2302 Humidity and Temperature Sensor: Examples, Pinouts, and Specs

Image of AM2302 Humidity and Temperature Sensor
Cirkit Designer LogoDesign with AM2302 Humidity and Temperature Sensor in Cirkit Designer

Introduction

The AM2302 sensor, also known as the DHT22, is a reliable digital sensor that measures both humidity and temperature. It combines a capacitive humidity sensor and a thermistor to provide accurate readings of the surrounding environment. This sensor is widely used in applications such as weather stations, home automation systems, and HVAC monitoring due to its ease of use and precision.

Explore Projects Built with AM2302 Humidity and Temperature Sensor

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Wemos D1 Mini Based Soil Moisture and Temperature Monitoring System
Image of pfe2: A project utilizing AM2302 Humidity and Temperature Sensor in a practical application
This circuit features a Wemos D1 Mini microcontroller connected to an AHT10 temperature and humidity sensor and a capacitive soil moisture sensor. The AHT10 communicates with the Wemos D1 Mini via I2C (with SDA connected to D2 and SCL to D1), while the soil moisture sensor's analog output is connected to the A0 pin of the Wemos D1 Mini. Both sensors and the microcontroller share a common power supply, with the 3V3 pin of the Wemos D1 Mini providing power to the sensors.
Cirkit Designer LogoOpen Project in Cirkit Designer
Air Quality and Humidity Monitoring System with NodeMCU and I2C LCD Display
Image of iot project: A project utilizing AM2302 Humidity and Temperature Sensor in a practical application
This circuit is designed for real-time air quality and humidity monitoring. It uses an MQ135 sensor to measure air quality, a DHT11 sensor to measure temperature and humidity, and displays the readings on an I2C LCD 16x2 screen. The NodeMCU V3 ESP8266 microcontroller processes the sensor data and controls the display output.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino Mega 2560 with Multiple DHT Sensors for Environmental Monitoring
Image of Schematic Diagram: A project utilizing AM2302 Humidity and Temperature Sensor in a practical application
This circuit is designed to monitor temperature and humidity using two DHT22 sensors and one DHT11 sensor, all controlled by an Arduino Mega 2560. The sensors are powered by the Arduino and communicate with it through digital pins D2, D3, and D4. The provided code is a template for implementing the sensor data acquisition logic.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino Nano-Based Bluetooth Temperature and Humidity Monitor with OLED Display and Alert Buzzer
Image of My project (DK): A project utilizing AM2302 Humidity and Temperature Sensor in a practical application
This circuit features an Arduino Nano microcontroller interfaced with an AHT10 temperature and humidity sensor, an HC-05 Bluetooth module, a 128x64 OLED display, and a buzzer with a series resistor. The Arduino Nano reads temperature and humidity data from the AHT10 sensor and displays it on the OLED screen. If the temperature exceeds a predefined threshold, the buzzer is activated. The HC-05 Bluetooth module allows for wireless communication, likely to send sensor data to another device such as a smartphone or computer.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with AM2302 Humidity and Temperature Sensor

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of pfe2: A project utilizing AM2302 Humidity and Temperature Sensor in a practical application
Wemos D1 Mini Based Soil Moisture and Temperature Monitoring System
This circuit features a Wemos D1 Mini microcontroller connected to an AHT10 temperature and humidity sensor and a capacitive soil moisture sensor. The AHT10 communicates with the Wemos D1 Mini via I2C (with SDA connected to D2 and SCL to D1), while the soil moisture sensor's analog output is connected to the A0 pin of the Wemos D1 Mini. Both sensors and the microcontroller share a common power supply, with the 3V3 pin of the Wemos D1 Mini providing power to the sensors.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of iot project: A project utilizing AM2302 Humidity and Temperature Sensor in a practical application
Air Quality and Humidity Monitoring System with NodeMCU and I2C LCD Display
This circuit is designed for real-time air quality and humidity monitoring. It uses an MQ135 sensor to measure air quality, a DHT11 sensor to measure temperature and humidity, and displays the readings on an I2C LCD 16x2 screen. The NodeMCU V3 ESP8266 microcontroller processes the sensor data and controls the display output.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Schematic Diagram: A project utilizing AM2302 Humidity and Temperature Sensor in a practical application
Arduino Mega 2560 with Multiple DHT Sensors for Environmental Monitoring
This circuit is designed to monitor temperature and humidity using two DHT22 sensors and one DHT11 sensor, all controlled by an Arduino Mega 2560. The sensors are powered by the Arduino and communicate with it through digital pins D2, D3, and D4. The provided code is a template for implementing the sensor data acquisition logic.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of My project (DK): A project utilizing AM2302 Humidity and Temperature Sensor in a practical application
Arduino Nano-Based Bluetooth Temperature and Humidity Monitor with OLED Display and Alert Buzzer
This circuit features an Arduino Nano microcontroller interfaced with an AHT10 temperature and humidity sensor, an HC-05 Bluetooth module, a 128x64 OLED display, and a buzzer with a series resistor. The Arduino Nano reads temperature and humidity data from the AHT10 sensor and displays it on the OLED screen. If the temperature exceeds a predefined threshold, the buzzer is activated. The HC-05 Bluetooth module allows for wireless communication, likely to send sensor data to another device such as a smartphone or computer.
Cirkit Designer LogoOpen Project in Cirkit Designer

Technical Specifications

Key Features

  • Measurement Range:
    • Humidity: 0-100% RH
    • Temperature: -40°C to +80°C
  • Accuracy:
    • Humidity: ±2% RH
    • Temperature: ±0.5°C
  • Resolution:
    • Humidity: 0.1% RH
    • Temperature: 0.1°C
  • Operating Voltage: 3.3 to 5V DC
  • Output Signal: Digital signal via a single-bus

Pin Configuration

Pin Number Name Description
1 VDD Power supply (3.3 to 5V DC)
2 DATA Digital output pin
3 NC Not connected
4 GND Ground

Usage Instructions

Connecting to a Circuit

  1. Connect the VDD pin to the 3.3V or 5V output on your microcontroller.
  2. Connect the DATA pin to a digital I/O pin on your microcontroller.
  3. Connect the GND pin to the ground on your microcontroller.
  4. It is recommended to use a 5.1kΩ pull-up resistor between the DATA pin and VDD for reliable communication.

Interfacing with Arduino UNO

To interface the AM2302 with an Arduino UNO, follow these steps:

  1. Connect the sensor as described above, using a digital pin (e.g., pin 2) for the DATA pin.
  2. Download and install the "DHT sensor library" from the Arduino Library Manager.
  3. Use the following example code to read humidity and temperature:
#include "DHT.h"

#define DHTPIN 2     // Digital pin connected to the DHT sensor
#define DHTTYPE DHT22   // DHT 22 (AM2302)

DHT dht(DHTPIN, DHTTYPE);

void setup() {
  Serial.begin(9600);
  dht.begin();
}

void loop() {
  // Wait a few seconds between measurements.
  delay(2000);

  // Reading temperature or humidity takes about 250 milliseconds!
  float humidity = dht.readHumidity();
  // Read temperature as Celsius (the default)
  float temperature = dht.readTemperature();

  // Check if any reads failed and exit early (to try again).
  if (isnan(humidity) || isnan(temperature)) {
    Serial.println("Failed to read from DHT sensor!");
    return;
  }

  // Compute heat index in Celsius (isFahrenheit = false)
  float heatIndex = dht.computeHeatIndex(temperature, humidity, false);

  Serial.print("Humidity: ");
  Serial.print(humidity);
  Serial.print("%  Temperature: ");
  Serial.print(temperature);
  Serial.print("°C  Heat index: ");
  Serial.print(heatIndex);
  Serial.println("°C");
}

Best Practices

  • Avoid placing the sensor in direct sunlight or near heat sources to prevent inaccurate readings.
  • Ensure the sensor is not exposed to condensation or water.
  • Allow the sensor to acclimatize to the environment for accurate readings.

Troubleshooting and FAQs

Common Issues

  • Inaccurate Readings: Ensure the sensor is not affected by external heat sources and is properly calibrated.
  • No Data: Check the wiring and connections, and ensure the pull-up resistor is in place.
  • Erratic Data: Ensure there is no interference on the data line and that the sensor is not being read too frequently.

FAQs

Q: How often can I read data from the sensor? A: The AM2302 should not be read more frequently than every 2 seconds to ensure accurate measurements.

Q: Can the sensor be used outdoors? A: Yes, but it should be protected from direct sunlight, rain, and condensation.

Q: Is the sensor waterproof? A: No, the AM2302 is not waterproof and should be protected from water and high humidity that can condense.

For further assistance, consult the datasheet or contact the manufacturer's technical support.