Component guide · Beginner · 3 min read
Sonoff TH10, TH16 and THR320D

Temperature and Humidity Switch Setup
By Geekobot Learning Team · Updated 29 Oct 2026
On this page
Sonoff TH switches are Wi-Fi relays with a jack for a temperature or humidity sensor, so they can run a heater, fan, dehumidifier, aquarium heater or incubator by reading, not just by schedule. The TH10 and TH16 switch 10 and 16 A; the THR320D Elite switches 20 A and has an LCD. Set limits in the eWeLink app, or run ESPHome or Tasmota for Home Assistant.
Key specs at a glance
- Load
- TH10 10 A, TH16 16 A, THR320D 20 A at 100 to 240 V AC
- Sensors
- Sonoff THS01 (temperature and humidity), DS18B20 waterproof probe (temperature), and others by model
- Sensor jack
- 2.5 mm jack (TH10/TH16), RJ9 (THR320D and newer sensors)
- Chip
- ESP8266 (TH10, TH16), ESP32 (THR320D)
- Display
- LCD on THR320D
- Modes
- Thermostat and humidistat rules in the app or firmware
This part is often wired to 230 V mains. Do all wiring with the plug pulled out, keep mains wires inside a closed box with strain relief, add a fuse, and never touch the board while it is plugged in. If you are new to mains wiring, have an electrician check it before you switch on.
Models in this guide
These are alternatives. Pick the one that fits your project; you only need one.
What the Sonoff TH is
Typical uses: keep a geyser or room heater between two temperatures, run an exhaust fan when humidity rises, or control a brooder lamp. The thermostat rule switches on below the low limit and off above the high limit, which avoids rapid cycling.
Check sensor compatibility: the older 2.5 mm jack sensors fit the TH10 and TH16, and the RJ9 sensors fit the THR320D.
Sonoff TH pinout
The pins on the Sonoff TH and what each one does.
| Pin | Function |
|---|---|
| L in / N in | Mains supply |
| L out / N out | Load |
| Sensor jack | THS01 or DS18B20 probe |
| Button | Pair and toggle |
- L in / N in
- Mains supply
- L out / N out
- Load
- Sensor jack
- THS01 or DS18B20 probe
- Button
- Pair and toggle
Wiring the Sonoff TH
Mains wiring must be done with the power off, in a proper enclosure, with cable and a fuse or MCB rated for the load. If you are not sure, have a qualified electrician install it. Place the sensor where it reads the controlled space, not next to the heater itself.
| Sonoff TH pin | TH10 / TH16 | THR320D |
|---|---|---|
| L in / N in | Supply through MCB | Supply through MCB |
| L out / N out | Heater or fan | Heater or fan |
| Sensor | 2.5 mm jack sensor | RJ9 sensor |
- L in / N in
- TH10 / TH16:
- Supply through MCB
- THR320D:
- Supply through MCB
- L out / N out
- TH10 / TH16:
- Heater or fan
- THR320D:
- Heater or fan
- Sensor
- TH10 / TH16:
- 2.5 mm jack sensor
- THR320D:
- RJ9 sensor
Example code
Pins are for the TH16; the THR320D differs. Minimum run and off times protect the relay and the load from rapid switching.
one_wire:
- platform: gpio
pin: GPIO14
sensor:
- platform: dallas_temp
id: temp
name: "Temperature"
switch:
- platform: gpio
pin: GPIO12
id: relay
name: "Heater"
climate:
- platform: thermostat
name: "Heater control"
sensor: temp
min_heating_off_time: 60s
min_heating_run_time: 60s
min_idle_time: 30s
heat_action: [switch.turn_on: relay]
idle_action: [switch.turn_off: relay]
default_preset: Home
preset:
- name: Home
default_target_temperature_low: 24Setup and tuning
add a scene: if temperature below X, turn on; if above Y, turn off.
leave at least 1 to 2 C between on and off limits.
extension cables are available; keep the jack dry.
a 2 kW heater draws about 9 A, fine on a TH16.
What you need
Shop this list6 of 7 found in our store · ₹28,186
Sonoff TH16A Temperature Humidity WiFi Smart Switch: the part this guide coversSonoff TH16A Temperature Humidity WiFi Smart Switch₹936
Sonoff TH10 Smart Temperature & Humidity Switch: another version this guide coversSonoff TH10 Smart Temperature & Humidity Switch₹875
Sonoff THR320D Elite Smart Temperature Humidity Monitoring Switch: another version this guide coversSonoff THR320D Elite Smart Temperature Humidity Monitoring Switch₹2,709
Home Assistant Green smart home hub: to control the switches locallyHome Assistant Green Smart Home Hub₹23,149
DS18B20 waterproof temperature probe: a probe for liquids or outdoors (with a TH-compatible plug or for ESPHome)Sonoff DS18B20 Waterproof Temperature Sensor Probe w/ 1m Cable – 1-Wire Interface₹340Closest match, check the specs- Fuse holder: to fuse the switched circuitFind this part
Digital multimeter: to check supply and signal voltagesDigital Multimeter₹177
Alternatives and when to choose them
- DS18B20 temperature sensor: the probe used for temperature.
- Sonoff BASIC and MINI: switches without a sensor input.
- Sonoff, Tasmota and ESPHome: open firmware.
Common mistakes to avoid
- Buying a sensor with the wrong jack for the model.
- Setting on and off limits too close together.
- Placing the sensor next to the heater.
- Overloading the relay with a large heater.
Frequently asked questions
Which sensor do I need?
THS01 for temperature and humidity, or a DS18B20 probe for temperature only; match the jack to your model.
Can it control an AC?
It can switch power, but an AC's own thermostat is better; use an IR blaster instead.
Does it work without internet?
Local rules work on newer firmware; ESPHome or Tasmota run fully offline.
Can I use it for an incubator?
Yes, with a probe and tight limits; add an independent over-temperature cut-out.
TH16 or THR320D?
THR320D for 20 A and a display; TH16 for lower cost.
Parts for this guide
Projects that use it
Put this into practice: 154 step-by-step builds in our project library use parts from this guide.
Keep learning
Sources
Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.


