Category Archives: itead

Sonoff 4CH 4 Channel Mains Control


Sonoff Sonoff 4CHA parcel turned up for me today – the Sonoff 4CH. You may recall I wrote some time ago about a smaller version they put out and I was quite scathing about the wiring. I turned out as you recall that this was a third party product and they were in the process of making their own version. Well, this is it.

The unit uses an ESP8285 (like the 8266 but with built-in Flash) to make a low cost 4-way mains power switch in a very nice DIN box. The price of the unit, at around £11.53 + postage, makes it cheaper than some people charge just for the box!!!

If you read this blog regularly you’ll know I’ve no interest in running their products on their own cloud – and that despite having my own very comprehensive software, this fellow has recently IMHO taken the lead in powering Sonoff products with his code. Well, it just so happens he supports this boar,  so this morning I grabbed the latest software, put in my MQTT and WIFI credentials, made the one change to the code needed to run this board (a single define) and off I went to open the board up.

Inside is the usual handy programming connector needing 3v3 and ground as well as serial in and out from an FTDI. As usual, I broke all the rules and instead of using a proper 3v3 supply I powered the board for the purposes of programming, directly from the FTDI – remembering to set it to 3v3 and not 5v.  At first I got nowhere until I realised I still had my Arduino environment set to ESP8266 – a quick check and there is indeed a setting for the smaller board.

And that was it – nothing to report really – it works as you’d expect.  Now what I don’t understand are the little covers – which on one side of the board cover up the 4 buttons to turn the outputs on and off (one of them is also the programming button) and on the other side the LEDs.  I will be drilling 5 holes in there so I can actually see the LEDs – but that’s just me.

Itead Sonoff 4CHDIN mounting, well put-together, inexpensive 4-relay switching.  The information claims you can use a maximum of 2.5Kw and that each output is 10 amps… well, I’m not sure I’d want to put 10 amps through there especially inductive, maybe more like half of that, while obeying the total of no more than 2.5KW.  There’s a little fuse on the board on the incoming live - but to save opening it up in the event of problems and finding a tiny fuse, I’d be thinking about the lowest sensible value of fuse in your power lead. I put a 10 amp fuse in there and may yet replace it with a 5 amp (of course what this means depends on which side of the pond you are on – we Brits get a lot more power out of 10 amps than our American friends).

You may notice something odd  - or depending where you live you might not find it odd at all – the neutral block is green and the earth block is grey. You see, being a Brit – I associate earth with grass – i.e. green and our earth wire is either green or some combination of green and yellow… so I could see someone being caught out by that – you’ll notice my wiring looks off with the green earth heading into the grey box!!!   Those push connectors incidentally work a treat! With previous Sonoff products I had people asking me what to do with the Earth wire – no such problem here.

This one is going to Spain with me – we have Star wiring over there and spare room on the power DIN rail so this will fit in very nicely to control some lighting and one small heater over there. If you’re starting from scratch this could make a decent low-cost-per-relay move into home control along with whatever software you use to control things – in my case – I send commands out from Node-Red via MQTT straight to the board over WIFI.


ITead Sonoff 4CH circuit board


At least on the surface, another winner from this company. Don’t all rush as Itead are on Chinese holiday until 3rd of Feb!



Ok, this entry will be in 2 parts – I’ll do some digging soon – but as I’ve had several requests for this…

POW, TH16 and DUAL

So what you’re looking at above are the Sonoff Pow, TH16 and DUAL mains controllers. These are ESP8266-based low cost controllers to turn things on and off. The TH16 has a sister product, the TH10 and we covered these a while ago. Now complete with CE markings (which we are told does NOT mean China Engineering before anyone steps in to defend British manufacturing…. and looking quite spiffy.

POW, TH16 and DUAL

Ok, critical bits first, I’m not convinced about the push to connect stuff inside – I know it is fashionable to do away with screwdrivers but hell, you need a screwdriver to get into the thing in the first place  and those push to fit jobs work GREAT with single-core wire – not quite so well with multi-strand, depending on the thickness. Also due to the case design the connectors at the ends could be a tad tricky to sort in a dark cupboard – however, generally very well built.

Note that all three have a proper fuse inside which is really nice to see – and two of them have 16 amp relays – the DUAL having a couple of 10 amp relays.

POW, TH16 and DUAL

Note also that they all have the 4 way programming connector at the top left in these photos. Vcc I should note is 3v3 and not 5v. I usually manage to reprogram them straight from a 3v3 FTDI but it is pushing it a bit.

The ESP8266, FLASH and other bits are on the underside of these boards but if you’re just programming them – then you need go no further as the large button on the top is GPIO0 and hence you can use that for programming. I have programmed the TH16 and 16 extensively, the Dual and the POW are delights I have yet to tackle – the POW in particular as right now I’ve no idea how to read the power chip.

But of course you can use these out of the box with the Expressif cloud to control things. We’ve had the discussion in the past about power, I would not take the 16 amps too literally nor the 10amps – maybe keep the maximum power 25% under what is being claimed – though the tracks are quite thick. Of all the boards of this type I’ve seen – these seem to be about the best put-together.

POW, TH16 and DUAL

on the rightmost image – I’m pretty sure that piece of copper in the middle is the power sensor and there appears to be an 8-pin control chip above it and to the right. Other than that they are much the same… note the nice cutouts in the board, decent spacing and thick tracks for power. A lot of designers could learn from this.  My only gripe is their continued use of a tiny FLASH chip… HOWEVER, here’s a thing – in the old boards, the FLASH chip was on the top – partially obscured by the programming button – NOW it is on the bottom – which should make it one hell of a lot easier to replace – WHEEEEEEEE. I do note two different sizes of FLASH – note the two boards on the right – topmost right 8-pin chip. Last time I tried updating a TH16 I ripped the tracks to bits – now – I might just be able to do it – and the chips I bought are the bigger size. Mind you my biggest problem is more basic – having shipped all my stuff from Spain to the UK for the winter I now have to FIND my supply of SMT flash chips!

More soon on this one but I thought I’d give you a head’s up.  To give you an idea of pricing – here’s the page for the TH10 and 16 -   - they have gone up in price since the early days so just under £7 plus postage for the TH16 – probably a good idea to buy a few – but WAY less than anywhere else as far as I know. I have one of the original boards controlling an electric heater in my office and another controlling the likes of salt and room lights at home and they’ve been happily working away all summer.

As for pricing – with this link you get discount (don’t worry I don’t get anything) – and by the look of it – a shipment of one POW to the UK is (in dollars as their site screws up pounds) $8.62 for the DUAL and $4.62 postage… You are better off buying TWO as the postage is only another dollar..  all of this if you translate to Sterling – even with the atrocious state of the pound – is still cheap.

There is a link for the POW but I think they are out of stock right now.

So – you have these  - and you can use their built in software – or you can roll your own. Our own software handles the TH10 and TH16 but not yet the DUAL and POW (note that the DUAL for reasons best known to ITEAD has a 4MB Flash whereas the others have smaller FLASH). If you’re in a hurry – here’s a link to a fellow who has done the hard work – and who is very responsive – if you’re an Arduino/ESP type – this might be of interest. 

4 Channel WiFi Wireless Switch  IM160920099 – blogged elsewhere

And coming up soon – writeups on:

Sonoff Touch EU
sonoff LED


WIFI Smart Socket

Smart socketIt looks like Itead have done it again – another winner – well that’s all down to the price and I’ll leave you to look that one up…the site says £9.76 for the unit which is reasonable – but I didn’t check postage.

The first modern WIFI wall socket I had was the Orbvibo Smart socket. I could not re-program it but I did manage to get Node-Red to talk to it over a websocket interface. I think it lasted a week before losing the info, then I discovered that Amazon had stopped selling them because of some regulation or other.  Not a nice experience – but they DID look nice.

Smart Socket[6]Similarly – the Itead  unit is good looking (though you would not tell it was theirs based on the one I have – there’s no reference to Itead on there at all and there were no instructions in the (very pretty) box. Probably because this is new (but available). This is an EU socket not UK so if you’re in the UK you’ll need a simple adaptor unless you want to live dangerously.

There is a programming button – which handily goes to GPIO0 on the ESP8266. Again a slight gripe here, once again they’ve Smart Socket[8]used a 1MB FLASH -  fine for their purposes but if ONLY they’d used the same as the ESP-12 (4MB) I could have done OTA – I believe there is other software that might be suitable which fits into the smaller space. However – not that big a deal. When my new 4MB Flash chips turn up I may just replace theirs.

pinsThe Smart Socket is designed to work with Itead’s APP – and if that’s what you want – read no further. It makes for a nice cheap WIFI controlled socket.

In my case of course I wanted it to work with our own software and hence remotely over Node-Red and MQTT – I suspect readers in here will want the same. So – out with the screwdriver – it turns out this was to be incredibly simple, once screw then finger-nails in the edge and it pops open  – there’s a 4-way set of holes which you can just shove wires into – ground, TX, RX and VCC.  I applied the relevant wires from my FTDI (obviously RX to TX etc)  to the holes – ensuring that [a] my finger was on the programming button at the time and [b] my FTDI was set to 3v3 – not 5v (important).  I blew the ROMs into the unit – this is covered elsewhere in the blog and is easy) and lo – one WIFI controlled switch I can control over MQTT etc.

I mean – it was that easy  - I’m missing the bit out about making a  change to my program to slow the flashing light down as the lights in this thing are BRIGHT.  So the green light is the general indicator (GPIO13) which I use all the time (thank heavens) and as in the SONOFF they use GPIO12 for the relay AND a nice blue light – so when the unit is running it is flashing green – if the output is on there is also a blue glow. Very nice.

So – there you have it – another winner.   It’s all down to postal charges really… oh, the relay claims 2KW – I’ll leave it up to someone else to see if it is up to that – I’d suggest that putting a 2KW electric heater on it will probably not work too well. It would be nice if a 1KW heater would work… anyone up to testing that ?


Itead Slampher and Sonoff

Slampher - in Scargill's review of Slampher and SonoffRemind you of IKEA? No? Heard of ESP8266? Yes? Well, Slampher and Sonoff are two products from Itead and I think you’ll like at least one of them. They arrived at my desk today. Slampher is a screwfit lamp fitting – take the E27 lamp out – put Slampher in – screw the lamp back in and you’re in business with a remote controlled lamp. It really is that easy.

This blog updated May 10, 2016.

There’s a tiny button on the unit that you press to turn the lamp on or off manually if you ever need to – or hold it down and you can make it listen for a controller – the handy – and i have to say very nice quality – keychain controller which can control 4 devices.

Handset - in Scargill's review of Slampher and SonoffThe REALLY good thing is that both of these products use ESP8266 so if you want to go in and re-program them – as I have  – to handle MQTTon your WIFI!!!! You CAN do but there is an APP if you don’t want to do it the hard way. I don’t have the App at this time so I can’t comment… but it’s an ESP8266 – how hard can it be to get that right.

Slampher and SonoffThe other product is called Sonoff and it’s just a little box that you wire mains into – and out the other end you fasten it to whatever you want – and control it the same way. SO the units obviously have both WIFI (ESP) and a 433Mhz receiver – because the little handset is 433Mhz.  Sonoff would not look out of place on a skirting board at all (proper little screw connectors inside – no soldering needed).

These are NOT expensive – in fact that really IS the point – Sonoff in particular – I could not build one at that price – and I guess that is part of the charm.  I can make this stuff with my eyes shut but by the time I put it all together and in a box….

The units I have are solid looking – the little mains controller Sonoff – the PCB inside is well put together with proper isolation on the PCB (some of you will have seen some HORRIBLY DANGEROUS pcbs in the past when it comes to UK mains but little Sonoff is ok at least at first glance).  I’ve not had a chance to pull the lamp unit apart yet – that will come later.

Pricing: I found this – $4.85 – if you live in the UK the postage brings it to $9.37 but even then! I checked out the cost of 3 – $14.55 all in to UK that is $5 each – that’s around £3 or so.

DIY programming: You’ll like this if you know how to program ESP8266 chips. I now have a diagram for Sonoff – initially the connectors did not seem to match those on the diagram – so I contacted Itead – they were keen to point out that they have a cloud system and App and of course the remote control via radio – all of which I’ll lose when I reprogram the board – but hey…. I want to control these with MY kit.

Look at the diagram below… this is looking at the TOP of the board. There is a 4 way or 5 way connector. If the latter you might want to get the meter out – but on the 4-way (mine)….  the SQUARE pin is not as you might think ground – it is 3v3 – then we have serial, serial and ground. If you wire your FTDI as per the wiring diagram below it should work.  The relay is controlled by GPIO12.

I was happy to see cooperation from Itead – obviously they would prefer that you use their cloud software and most will – but we are hackers and would never be satisfied without control, right? Ignore the LED, it is fastened to the RF device so you don’t have control over that. Right now I don’t have enough info to make any use of the RF device. If someone knows better please write in. Would be nice to have both.

Warning – you are on your own if you start this – you will need your own software and messing with the board will kill any warranty.  Clearly this must NOT be plugged into the mains while programming – use FTDI at 3v3 settings. No doubt 5v would cause damage.


Sonoff board



CLARIFICATION – the square pin is NOT ground – the square hole is 3v3. You should see that the round hole is connected to the flood filling (if you have good eyesight).

Use FTDI at 3v3 setting – in the original boards,  press the large button –THEN power up FTDI. DO NOT connect mains power while doing this – you will fry. Test MQTT connectivity, disconnect, put back in the box, use. NOTE – the newer boards marked RF do not seem to attach GPIO0 to the button – see later blog – it may be necessary to make a VERY find short at power=up – of two surface mount components.

As for actual use.. here’s the interface in Node-Red


Complicated, isn’t it. The node on the left is one of Andrei’s UI components – the node on the right is the standard MQTT connection – all of course running on my Raspberry Pi2 and already in charge of the heating and a load of experiments.

Here’s what it looks like on the phone…


and here it is - waiting for the screws which for the LIFE of me I can’t find… works a TREAT. The output relay is on GPIO12.


I have modified my general purpose MQTT software to run with the Sonoff devices and it works a treat.   - see the home control 2016 project in here where you’ll also find binary files.  A couple of settings need changing from normal – I normally use GPIO2 for WIFI setup and the SONOFF WIFI units use GPIO0…  also  - GPIO13 which I use as a status indicator – turns out the Sonoffs use them but reference 3v3 so I have an inversion setting so they flash off most of the time instead of on all the time – it’s all in the DOC file in the project above. With both of those settings updated... you can also use the button as an on-off button if you like (toggle).

The SONOFFs have only 1MByte of FLASH which would kill off OTA for all but the simplest of projects – my code needs the larger size IF you want OTA. With this in mind, is it worth paying extra for the Electrodragon? Some say the quality of the latter is not so good? But they do use an ESP-12 which will have the normal 4Mbytes of FLASH… what do you think. Update Jly 2016:  The Electrodragons didn't turn out so well - but now I've just proven that it is in face easy with a fine soldering iron to fit a £0.37 32Mbit FLASH chip to these, replacing the original - which means full OTA and no problems expanding.  See for more info.