A lightweight and minimal Arduino library for the Sensirion SHT40I-Analog temperature + humidity sensor family.
Supports all analog-output variants (HD1B, ID1B, JD1B, KD1B, LD1B) and converts the sensor’s analog RH/T voltages into real-world %RH and °C / °F values.
Designed for low flash usage and compatible with AVR, ESP32, ESP8266, RP2040, STM32, and other Arduino platforms.
- HD1B – standard linear output
- ID1B – industrial RH + table-based T
- JD1B – industrial RH + standard T
- KD1B – humidity-only
- LD1B – table-based RH + T
- Analog RH output → %RH
- Analog T output → °C / °F
- Customizable ADC resolution (8/10/12/13/16-bit)
- Simple API:
readHumidity()readTemperatureC()readTemperatureF()
- Works with 3.3V or 5V sensors
- Extremely small footprint — ideal for embedded systems
- Pure analog — no I²C required
- Open Arduino IDE
- Navigate to:
- IDE 1.x:
Sketch > Include Library > Manage Libraries… - IDE 2.x: Library Manager sidebar
- IDE 1.x:
- Search for: 7Semi SHT4x analog
- Click Install
#include <SHT4x_analog_7Semi.h>| SHT40I-Analog Pin | Arduino Pin |
|---|---|
| VDD | 3.3V |
| GND | GND |
| AOUT-RH | A0 (or any analog) |
| AOUT-T | A1 (or any analog) |
Note: Some variants such as KD1B do not provide a temperature output pin.