Sensirion SHT20

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
felixm
Normal user
Posts: 4
Joined: 09 Oct 2016, 17:05

Sensirion SHT20

#1 Post by felixm » 01 Jul 2017, 23:08

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 123 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?

felixm
Normal user
Posts: 4
Joined: 09 Oct 2016, 17:05

Re: Sensirion SHT20

#2 Post by felixm » 02 Jul 2017, 23:23

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
Attachments
_P064_SHT.ino.zip
(1.52 KiB) Downloaded 159 times

batal131
Normal user
Posts: 21
Joined: 20 Dec 2017, 08:23

Re: Sensirion SHT20

#3 Post by batal131 » 26 Jan 2019, 13:32

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

batal131
Normal user
Posts: 21
Joined: 20 Dec 2017, 08:23

Re: Sensirion SHT20

#4 Post by batal131 » 28 Jan 2019, 12:38

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.

PeterF
Normal user
Posts: 1
Joined: 17 Jul 2019, 11:40

Re: Sensirion SHT20

#5 Post by PeterF » 17 Jul 2019, 11:43

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

Mararero
Normal user
Posts: 1
Joined: 03 Jun 2020, 12:15

Re: Sensirion SHT20

#6 Post by Mararero » 03 Jun 2020, 12:39

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!

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 14 guests