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.
Kliklistrik |
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.
- 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:
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: