Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use Adafruit HTS221: Examples, Pinouts, and Specs

Image of Adafruit HTS221
Cirkit Designer LogoDesign with Adafruit HTS221 in Cirkit Designer

Introduction

The Adafruit HTS221 (Part ID: 4535) is a digital humidity and temperature sensor designed for precise environmental monitoring. Manufactured by Adafruit, this sensor combines high accuracy with ease of use, thanks to its I2C communication interface. The HTS221 is ideal for applications such as weather stations, HVAC systems, IoT devices, and other projects requiring reliable humidity and temperature measurements.

Explore Projects Built with Adafruit HTS221

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
ESP32-Based NTP Clock with DHT22 Temperature Sensor and WS2812 LED Matrix Display
Image of date time and temperature display : A project utilizing Adafruit HTS221 in a practical application
This circuit features an ESP32 Devkit V1 microcontroller connected to a DHT22 temperature and humidity sensor and an 8x8 WS2812 RGB LED matrix. The ESP32 reads temperature data from the DHT22 sensor and displays the current date, time, and temperature on the LED matrix, with date and time synchronized via NTP (Network Time Protocol). The ESP32 provides power to both the DHT22 and the LED matrix and communicates with the DHT22 via GPIO 4 and with the LED matrix via GPIO 5.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO with HTU21D-F Sensor for Temperature and Humidity Monitoring
Image of Interfacing HTU21D Temperature and Humidity Sensor with Arduino UNO: A project utilizing Adafruit HTS221 in a practical application
This circuit connects an Arduino UNO microcontroller to an Adafruit HTU21D-F Temperature & Humidity Sensor. The Arduino is programmed to read temperature and humidity data from the sensor and output the readings to the Serial Monitor at half-second intervals. The sensor is powered by the Arduino's 5V output and communicates with the microcontroller via the I2C protocol using the SCL and SDA lines.
Cirkit Designer LogoOpen Project in Cirkit Designer
Raspberry Pi Pico-Based Temperature and Humidity Monitoring System
Image of rpi pico with aht20: A project utilizing Adafruit HTS221 in a practical application
This circuit connects an Adafruit AHT20 Temperature and Humidity Sensor to a Raspberry Pi Pico microcontroller. The AHT20 sensor communicates with the Raspberry Pi Pico via I2C protocol, using SCL and SDA lines for clock and data respectively. The sensor is powered by the Pico, with connections for VCC and GND to provide the necessary power supply.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino Mega 2560-Based Multi-Sensor Weather Station with TFT Display and IR Control
Image of aqua2: A project utilizing Adafruit HTS221 in a practical application
This circuit uses an Arduino Mega 2560 to read temperature data from multiple DS18B20 sensors, display the data on an ILI9341 TFT display, and maintain time using an Adafruit DS1307 RTC module. It also receives IR signals using a VS1838B IR receiver and includes an Adafruit MS8607 PHT sensor for additional environmental monitoring.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with Adafruit HTS221

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of date time and temperature display : A project utilizing Adafruit HTS221 in a practical application
ESP32-Based NTP Clock with DHT22 Temperature Sensor and WS2812 LED Matrix Display
This circuit features an ESP32 Devkit V1 microcontroller connected to a DHT22 temperature and humidity sensor and an 8x8 WS2812 RGB LED matrix. The ESP32 reads temperature data from the DHT22 sensor and displays the current date, time, and temperature on the LED matrix, with date and time synchronized via NTP (Network Time Protocol). The ESP32 provides power to both the DHT22 and the LED matrix and communicates with the DHT22 via GPIO 4 and with the LED matrix via GPIO 5.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Interfacing HTU21D Temperature and Humidity Sensor with Arduino UNO: A project utilizing Adafruit HTS221 in a practical application
Arduino UNO with HTU21D-F Sensor for Temperature and Humidity Monitoring
This circuit connects an Arduino UNO microcontroller to an Adafruit HTU21D-F Temperature & Humidity Sensor. The Arduino is programmed to read temperature and humidity data from the sensor and output the readings to the Serial Monitor at half-second intervals. The sensor is powered by the Arduino's 5V output and communicates with the microcontroller via the I2C protocol using the SCL and SDA lines.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of rpi pico with aht20: A project utilizing Adafruit HTS221 in a practical application
Raspberry Pi Pico-Based Temperature and Humidity Monitoring System
This circuit connects an Adafruit AHT20 Temperature and Humidity Sensor to a Raspberry Pi Pico microcontroller. The AHT20 sensor communicates with the Raspberry Pi Pico via I2C protocol, using SCL and SDA lines for clock and data respectively. The sensor is powered by the Pico, with connections for VCC and GND to provide the necessary power supply.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of aqua2: A project utilizing Adafruit HTS221 in a practical application
Arduino Mega 2560-Based Multi-Sensor Weather Station with TFT Display and IR Control
This circuit uses an Arduino Mega 2560 to read temperature data from multiple DS18B20 sensors, display the data on an ILI9341 TFT display, and maintain time using an Adafruit DS1307 RTC module. It also receives IR signals using a VS1838B IR receiver and includes an Adafruit MS8607 PHT sensor for additional environmental monitoring.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications:

  • Weather monitoring systems
  • HVAC (Heating, Ventilation, and Air Conditioning) control
  • IoT environmental sensing
  • Industrial and home automation
  • Data logging and scientific experiments

Technical Specifications

The Adafruit HTS221 is a compact and efficient sensor with the following key specifications:

Parameter Value
Operating Voltage 1.7V to 3.6V
Communication Interface I2C (default) or SPI
Humidity Measurement Range 0% to 100% RH
Humidity Accuracy ±3.5% RH (typical)
Temperature Range -40°C to +120°C
Temperature Accuracy ±0.5°C (typical)
Power Consumption 2 µA in low-power mode
I2C Address 0x5F (default)
Dimensions 2.0mm x 2.0mm x 0.9mm

Pin Configuration and Descriptions

The Adafruit HTS221 breakout board includes the following pins:

Pin Name Description
VIN Power supply input (3.3V or 5V compatible)
GND Ground connection
SCL I2C clock line (connect to microcontroller SCL pin)
SDA I2C data line (connect to microcontroller SDA pin)
CS Chip Select (used for SPI communication, leave unconnected for I2C)
INT Interrupt pin (optional, for event-driven applications)

Usage Instructions

Connecting the HTS221 to a Microcontroller

To use the Adafruit HTS221 with a microcontroller (e.g., Arduino UNO), follow these steps:

  1. Connect the VIN pin to the 3.3V or 5V power supply of the microcontroller.
  2. Connect the GND pin to the ground of the microcontroller.
  3. Connect the SCL pin to the I2C clock pin (A5 on Arduino UNO).
  4. Connect the SDA pin to the I2C data pin (A4 on Arduino UNO).
  5. Leave the CS pin unconnected for I2C communication.
  6. Optionally, connect the INT pin to a GPIO pin if you plan to use interrupts.

Arduino Code Example

Below is an example of how to use the Adafruit HTS221 with an Arduino UNO. This code uses the Adafruit HTS221 library, which can be installed via the Arduino Library Manager.

#include <Wire.h>
#include <Adafruit_HTS221.h>

// Create an instance of the HTS221 sensor
Adafruit_HTS221 hts;

void setup() {
  Serial.begin(9600);
  while (!Serial) {
    delay(10); // Wait for Serial Monitor to open
  }

  // Initialize the HTS221 sensor
  if (!hts.begin_I2C()) {
    Serial.println("Failed to find HTS221 sensor! Check wiring.");
    while (1) {
      delay(10); // Halt execution if sensor is not found
    }
  }

  Serial.println("HTS221 sensor initialized successfully!");
}

void loop() {
  // Read humidity and temperature values
  float humidity = hts.readHumidity();
  float temperature = hts.readTemperature();

  // Print the values to the Serial Monitor
  Serial.print("Humidity: ");
  Serial.print(humidity);
  Serial.println(" %RH");

  Serial.print("Temperature: ");
  Serial.print(temperature);
  Serial.println(" °C");

  delay(1000); // Wait 1 second before the next reading
}

Important Considerations:

  • Ensure the I2C pull-up resistors are present on the SDA and SCL lines. Most breakout boards include these resistors by default.
  • The HTS221 operates at a maximum voltage of 3.6V. If using a 5V microcontroller, ensure the breakout board includes a voltage regulator and level shifters (Adafruit's breakout board does).
  • Avoid exposing the sensor to extreme conditions (e.g., condensation or high humidity for prolonged periods) to maintain accuracy.

Troubleshooting and FAQs

Common Issues and Solutions

  1. Sensor not detected:

    • Ensure the I2C connections (SDA, SCL) are correct and secure.
    • Verify the I2C address (default is 0x5F). Use an I2C scanner sketch to confirm.
    • Check the power supply voltage (must be between 1.7V and 3.6V).
  2. Incorrect or fluctuating readings:

    • Ensure the sensor is not exposed to rapid temperature or humidity changes.
    • Avoid placing the sensor near heat sources or in direct sunlight.
    • Calibrate the sensor if necessary (refer to the Adafruit HTS221 library documentation).
  3. Interrupt pin not working:

    • Verify the interrupt configuration in your code.
    • Ensure the INT pin is connected to a GPIO pin on the microcontroller.

FAQs

Q: Can I use the HTS221 with a Raspberry Pi?
A: Yes, the HTS221 is compatible with Raspberry Pi. Use the I2C interface and appropriate libraries (e.g., Adafruit CircuitPython HTS221).

Q: What is the default I2C address of the HTS221?
A: The default I2C address is 0x5F.

Q: Can the HTS221 measure dew point?
A: The HTS221 does not directly measure dew point, but you can calculate it using the temperature and humidity readings.

Q: Is the HTS221 suitable for outdoor use?
A: The HTS221 can be used outdoors if protected from direct exposure to water, dust, and extreme conditions. Consider using an enclosure with proper ventilation.

By following this documentation, you can effectively integrate the Adafruit HTS221 into your projects for accurate environmental sensing.