Sensirion

Overview

The SHT1x/SHT2x provides calibrated, linearized sensor signals in digital, I2C format. The SHT1x/SHT2x humidity sensor series contains a capacitive-type humidity sensor, a band-gap temperature sensor, and specialized analog and digital integrated circuits – all on a single CMOSens® chip. This yields superior sensor performance in terms of accuracy and stability as well as minimal power consumption. Its relative humidity calculation accuracy is ±3%.

An electronic identification code is stored on the chip – which can be read out on command. Furthermore, the resolution of the SHT2x humidity sensor can be changed on command (8/12 bit up to 12/14 bit for RH/T) and a checksum helps to improve communication reliability. With this set of features and its proven reliability and long-term stability, the SHT2x humidity sensor offers an outstanding price-performance ratio.

In the second figure, you can see a water proof version of this sensor for outdoor deployment.

Documentation for this sensor is available here.

Connecting to Arduino

SHT Sensor Pins Arduino Pins
VDD/VCC 5V or 3.3V
GND GND
SDA 2
SCL 3

Code example

#include "Sensirion.h"

#define SHTD_PIN 2
#define SHTC_PIN 3
#define SHT2x

//we can also power the SHT with a digital pin, here pin 6
#define PIN_POWER 6

#ifdef SHT2x
Sensirion sht = Sensirion(SHTD_PIN, SHTC_PIN, 0x40);
#else
Sensirion sht = Sensirion(SHTD_PIN, SHTC_PIN);
#endif

float h;
float t;
int ret;
int retry=0;
    
void setup() {

  delay(3000);
  Serial.begin(38400);
  //and to power the temperature sensor
  pinMode(PIN_POWER,OUTPUT);
}

void loop() {

    digitalWrite(PIN_POWER,HIGH);
    delay(1000);
    
    while ( (ret != S_Meas_Rdy) ) {
      ret=sht.measure(&t, &h);
      retry++;
      Serial.print("[");
      Serial.print(ret);
      Serial.print(":");
      Serial.print(retry);
      Serial.print("] ");      
    }

    if (ret != S_Meas_Rdy) {
        Serial.println("Failed to read from SHT sensor!"); 
    }
    else {         
        Serial.print("Temperature: ");
        Serial.print(t);
        Serial.print(" degrees Celcius Humidity: ");
        Serial.print(h);
        Serial.println("%"); 
    }

    digitalWrite(PIN_POWER,LOW);
    ret=0;
    retry=0;
    delay(5000);
}    

The raw source of the sketch example is visible here.

Enjoy!