
Temperature & Humidity
High-accuracy temperature and humidity sensor
Precision sensor providing accurate temperature and humidity measurements. Can be used to gather environmental information or integrated into home automation systems.
For ages 14 and up. Not a toy. Contains small parts: choking hazard. Keep away from children under 3. Adult supervision recommended.
Made by Atech ApS, Lille Strandstræde 6A, st. th., 1254 København K, Denmark.
Technical specifications
- Part
- AHT20 Temperature & Humidity Sensor
- Interface
- I2C (0x38)
- Ports
- 1 port
- Current
- ~1 mA
- Size
- 19.5 x 19.5 x 9.5 mm
- Chip
- AHT20 (ASAIR (Guangzhou Aosong Electronics))
Pins
- 3.3V
- supply
- GND
- ground
- Data A
- I²C SDA
- Data B
- I²C SCL
Key features
- Temperature range: -40 to +125°C
- Humidity range: 0-100%RH
- Environmental data collection
- Home automation ready
Common applications
Technical
Temperature & Humidity
AHT20 Temperature & Humidity SensorIntegrated temperature (-40 to +125°C) and humidity (0-100%RH) sensor. Background RTOS task measures every 2s, so readings are instant.
read_temperatureRead temperature in Celsiusfloat Cread_humidityRead relative humidityfloat %RH
AHT20 TEMPERATURE & HUMIDITY SENSOR: - readTemperature() returns float in Celsius. readHumidity() returns float 0-100 %RH. - Sensor runs in a background FreeRTOS task (reads every 2s automatically). - Calling readTemperature()/readHumidity() returns the latest cached value. It's instant, not blocking. - Don't read faster than every 500ms; the sensor update rate is fixed at ~2s. - Values are valid after begin() completes. First read may return 0 briefly.
Two large numeric readouts side-by-side: Temperature (°C) and Humidity (%), each with a 60-second live sparkline beneath. Highlight when values cross user-set thresholds (e.g. red text above 30°C).
| Pin | Line | Dir | Function |
|---|---|---|---|
| 1 | HV | – | not connected |
| 2 | 5V | – | not connected |
| 3 | 3.3V | input | supply |
| 4 | GND | – | ground |
| 5 | Data A | bidirectional | I²C SDA |
| 6 | Data B | input | I²C SCL |
from p2p/ground_truth/hardware/prototyping_line/modules/temperature&humidity_sensor.md
