The Adafruit HTU21D-F is a high-precision digital temperature and humidity sensor module that provides reliable and accurate readings. It is based on the HTU21D sensor by TE Connectivity. This sensor is ideal for a wide range of applications including weather stations, climate control systems, and environmental monitoring projects. Its small form factor and low power consumption make it suitable for portable and battery-powered applications.
Pin Number | Name | Description |
---|---|---|
1 | VDD | Power supply (3.3V to 5V) |
2 | GND | Ground |
3 | SDA | I2C Data |
4 | SCL | I2C Clock |
Before you can use the HTU21D-F with an Arduino, you need to install the Adafruit HTU21DF library. You can install it using the Arduino Library Manager by searching for "Adafruit HTU21DF."
Here is a simple example code to get you started:
#include <Wire.h>
#include <Adafruit_HTU21DF.h>
// Create an instance of the Adafruit_HTU21DF class
Adafruit_HTU21DF htu = Adafruit_HTU21DF();
void setup() {
Serial.begin(9600);
Serial.println("HTU21D-F test");
if (!htu.begin()) {
Serial.println("Couldn't find sensor!");
while (1);
}
}
void loop() {
Serial.print("Temp: "); Serial.print(htu.readTemperature());
Serial.print(" C\tHumidity: "); Serial.print(htu.readHumidity());
Serial.println(" %");
delay(500);
}
Q: Can the HTU21D-F sensor be used with a 5V system? A: Yes, the sensor can be directly connected to a 5V system.
Q: How can I calibrate the sensor? A: The HTU21D-F comes factory-calibrated. However, for critical applications, you may need to perform field calibration. Refer to the sensor's datasheet for detailed calibration procedures.
Q: Is the sensor waterproof? A: No, the HTU21D-F is not waterproof and should be protected from condensation and water exposure.
For further assistance, consult the Adafruit HTU21D-F datasheet and the Adafruit support forums.