The Adafruit HDC1008 is a digital sensor that provides precise measurements of temperature and humidity. Utilizing an I2C interface for communication, this sensor is ideal for a wide range of applications, including weather monitoring systems, HVAC (Heating, Ventilation, and Air Conditioning) control, and any project where environmental monitoring is essential.
Pin Number | Name | Description |
---|---|---|
1 | VDD | Power supply (3.3V to 5V) |
2 | GND | Ground |
3 | SDA | I2C Data |
4 | SCL | I2C Clock |
5 | ADDR | Address pin (connect to GND or VDD) |
6 | DRDYn | Data Ready (active low; optional use) |
#include <Wire.h>
#include "Adafruit_HDC1008.h"
Adafruit_HDC1008 hdc = Adafruit_HDC1008();
void setup() {
Serial.begin(9600);
if (!hdc.begin()) {
Serial.println("Couldn't find sensor!");
while (1);
}
}
void loop() {
Serial.print("Temp: ");
Serial.print(hdc.readTemperature());
Serial.print("°C, Humidity: ");
Serial.print(hdc.readHumidity());
Serial.println("%");
delay(1000); // Wait for 1 second between measurements
}
Q: Can the HDC1008 be used with both 3.3V and 5V systems? A: Yes, the HDC1008 can operate with a supply voltage from 3.3V to 5V.
Q: How can I change the I2C address of the sensor? A: The I2C address can be changed by connecting the ADDR pin to either GND (0x40) or VDD (0x41).
Q: Is calibration required for the HDC1008 sensor? A: The HDC1008 comes factory-calibrated. However, for critical applications, you may perform additional calibration.
Q: What is the maximum I2C bus speed for the HDC1008? A: The HDC1008 supports standard (100kHz) and fast (400kHz) I2C bus speeds.
For further assistance, consult the Adafruit HDC1008 datasheet and your microcontroller's documentation.