Problem with SHT10

Hi all

I’m triying to connect a sht10 hum&temp sensor to my electron/photon.


I hooked the cables:

Red—3,3V
Green–ground
yellow–Clock----D1
Blue—Data—D0
I put a 10K resistor from data(blue) to 3,3v

The code:

// This #include statement was automatically added by the Particle IDE.
#include <SHT1x.h>

#include "math.h"


// Specify data and clock connections and instantiate SHT1x object
#define dataPin  D0
#define clockPin D1
SHT1x sht1x(dataPin, clockPin);

void setup()
{
    Serial.begin(9600);
    delay(10000);
    Particle.publish("test","===Starting===");
    Serial.println("===Starting===");
}

void loop()
{
    float temp_c;
    float temp_f;
    float humidity;
    
    // Read values from the sensor
    temp_c = sht1x.readTemperatureC();
    humidity = sht1x.readHumidity();
    Serial.println("temp");
    Serial.println(temp_c);
    Serial.println("hum");
    Serial.println(humidity);
    Particle.publish("test",temp_c);
            Particle.process();
    delay(5000);
}

If I connect to putty to follow serial I received a message saying “Serial disconnected”

The console did not give any information

Any body know’s what I’m doing wrong?

Many thank’s

Eduard

You may want to use the second resistor too (as pullup for the clock pin)

Nothing happen, I connected a second resistor to click and nothing happens

You can try the red wire and the two pullups on Vin instead of 3v3 or swap the 10k resistors for 4k7

Hi,

At the end I solved the problem, wiring correctly 3,3v to a 10k resistor to data and formating the reading: String(temp_c,2)

thank’s for your help