will be read-only starting December 31st, 2018. For more info please look at this Forum Post

:: Sensirion Humidity and Temperature Sensors ::

Sensirion humidity and temperature sensor support on Arduino.


GitHub Repository

Supported Sensors

The following sensors are supported:

  • SHTC1
  • SHTW1
  • SHTW2
  • SHT3x-DIS (I2C)
  • SHT3x-ARP (ratiometric analog voltage output)


Download arduino-sht either from GitHub via git or from the releases page and place it in your Arduino/libraries directory. After restarting the Arduino IDE, you will see the new SHTSensor menu items under libraries and examples.

Integrating it Into Your Sketch

Assuming you installed the library as described above, the following steps are necessary:

  • Import the Wire library like this: From the menu bar, select Sketch > Import Library > Wire
  • Import the arduino-sht library: From the menu bar, select Sketch > Import Library > arduino-sht
  • Create an instance of the SHTSensor class (SHTSensor sht;)
  • In setup(), make sure to init the Wire library with Wire.begin()
  • If you want to use the serial console, remember to initialize the Serial library with Serial.begin(9600)
  • Call sht.readSample() in the loop() function, which reads a temperature and humidity sample from the sensor
  • Use sht.getHumidity() and sht.getTemperature() to get the values from the last sample

Important: getHumidity() and getTemperature() do not read a new sample from the sensor, but return the values read last. To read a new sample, make sure to call readSample()

Sample Code

#include <Wire.h>
#include <SHTSensor.h>

SHTSensor sht;

void setup() {
  // put your setup code here, to run once:


void loop() {
  // put your main code here, to run repeatedly:

  Serial.print("  RH: ");
  Serial.print(sht.getHumidity(), 2);
  Serial.print("  T:  ");
  Serial.print(sht.getTemperature(), 2);


Sensirion Developer Page

Check out the Sensirion Developer page for more information: