SHT10 Environment don´t work

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
quito96
Normal user
Posts: 10
Joined: 06 Sep 2020, 13:59

SHT10 Environment don´t work

#1 Post by quito96 » 06 Sep 2020, 14:17

Hi there,

my first Project Esp Easy Project is work with the SHT10 sensor.

I have bought a FS200-SHT10 sensor in advance and i have used Arduino Uno and SHT1x.h library, this works.
And the same Test works with ESP 8266 Wemos D1 as well.

Now I have a Wemos and Esp Easy with the goal to build the SHT10 but this doesn't work.
Is it possible that the library SHT1x.h is missing in Esp Easy?

How can i solved this issue?

BR Quito

TD-er
Core team member
Posts: 8748
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: SHT10 Environment don´t work

#2 Post by TD-er » 06 Sep 2020, 15:09

How do you build it?
If you're using Arduino IDE (which I do not suggest to use) you have to copy the dirs in the libs directory into the directory where your Arduino IDE installation does keep its libraries. (depends on whether you're using a stand-alone or installed version)

When using PlatformIO, the libraries should be included automatically.

quito96
Normal user
Posts: 10
Joined: 06 Sep 2020, 13:59

Re: SHT10 Environment don´t work

#3 Post by quito96 » 06 Sep 2020, 16:17

quito96 wrote: 06 Sep 2020, 14:17 I have bought a FS200-SHT10 sensor in advance and i have used Arduino Uno and SHT1x.h library, this works.
And the same Test works with ESP 8266 Wemos D1 as well.
This was only for testing the STH10 Hardware.
Now I use a Wemos and Esp Easy, but the SHT10 doesn't work.
Add the STH10 like this HowTo https://www.letscontrolit.com/wiki/inde ... itle=SHT1X

TD-er
Core team member
Posts: 8748
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: SHT10 Environment don´t work

#4 Post by TD-er » 06 Sep 2020, 17:10

Are you building a firmware version for yourself, or do you try using a nightly build? See: https://github.com/letscontrolit/ESPEasy/releases
If it is a nightly build, please tell which one.

quito96
Normal user
Posts: 10
Joined: 06 Sep 2020, 13:59

Re: SHT10 Environment don´t work

#5 Post by quito96 » 06 Sep 2020, 17:52

I use this one:

Build:⋄ 20110 - Mega
System Libraries:⋄ ESP82xx Core 5d3af165, NONOS SDK 2.2.2-dev(38a443e), LWIP: 2.1.2 PUYA support
Git Build:⋄
Plugin Count:⋄ 46 [Normal]
Build Origin: Travis
Build Time:⋄ Aug 29 2020 16:09:41
Binary Filename:⋄ ESP_Easy_mega_20200829_normal_ESP8266_4M1M
Build Platform:⋄ Linux-4.19.104-microsoft-standard-x86_64-with-glibc2.29
Git HEAD:⋄ mega_c625d91

TD-er
Core team member
Posts: 8748
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: SHT10 Environment don´t work

#6 Post by TD-er » 06 Sep 2020, 21:46

OK, and what is exactly happening, or failing?
What have you tried?

If you're using a pre-built image, then it has nothing to do with missing libraries.
Either the plugin is included in the build or it isn't.
See here to check which plugin is included in what build: https://espeasy.readthedocs.io/en/lates ... al-plugins

SHT1x (plugin 31) should be included in the "normal" builds.

quito96
Normal user
Posts: 10
Joined: 06 Sep 2020, 13:59

Re: SHT10 Environment don´t work

#7 Post by quito96 » 07 Sep 2020, 20:47

Hi,

First i have checked that Wemos D1 Pro and SHT10 Hardware to be sure that it works :!: http://arduinolearning.com/amp/code/ard ... xample.php

Setup ESP Easy for Wemos D1 Pro - Works :!:
Environment BME280 —> Works :!:
Environment SHT10 —> Installed like How To-> https://www.letscontrolit.com/wiki/inde ... itle=SHT1X
—> FAILED WITH MESSAGE SHT1X : Sensor did not ACK command :oops:

Cabling tested — OK — tryed to swap the lines data and clock-wit no success :!:

Second check Wemos D1 Pro and SHT10 Hardware works http://arduinolearning.com/amp/code/ard ... xample.php Result:OK :!:

See Logfile:
994058: WD : Uptime 17 ConnectFailures 0 FreeMem 21848 WiFiStatus WL_CONNECTED
997505: BME280: dew point 12.64C
997516: BME280 : Address: 0x77
997517: BME280 : Temperature: 21.09
997517: BME280 : Humidity: 58.66
997517: BME280 : Barometric Pressure: 1014.66
998398: SHT1X : Sensor did not ACK command

I suspect my SHT10 is not compatible with Easy ESP :roll:

TD-er
Core team member
Posts: 8748
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: SHT10 Environment don´t work

#8 Post by TD-er » 07 Sep 2020, 21:00

Do you use pull up resistors on the SDA and SCL lines?
Maybe those other pieces of test code do activate an internal pull up resistor?

Please also check the I2C clock frequency.
Maybe this sensor can only handle 100 kHz? (default setting is 400 kHz)

quito96
Normal user
Posts: 10
Joined: 06 Sep 2020, 13:59

Re: SHT10 Environment don´t work

#9 Post by quito96 » 07 Sep 2020, 21:05

Do you use pull up resistors on the SDA and SCL lines?
Maybe those other pieces of test code do activate an internal pull up resistor?
Try with pull up and without pull up resitors—> don´t work

Please also check the I2C clock frequency.
How can i do this?
Maybe this sensor can only handle 100 kHz? (default setting is 400 kHz)
— Datasheet Sensirion SHT10 SCK Frequency max 1MHZ—

TD-er
Core team member
Posts: 8748
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: SHT10 Environment don´t work

#10 Post by TD-er » 07 Sep 2020, 21:25

Web interface => Hardware tab.
That's where you define the I2C pins and the clock speed.

And it is possible the sensor may work on higher frequencies, but then the cabling and pull up resistors must also match.
It is just a bit more forgiving on lower frequencies.

If that's not working, you may also try to enable pull up resistors on the same web page for both the SDA and SCL pin, or simply add pull up resistors between those pins and 3v3 (resistor of 4k7 should be fine, but is not too critical)

quito96
Normal user
Posts: 10
Joined: 06 Sep 2020, 13:59

Re: SHT10 Environment don´t work

#11 Post by quito96 » 07 Sep 2020, 21:31

no chance... ...does not work

I think I'm going to put the whole thing back together again.
The 8266 is a WEMOS D1 Mini Pro - Which bin do you recommend?

TD-er
Core team member
Posts: 8748
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: SHT10 Environment don´t work

#12 Post by TD-er » 07 Sep 2020, 21:55

OK, I just fell into the same trap again.... which is relying on my memory.
And apparently my memory is quite corrupt regarding the interface of the SHT1x sensor.
Every single time it is asked or mentioned, my memory keeps telling me it is an I2C sensor, but I just looked at the code and apparently it isn't.

So sorry about the confusion I caused by mentioning the I2C settings.

Still, it may be a good idea to test with pull-up resistors.

Given a remark in the code about a delay needed for longer cables, I wonder how long your cabling is.

quito96
Normal user
Posts: 10
Joined: 06 Sep 2020, 13:59

Re: SHT10 Environment don´t work

#13 Post by quito96 » 07 Sep 2020, 22:03

The Cable is 1m long…..

Try with or without pullup resistor and with 100NF Capacitor no change

TD-er
Core team member
Posts: 8748
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: SHT10 Environment don´t work

#14 Post by TD-er » 07 Sep 2020, 22:07

Have you also tried changing the "Clock delay" of the task?
It has a note stating: Reduce clock/data frequency to allow for longer cables

And to be honest, 1m cable does fall into this "longer" category.

Comments in the code state: delay of 10 usec is enough for a 30m CAT6 UTP cable.

quito96
Normal user
Posts: 10
Joined: 06 Sep 2020, 13:59

Re: SHT10 Environment don´t work

#15 Post by quito96 » 07 Sep 2020, 22:12

no matter what I try it does not work out... tomorrow I set the whole thing up again :roll:

first of all thanks, I will let you know if it works

quito96
Normal user
Posts: 10
Joined: 06 Sep 2020, 13:59

Re: SHT10 Environment don´t work

#16 Post by quito96 » 12 Sep 2020, 18:27

Update:

Today I have completely rebuilt Easy Esp for a second time.
Unfortunately also without success.

Today I borrowed a Lokic Analyser and looked at the communication to the SHT10. There is actually no communication between Wemos and SHT10.

Figure 1 shows the communication between a Wemos D1 and a SHT10 sensor using Arduino Sketch as you would expect.
Bildschirmfoto 2020-09-12 um 17.56.06.jpg
Bildschirmfoto 2020-09-12 um 17.56.06.jpg (209.28 KiB) Viewed 13155 times


Figure 2 shows the communication between EasyESP and SHT10:
Bildschirmfoto 2020-09-12 um 17.57.40.jpg
Bildschirmfoto 2020-09-12 um 17.57.40.jpg (189.38 KiB) Viewed 13155 times
The pictures speak for themselves. FAILED WITH MESSAGE SHT1X : Sensor did not ACK command
The meassage in the logfile means: No Communication to SHT10 and thats correct.

But why is that so? :?:

I set it up according to the instructions as given in the device.

TD-er
Core team member
Posts: 8748
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: SHT10 Environment don´t work

#17 Post by TD-er » 12 Sep 2020, 20:11

Can you give a schematic diagram how it is connected to the ESP?
Also please give the pins used and also what pull-up resistors are used. (if any)

quito96
Normal user
Posts: 10
Joined: 06 Sep 2020, 13:59

Re: SHT10 Environment don´t work

#18 Post by quito96 » 13 Sep 2020, 12:21

Hi TD-er,

as I already explained above, the pullup internally or externally (4K7) is not important.
I had already tested this sufficiently.
Additionally pullup and capacitor are integrated in the present SHT10.
This SHT10 is completely assembled and ready to use.

Bildschirmfoto 2020-09-13 um 11.58.19.jpg
Bildschirmfoto 2020-09-13 um 11.58.19.jpg (131.08 KiB) Viewed 13123 times
The code below is installed on a second WemosPro and wired exactly like the ESP Easy installation and works.See code and Logic Analyser Result.

Code: Select all

#include <SHT1x.h>
 
// Specify data and clock connections and instantiate SHT1x object
#define dataPin  12  //D6 SDA-Wemos D1 Mini
#define clockPin 13  //D7 SCK-Wemos D1 Mini
SHT1x sht1x(dataPin, clockPin);
 
void setup()
{
   Serial.begin(38400); // Open serial connection to report values to host
   Serial.println("Starting up");
}
 
void loop()
{
  float temp_c;
  float temp_f;
  float humidity;
 
  // Read values from the sensor
  temp_c = sht1x.readTemperatureC();
  temp_f = sht1x.readTemperatureF();
  humidity = sht1x.readHumidity();
 
  // Print the values to the serial port
  Serial.print("Temperature: ");
  Serial.print(temp_c, DEC);
  Serial.print("C / ");
  Serial.print(temp_f, DEC);
  Serial.print("F. Humidity: ");
  Serial.print(humidity);
  Serial.println("%");
 
  delay(2000);
}
Bildschirmfoto 2020-09-12 um 17.56.06.jpg
Bildschirmfoto 2020-09-12 um 17.56.06.jpg (209.28 KiB) Viewed 13123 times

Post Reply

Who is online

Users browsing this forum: No registered users and 48 guests