Sonoff TH16

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
biros
New user
Posts: 1
Joined: 19 Mar 2021, 16:39

Sonoff TH16

#1 Post by biros » 19 Mar 2021, 17:32

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).
Attachments
2.JPG
2.JPG (114.21 KiB) Viewed 15842 times
1.JPG
1.JPG (35.01 KiB) Viewed 15842 times
3.jpg
3.jpg (44.49 KiB) Viewed 15842 times

User avatar
Ath
Normal user
Posts: 3417
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Sonoff TH16

#2 Post by Ath » 21 Mar 2021, 09:50

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?
/Ton (PayPal.me)

JWD
New user
Posts: 9
Joined: 19 Feb 2022, 21:34

Re: Sonoff TH16

#3 Post by JWD » 19 Feb 2022, 21:54

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?

JWD
New user
Posts: 9
Joined: 19 Feb 2022, 21:34

Re: Sonoff TH16

#4 Post by JWD » 19 Feb 2022, 21:58

Oh - I saw another valid pair of readings! But now back to NaN!

User avatar
Ath
Normal user
Posts: 3417
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Sonoff TH16

#5 Post by Ath » 19 Feb 2022, 22:03

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.
/Ton (PayPal.me)

JWD
New user
Posts: 9
Joined: 19 Feb 2022, 21:34

Re: Sonoff TH16

#6 Post by JWD » 19 Feb 2022, 22:20

Thanks - in the meantime, is there anything I can do to mitigate the issue?

JWD
New user
Posts: 9
Joined: 19 Feb 2022, 21:34

Re: Sonoff TH16

#7 Post by JWD » 23 Feb 2022, 09:09

Now tried with an AM2301 but same NaN result.

d.pancer
Normal user
Posts: 27
Joined: 30 Jan 2021, 21:42

Re: Sonoff TH16

#8 Post by d.pancer » 21 Apr 2022, 19:58

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?

JWD
New user
Posts: 9
Joined: 19 Feb 2022, 21:34

Re: Sonoff TH16

#9 Post by JWD » 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

d.pancer
Normal user
Posts: 27
Joined: 30 Jan 2021, 21:42

Re: Sonoff TH16

#10 Post by d.pancer » 21 Apr 2022, 20:26

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.

JWD
New user
Posts: 9
Joined: 19 Feb 2022, 21:34

Re: Sonoff TH16

#11 Post by JWD » 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!

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

Re: Sonoff TH16

#12 Post by TD-er » 22 Apr 2022, 09:45

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

d.pancer
Normal user
Posts: 27
Joined: 30 Jan 2021, 21:42

Re: Sonoff TH16

#13 Post by d.pancer » 23 Apr 2022, 21:25

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.

JWD
New user
Posts: 9
Joined: 19 Feb 2022, 21:34

Re: Sonoff TH16

#14 Post by JWD » 23 Apr 2022, 22:12

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.

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

Re: Sonoff TH16

#15 Post by TD-er » 23 Apr 2022, 22:52

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.

JWD
New user
Posts: 9
Joined: 19 Feb 2022, 21:34

Re: Sonoff TH16

#16 Post by JWD » 24 Apr 2022, 12:51

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.

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

Re: Sonoff TH16

#17 Post by TD-er » 24 Apr 2022, 20:28

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)

JWD
New user
Posts: 9
Joined: 19 Feb 2022, 21:34

Re: Sonoff TH16

#18 Post by JWD » 24 Apr 2022, 20:41

Yes all 4 of my sensors added in the same way as before and all giving valid readings! Result!

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 21 guests