20161105_112709x

The Sonoff POW

Some months ago I wrote about a hack I did to one of my Sonoff devices to be able to use a simple current sensor to monitor my washer machine process and alert me whenever my laundry was done.

A few weeks ago Itead Studio released two new models for their Sonoff line, the POW and the DUAL. And the POW is Itead’s answer to my hack. I’m not saying they copied me, just that the Sonoff POW makes my hack utterly unnecessary. Do you want to remotely monitor your devices energy consumption? Buy a POW.

What’s new?

Actually, the Sonoff POW layout shows some very significant differences to that of the Sonoff TH16, for instance.

The Sonoff TH16 (left) and the Sonoff POW (right), spot the differences...

The Sonoff TH16 (left) and the Sonoff POW (right), spot the differences…

Again, the Sonoff TH16 (left) and the Sonoff POW (right)

Again, the Sonoff TH16 (left) and the Sonoff POW (right)

Obviously the POW has some circuitry for the power monitoring. The main component of this is the HLW8012 (the SOP8 packaged IC in the picture above). I wrote about the HLW8012 a few days ago, so I will not talk a lot about it here.  The schema of the POW around the HLW8012 is almost the same as in the datasheet. You can see the 1 milliOhm manganese-copper resistor in the center of the board. The IC reads the difference in voltage at the edges of the resistor to calculate the current flowing through. Also, the 5 0603 470kOhm resistors left of the manganese one are the upstream side of the voltage divider that feeds the voltage monitor pin of the HLW8012.

Detail of the HLW8012 in the Sonoff POW

Detail of the HLW8012

A lot of components have been moved to new positions or removed. The HLW8012 [Aliexpress] sits exactly where the header for the RF module is in the TH16. So no chance for an RF+POW version. The diode bridge has been moved closer to the edge of the board and the creepage slots run deeper into the DC side of the board.  The relay is almost exactly the same as in the TH16, a Honfa HF152F-005-1HST, also rated [email protected] or [email protected] And the programming header sits in the same place.

The relay in the Sonoff POW is rated 16A

The relay is rated [email protected]

Detail of the AC/DC components in the Sonoff POW

Detail of the AC/DC components

Like the TH16 it has two LEDs, a red attached to GPIO12 like the relay (so it will be on whenever the realy is closed) and a green one on GPIO15. The button is, of course, tied to GPIO0 so you can use it to enter flash mode on boot.

But the most important difference from my point of view is that the Sonoff POW lacks the sensor interface I talked about in my post about the Sonoff TH10 and TH16. This is actually a pity. It’s like if Itead was teasing us with different options but forcing us to choose between a nice interface for external sensors or the power monitor feature. I will even add a third option to the list and it will make my perfect device, and hopefully next Itead release:

  • Power monitoring
  • External sensors
  • Socket enclosure (like the S20)

If they can sell that for under 15€ it’s a winner.

Quality of the new Sonoff line (TH10, TH16, POW and DUAL) is pretty good and that’s why they recently got the CE mark from the EU. The device looks solid, albeit a bit to big. The enclosure is the same as in the TH10 and 16. I still love how the button peeks out of the box. It almost looks like part of the enclosure.

ESPurned!

You can use the POW with the official eWeLink app. But if you have read me before you might already know I’m not going that way. Instead I soldered a 4 pin header and flashed my own firmware to the device. For the last days I’ve been mostly playing with the HLW8012. Check my post about the HLW8012 a few days ago for a deeper look into it and a library for ESP8266 and Arduino to use it.

Today I’ve been updating my ESPurna firmware with the HLW8012 library to support the Sonoff POW. It’s still under development but you can give it a try.

The ESPurna firmware is released as free open software and can be checked out at my Espurna repository on GitHub.

CC BY-SA 4.0 The Sonoff POW by Tinkerman is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

55 thoughts on “The Sonoff POW

  1. Harley

    Would love to see a review of Domoticz home automation software used with ESPurna flashed Sonoff devices.

    I currently use ESP Easy firmware on other ESP8266 devices because Domoticz have native support for the it.

    Normally I recommed ESPEasy firmware and Domoticz so everyone I know because of its ease of use.

    Reply
  2. Nuno

    I attempted to flash a sonoff pow with an ftdi adapter at 5v. Only noticed my mistake when platformio couldn’t find the device when uploading.

    Now even after switching to 3.3v, platform io never finds the device. I just get a generic espcomm failed to sync error when I try to upload the firmware.

    Curiously, it still works with the firmware it came with (and the ewelink app), I just can’t seem to flash any other firmware on it.

    Is this it fried?

    Reply
    1. Xose Pérez Post author

      I very much doubt it’s fried since you say it still works with the original firmware. My experience is that these IC are quite tolerant to 5V, never fried one by mistake and I have done that mistake more than once. Try resetting your programmer before trying again (disconnect it from you PC), then hold the button down while plugging in the programmer again and keep it down while flashing the device. Sometimes that helps. I suspect that a bad contact might bounce the button signal and the ESP8266 won’t get into flash mode.

      Reply
  3. Pingback: Smartphone und Arduino | wer bastelt mit?

  4. Zerosub

    Hi Xose,

    i managed to flash espurna on my sonoff pow. I’m using version 1.4.4 with domoticz support.
    I like it alot and the webinterface is very nice.

    But i can’t find the right way to integrate it. Do i have to use mqtt to make it work or does it communicate directly with domoticz?

    I installed a mqtt broker, and i can see the Pow sending messages:
    domoticz/in, Message: {“idx”: 4, “nvalue”: 1, “svalue”: “”}

    Will i be able to use the powermeter in domoticz?

    Reply
  5. ron lambkin

    Hello Xose,

    Thank you kindly for sharing this information.

    Would you be able to tell me if the HLW8012 is limited to 3500 watts or is it just the circuit trace & relay? I would like to measure up to 5000 watts if possible on a custom designed board. I understand you have played around with that (HLW8012) chip, so I thought I would ask. I searched on the chinese data sheet, but couldn’t find anything

    Thanks again,

    Ron (from Canada)

    Reply
    1. Xose Pérez Post author

      The chinese datasheet is also my only source of information so I don’t really know. My experiments have never gone further than 1kW. 5kW would mean ~2.5ms pulse width which should be easy for the ESP8266 but you are way beyond the limits of the relay in the POW which is rated 20A (you use 120V mains in Canada, right?)…

      Reply
      1. Kike

        Hola Xose,
        From what I can tell V1P-V1N is 43.75mV from the datasheet. And if the resistor is 0.001 ohms… Not taking into account relay and tracks in the board… that is like 43.74 Amps, right?

        Reply
        1. Xose Pérez Post author

          You should also take into account other values like the resistor max power rate. A 1W shunt should handle up to ~31A peak.

          Reply
  6. Dave

    Xose, not sure if these are available in Spain, but i recently got my hands on one of the ecoplugs from walmart, you can search for item# 554470210. It has an enclosure similar to sonoff s20, it has built in power monitoring with the HLW8012 ic and it has esp8266 built in. So far I am using Tasmota firmware and I have gotten most of the features working, i am still trying to find out which gpio pins are going to the HLW8012ic and will see if tasmota firmware will be able to give me power meter readings. Also, I will be in Barcelona at the end of April, I am very excited about the trip!

    Reply
    1. Xose Pérez Post author

      Yes, I know about the ecoplug and my ESPurna firmware has support for them except for the power monitoring. Problem is that it’s not available here and importing it costs an abusive quantity of money. Besides it’s only 120V and here we work at 230V so I will need further equipment. Anyway I think the HLW8012 in the Ecoplug is accessed via a secondary controller with an I2C interface. Not sure about it. A user here has sent me logs of the readings he’s getting but so far no one I know of has been able to reverse engineered it.

      Reply
  7. Albert

    Hola Xose,

    En pregunte si ESPurna (amb un Sonoff Pow) pot mesurar factors de potència negatius, es a dir, diferenciar entre quan es consumeix i quan s’injecta a la red.

    Si fora així, m’acabes de d’estalviar molts mals de cap!

    Gràcies,

    Albert

    Reply
    1. Xose Pérez Post author

      Hola Albert
      Doncs no sabria dir-te. No tinc gaire experiència en mesurar energia “injectada” a la xarxa elèctrica… l’únic que et puc dir és que el HLW8012 (el chip que porta el POW) mesura per separat corrent instantani (mesurant la diferència de potencial a ambdós costats d’una resistència de 0.001Ohm) i voltatge amb un divisor de potencial de 2570 a 1. Amb aquestes dos mesures fa sampling de potència instantània i retorna potència activa, voltatge i corrent RMS.

      Reply
  8. Jordi

    Buenas, habría posibilidad de volver al firmware original una vez cambiado por el ESPurna?

    Reply
    1. Xose Pérez Post author

      Hola

      Solo si antes has hecho una copia del mismo usando esptool, por ejemplo. Aunque he de reconocer que yo no lo he probado.

      Reply
  9. Leonel

    Hi, From the ITEAD website I get the impression that the POW provides both ‘total power used’ and actual power (‘now’) usage values.
    Accurate measuring of ‘power used’ is a continuous function of ‘actual power’. I therefore assume that ‘total power used’ is calculated and maintained by the Sonoff POW device (like smart power meters which provide both total power used and current power values). Is that assumption correct?
    Does ESPurna also provide both these values?
    If so, is ‘total used’ a standard feature of the HLW8012 chip or is it constantly calculated and maintained in the software?
    What when the Sonoff POW loses power, is ‘total power used’ value locally retained in non-volatile memory or is it lost?
    Thanks

    Reply
    1. Xose Pérez Post author

      I guess that by “total power” you mean “total energy” since the power over time is energy. ESPurna does report total energy as well as current power. I don’t know about the original firmware but ESPurna will reset the total energy to zero upon reboot. My suggestion is to use whatever database you are using to store the values to calculate the energy consumption per day/week/…

      Reply
  10. Gra

    Hi Xose,

    Nice review. I just received my Sonoff POW today (ordered from banggood) and I wonder if it’s a knock-off or whether Itead are changing the design. The reason I say this is that the relay in mine is an HKE V6-S-DC5V and the contacts are only rated to 10A for 250V.

    I’ll have to be careful not to overload it!

    Thanks,
    Gra

    Reply
    1. Xose Pérez Post author

      I would stay in the safe zone with these boards. Wouldn’t load it with more than (say) 5A continuously.

      Reply
      1. Tod

        Hi Xose,

        Thanks for the firmware!

        My Sonoff POW also comes with that V6-S-DC5V rated at 10A for 250W, and even worse, its datasheet mentions a max switching power of 450W ! (http://www.hankukrelay.co.kr/img/product/hke/pdf/V6.pdf) … So much for the advertised 16A …

        I really need this to be able to handle up to 3000W though.
        You guys know of any equivalent alternative (i.e. ESP with power consumption and real 16A/3500W) ?

        Reply
  11. GP

    Thanks for taking the time to review this product, very useful.

    Do you know if the POW provides readings of both Voltage and Current or just Current? And does it calculate Watts as simply Volts x Amps (Actually VA, not W) or does it take into account Power Factor too?

    Thanks again
    GP

    Reply
    1. Xose Pérez Post author

      It calculates voltage and current (both RMS) and true (or active) power so it takes the power factor into account.

      Reply
  12. Izhar Marinov

    Hi Xose,

    I would like start with saying thanks, I have quite a few sonoff devices running espurna and controlled by openhab and it is working great. Your work and effort are appreciated.

    As mentioned in your review a sonoff POW with temperature sensor interface would be a great combination, looking at the POW schematics, it seems GPIO2, labeled SDA, is not used and has a pull-up (R9) connected to it. Can you think of any reason not to use this GPIO to connect to d DS1820 ? this is assuming I can actually locate the tiny resistor…

    izhar

    Reply
    1. Xose Pérez Post author

      Hi Izhar. Thanks for your support.
      GPIO2 must be pulled high for the chip to start up correctly, but once running you can use it as any other GPIO. No reason you could not use it for a DS18B20.

      Reply
      1. Alberto

        Hola Xose.
        ¿Es posible localizar mas GPIO’s para conectar más sensores?
        Estoy evaluando si me compro el sonoff POW para accionar una bomba de agua y necesito un par de GPIO’s extra para verificar niveles.
        Gracias!
        Alberto

        Reply
        1. Xose Pérez Post author

          El POW utiliza muchos de los GPIOs disponibles: 0 (botón), 12 (relay), 15(led) y 5, 13 y 14 (comunicaciones con el HLW8012). De los que quedan (1, 2, 3, 4 y 16) el que tienes más fácil es el GPIO2 porque hay un pull-up necesario para que el ESP8266 arranque y podría soldarse un cable a uno de los pads de la resistencia relativamente fácil. El resto deberías soldar un cable fino directamente a las patas del controlador…

          Reply
  13. wan hui

    Hi Xose,

    Thank you very much, I bought a few sonoff pow before,and I have flashed the espurna into my sonoff pow,I tested a few times,after the flashing , when I put it into my 220V circuit, I find it the circuit is open, I have tried to set the relay mode to “on”, or double click the main bottom of the device ,it doesn’t work.
    I doubt if the firmware supports the Connection to the 220V circuit

    Reply
    1. Xose Pérez Post author

      I have a couple of sonoff pow working at home and we use 230V here… could it be something else?

      Reply
  14. guille

    Hola, antes que nada felicitaciones por tu projecto!
    Despues de ver minuciosamente el esquematico hay algo que no entiendo. la medición de tension se hace poniendo un divisor resistivo entre vivo y neutro tomando una pequeña fraccion de la tension total. Ahora bien, he visto que en algunos circuitos toman como referencia el neutro y otros la tension de linea. Pero en tu esquematico la referencia es flotante! mide la tension de neutro pero no usa como referencia la tensión de línea. Podrias explicarme?

    Reply
  15. Ruben Tavares

    Is there any way to hack the POW so that it can measure the power usage in a hole house?
    The power breakers im my house are rated at 16A max, but from what i have been reading no one recomends using the POW for its rated power (16A).
    The relay could be taken off the board, i just need the power measurement part.

    Reply
    1. Xose Pérez Post author

      I do not recommend that. I don’t think it’s safe to use it with a 10A load or more. Traces are not so thick and contacts might not support higher currents.

      Having said that, the theoretical limit for the HLW8012 power measuring chip is 30.94mV RMS in the VIP/VIN inputs. Those inputs monitor both sides of a milliohm shunt resistor. That means there is a limit of 30.94A RMS. Depending on the appliances at your home that could be enough or not.

      Reply
  16. Pakidermo5000

    Hi Xose, first of all thank you for your work. I am running 3 Sonoff Pow at home to avoid overcharge of the line and I use domoticz to stop one of them.
    I have now bought the temp and humidity sensor si7021 and wanted to connect it to the SonoffPow. 2 questions arise now:
    1. Would espurna handle temp, humidity, power, and voltage?
    2. To which pins should I solder the cables so that the sensor is powered and passes the data to the SonoffPow?

    Thanks.

    Reply
    1. Xose Pérez Post author

      Great! Yes, ESPurna supports SI7021 sensor. It is a I2C sensor so you will need two digital pins to drive it (besides power and ground). The POW just has two spare GPIOs: 2 and 4. GPIO2 has a pull-up resistor so you can solder a wire to it quite easily, GPIO4 on the other hand is not brought out. You will have to solder a thin wire to the chip leg… It’s doable, but quite tricky if you have not done it before…

      Reply
  17. Misza

    I wanted to check Your software, but when I want to open bitbucket site I only get: “Repository unavailable”? What is happening?

    Reply
  18. Dexter

    Hi there, I’ve got 4 sonoff pow with 2017/08/20 date on the enclosure. unfortunately after soldering the 4 pin heads and connecting to my serial adapter, I’m not able to flash it. Arduino says
    warning: espcomm_sync failed
    error: espcomm_open failed
    error: espcomm_upload_mem failed
    error: espcomm_upload_mem failed

    it seems like I’m not able to put the sonoff in update mode, any hint?

    I’ve alredy tryied to keep the button pushed until it finishes the flashing process, or to switch between tx and rx
    thank you

    Reply
    1. Xose Pérez Post author

      Sometimes the button does not property do the contact at the right moment. Keep trying. Also (as a rule of thumb for any device) always try to switch RX and TX. Sometimes they are labeled from the ESP8266 point of view and sometimes from the programmer.

      Reply
  19. Jack

    Green led (blue in ver 2.0) is managed differently than in sonoff-th. Simply changing (in C language) the port number from 13 to 15 does not solve the problem. You can tell how to manage this LED?

    Reply
    1. Xose Pérez Post author

      The POW has the LED in GPIO15 in direct logic while the TH is in GPIO13 in inverse logic. I don’t have access to any V2 POW so I can’t tell. Best way is to grab a tester and find out the GPIO connected to the LED. The schematic in Itead’s wiki show the original POW connections. Apparently nothing has changed?

      Reply
  20. Pakidermo5000

    Thank you very much for the answer. I understand GPIO4 is the bottom right pin of ESP8266 (pin 16) and GPIO2 is the pin14, right?

    I actually have the Itead si7021, and the idea was to add a female jack to the sonoof pow and connect the itead si7021 directly there. But the itead si7021 jack has only 3 pins, Vin Gnd and Data. Any chance of doing it? or it is just better to disassembly the unit and connect SCL and SDA of the si7021 to gpio2 and gpio4?

    Moltes gràcies.

    Reply
    1. Xose Pérez Post author

      You are right about the GPIOs.

      Itead’s SI7021 is a SI7021 sensor dressed in a DHT22 costume. I mean, they have added a microcontroller to the sensor that does a facade, making it behave like a DHT22. So you just need one pin to control it.

      Reply
  21. Chris37000

    Hello,

    Sorry for my limited english.

    I have a colleague who spoke to me about this module, because I was looking for a way to make an unloader at least one shot. Only I have a current of 30A out of the EDF meter, plus it’s three-phase, but just put 3 modules.

    I am a programmer so arduino I know a little bit to have started doing some tests.

    I do not know what you thought about it, but to leave on this module does not seem viable considering its power, but perhaps with the component HLW8012 and an arduino.

    This is to unload material in case of overload on the EDF circuit breaker.

    Reply
    1. Xose Pérez Post author

      The HLW8012 current measuring circuit measures the differential voltage across a shunt resistor. The IC itself has a limit of 30.95mV RMS. With a 1mOhm shunt that means 30.95A RMS max. It’s a tight match. Te POW is not ready for such high currents, will not use it for a load bigger than 10A.

      Reply
  22. Gábor Zoltán

    Very nice review!

    Thx!

    I have one question as follows; Does anyone has the original FW? (only a hex would be perfect!)

    To give back something; a arduino mini can easily be used as a sensor board that is sending the data on serial. No hardwere change required at all and you just gained all the ports arduino mini has! (Also it fitts in nice and there are 3v versions.)

    Best Regards,
    Gábor Zoltán

    Reply
  23. Gábor Zoltán

    I was thinking if i could use serial port on POW. Don’t! Somehow thete is te 220V!
    Be careful!

    Reply
    1. Xose Pérez Post author

      The digital ground in the POW is connected to live neutral, so don’t connect anything to the serial port while powered with mains!!

      Reply
      1. Luca Bertagnolio

        How true! Too bad I have discovered this the hard way, as I just blew a POW, the CP2104 USB interface, and the PC USB port…

        Now I know better… there is still some smell of smoke in the lab… I thought I was being smart by disconnecting the 3.3V line, and that I could get the serial log from Espurna, but… boom! 🙁

        Reply
  24. John Horvath

    Very informative review, too bad I didn’t read it earlier. I followed the instructions on the Tasmota wiki where it was uncertain whether the button on the POW is actually connected to ground, so many recommended connecting to the GPIO0 on the board with a wire and ground the unit that way.. I tried a couple of times to flash but I kept getting the ‘Timed out waiting for packet header’ error (I have a feeling my programming adapter is no good). Anyway, after a coupe of attempts I noticed that the blue LED no longer worked if I connected the POW to the adapter without going into flash mode. However, when I connected the unit to the mains the blue LED would be on all the time, no blinking. Pressing the button or holding it down for several seconds had no effect. Has this happened to anyone else, that is, after repeated tries the POW simply no longer works? Actually, is my unit actually now broken or is there some way to fix it?

    Reply
    1. Xose Pérez Post author

      I don’t think you bricked your POW unless you had short-circuit it… Most of the times it’s just a bad flash. Try erasing the flash first and then flash it again.

      Reply
  25. Gaurav Jariwala

    Hi,

    Nice information and article.

    iam intrested to use sonoff pow as water level pump controller.

    curently using sonoff pow to run 1.5hp water motor to fill overhead water tank,system works fine ,water pump turns on and off at desired time.

    I want to add some float switch or sensor to turn trigger off command in sonoff to turn pump off when water level reaches high (dont need low level trigger) irrespective of switch off schedule time is yet to trigger as programmed.

    As of now have to manually push sonoff button to switch off when water overflow before switch off command is triggered.

    Need to use sonoff pow only (if iam not wrong it can handle water pump of heavy load of 16a or 3500 w).

    Connecting float directly to push button of sonoff may risk leakage of ac current hence overruled.

    Can you guide or advice how to achieve this configuration or what type of sonoff to use as water level sensor or trigger with water pump of high load rating.

    Reply
    1. Xose Pérez Post author

      The Sonoff POW does not have available general purpose IOs available to connect extra sensors unless you want to repurpose RX and TX in the programming header. Also, I would not load it with 16A, even thou the manufacturer claims so I think it’s somewhat risky to load it with more than 10A.

      Reply

Leave a Reply (all comments are moderated, be patient)

This site uses Akismet to reduce spam. Learn how your comment data is processed.