I have a SHT-85 sensor connected to my Arduino Uno with the following wiring:
1 SCL - A5 analog in
2 VDD - 3.3V
3 VSS - GND
4 SDA - A4 analog in
I installed the arduino-sht library to Arduino IDE and uploaded the following code:
#include <SHTSensor.h>
#include <Wire.h>
SHTSensor sht;
// To use a specific sensor instead of probing the bus use this command:
// SHTSensor sht(SHTSensor::SHT3X);
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.println("init(): success\n");
} else {
Serial.println("init(): failed\n");
}
sht.setAccuracy(SHTSensor::SHT_ACCURACY_MEDIUM); // only supported by SHT3x
}
void loop() {
// put your main code here, to run repeatedly:
if (sht.readSample()) {
Serial.println("SHT:\n");
Serial.println(" RH: ");
Serial.println(sht.getHumidity(), 2);
Serial.println("\n");
Serial.println(" T: ");
Serial.println(sht.getTemperature(), 2);
Serial.println("\n");
} else {
Serial.println("Error in readSample()\n");
}
delay(2000);
}
Now, this results in the Serial Monitor returning exactly nothing.
So something is wrong either in the wiring or in the code. I have already tried the following:
-
Switch the SCL and SDA. This results in the "init(): failed" and "error in readSample()" at every attempt at reading.
-
Use 5V instead. No change
-
Downgrade to earlier versions of the sht library. No change.
Somebody who has experienced the same problem? Any help is greatly appreciated!