The Adafruit SHT31-D is a precision sensor for measuring temperature and humidity. Based on the Sensirion SHT31-D sensor, this breakout board is designed for easy integration into a wide range of applications, including weather stations, environmental monitoring, home automation, and HVAC systems. Its high accuracy, fast response time, and low power consumption make it an excellent choice for both hobbyists and professionals.
Pin Number | Name | Description |
---|---|---|
1 | VDD | Power supply (2.4V to 5.5V) |
2 | GND | Ground |
3 | SCL | I2C Clock |
4 | SDA | I2C Data |
5 | ADR | Address selection pin |
6 | ALR | Alert pin (active low) |
7 | NC | Not connected |
8 | NC | Not connected |
#include <Wire.h>
#include "Adafruit_SHT31.h"
Adafruit_SHT31 sht31 = Adafruit_SHT31();
void setup() {
Serial.begin(9600);
if (!sht31.begin(0x44)) { // Set to 0x45 for the alternative I2C address
Serial.println("Couldn't find SHT31");
while (1) delay(1);
}
}
void loop() {
float t = sht31.readTemperature();
float h = sht31.readHumidity();
if (!isnan(t)) { // Check if 't' is not a NaN value
Serial.print("Temp *C = "); Serial.println(t);
} else {
Serial.println("Failed to read temperature");
}
if (!isnan(h)) { // Check if 'h' is not a NaN value
Serial.print("Hum. % = "); Serial.println(h);
} else {
Serial.println("Failed to read humidity");
}
delay(500);
}
Q: Can the SHT31-D sensor be used outdoors? A: Yes, but it should be protected from direct sunlight, high humidity, and water ingress.
Q: What is the purpose of the ADR pin? A: The ADR pin allows you to change the I2C address of the sensor. This is useful if you have multiple sensors on the same I2C bus.
Q: How often should the sensor be calibrated? A: The SHT31-D is factory-calibrated. However, recalibration is recommended if the sensor is used in harsh environmental conditions over a long period.
For further assistance, consult the Adafruit SHT31-D datasheet and the Sensirion SHT31-D technical documentation.