AHT20 Temp&Humi Sensor
Grove - ATH20 is a highly reliable, accurate, quick response and integrated temperature & humidity sensor.. The chip is well calibrated, linearized and compensated for digital output.
The typical accuracy of this module can be ±2%RH (for relative humidity) and ±0.3°C (for temperature). This module is compatible with 3.3 Volts and 5 Volts and hence does not require a voltage level shifter. This module communicates using with I2C serial bus and can work up to 400kHz speed. We also have provided a highly abstracted library to make this product more easier to use.
Using the sensor is easy. For Seeeduino (Arduino UNO like), just connect this breakout board with the main control board via Grove cable. Then use the provided library and example/demo code available at GitHub to get your data. If you're using an Arduino without a Base Shield, simply connect the VIN pin to the 5V voltage pin, GND to ground, SCL to I2C Clock (Analog 5) and SDA to I2C Data (Analog 4).
Features¶
- Well calibrated, linearized, compensated for digital output
- Highly reliable, accurate and quick response time (75ms)
- Grove compatible and easy to use
- Easy-to-use Arduino Library
- I2C Address 0x38
Note
If you want to use multiplue I2C devices, please refer to Software I2C.
Tip
More details about Grove modules please refer to Grove System
Specifications¶
Parameter | Value |
---|---|
Input voltage (VCC) | 2.7-5.5V |
I/O Logic Level | 3.3 volts or 5 volts based on VCC |
Operating Current | 23 μA (0.25uA while in sleep mode) |
Operating Temperature | -40–85 ℃ |
Temperature Sensor Range | -40–85 ℃, with ±0.3°C accuracy |
Humidity Sensor Range | 0% - 100%(Relative Humidity), with ±2% accuracy |
Sensor Chip | ATH20 |
Port | I2C |
Weight | 4 g (for breakout board), 9 g for whole package each piece |
Dimensions | 10(length)×20(width) mm |
Platforms Supported¶
Arduino | Raspberry Pi | BeagleBone | Wio | LinkIt ONE |
---|---|---|---|---|
Caution
The platforms mentioned above as supported is/are an indication of the module's software or theoritical compatibility. We only provide software library or code examples for Arduino platform in most cases. It is not possible to provide software library / demo code for all possible MCU platforms. Hence, users have to write their own software library.
Play With Arduino¶
Hardware¶
- Step 1. Prepare the below stuffs:
Seeeduino Lotus | Grove - ATH20 |
---|---|
Get One Now | Get One Now |
- Step 2. Connect Grove - ATH20 to I2C port of Seeeduino Lotus.
- Step 3. Connect Seeeduino Lotus to PC via a USB cable.
Hardware Overview¶
Caution
Do not touch, shake or let this product vibrate while using. Otherwise, it will affect the accuracy of data measured.Note
If we don't have Grove Base Shield, We also can directly Grove - Temperature&Humidity Sensor(SHT31) to a board with MCU as below.
Seeeduino | Grove - Temperature&Humidity Sensor(SHT31) |
---|---|
5V | Red |
GND | Black |
SDA | White |
SCL | Yellow |
Software¶
-
Step 1. Download the Library from Github.
-
Step 2. Refer to How to install library to install library for Arduino.
-
Step 3. Restart the Arduino IDE. Open a new sketch, and copy the following code into the new sketch.
// ARDUINO DEMO FOR GROVE-ATH20
//
#include <Wire.h>
#include "ATH20.h"
ATH20 ATH;
void setup()
{
Serial.begin(115200);
Serial.println("ATH20 DEMO");
ATH.begin();
}
void loop()
{
float humi, temp;
int ret = ATH.getSensor(&humi, &temp);
if(ret) // GET DATA OK
{
Serial.print("humidity: ");
Serial.print(humi*100);
Serial.print("%\t temerature: ");
Serial.println(temp);
}
else // GET DATA FAIL
{
Serial.println("GET DATA FROM ATH20 FAIL");
}
delay(100);
}
// END FILE
-
Step 4. Upload the demo. If you do not know how to upload the code, please check How to upload code.
-
Step 5. Open the Serial Monitor of Arduino IDE by click Tool-> Serial Monitor. Or tap the Ctrl+Shift+M key at the same time. Set the baud rate to 115200. If every thing goes well, you will get the results.
The result should be like:
Resources¶
- [EAGLE] AHT 20 EAGLE FILE
- [Library] Library and example code
- [Datasheet] Datasheet for AHT20
- [MoreReading] I2C How-to for Arduino