Page 1 of 1

Sensirion SHT20

Posted: 01 Jul 2017, 23:08
by felixm
Dear forum members,

some weeks ago i ordered a soil moisture sensor from china (like this: https://de.aliexpress.com/item/Soil-tem ... 08137.html), unfortunately i thought ESPeasy support all sht-series. Now i've got one with SHT20 - Sensor and won't get it working.

I tried Sl7021 Module via I2C, tried adopting the SHT3X-module from forum (https://www.letscontrolit.com/forum/vie ... php?t=2363), only resulting in Read errors or false values (like 72678°C).

On my search i found a Arduino Library for Sensirion Sensors https://forum.arduino.cc/index.php?topic=404335.0. The example sketch works flawlessly with my wiring. i quickly wrote a new module for ESPEasy
_P064_SHT.ino.zip
(1.45 KiB) Downloaded 394 times
using the same commands as in the example sketch (it works I2C-independent, non-blocking). Unfortunately i only get Timeout Errors. I tried many combinations of GPIO's, tried using R147 as abse and the new dev10. All the same.
As it's not the ACK-Command that's missing, but only the answer it seems that it basically works and the response will not be heard. I assume that ESPEasy interferes the answer in any way, but i don't understand the big ESPEasy sketch in detail at this point.

Is there anybody on forum that may point me to a way to a solution?

Re: Sensirion SHT20

Posted: 02 Jul 2017, 23:23
by felixm
now i solved the problem: The measure() command has to be called repeatedly until the measurement is ready. In the example loop() is running repeatedly, in ESPEasy PLUGIN_READ is called once a minute.

Just added a small while loop and it works.

Note: If you're using DeepSleep the module has to call sendData after finsihing mesurement, as the regular send is already done at this point (measurement needs too long).

I upload the working module as attachment. It should work with all Sensirion SHT 1X, SHT 2X, SHT 3x Sensors. I tested only SHT 20. You need the Sensirion library from here https://forum.arduino.cc/index.php?topic=404335.0.
It could even replace the SHT1X module ,as this is also I2C-independent and compatible for all series. It has ACK and CRC managment built in.

felix

Re: Sensirion SHT20

Posted: 26 Jan 2019, 13:32
by batal131
Any news here? Have SHT20 that not working with Si7021 plugin :( But wirking on other firmwares.

https://www.aliexpress.com/item/SHT20-D ... 23015.html

Re: Sensirion SHT20

Posted: 28 Jan 2019, 12:38
by batal131
Anyway, adopted this plugin to latest mega and sht20 works. Thanks :) As result I have working sht20 and some fantom reboots, but that's not a big problem.

Re: Sensirion SHT20

Posted: 17 Jul 2019, 11:43
by PeterF
Can you please post your adapted, _P064_SHT.ino ?
I got an error while compliling:

Code: Select all

no matching function for call to 'addFormSelector(String&, const __FlashStringHelper*, const __FlashStringHelper*, int, const String [3], int [3], int16_t&)'
Yours Peter

Re: Sensirion SHT20

Posted: 03 Jun 2020, 12:39
by Mararero
Hello,
greetings to all. Let's see if anyone can help me ...
Buy three SHT20 sensors to measure soil moisture. The sensor is connected to pins D1 and D2 of the wemos D1 mini board, with Espeasy mega frimware. With device SHT1x it does not send data and neither with SI7021. Here we talk about a plugin but I don't know if it is incorporated in the latest version of mega ?. What device should I use?
Thank you!