Linkit One and HDC1008 humidity and temperature sensor

The HDC1008 is a digital humidity sensor with integrated temperature sensor that provides excellent measurement accuracy at very low power. The device measures humidity based on a novel capacitive sensor. The humidity and temperature sensors are factory calibrated.

The sensing element of the HDC1000 is placed on the bottom part of the device, which makes the HDC1000 more robust against dirt, dust, and other environmental contaminants. The HDC1008 is functional within the full –40°C to +125°C temperature range.

Here is a typical module with the device

hdc1008

Key Features

  • Relative Humidity (RH) Operating Range 0% to 100%
  • 14 Bit Measurement Resolution
  • Relative Humidity Accuracy ±3%
  • Temperature Accuracy ±0.2°C
  • Supply Voltage 3 V to 5 V
  • I2C Interface

 

Layout

Here is a layout showing how to connect the HDC1008 to the Linkit One

%e2%80%8clinkitone-and-hdc1008_bb

 

Code

The good folks at Adafruit have done the hard work and produced a library for this device – https://github.com/adafruit/Adafruit_HDC1000_Library  .

If you are using Arduino IDE 1.6.5 or later you can easily import this library by going to Sketch -> Include Library -> Manage Libraries

[codesyntax lang=”cpp”]

#include <Wire.h>
#include "Adafruit_HDC1000.h"


Adafruit_HDC1000 hdc = Adafruit_HDC1000();

void setup() 
{
  Serial.begin(9600);
  Serial.println("HDC100x test");

  if (!hdc.begin()) 
  {
    Serial.println("Couldn't find sensor!");
    while (1);
  }
}


void loop() 
{
  Serial.print("Temp: "); Serial.print(hdc.readTemperature());
  Serial.print("\t\tHum: "); Serial.println(hdc.readHumidity());
  delay(500);
}

[/codesyntax]

Output

Open the serial monitor and you should see something like this

Temp: 29.33             Hum: 44.81
Temp: 29.31             Hum: 44.81
Temp: 29.28             Hum: 44.81
Temp: 29.25             Hum: 44.81
Temp: 29.25             Hum: 44.90
Temp: 29.22             Hum: 44.90
Temp: 29.22             Hum: 44.90
Temp: 29.18             Hum: 44.90
Temp: 29.16             Hum: 44.89
Temp: 29.13             Hum: 44.98
Temp: 29.11             Hum: 44.98
Temp: 29.10             Hum: 44.98
Temp: 29.08             Hum: 44.98
Temp: 29.07             Hum: 45.08
Temp: 29.06             Hum: 45.08
Temp: 29.04             Hum: 45.08

 

Links

Adafruit HDC1008 Temperature & Humidity Sensor Breakout Board