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 !!!!


79 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.

  10. Could use some help...I'm not a technogeek. I want to monitor room temperature via wifi/internet and be able to see it on my phone. No switching. No hardwiring into appliances or a wall desired. Can I somehow plug in the TH10 or TH16 (?which should I use) into a wall outlet and have it report a room temperature to me? If so, how? Do I have to have 3 dangling wires screwed into some plug thing to plug into an outlet, or is there something more aesthetic I can buy to do this job? Thanks.

  11. Hi AW,
    If you're just after monitoring a temperature reading via a simple mobile phone interface, you could consider "Blynk". This is a clever little platform with an Android and Apple iPhone App which, with a small amount of code, an ESP8266 (powered via a USB charger or similar) and a DHT22 or Dallas DS18B20 temperature sensor will give you what you need with very little technical knowledge required.

    Above is an 'instructables' article describing something similar to what I think you're after but there is an active discussion forum/group at the Blynk web site

    I recommend Blynk for your requirement as it sorts the internet/mobile access side of things and the sensor all in one go. There are other options available without using Blynk but these may be more convoluted especially if you're not already familiar with ESP8266 etc.

    Rather than using a 'vanilla' ESP8266 requiring 3.3v as per the instructable, I'd recommend looking at a "Wemos D1 Mini" board as these have onboard Micro USB interface for programming and for powering the device, so once programmed you could just stick it in a little ABS enclosure and power it from a USB power supply/charger via a standard microUSB cable.


    1. Hi Darren - I'm guessing you've never gone through my earlier posts. I took an intense interest in Blynk and had many conversations with the designers - it is pretty - however - most of these systems show little interest in Node-Red, preferring to work with every interface known to man and hence limiting their overall capability and stretching their resources - if they would merely concentrate on producing an all-singing API so we could roll our own thing - but sadly - no - which is why I've all but abandoned all of the alternatives in the hope that Node-Red Dashboard will continue to improve - indeed again looking back through posts in here you'll see how to add all sorts of impressive widgets to Node-Red Dashboard, far beyond the limits of the existing graphing, dial and other interfaces. There IS an interface between Node-Red and Blynk which is 99% reliable but I could never make it 100%.

      Still - some of the Blynk widgets are great - their colour widget however is not and takes up way too much screen space. As you've brought this to my attention I've been back to their site - what has happened recently? Not a lot. To this day, Node-Red is STILL not officially supported as far as I can see so you're in the hands of third parties who may or may not choose to keep the interface going.

      1. Hi, Peter. I just left a reply to Darren, but your input would be valuable also. However, I'll admit I didn't understand much of what you wrote to Darren, since I've no understanding of what Node Red is. Again, all you guys have been great with your patience with my basic questions.

    2. Darren, first off, thank you for the thorough and respectful post reply to a noob like me. That said, I checked out the links and found myself a touch overwhelmed by what was there. I don't own a soldering iron, and I've never bought that white pegboard thing that you attach wires and such to.

      It looks like fun to learn, but unfortunately I'm not able to invest that much time relative to what I want to do.

      Is there any way to use Blynk with software programming of it to work with the already-made Sonoff TH10/16? That way I just screw in wires to the Sonoff, plug in the humidity/temp probe, and then program Blynk to recognize it and email me when the temp exceeds a certain threshold. Is this possible?

      1. Hi AW,

        Yes you could use the SONOFF with the external temperature probe and Blynk to do exactly what you require...but (there's always a but...) in order to flash the replacement firmware (Blynk software stored on the sonoff itself), one needs to solder 4 pins to the SONOFF board and then connect those 4 pins to a PC via a special USB device and some software on a PC. Its probably easier on an ESP8266 "Development board" instead of a Sonoff as you can buy SOME of them with header pins already soldered...and then you could use breadboard jumper wires (female to female) to connect between a DHT22 breakout board (with header pins also pre soldered). Many 'dev' boards have MicroUSB sockets which can be used to power the device but also to flash new firmware across however the SONOFF requires a separate USB to Serial device to update the software - this is something I have several of and use all the time but isn't something a 'noob' would have just lying around. Given your self confessed noob status, and the complications listed above, a Sonoff device gives with one hand and takes with another so it might be pushing it a bit.

        Your best bet might be be to get someone to do the soldering for you on the Sonoff and that would get you past the first hurdle. You could then learn the coding side of things with Blynk (if you are up for that). It would be a great opportunity to be brave and have a go yourself as it's more rewarding that way but I also appreciate there's quite a bit of learning curve if this is just a one-off.

        I have built and implemented several not dissimilar SONOFF / Blynk projects for colleagues and friends, providing the kit ready to "plug in and go" including bespoke software to do whatever is required (Remote temperature sensor and relay for remote heater control, Garage door control, Driveway gate control, timed outdoor lighting etc) so I would be willing to assist you more if necessary but that wouldn't want to totally remove the satisfaction you'd get by having done at least some of it yourself.

        Let me know if you need any more help and how much help and between us all here there's more than enough knowledge and helpfulness to get you sorted.

        1. AW - Re-reading your reply, it sounds like you need something a bit more 'off the shelf' so my last reply is probably not much help.

          The standard (chinese) software/firmware that comes with the Sonoff might be up to the job - you'd be in the hands of ITEAD and need their proprietary iPhone/Android app to be able to view the temperature etc but that would work "out of the box". It doesn't sound like it sends email alerts but it would show a temperature reading on your smart phone. I've never tried the standard Chinese firmware so can't provide any details on how it works (or how well) as the first thing I do is remove the standard firmware/software and replace it with my own (or someone else's) as I'm a geek.

          I'm happy to assist (offline) with a ready made turn-key solution if you're interested - it's all good fun this 🙂

          1. Sorry, I missed this comment, Darren. How can I reach you offline to find out more about your ready made turn-key option?

        2. You ROCK. Thank you for your patient and thorough, albeit intimidating, guidance. Of course, the advantage with the Sonoff is the ability to simply plug in a temp/humidity sensor and you're good to go to see the info over wifi anywhere in the world. It seems such a minor thing to be able to trigger an email alert in the Ewelink app, but the developers I contacted have no plans to change anything in it. You're right, though...for a one-off, that's a lot of learning and I don't think I've got what it takes to do it. Still, I really appreciate the time and effort you made in coaxing me to try!

        3. Just a short addition but if soldering is the issue I have found it unnecessary on these devices. You can just hold a row of 4 pins in place whilst the flashing takes place (20 secs). After that further updates if necessary can be done OTA

  12. Hi Pete,
    Crossed wires maybe?. I am totally with you on node red vs blynk but for the poster "AW" who appears to just want a simple temperature sensor reading accessible by mobile phone it's a quicker solution to solder a DHT22 to a Wemos and flash Blynk on there. Quite different requirement and complexity to the great work you are doing with more compressive control systems, node red and your code Base.

  13. More news. So I just wanted a simple monitor for cheap that could send an alert if a temp exceeded a threshold. You can find them for $60 to $200 online. I scoured for something cheaper. Today, deep within Amazon, I found this, which looks like a kit thing put together by a coding group. Anyone know of it?

  14. And more news. OK, got the Sonoff TH10 and the temp/humidity probe. Total cost with an extension cord around 20 bucks. Cut the cord in about half and put the Sonoff in the middle. With this I can monitor temp/humidity, and have something (like a portable AC unit) switch on remotely (manually or in response to a temperature threshold) AND, something I didn't know, when the unit is switched on or off I get a notification on my phone. In other words, the email push I thought I needed is unnecessary, and the notification of a temperature threshold being hit is already contained in the Ewelink software. I can monitor temp and humidity and I get notifications when thresholds are hit, so all is good and MUCH easier than I thought it would be.

Leave a Reply

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