AM2320 temperature and humidity sensor and ESP32 example

AM2320 is a simple to use, high performance temperature and humidity sensor capable of long distance signal transmission up to 20 meters.The product also has high reliability and excellent stability.

It can be used in applications like HVAC, dehumidifiers, testing and detection equipment, consumer goods, automotive, automation, data loggers, weather stations, home appliances, humidity regulator, medical, and other related humidity detection control.

The sensor consists of capacitive humidity sensor and an integrated high – precision temperature sensor and connected to a high performance microprocessor. The output is already temperature compensated resulting to accurate temperature and humidity information.

 

 

Specifications

• Operating Voltage: 3.1 VDC to 5.5 VDC
• Operating Temperature Range: -40 ° C to + 80 ° C
• Humidity Range: 0 to 99.9% RH
• Accuracy ( 25 ° C environment)
Temperature: ± 0.5 ° C
Humidity: ± 3%
• RH (10 … 90% RH)
Resolution: Temperature: 0.1 ° C
Resolution: Humidity: 0.1% RH
• Attenuation values
Temperature: <0.1 ℃ / Year
Humidity: <1% RH / Year
• Response time: Temperature: 5s
• Response Time: Humidity: 5s 1 / e (63%)
• Output signal: single bus / IIC signal
• Housing material: PC plastic

 

Layout

Once again this layout is based around my trusty ESP32 Wemos LOLIN32 board

esp32 and am2302
esp32 and am2302

 

Code

You will need to install the folllowing library from https://github.com/EngDial/AM2320


#include <Wire.h>
#include <AM2320.h>

AM2320 th;

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

void loop() {
Serial.println("Chip = AM2320");
switch(th.Read()) {
case 2:
Serial.println(" CRC failed");
break;
case 1:
Serial.println(" Sensor offline");
break;
case 0:
Serial.print(" Humidity = ");
Serial.print(th.Humidity);
Serial.println("%");
Serial.print(" Temperature = ");
Serial.print(th.cTemp);
Serial.println("*C");
Serial.println();
break;
}
delay(2000);
}

 

Output

Open the serial monitor

Chip = AM2320
Humidity = 47.10%
Temperature = 24.80*C

Chip = AM2320
Humidity = 48.70%
Temperature = 25.10*C

Chip = AM2320
Humidity = 53.60%
Temperature = 25.40*C

Chip = AM2320
Humidity = 55.80%
Temperature = 25.80*C

Chip = AM2320
Humidity = 59.80%
Temperature = 26.20*C

 

Links

AM2320 Digital Temperature and Humidity Sensor Replace AM2302 SHT10

https://akizukidenshi.com/download/ds/aosong/AM2320.pdf