Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Sensors SHT35, SHT31 and SHT30

PriceChinese modules price: 7-17$

Adafruit SHT31 module price: 18$ + tax + delievery

Image AddedImage Added


Library: arduino-sht (github)

...

Code Block
languagecpp
titleExample scetch
collapsetrue
#include <Wire.h>

#include <SHTSensor.h>

SHTSensor sht;

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

  Wire.begin();
  Serial.begin(9600);
  delay(1000); // let serial console settle

  if (sht.init()) {
      Serial.print("Sensor Senserion SHT3X");
      Serial.print("\n\n");
  } else {
      Serial.print("init(): failed\n");
  }
  sht.setAccuracy(SHTSensor::SHT_ACCURACY_HIGH); // only supported by SHT3x

}

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

  if (sht.readSample()) {
      Serial.print("  T:  ");
      Serial.print(sht.getTemperature(), 2);
      Serial.print("  ");
      Serial.print("  RH: ");
      Serial.print(sht.getHumidity(), 2);
      Serial.print("\n");
  } else {
      Serial.print("Error in readSample()\n");
  }

  delay(1000);
}

Chinese modules Test Results


Children Display