SHT35 → Temperature and Humidity Sensor

Sensirion Temperature/Humidity sensors are some of the finest & highest-accuracy devices you can get. And with a true I2C interface, reading the data is for easy. The SHTC3 sensor has an excellent ±2% relative humidity and ±0.2°C accuracy for most uses.

Install the Adafruit SHT31 library:

Copy/Paste this example and upload it to your board.

#include <Arduino.h> #include <Wire.h> #include "Adafruit_SHT31.h" Adafruit_SHT31 sht31 = Adafruit_SHT31(); void setup() { Serial.begin(115200); while (!Serial) delay(10); // will pause Zero, Leonardo, etc until serial console opens Serial.println("SHT31 test"); if (! sht31.begin(0x45)) { // Set to 0x45 for alternate i2c addr Serial.println("Couldn't find SHT31"); while (1) delay(1); } } void loop() { float t = sht31.readTemperature(); float h = sht31.readHumidity(); if (! isnan(t)) { // check if 'is not a number' Serial.print("Temp *C = "); Serial.println(t); } else { Serial.println("Failed to read temperature"); } if (! isnan(h)) { // check if 'is not a number' Serial.print("Hum. % = "); Serial.println(h); } else { Serial.println("Failed to read humidity"); } Serial.println(); delay(1000); }

Open the Serial Monitor (Tools -> Serial Monitor) and you should see the values appearing every second.

Select a repo