Sunday, 3 March 2019

Sonoff TH10 Dual Sensor Modification

I wanted a second temperature sensor on my Sonoff TH10. I had read the blog post from Xose "Tinkerman" Pérez and decided to set about modifying my switch.

I was dismayed to find that the board in my device was neither of the two he discusses. I don't know what the version is of Tinkerman's board, but mine says Ver 2.1 2018-06-15. Surprisingly, I think the schematic is the same as the circuit on the Sonoff Wiki. IN any case, it turns out the 2.5mm jack socket has GPIO4 and GPIO14 exposed already.

I reckon Sonoff were going to market a "cheap" version which only worked with a single one-wire sensor and an "expensive" version which would work with two wire devices and they've ditched the
idea and just fully populated the board.

Anyway, my sensors are the Sonoff Si7021 type, which are a one-wire device. I've reflashed my device with TASMOTA which already supports a second temperature sensor on GPIO14.

I got the sensor pinout from the ITEAD Wiki and started looking at my options. I Could make a Y-splitter cable which takes the GPIO lines from the second ring and tip and passes them straight through to one socket, but crosses them over for a second socket. The less expensive option, though, was to buy a 2.5mm 4 pole jack socket and piggy-back onto the existing jack.

In the factory TH10 device,  
  • Screen = +3.3V
  • First ring = Gnd
  • Second ring = GPIO4
  • Tip = GPIO14
On the Si7021 sensor, 
  • Screen = +3.3V
  • First ring = Gnd
  • Second ring = no connection
  • Tip = GPIO14
So, for my secondary jack socket, I have wired GPIO4 out to the tip. This allows me to select a second temperature sensor in the TASMOTA interface. The sensor doesn't contain the wire to the second ring, so there can be no interference.

In TASMOTA, configuring to have a second temperature sensor is straightforward and requires no software modifications. I've gone Main / Configuration / Configure Module and selected Si7021 as the GPIO4 temperature sensor. The Configure Module and Main screens now look like this:


2 comments:

  1. Thanks for this. I had the same problem as you, trying to find information on the V2.1 2018-06-15. Thank you for posting this and saving me the hard work :) much appreciated.

    ReplyDelete
  2. Hi,, nice, do you know if it could be possible to change on/off status based on the DIFFERENCE between the 2 sensors , lets say... If S1(sensor1 Temp > S2 Temp, then ON Sonoff. Thanks in advance

    ReplyDelete