Page 1 of 1

Sonoff TH16

Posted: 19 Mar 2021, 17:32
by biros
Hello,
Just bought a Sonoff TH16 (v2.1) with the Si7021 sensor. I tried adding the 7021 as an I2C device but i got a constant 0/00 / 0.00 temp/hum reading (so yeah, it's not a I2C bus sensor).
I've added it as a DHT11/12/22 SONOFF2301/7021 with GPIO-14 (D5) and it started showing the values but very rarely, "nan / nan" shows up very often in the devices table.
build: ESP_Easy_mega_20210114_normal_ESP8266_1M (tried with the newer but same results).

Re: Sonoff TH16

Posted: 21 Mar 2021, 09:50
by Ath
Can you verify that the wiring of the sensor is ok, f.e by moving the sensor to see if it works better, and also check if the connector on the TH16 isn't dirty, corroded or otherwise making a bad connection? And if possible, try another sensor?

Re: Sonoff TH16

Posted: 19 Feb 2022, 21:54
by JWD
I'm new to ESPEasy but havenow managed to get my Sonoff TH16 +Si7021 to show a valid reading on the Task screen. The problem is that the vast majority of the time I get these NaN values for the TEmperature and Humidity - in fact I have only seen proper values once! I haven't changed anything since and I am waiting for another one!
In the Log I am getting DHT: No Reading

I have GPIO Data set to GPIO-14 (D5) for the Sensor in the Task and Sensor model set to Si7021

Surely this has been around for a while and there might be a soluton by now? Please?

Re: Sonoff TH16

Posted: 19 Feb 2022, 21:58
by JWD
Oh - I saw another valid pair of readings! But now back to NaN!

Re: Sonoff TH16

Posted: 19 Feb 2022, 22:03
by Ath
There was a recent suggestion that the timing is a bit 'tight' on this type of sensor, so it will probably be made configurable in some way, no verdict on that yet.

Re: Sonoff TH16

Posted: 19 Feb 2022, 22:20
by JWD
Thanks - in the meantime, is there anything I can do to mitigate the issue?

Re: Sonoff TH16

Posted: 23 Feb 2022, 09:09
by JWD
Now tried with an AM2301 but same NaN result.

Re: Sonoff TH16

Posted: 21 Apr 2022, 19:58
by d.pancer
Hi,

any updates on this? I have have same problem. I keep getting "nan" values over and over.

Also, can this Si7021 sensor be run together with DS18b20's? I have another sonoff TH16 with multiple DS18b20 sensors running on it just great! Can I add a Si7021 on the same GPIO 14?

Re: Sonoff TH16

Posted: 21 Apr 2022, 20:05
by JWD
No update from me as I have resigned to just needing the temperature readings for this project. I am interested that you have multiple Temp sensors on one TH16 and I wondered if you might point me to any info on how you've done that?

Thanks

Re: Sonoff TH16

Posted: 21 Apr 2022, 20:26
by d.pancer
JWD wrote: 21 Apr 2022, 20:05 No update from me as I have resigned to just needing the temperature readings for this project. I am interested that you have multiple Temp sensors on one TH16 and I wondered if you might point me to any info on how you've done that?

Thanks

Sure, its super easy:

There are two versions of the TH16. Check out these two links link below:

https://tinkerman.cat/post/sonoff-th10- ... actuators/
https://lastminuteengineers.com/multipl ... -tutorial/

The version i have is this one:
Image

You just need to solder a thin wire to the GPIO 14 point behind the 2.5mm jack (labeled in the diagram above and on the website provided) and run it to the top side of the sonoff. I used the thin narrow slit on the board. Next you just grab your DS18b20 sensors and connect all grounds, vcc, and Data pins together. Everything is connected in series.

I used VCC and Ground breakout pins used for programing.


In the sonoff you select DS18b20 from the pull down, Select:
GPIO14
GPIO -> RX is set to "None"
Number of Output Values: Choose how many sensors you connected (Single, double, triple, Quad)

Hit submit.

next you will see some more drop down with addresses. Each dropdown corresponds to a sensors address. After you add them if you hold them in your hand to raise the temp you will be able to distinguish which sensor address is which sensor. Once you know this, you can label them according in the values section below.

Alternatively you can add each Sensor as a separate device, instead of using the (Single, double, triple, Quad) selects.

Re: Sonoff TH16

Posted: 22 Apr 2022, 09:03
by JWD
Just double checking - you said “ Next you just grab your DS18b20 sensors and connect all grounds, vcc, and Data pins together. Everything is connected in series” but that sounds like parallel? I have the waterproof Sonoff sensors with jacks- would I still need the soldered wire or access through the socket with one of the 2.5mm plugs. Sorry - at the edge of any technical knowledge here!

Re: Sonoff TH16

Posted: 22 Apr 2022, 09:45
by TD-er
Dallas 1wire sensors are indeed connected "in parallel".

Meaning the data pin is on the same (one) wire.
See here: https://www.letscontrolit.com/wiki/inde ... as_DS18b20

Re: Sonoff TH16

Posted: 23 Apr 2022, 21:25
by d.pancer
JWD wrote: 22 Apr 2022, 09:03 Just double checking - you said “ Next you just grab your DS18b20 sensors and connect all grounds, vcc, and Data pins together. Everything is connected in series” but that sounds like parallel? I have the waterproof Sonoff sensors with jacks- would I still need the soldered wire or access through the socket with one of the 2.5mm plugs. Sorry - at the edge of any technical knowledge here!
Yes, the sensors themselves are connected in parallel. I guess i should have worded it differently. I was referring to connecting all grounds, vcc, and data together....so each of the three connections would be connected in series relative to each other.

The sensor that has the 2.5mm jack can just be pugged into the jack port as per normal.

Re: Sonoff TH16

Posted: 23 Apr 2022, 22:12
by JWD
Thanks and sorry if the following is a dumb question…
If I cut the plugs off the 4 Sonoff temp sensors I have and expose the wires of all of the sensor cable ends, solder them together in parallel with the matching wires from one of the plugs should that work when I plug it into the TH16?
At the moment if have the 4 sensors each plugged into their own TH16 which seems like overkill. Each one monitors the air temperatures of the 4 supply / exhaust ducts of our home heat recovery ventilation. It would be a lot neater to just use one TH16 for all four sensors.

Re: Sonoff TH16

Posted: 23 Apr 2022, 22:52
by TD-er
Please check out the wiki link I posted 2 posts earlier.
Even though the Wiki is outdated for most of the ESPEasy documentation, it still has some very valuable info on questions like these.

Re: Sonoff TH16

Posted: 24 Apr 2022, 12:51
by JWD
Just for anyone not so smart as some about all this stuff, I cut the jack plug off near the plug of two of my Sonoff waterproof temp sensors then joined all the same colour wires from the cable to one plug to both of the temp sensors sets of wires and then added the individual devices as normal.
I now have two 18DSb20 Sonoff sensors giving their temperature readings to one TH16.

I’ll now add the other two and hope it all still works!

It was all the mentions of pull-up resistors I wasn’t sure about but I read eventually that it is already built into the TH16 circuit board, so using the jac plug to access the connections enquired for the one wire loop is fine.

Thanks for the smart people on here for nudging me in the right direction.

Re: Sonoff TH16

Posted: 24 Apr 2022, 20:28
by TD-er
Just add them one-by-one and keep an eye on whether it keeps working.
If there is a pull-up resistor in the Dallas sensor units, then after N modules it may no longer work (regardless the combination of sensors)
If adding a new one results in it no longer working, it might thus be related to the presence of such an resistor, or it could just be bad soldering or something else wrong with the sensor :)
I have tested it for quite a long time with 12 Dallas sensors on a small breadboard and I know that's working fine. So there is not really a limit to the nr of Dallas sensors you can use (apart from the limit in nr. of tasks and the fact you can configure upto 4 per task in ESPEasy)

Re: Sonoff TH16

Posted: 24 Apr 2022, 20:41
by JWD
Yes all 4 of my sensors added in the same way as before and all giving valid readings! Result!