cactus.io logo

Hookup TI HDC1008 Humidity Temperature Sensor to Arduino

Overview

The easist way to connect the TI HDC1008 Sensor is to use a breakout board. We used the Adafruit HDC1008 board. It requires only 4 wires. This being for power and data. Once the sensor is connected up to the Arduino the next step is to download the HDC1008 library and sample sketch. We can then program the board and check out the results via the console.

Images

View Honeywell HIH6130 Humidity - Temperature Sensor Details
Note: Images shown on this page are not to scale.

Parts List

Data Sheets


Hookup Diagram

Connecting up the sensor requires 4 wires. We can source power from either the 5V or the 3.3V pin on the Arduino. We are using the 5V pin in the diagram. The data wire (SDA) is connected to pin A4. The clock wire (SCL) is connected to pin A5 on the Arduino. We are not using the alarm (AL_H and AL_L) outputs from the sensor. The alarm outputs require additional programming and software that is not included in the cactus.io HDC1008 library.

Connect Arduino to Texas Instruments HDC1008 Humidity - Temperature Sensor

Software

You will need to download the cactus.io HDC1008 library to use the sample sketch shown below.

Using the Arduino IDE we can run this sample sketch to read data from the sensor. Once you upload the compiled code to the Arduino board you can see the results displayed on the serial console.

In the sample sketch below we read the HDC1008 sensor and output the results to the console every three seconds.

Texas Instruments HDC1008 Sample Sketch
Download as (Arduino Sketch) (Text File)
1
#include <Wire.h>
2
#include "cactus_io_HDC1008.h"
3
4
//Set up an instance of the sensor
5
HDC1008 hdc = HDC1008();
6
7
void setup() {
8
Serial.begin(9600);
9
Serial.println("TI HDC1008 Humidity - Temperature Sensor | cactus.io");
10
Serial.println("Temp\t\tTemp\t\tHumidity");
11
Serial.println("(celsius)\t(fahrenheit)\t(%)");
12
13
// Check if the sensor is connected and can be found by the Arduino
14
if (!hdc.begin()) {
15
Serial.println("Couldn't find sensor!");
16
while (1);
17
}
18
}
19
20
void loop() {
21
// Read the data -> stored to public variables
22
hdc.readSensor();
23
24
// Access the variables and print to serial monitor
25
Serial.print(hdc.temperature_C); Serial.print("\t\t");
26
Serial.print(hdc.temperature_F); Serial.print("\t\t");
27
Serial.print(hdc.humidity); Serial.print("\t\t");
28
29
delay(3000);// 3 second delay
30
}

Sketch Output

Connect Arduino to Texas Instruments HDC1008 Humidity - Temperature Sensor

License