Sonoff IoT swich

DIY Wi-Fi Wireless Switch For Smart Home With ABS Shell Socket Remote Control Switch Module is an IoT home automation device. This device, also known as Sonoff from ITEAD, can control 110V to 230V AC mains power on/off (up to 7A or 10A depending on document). The switch is controlled with mobile app (or local buttom). The control works so that this IoT device uses WiFi Internet communications to cloud serrvice. For more details read User Guide for ITEAD Smart Home Devices.

Specifications:

Power: <=0.5W

Rate Voltage: 100-260V

Control mode: Mobile APP (Android, iOS)

Transmission mode: Wi-Fi communication;

Power: 7A/1500W

Thsi device is maybe the cheapest IoT which that can control 230V power wirh iPhone and Android. This is ready to use device as it is. I am disappointed since I need to use and install an external app to use it. The app did not feel to be good or reliable (problems in getting the device detected and connected to home WiFi etc..)

It can be also customized if you want. The device is based on very popular ESP8266 IoT chip. The firmware inside device can be flashed just like any other ESP8266 dev board, there is even programming contacts easily accessible (place to solder pin header).

Let’s look what is inside this device. Here is the box the Sonoff IoT swiching device came to me:

Here is picture of the device itself (I had already added mains input cable to it).

For cable connection the device provides normal OK screw terminals.

The case protects the screws well and works as strain relief for the mains cable.

Let’s open the main case to see the electronics inside.

The circuit board looks nice.

On this side of the board the biggest components are the mains power controlling relay and power supply transformer. The IC you see on the circuit board is iW1700 switch mode power supply IC. On the left side the blue disk is VDR that protects agains overvoltage. The big grey resistor is “fusible resistor” that acts like surge current limiter and serious overload protection (like fuse).

On hte bottom of the board the most important components are ESP8266, rectifier and voltage regulator.  The swich mode power supply generates 5V power that is used directly for the relay coil. The 3.3V for ESP8266 is made with linear regulator from that 5V.

Take a note on the cut-outs on the circuit board, they are here to make sure that the mains power traces don’t be too near to each other (to make short circuit).

For more details on the actual circuit details, refers to the schematic available at http://www.communica.co.za/Content/Catalog/Documents/D0917396801.pdf

 

Links to more information

ITEAD Sonoff and Slampher Review (and Teardown)

http://www.chet.ie/?p=240

Sonoff more information:

https://www.itead.cc/sonoff-wifi-wireless-switch.html

https://www.itead.cc/wiki/Sonoff_Smart_Home_Solution

https://www.itead.cc/blog/user-guide-for-sonoff-slampher

https://www.element14.com/community/groups/internet-of-things/blog/2015/12/25/itead-studio-sonoff-and-slampher-low-cost-smart-home-solution–review

https://www.domoticz.com/forum/viewtopic.php?t=9670

http://www.chet.ie/?p=240

http://www.banggood.com/DIY-Wi-Fi-Wireless-Switch-For-Smart-Home-With-ABS-Shell-p-1019971.html

https://www.itead.cc/sonoff-wifi-wireless-switch.html

http://tech.scargill.net/itead-slampher-and-sonoff/

http://blog.squix.org/2016/01/esp8266-products-hitting-market.html

https://hackspark.fr/en/sonoff-esp8266-wifi-smart-relay-switch.html

http://electronicopensource.blogspot.fi/

http://www.communica.co.za/catalog/Details/P0240254864

http://tech.scargill.net/itead-slampher-and-sonoff/

https://nathan.chantrell.net/20160422/esp8266-relay-modules-from-itead-and-electrodragon/

Schematic

http://www.communica.co.za/Content/Catalog/Documents/D0917396801.pdf

Component data

http://www.dialog-semiconductor.com/sites/default/files/iw1700-datasheet.pdf

https://www.itead.cc/wiki/AC-DC_Power_Module_5V_500mA

http://www.futureelectronics.com/en/technologies/electromechanical/relays/power-relays/Pages/9002503-HF32F-G-05-HS%20(257).aspx?IM=0

http://www.hongfa.com/pro/pdf/HF32F-G_en.pdf

Alternative firmware

https://bitbucket.org/xoseperez/espurna

 

12 Comments

  1. Tomi Engdahl says:

    Information on other Sonoff model:

    Home appliances control using SONOFF TH10
    https://hackaday.io/project/19879-home-appliances-control-using-sonoff-th10

    Sonoff TH10/TH16 is a smart switch version of Sonoff which can monitor and set temperature and humidity through the iOS/Android APP eWeLink.

    Sonoff TH10/TH16 is a smart switch version of Sonoff which can monitor and set temperature and humidity through the iOS/Android APP eWeLink. Just as the name indicates, the Sonoff TH device supports two current supply specifications: 10A or 16A. It features presetting the range for temperature or humidity. When the temperature or humidity of the environment fall within the range, it will automatically turn on or off the connected devices. It supports three kinds of temperature and humidity sensors

    AM2301
    DS18B20
    DHT11

    Reply
  2. Tomi Engdahl says:

    Hacked IoT Switch Gains I2C Super Powers
    http://hackaday.com/2017/03/27/hacked-iot-switch-gains-i2c-super-powers/

    Economies of scale and mass production bring us tons of stuff for not much money. And sometimes, that stuff is hackable. Case in point: the $5 Sonoff WiFi Smart Switch has an ESP8266 inside but the firmware isn’t very flexible. The device is equipped with the bare minimum 1 MB of SPI flash memory. Even worse, it doesn’t have the I2C ports exposed so that you can’t just connect up your own sensors and make them much more than just a switch. But that’s why we have soldering irons, right?

    [Jack] fixed his, and documented the procedure.

    Sonoff WiFi Smart Switch With I2C Port
    http://www.jackenhack.com/sonoff-switch-i2c/

    How to add an I2C interface to a Sonoff WiFi Smart Switch.

    Reply
  3. Tomi Engdahl says:

    SuperHouseTV #21: Six Sonoff Secrets: Storage, Safety, Switches, Sensors, Software, and Sites
    https://www.youtube.com/watch?v=8mz5sCAvDAY

    Customise your Sonoff home automation controllers with a memory upgrade, weatherproof housing, control switches, sensors, and custom firmware.

    Examples, diagrams, links, and more information is at
    http://www.superhouse.tv/21-six-sonoff-secrets/

    Reply
  4. Tomi Engdahl says:

    SuperHouseTV #17: Home automation control with Sonoff, Arduino, OpenHAB, and MQTT
    https://www.youtube.com/watch?v=_389pQPLyr8

    The Sonoff from Itead Studio is a fantastic little mains-switching module with a built-in ESP8266 and WiFi. If you want an easy way to control mains devices such as lamps and fans, this could be it!

    Reply
  5. Tomi Engdahl says:

    Interesting looking new Sonoff products:

    SONOFF® DIY Dual Channel WIFI Wireless Remote Control Switch For Smart Home Support 2G / 3G / 4G Network
    http://www.banggood.com/SONOFF-DIY-Dual-Channel-WIFI-Wireless-Remote-Control-Switch-For-Smart-Home-Support-2G-3G-4G-Network-p-1138790.html?p=27131452996820140438

    Control APP: eWelink
    Input voltage: AC 90 ~ 250V
    Maximum power: 2200W for single channel, ≤3500W for dual channel
    Maximum current: 10A for single channel, ≤16A for dual channel

    Reply
  6. Tomi Engdahl says:

    SONOFF® 10A 2200W Smart WIFI Switch 4CH 4 Channel Wireless Switches Din Rail Mounting Home Automation Module
    http://www.banggood.com/SONOFF-10A-2200W-Smart-WIFI-Switch-4CH-4-Channel-Wireless-Switches-Din-Rail-Mounting-p-1138789.html?p=27131452996820140438

    Sonoff 4CH is an ESP8285 based 4 channel (4-gang) din rail mounting WiFi switch.
    Sonoff 4CH supports to connect and control 4 home appliances, which can be turned on/off separately by the buttons or iOS and Android APP EweLink. Owning a Sonoff 4CH means you have 4 Sonoff basic WiFi switches integrate together.
    The enclosure is din rail mount supported! A DIN rail is a metal rail of a standard type widely used for mounting circuit breakers and industrial control equipment inside equipment racks.

    Sonoff 4CH belongs to Sonoff family, definitely, it bears all the functions basic Sonoff has. In EweLink, you can remote turn on/off from anywhere at any time, set single/repeat/countdown timing schedules to turn on/off at a specified time, share to others so that they can control together.
    Sonoff 4CH is hacker-friendly that you can flash your firmware without difficulty.
    After accessing to Google Nest, e-WeLink can receive real-time environment data like temperature, humidity from Google Nest, as well as checking if there is anybody home or not. All these can be used to create smart scene to control e-WeLink supported Sonoff devices.
    Support independently turn on/off 4 home appliances
    Support to control home appliances by local toggle buttons or APP
    Support tracking device status and timely remote control through APP

    Reply
  7. Tomi Engdahl says:

    Sonoff – WiFi Wireless Smart Switch for MQTT COAP Smart Home
    https://www.itead.cc/sonoff-wifi-wireless-switch.html

    Reply
  8. Tomi Engdahl says:

    Son of Sonoff
    http://hackaday.com/2017/05/12/son-of-sonoff/

    We’ve covered the Sonoff a few times–a very inexpensive box with an ESP8266, a power supply, and an AC relay along with a way to tap into a power cord. Very inexpensive means $5 or $6. The supplied software will work with several systems (including, recently, Alexa). But what self-respecting hacker wants to run the stock firmware on something with an ESP8266 inside?

    [Tzapu] certainly didn’t. But he also knew he didn’t want to start from scratch every time he wanted to deploy a switch. So he built SonoffBoilerplate and put the code on GitHub. The code manages taking configuration (including network settings) using a web-portal, can update itself over the air, and integrates with Blynk and MQTT.

    Reply
  9. Tomi Engdahl says:

    Sonoff (ESP8266) reprogramming – Control Mains from Anywhere
    https://tzapu.com/sonoff-firmware-boilerplate-tutorial/

    What’s a “Sonoff”? you ask

    Is it sold at Ikea? No, this is not sold at Ikea:)

    The Sonoff is a very small module, basically a wifi enabled wireless switch, based on the ESP8266 chip that can switch mains power. Part of it’s charm is that itis all embedded in one tiny and nice box, power supply and all and that it can fairly easy be reprogrammed. It is also really really really cheap, about $5. Cheap.

    SonoffBoilerplate

    Because I can see myself running a number of these little devices which I like very much, I thought I’d better have a starting point so i don’t start from scratch every time I prepare another one.
    The goals would be:
    – over the air updates, so you don t have to take the module out for reprogramming
    – easy configuration of parameters and wifi credentials
    – flexible enough to be reused
    – controllable through various methods, physical, mqtt, http, blynk

    Sonoff physical modifications

    You will need to solder a header onto the Sonoff in order to reprogram it.
    The latest, WiFi only version, of the device has an unpopulated 5 pin header onto which you need to add some pins.

    Pinout
    1. vcc 3v3 (this is the square pad)
    2. rx
    3. tx
    4. gnd
    5. gpio 14 (untested yet)

    After you solder the header and connect a usb to serial dongle

    First you need to have Arduino IDE with the ESP8266 core installed
    You will need to download SonoffBoilerplate together with all the libraries it depends upon.
    Libraries:
    – WiFiManager
    – Blynk

    SonoffBoilerplate
    https://github.com/tzapu/SonoffBoilerplate

    This is a replacement firmware (Arduino IDE with ESP8266 core needed) for the ESP8266 based Sonoff devices. Use it as a starting block for customizing your Sonoff.

    Reply
  10. Tomi Engdahl says:

    Hijacking the Sonoff OTA Mechanism
    http://hackaday.com/2017/05/31/hijacking-the-sonoff-ota-mechanism/

    ITEAD’s Sonoff line is a range of Internet-of-Things devices based around the ESP8266. This makes them popular for hacking due to their accessibility. Past projects have figured out how to reflash the Sonoff devices, but for [mirko], that wasn’t enough – it was time to reverse engineer the Sonoff Over-The-Air update protocol.

    [mirko]’s motivation is simple enough – a desire for IoT devices that don’t need to phone home to the corporate mothership, combined with wanting to avoid the labor of cracking open every Sonoff device to reflash it with wires like a Neanderthal. The first step involved connecting the Sonoff device to WiFi and capturing the traffic. This quickly turned up an SSL connection to a remote URL. This was easily intercepted as the device doesn’t do any certificate validation – but a lack of security is sadly never a surprise on the Internet of Things.

    SonOTA – Flashing Itead Sonoff devices via original OTA mechanism
    http://blog.nanl.de/2017/05/sonota-flashing-itead-sonoff-devices-via-original-ota-mechanism/

    There’s now a script with which you can flash your sonoff device via the original internal OTA upgrade mechanism, meaning, no need to open, solder, etc. the device to get your custom firmware onto it.

    This isn’t perfect (yet)

    Reply
  11. Tomi Engdahl says:

    SuperHouseTV #21: Six Sonoff Secrets: Storage, Safety, Switches, Sensors, Software, and Sites
    https://www.youtube.com/watch?v=8mz5sCAvDAY

    Customise your Sonoff home automation controllers with a memory upgrade, weatherproof housing, control switches, sensors, and custom firmware.

    Reply
  12. Tomi Engdahl says:

    SuperHouseTV #17: Home automation control with Sonoff, Arduino, OpenHAB, and MQTT
    https://www.youtube.com/watch?v=_389pQPLyr8

    The Sonoff from Itead Studio is a fantastic little mains-switching module with a built-in ESP8266 and WiFi. If you want an easy way to control mains devices such as lamps and fans, this could be it! Sonoff modules are preloaded with firmware that allows them to be controlled by a phone app, so they’re very easy to get started. But that’s just the beginning: using a USB-serial converter and the Arduino IDE, you can load your own software on the Sonoff and make it do your bidding. I used the Arduino IDE to load a sketch with MQTT support and OTA (over the air) updates, allowing it to be controlled by OpenHAB.

    Reply

Leave a Comment

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

*

*