Stufin
Home Quick Cart Profile

ASAIR Temperature and Humidity Sensor AM2302 (Original)

Buy Now on Stufin

Operating Voltage

3.3V to 5.5V

Temperature Range

-40C to 80C

Temperature Accuracy

0.5C

Humidity Range

0 to 99.9% RH

Humidity Accuracy

2% RH

Output Signal

Digital (3-wire interface)

Communication Protocol

Single-bus, asynchronous communication

Power Consumption

5V, 2.5mA (typical)

Dimensions

24.5 mm x 15.5 mm x 7.5 mm

Applications

The ASAIR Temperature and Humidity Sensor AM2302 (Original) is suitable for a wide range of IoT applications, including

Environmental monitoring systems

Weather stations

Industrial automation

HVAC systems

Greenhouse automation

Agricultural monitoring

Home automation

Smart buildings

Conclusion

The ASAIR Temperature and Humidity Sensor AM2302 (Original) is a highly accurate and reliable sensor designed for IoT applications. Its compact design, low power consumption, and high accuracy make it an ideal choice for temperature and humidity monitoring systems. With its digital output and simple communication protocol, the sensor is easy to integrate into various IoT devices and systems.

Pin Configuration

  • ASAIR Temperature and Humidity Sensor AM2302 (Original) Pinout Explanation
  • The ASAIR Temperature and Humidity Sensor AM2302 is a popular IoT component used to measure temperature and humidity in various applications. The sensor module has 3 pins, which are explained below:
  • Pin 1: VCC (Power Supply)
  • -------------------------
  • Pin Function: Power supply for the sensor module
  • Voltage: Typically 3.3V to 5V DC
  • Description: This pin is used to power the sensor module. Connect it to a suitable power source, such as a microcontroller's VCC pin or a voltage regulator output.
  • Pin 2: Data (Signal)
  • ---------------------
  • Pin Function: Digital output signal carrying temperature and humidity data
  • Signal Type: Digital signal (TTL logic level)
  • Description: This pin outputs the measured temperature and humidity data in a digital format. Connect it to a digital input pin of a microcontroller or a digital signal processing unit.
  • Pin 3: GND (Ground)
  • ---------------------
  • Pin Function: Ground reference for the sensor module
  • Description: This pin is the ground reference for the sensor module and should be connected to the ground terminal of the power source or the microcontroller's GND pin.
  • Connection Structure:
  • -------------------------
  • To connect the ASAIR Temperature and Humidity Sensor AM2302, follow this structure:
  • 1. VCC Pin: Connect the VCC pin of the sensor module to a suitable power source (3.3V to 5V DC).
  • 2. Data Pin: Connect the Data pin of the sensor module to a digital input pin of a microcontroller or a digital signal processing unit.
  • 3. GND Pin: Connect the GND pin of the sensor module to the ground terminal of the power source or the microcontroller's GND pin.
  • Example Connection Diagram:
  • ```
  • +---------------+
  • | Power Source |
  • +---------------+
  • |
  • |
  • v
  • +---------------+
  • | VCC (3.3V) |
  • +---------------+
  • |
  • |
  • v
  • +---------------+
  • | ASAIR AM2302 |
  • | (Temp & Hum) |
  • +---------------+
  • |
  • |
  • v
  • +---------------+
  • | Data (Digital) |
  • +---------------+
  • |
  • |
  • v
  • +---------------+
  • | Microcontroller |
  • | (Digital Input)|
  • +---------------+
  • |
  • |
  • v
  • +---------------+
  • | GND (Ground) |
  • +---------------+
  • ```
  • Remember to use suitable connectors, wires, and breadboards to ensure secure and reliable connections. Always refer to the datasheet and documentation provided with the sensor module for specific connection guidelines and precautions.

Code Examples

ASAIR Temperature and Humidity Sensor AM2302 (Original) Documentation
Overview
The ASAIR Temperature and Humidity Sensor AM2302 is a widely used, high-accuracy sensor module that measures temperature and humidity in various environments. It's based on the AM2302 chip, which provides reliable and stable readings. This sensor module is suitable for IoT applications, weather stations, and other projects requiring accurate temperature and humidity monitoring.
Technical Specifications
Temperature measurement range: -40C to 80C (accuracy: 0.5C)
 Humidity measurement range: 0% to 99.9% RH (accuracy: 2%)
 Power supply: 3.3V to 5.5V
 Communication protocol: Digital single-bus
 Response time: 2 seconds
Connection Diagram
The AM2302 sensor module has three pins:
VCC (power supply)
 GND (ground)
 OUT (digital output)
Code Examples
### Example 1: Reading Temperature and Humidity using Arduino
This example demonstrates how to read temperature and humidity data using an Arduino board.
```c
#include <dht.h>
#define DHTPIN 2     // Pin connected to the OUT pin of the AM2302 sensor
#define DHTTYPE DHT22 // DHT 22 (AM2302)
DHT dht(DHTPIN, DHTTYPE);
void setup() {
  Serial.begin(9600);
  dht.begin();
}
void loop() {
  int chk = dht.read();
  if (chk == DHTLIB_OK) {
    Serial.print("Temperature: ");
    Serial.print(dht.readTemperature());
    Serial.println(" C");
    Serial.print("Humidity: ");
    Serial.print(dht.readHumidity());
    Serial.println(" %");
  } else {
    Serial.println("Error reading sensor data.");
  }
  delay(2000);
}
```
### Example 2: Reading Temperature and Humidity using Raspberry Pi (Python)
This example demonstrates how to read temperature and humidity data using a Raspberry Pi and Python.
```python
import time
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(17, GPIO.IN, pull_up_down=GPIO.PUD_UP)
def read_am2302_sensor():
    data = []
    GPIO.setup(17, GPIO.OUT)
    GPIO.output(17, GPIO.LOW)
    time.sleep(0.02)
    GPIO.output(17, GPIO.HIGH)
    GPIO.setup(17, GPIO.IN)
for i in range(40):
        while GPIO.input(17) == GPIO.LOW:
            continue
        t0 = time.time()
        while GPIO.input(17) == GPIO.HIGH:
            continue
        t1 = time.time()
        if (t1 - t0) > 0.00004:
            data.append(0)
        else:
            data.append(1)
humidity_bit = data[0:8]
    humidity = 0
    for i in range(8):
        humidity += humidity_bit[i]  2  (7 - i)
temperature_bit = data[16:24]
    temperature = 0
    for i in range(8):
        temperature += temperature_bit[i]  2  (7 - i)
return humidity, temperature
while True:
    humidity, temperature = read_am2302_sensor()
    print("Humidity: {:.2f}%".format(humidity))
    print("Temperature: {:.2f}C".format(temperature))
    time.sleep(2)
```
Note: These examples assume you have the necessary libraries and dependencies installed for your chosen platform.
Troubleshooting Tips
Ensure proper connections between the sensor module and your microcontroller or single-board computer.
 Verify that your code is correctly configured for the AM2302 sensor module.
 Check the power supply voltage and ensure it's within the recommended range.
By following these examples and technical specifications, you can successfully integrate the ASAIR Temperature and Humidity Sensor AM2302 into your IoT projects.