Sonoff TH10 and TH16

You will have seen me write about the excellent Sonoff ESP8266-controlled mains relay switching devices in the past and I went into great detail as to how to program them using the HC2016 software, the only caveat being they don’t have enough FLASH memory for OTA (well, not with my software). Oh yes and I HAVE added that “button control” that people asked for.

Well, here are two new boards – the Sonoff TH10 and TH16 – if you look on their website – full information including schematics etc. are freely available.

Itead Sonoff TH10[6]

Before we start – here are my previous blog entries Sonoff

Slampher and Sonoff
More Sonoff
Even More Sonoff
Sonoff to Mains Block
32Mb ESP01 and Sonoff

Compared to other boards, several of us have discussed that the Sonoff boards are well made with good clearance on tracks for mains power etc. Some doubted whether their small relays would truly handle the loads claimed.

Well, it looks like ITEAD have taken this on board as I’ve just received both TH10 and TH16 modules.  As far as I can tell the only difference is that the TH10 has a 10 amp relay, the TH16 has a 16 amp relay.

Side View of Sonoff TH10First impressions? Solid. They are bigger than the original Sonoff modules (which I use on a daily basis for controlling lamps etc) but also  much more substantial looking – the programming button is much easier to access as it is intended to be used rather than looking like a reset button.  I’ve made good use of this as an output toggle (which also works on the previous Sonoffs).

As usual I’ll leave it up to others to tell you what you can do with the Sonoff software – first thing I did was to reprogram the boards to handle my own software.

So – the output control is identical to the older models – but they’ve also added in a temperature port. They have very kindly made the input port compatible with my software (see settings below) and options are temperature only using the Dallas temperature sensor which they can provide on a waterproof lead complete with stainless tip – or the DHT22 which also handles humidity – I’m pleased to see they did not use the inferior DHT11 which isn’t that accurate.

PCB for Itead Sonoff TH10

So – see the original article – you’ll see there how to program up the board – this time – the ground and power connectors are blindingly obvious on the end of the board – that’s 3v3 not 5v – I got away with using an FTDI at 3v3 but you may want to consider a proper 3v3 supply for programming.

Itead Sonoff TH10

If you set wifi_button to 0 – sonoff to 1, temp_type to 0 (Dallas) or 1 (DHT) and temperature_port to 14 (these are non-volatile)   you will be able to control the output on out12 (i.e. out12:0 or out12:1), you will be able to read the temperature AND you can toggle the output on and off with the external button on the Sonoff!

The CE and ROHS stickers should keep those who care about such things happy – the important thing for me is looking at the PCB around the mains it is clearly obvious that thought has been put into this. Well done.

Sonoff connectorsOh yes, the FLASH – like the unit before it – we’re looking at an 8Mb FLASH – that is 1MB –  I don’t really support that for OTA though everything works except OTA. I am pretty sure that like other boards, this FLASH if you really must, can be replaced but be warned my soldering isn’t bad and I’ve done lots of Sonoffs, ESP-01s etc – but the little tracks came clean off when I tried it on one of these boards, immediately trashing it – so do so at your own risk.

As for the push connectors for mains in and out – not everyone’s cup of tea and I did have a chuckle that they’ve gone to the effort of avoiding using a screwdriver for the cables – but you have to use a screwdriver to get the cover off !!!!


62 thoughts on “Sonoff TH10 and TH16

  1. Just a quick look but that does not look like a CE mark, It looks like the so called "china export" mark. With the CE mark the C and E should form circles that over lap.

    That said I now have two of the old one running your code and they seem to be rock solid. un-plug them and plug them back in and they connect and start running first time every time.

    I'm quite happy to run these at home as the board has better creepage and clearances then some CE marked products I've looked at.

      1. I don't put much store in CE marking - it means very little as you can easily self-certify and as you say there is China engineering. You can buy the stickers cheap and for small batches CE testing is... well, don't get me started. One look at these boards and you can tell they've put thought into them - the power area compared to some oriental power supplies is well thought out.

      1. HAH! I knew I'd seen that name somewhere. Can you check your blog. I'm having a go at your Sonoff code and I've managed to get as far as the opening screen on PlatformIO - and downloading your project. Anything further than that is currently escaping me... a starter for 10 would be appreciated.


    1. CE marking is not, but if the product really passed the standard safety tests, it is.

      For us hackers it doesn't matter much, but if Itead wants to sell their products to as a consumer product within the EEC, they need to have CE certification passed, either by them directly or by the importer, as customs may require proofs at any time.

      And be sure that if your device catch fire, the insurance company will not pay for your burnt house if they can prove that it may be the cause 🙂

      Again, this is a risk that we can tak as hackers, but we know what we are doing, are we?

      1. I think they'll be managing quite nicely regardless - our market is but a tiny corner - and as you say enthusiasts - and I do think that is where they are interested - after all you could not put programming and other connectors onto a product for the mass market most of whom would not know a programmer from a hole in the ground. I doubt VERY much if a British insurance company would miss the opportunity to rubbish a Chinese product REGARDLESS of what markings it had. "And which reputable firm did you buy this from, sir?" - "China" - "Oh, I'm afraid we don't do China". Trust me - I've been there.

        Frankly I'd be more worried about people poking wires into a connector 🙂

        1. And... while I think about it - I doubt VERY much if the mass market read this blog 🙂 So I'm assuming I'm talking to people who are (a) enthusiastic and (b) have something of a clue how not to get electrocuted.

          (Disclaimer: If anyone electrocutes themselves, I don't exist - you only imagined reading this blog).

          1. i've just spent the last few years getting the CE marking up to date for a range of products from medical to machinery. only issue we cant see it the creepage and clearance inside the switch mode supply transformer. the PCB etc goes out the window if the transformer is badly wound and insulated.

            But i'm more happy to run with them than an imported psu that you can't open.

            anyway I've a timer that states that it should not be left unattended! so not sure why you would use it if the manufacture don't think it's safe!!

      1. Oh and the output is on GPIO12. What I don't understand is that in the middle of the board is quite a large 0.1" pitch connector - or rather the filled in holes for one - and not much attached. I wonder why they didn't take the opportunity to put the other IO onto that connector. Still - it's a step up. I'm just so annoyed that I messed up the tracks on the FLASH chip when trying to update.

        1. Hi Peter, did you use a hot air setup to remove the IC?
          I purchased an ATTEN 8586 a few years ago and it was the best investment I've ever made. So easy to remove IC's or other parts from boards without doing any damage to the PCB itself. Oh and it doubles up nicely for heatshrinking jobs too 🙂

  2. They look good, but I've just had a sonoff die after only 2 day of operation. Mains input section has gone. powered from the program port and all's well.

    Now I've got to see which bit has gone too much talk of reliability of late!

  3. I had a couple of Sonoff Dual's arrive yesterday. Very impressed by the casing and push terminals - I think they're quite an improvement over the screw terminals on the original.
    Does anyone know how to pull GPIO0 low to load new ESP8266 firmware via serial? On the single channel version, the push button does this - but it doesn't seem to do it on this one.
    Any ideas?

  4. Can anyone post a step by step description of how to put the TH10 into flash upload mode? I've seen a couple of methods posted, but have not been able to get the board into the upload mode (I have previously been successful doing this with the other itead Sonoff unit, but haven't been able to do so with the TH10).

      1. Oh, sorry - I just assumed that was common knowledge. Yes, the button held down with the power off lets you program them. From there on it can be used as a toggle for the output (well, it can on my software) and also for web access... but I've not made that last one the default yet, I think it defaults to GPIO2 for web setup for our own boards. Pity there isn't something that would uniquely identify the SONOFF board.

      2. Thank you, this worked great. Unfortunately the itead folks got a bit more clever with this device. I was able to download my Arduino Sketch, and it attempts to work, but it appears the bootloader on this device is set up to load the itead configuration firmware before my sketch loads. Other devices, such as the Sonoff relay board don't do this. The net result is that the device comes up in AP mode before the sketch attempts to start the WiFi server in my sketch. Looks as though I need to fully erase the memory in the ESP8266. Can someone point me to a method of erasing the memory that still allows me to download a sketch (doesn't "brick" the TH10)?

        1. I'm having trouble with this David... unless I'm reading your note incorrectly - it is suggesting that somehow, sometihng iTead have done is interfering with the flashing process. Not buying it. That process is set in ROM on the ESP8266 and cannot be altered (if it could I'd be changing that 78k debug output to 115k).

          Ok, so - it may be that you need to PROPERLY clear the device first in case there is something going on at the top end of the setup - recent versions of the SDK DEMAND that this is set up - earlier versions did not. Reading through my setup article might provide insight.

    1. Hi Be aware that the sonoff touch requires a neutral connection at the switch. Whilst this is normal in US houses it is unusual in UK houses due to our solid walls leaving restricted space for wiring and pattress depth.

    2. Same here in Indonesia. No neutral in the light switch sockets.
      For this reason, I have chosen to use these with custom made enclosures. A lot more expensive of course, but no batteries and wiring required. As I live in an apartment, I don't have many switches to deal with an my Amazon Echo takes care of the front room lighting and sockets. There is a module for the Pi that plugs into the GPIO port and there is a Node-red module to decode them.

      1. No neutral here in Spain.. I started looking into this and the more I do the more I wonder why Britain came up with this live-neutral system in the first place. I know why we came up with the ring main - to save copper!

    1. This is new to me - and hence I've not had a chance to look at it - I'll drop ITStudio a note and if they ship of a sample I'll have a look with a view to modifying the software.


  5. Good afternoon, everyone. I just opened up my new Sonoff POW, and, as exlected, it's a fine little switch. The on oars relay is rated for 1 hp at 240v, so I will likely give a solitaire feild test on my big dirty .5 hp pumps soon.
    I'll use one for each pump, plus a TH to monitor the water temp.

    Meanwhile, I have it measuring the power useage of my Sonoff controlled fishtank.

    Ivery been focusing on the hardware, and have been using Ewelinks, as it meets my needs.

    As for the power sensor, I was hoping I could jumper in a nice closed core current meter, but I'll need to trace it out a little more before I start cutting it up. The good news is the 16A relay can likely handle all but the most industrial applications.


    1. I have all the new Itead devices on the way, should be here toward the end of October and I'll tackle all of them - so the more info folks can provide beforehand the easier it will be for me 🙂

          1. I received a sonoff pow today and I'm trying to flash it but I believe the button may not be connected to GPIO0.

            Have you managed to flash it? If so, would love some pictures/instructions on how to do it!

  6. I just purchased my first sonoff with another on the way. I do have a question regarding the timer function native to the device. Are the times stored on the device or is it necessary that my IPhone be in range for the timer to work?

  7. Thanks Pete for this great blog.

    Thanks to your direction I've managed to flash a webserver on a sonoff TH . However I'm unclear:

    - how I can read the temperature / humidity from the ESP 8266 : which pin? Which configuration?



  8. Hello Peter,
    Thank you for all the work you've done and explain how to flash the sonoff device.
    I have one question which I can't find the answer anywhere, although should be simple!
    I have the sonoff TH10 with ESP Easy firmware, the ip is:, if I want to turn on the relay, I use the following command:,12,1
    which works fine, what I'm struggling to find out is how do I read the temperature/humidity sensors which are on gpio 14, and I didn't manage to find any answer.
    Thank you in advance

    1. @radu: i think you think the wrong way, with ESPEasy you do not read the sensor date, instead ESPEasy does send the sensor data to somewhere else...

      see pictures for my config:

      under config you can define where to send sensor data, e.g simple http get request or mqtt

        1. Hello krikk
          Thank you for your answer, after all I've found how to get the data from the relay, it's pretty simple, but not documented, all the details you can get them with 1 call and you receive a JSON answer, the request is link is very difficult: relay-ip:relay-port/json 🙂

    2. Hi Radu,

      for me it's the other way around: I have the temperature working, but can't switch the lamp. Using the same command, and I hear the switch clicking ,but nothing happens. What is your config for the switch?

      1. I did but I haven't got an answer.
        I was thinking that maybe someone with more electrical knowledge than me can explain why.

  9. Hello,
    Thanks for having this blog it seems very useful and informative for "automation folks" which I'm planning to become myself as well. I'm (very) new to sonoff and trying to find an answer here with no success. I like to figure out how to set up the external 2.5 mm plug on the TH10 to control the switch instead of being triggered by temperature. My plan is to plug in the original wall switches to keep the traditional setup and add wifi option with the sonoff. I've seen a video on youtube and the person demonstrating it claims it is possible to do with the original firmware. When I plug into the 2.5 mm the sonoff shots off, tried on several units same issue. Please advise what to do. Thank you so much!

    1. Well you would have to write your own software of modify some existing software. I can't remember offhand but the temperature sensor simply feeds a port bit - will no doubt have a pullup resistor so likely all you need do is chip out the support for the (I think) Dallas temperature chip - and monitor the input to turn the output on or off depending on the state of the input.

Leave a Reply

Your email address will not be published. Required fields are marked *