Sonoff TH10 & TH16: sensors, displays, actuators,…

Itead Studio keep on creating interesting products for the hacker community. A few weeks ago a new version of the already classic Sonoff TH came to life. This new version comes in two flavours: the Sonoff TH10 and TH16 and you can buy them at Aliexpress: Sonoff TH 10A/16A Temperature And Humidity Monitoring WiFi Smart Switch.

In this article I will briefly talk about what’s new in this device to quickly go to explore one of those novelties: it’s external interface.

What’s new?

The first thing I noticed is it’s size. The new Sonoff TH10 (or TH16, they are the same except for the relay) It’s a lot bigger than the old Sonoff TH. The old case is 87.5×38.8×23.5mm while the new one is 114×51.6×32.2mm. It’s bigger in every dimension and it they were cubes (they are not) the new Sonoff would be 2.37 times bigger in volume!!

"Classic" Sonoff TH (right) versus the new Sonoff TH10 (left). Does size matter?

“Classic” Sonoff TH (right) versus the new Sonoff TH10 (left). Does size matter?

Maybe we can find an explanation for this growth in the inside but my first though is that one of the good things about the Sonoff was it’s relatively small size (compared to it’s competitor by Electrodragon, for instance).

In the inside we have a completely different PCB layout. The PCB is also 1.82 times bigger (64.8×33.9mm versus 88.9x45mm) but it certainly breathes. Having all the connectors on the same side reduces trace distance and improves the separation between high and low voltage sides of the board. High voltage traces are a lot thicker and also have an extra of tin on top. All in all it looks like they have tried to answer people concerns about the safety of the device. But they still don’t have the CE mark (actually the CE mark in the case means “China Export”, check for the right Conformité Européene mark).

UPDATE 2016/10/08: Itead has contacted me to say that they are working on the CE certification and they expect to have it in no more than a month.

UPDATE 2016/10/20: Itead has contacted me again to communicate that some of their Sonoff line has now officially the CE certification (document of the CE certificate for new Sonoff products). The certification covers Sonoff TH10 and TH16 and also Sonoff DUAL and POW. They have also been certified as RoHS compliant.

Now the same comparison from the inside...

Now the same comparison from the inside…

The only difference between the Sonoff TH10 and TH16 is the relay. The TH10 uses a Hui Ke HK3FF-DC5V-SHG subminiature high power relay rated 10A while the TH16 uses a Honfa HF152F-005-1HTQ(104). The old Sonoff TH uses a HKE HRS3FNH-S-DC5V-A. They are all driven with GPIO12 through a transistor labeled 12W59. Don’t know enough about relays to know which one is better and why, what I know that none of them is a SPDT relay actually the Hul Ke is a SPDT relay, but the NC pole is not exposed and connected to the input line…. So crossover switching is still not possible

Then there are these new push terminals. I guess they are easy to use while sticking the cable in the hole. Also the designers have added two neutral and two ground terminals so the user does not need a terminal bar to power the device and the load. There is also a very welcome F20AL250V 20A fuse.

The new push terminals and the fuse in the Sonoff TH10

The new push terminals and the fuse in the Sonoff TH10

The user interface has also improved with a new LED that can be driven with GPIO13 (the other one is tied to GPIO12, so it follows the relay state). The enclosure is thin enough so the LEDs are visible through it. Also the new button is much better in terms of usability and aesthetic pleasure. And finally there is the new external interface… which I will explore in the next sections.

The new interface

Using an audio jack as an interface is quite common. I used it in my Smartmeter pulse counter years ago. It’s also good news for anyone willing to add their own sensors. But it has two caveats: first they have decided to go for a 2.5mm jack, which is not as common as the 3.5mm one. Harder to find and more expensive. Second, even thou they are using a 4 channels jack (or TRRS for tip-ring-ring-sleeve) they are only using 3 of them for 3V3, GND and GPIO14. So what happened to the fourth?

Named pads, headers and test points in the Sonoff TH10 board

Named pads, headers and test points in the Sonoff TH10 board

Well as you can see in the image the engineering team at Itead Studio actually thought about it. Only it’s not enabled. In the image above you can see that GPIO14 is tied to the jack tip with a 0Ohm resitor and a 5KOhm pull-up (actually two 10k in parallel). Side by side to this 0Ohm resistor there is a pad ready to connect the first ring in the jack to GPIO4 and another one to add a pull-up too. So you just have to solder a 0Ohm SMD resistor to that pad (the one with the GPIO4 label) to bring out a second IO to connect the sensor…

I don't have 0603 SMD parts (too small for me) but a 0805 resistor fits just fine.

I don’t have 0603 SMD parts (too small for me) but a 0805 resistor fits just fine.

Have you read pull-up resistors? Me too. Do you know any 2 wire protocol that needs pull-ups? Me too!! So now we have a whole bunch of digital sensors we can attach to the Sonoff TH10/TH16.

A zillion of sensors, actuators, displays…

Itead Studio sells two sensors for the Sonoff TH10/TH16: an AMD2301 temperature and humidity sensor (DHT22 compatible) and a DS18B20 waterproof temperature sensor.

AM2301 and DS18B20 sensors for the Sonoff TH10/TH16

Look at the size of that AM2301 enclosure!

But now we can connect any digital device that requires one or two GPIO pins to drive it. And that includes I2C devices. We still have a limitation: the interface has a 3V3 channel, so we won’t be able to power 5V sensors with it… unless we hack that too (cut that thick trace going to the “3V3 / SLEEVE” point and solder a wire to any of the 5V test points in the image).

First I worked my testing cable. A 2.5mm TRRS jack [Aliexpress] to 4-channels Dupont connector.

Wooden clothes pins rocks

Sometime ago a friend told me I should always carry a wooden clothes pin with me…

Testing cable for the Sonoff TH10 sensor interface

Now ready to test sensors…

So let’s start playing! A BMP085 [Aliexpress] pressure sensor, a HC-SR04 [Aliexpress] ultrasonic range module, a PIR [Aliexpress], an I2C LED display [Aliexpress] or an nice little 0.96″ I2C OLED display [Aliexpress]…

BMP085 with the Sonoff TH10/TH16

A BMP085 sensor using I2C protocol

HC-SR04 ultrasonic range module with the Sonoff TH10/TH16

The HC-SR04 ultrasonic range module needs two GPIOs to drive the trigger and echo pins, but it only works with 5V.

Using a PIR with the Sonoff TH10/TH16

This PIR works great with 3V3 and can be driven with just one GPIO. This is actually quite useful for a light switch…

I2C LED display with the Sonoff TH10/TH16

You will need 5V to drive this I2C LED display…

An I2C OLED display with the Sonoff TH10/TH16

But this 0.96″ I2C OLED is a perfect match!

What else… well, almost anything digital out there: displays, humidity sensors, distance sensors, touch sensors, encoders, magnetometers, gyroscopes, accelerometers, tilt switches, reed switches, real time clocks,… and also servos, external relays, buzzers, and WS2812 strips!

Sensors and actuators for the Sonoff TH10/TH16

A zillion of sensors AND actuators

Flashing it

Last note before letting you go to find something to attach to your new Sonoff TH10/TH16. Tech people at Itead Studio know some of their clients will open the product enclosure and own the device by flashing their own firmware into it. They even use it as an advertising slogan: “For hackers, Sonoff Pow is another exciting board.”. So go ahead. The programming header is labelled and goes like this (check the picture above): VCC, RX, TX, GND. The button is tied to GPIO0 so just press it while powering the board and you are in flash mode.

If you don’t know what to flash give a try to the Espurna firmware. It’s a work in progress but will soon support I2C devices or two relays (for the Electrodragon or the Sonoff Dual) in different configuration modes including crossover switching.

By the way: I hope I will have a Sonoff Pow soon in my hands…

CC BY-SA 4.0 Sonoff TH10 & TH16: sensors, displays, actuators,… by Tinkerman is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

23 thoughts on “Sonoff TH10 & TH16: sensors, displays, actuators,…

  1. Pingback: Tinkerman, Sonoff | It's Not Available

  2. Pingback: Tinkering with the Sonoff TH (by Tinkerman) | esp8266hints

  3. Fabien

    Thank you. I just recieve my board today and it was very simple to upload new firmware with you post. But I can’t compile espruma. I think you have a custom version of platformio.

    1. Xose Pérez Post author

      Yes you are right. I have a custom platformio.ini file that suports inheritance. There is a PR about it but I have no idea if or when it will be merged (https://github.com/platformio/platformio/pull/790).
      Since you are not the first one to face this problem I have updated the file in the repo with a compatible one. Please update your repo copy before trying again.
      And thanks for your interest in the firmware.

    1. Xose Pérez Post author

      The old Sonoff exposes GPIO14 in the “programming” header. It’s the pin further from the button. So the answer is yes. The one I tested here works with 3V3 and it’s a perfect match for the job.

        1. Xose Pérez Post author

          I don’t think so. As far as I know there are no commercially available PIR sensors with a 2.5mm jack interface. Itead Studio only sells AM2301 and DS18B20 sensors for their TH series.

    1. Xose Pérez Post author

      Have not tried it myself but I’d bet you can use any of these sensors with ESPEasy as long as you can define what GPIOs there are attached to.

    1. Xose Pérez Post author

      Yes. I have done it with a Sonoff Basic in the past. You’d need thin copper and good hand control. But I’m working on an adaptor for the TH series that would use a ADC121 with I2C interface to use an external analog CT. Will write about that soon.

  4. jerrynorbury

    Would it be normal (usual) to replace the plastic case it’s supplied in with a waterproof enclosure OR would you normally try find a waterproof enclosure big enough to put it all in?

    1. Xose Pérez Post author

      Hi. Assuming you will use a good waterproof enclosure I can’t really see a reason to keep the original one. Please make sure water never ever gets in.


Leave a Reply