Interfacing AHT20 with Arduino

AHT20 is a temperature and humidity sensor that utilizes a MEMS semiconductor capacitive humidity sensor and a standard on-chip temperature sensor. It has better performance and is more stable in harsh environments compared to DHT11, DHT22 which are commonly used temperature and humidity sensors. It has an astounding humidity measuring range of 0-100% RH with humidity accuracy as low as ±2% at 25℃. It comes in an SMD package and its output is calibrated in standard I2C format. In the article “Interfacing AHT20 with Arduino”, you will learn how to interface industrial grade temperature and humidity sensors with Arduino.

Features of AHT20

  • Temperature measurement range -40 ~ 85°C
  • Humidity measurement range 0 ~ 100% RH
  • Digital output, I2C interface
  • Excellent long-term stability
  • Quick response and strong anti-interference ability

Specification

  • Operating Voltage: DC:2.0-5.5V
  • Measuring Range (humidity) 0 ~ 100% RH
  • Temperature Range: -40 ~ + 85 ℃
  • Humidity Accuracy: ± 2% RH (25 ℃)
  • Temperature Accuracy ± 0.3 ℃
  • Resolution: Temperature: 0.01 ℃, Humidity: 0.024% RH

Components Required for Interfacing AHT20 with Arduino

  1. Arduino UNO/NANO × 1 
  2. AHT20 Sensor × 1 
  3. 16×2 I2C LCD × 1 

Working of the Interfacing AHT20 with Arduino

circuit diagran of Interfacing AHT20 with Arduino

Working of the circuit can be divided into 3 parts:

  1. Sensor Unit: This unit can be depicted as a Transducer that measures Temperature and Humidity change. This unit consists of an industrial temperature and humidity AHT20 sensor.
  2. Processing Unit:  Since the sensor unit provides data in standard digital I2C format, the processing unit can directly read the data and process it into the required data format to send it to the Display unit. This unit consists of Arduino UNO or Arduino NANO or its derivatives. Here in this article, we are using Seeeduino nano instead of Arduino nano. Both boards share the same pin configuration and controller but Seeeduino nano has an I2C grove.
  3. Display Unit:  This unit displays data obtained from the Arduino into a 16×2 I2C Alphanumeric LCD.

Circuit Description of Interfacing AHT20 with Arduino

SDA(Serial Data) and SCL(Serial Clock) pins of AHT20 are connected to Arduino SDA pins (A4 pin) and SCL pin (A5 pin). These pins are also connected to the  SDA and SCL pins of 16×2 I2C LCD. 5V and GND pins from Arduino are connected to VDD/5V and VSS/GND pins of AHT20 and LCD respectively as shown in the circuit diagram.

Here to avoid a messy wiring system and also to connect multiple I2C devices, we can use an IC2 connection Hub. Each I2C device is recognized by its address to avoid conflict. AHT20 has an address of 0×38 which is the same for all AHT20 but the address of a 16×2 I2C LCD can be changed by using pins A0 A1 A2. Instead of using a traditional 16×2 LCD, we are using a 16×2 I2C LCD simply because data communication is possible only with 2 pins (SDA and SCL) which help to simplify the circuit and avoid a messy wiring system.

If you want to interface a traditional 16×2 LCD then its full details can be found on this video link

author prototype of Interfacing AHT20 with Arduino

Software code

Leave a Comment