This question already has an answer here:

I'm designing my own Sonoff with ESP32, with power monitoring capability. Now before I start my own design, I took a look at Sonoff design. In the Sonoff POW the power metering IC has a 0R resistor, while the datasheet of HLW8012 did not have any 0R resistor. The 0R an an SMD 1206 resistor, and I don't quite understand its purpose.

What's the purpose of 0R here?

Moreover, Is the transformer enough to make the Mains isolated from the power supply, or we should go for extra safety and mains isolation stuff?

enter image description here

enter image description here


marked as duplicate by Marcus Müller, RoyC, berendi - protesting, Phil G, Brian Carlton Jul 12 at 2:27

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 2
    \$\begingroup\$ sigh. You're still designing around an IC that only has documentation in a language you can't read, and that you still don't need. \$\endgroup\$ – Marcus Müller Jul 3 at 12:07
  • 9
    \$\begingroup\$ Again, you're clearly in a learning phase, and that's fine. But you really must not start with grid voltage monitoring. The best realistic outcome is that you'll be frustrated. The most likely outcome is that you destroy something, and among the things heavily damaged might be your health (electrocution is deadly) and all things that burn with your device. simply pick a different project, and come back to this later. I don't say this to put you down – you're really just in over your head with this, and you really don't realize. \$\endgroup\$ – Marcus Müller Jul 3 at 12:10
  • 4
    \$\begingroup\$ ”Why I need it is because i want all my overall design small and not planning to use current transformer stuff, that makes my circuit bigger.” That’s not a valid reason. Look up the term XY problem. \$\endgroup\$ – winny Jul 3 at 12:17
  • 2
    \$\begingroup\$ yeah, but you just believe this chip helps you achieve something you think you can achieve. You won't. Not with a Chinese chip that you don't understand, doing something that you don't understand even the basic principle of, in a complex technological environment that you have just the slightest idea. A psychologist friend of mine uses to say: If you meet someone who says something is too hard for you, that person might be mean. If you meet ten people that tell you something is too hard for you, maybe consider you might be overestimating your abilities. \$\endgroup\$ – Marcus Müller Jul 3 at 12:19
  • 2
    \$\begingroup\$ Then please don't come here asking for advice. Our advice is clear: don't use the chinese IC that you don't understand. You choose to still do it – OK, but again, if you don't want advice, don't ask for advice. I feel stupid just for even having to discuss that! \$\endgroup\$ – Marcus Müller Jul 3 at 12:49

Downwards triangle is ground. All grounds are connected together unless specified otherwise. It does not appear that this circuit has separate analog and digital grounds. In fact, it connects the ground directly to the live mains! Hence all the dire warnings about not connecting it to your PC at the same time. The circuit is intended to be in a sealed box communicating over radio.

0R resistors can serve various purposes. They may bridge a track on the PCB, although that doesn't look like what's happening here. More often they are there to be substituted by other parts during the testing process; it was probably intended in case they wanted to put a ferrite bead or other noise-suppressing component in there without changing the PCB.

  • \$\begingroup\$ OP removed the ground question after it was pointed out they asked it already in a different question. \$\endgroup\$ – Marcus Müller Jul 3 at 12:23

That 0Ω resistor probably fulfills a compensating role for something that after months of careful design was determined to require all the effects (that being parasitics, or nothing) of a 0Ω resistor.

That's the thing about building good shunt resistor monitoring:

You don't only need good understanding about how the circuits work on paper (which you, in all honest brutality, you really don't have yet), you also need the experience to know about the way simple components behave differently than their simple theoretical models.

You're at no point where you understand the parasitics of resistors and PCB traces. Hence, to you this 0Ω resistor isn't explicable.

To us, we don't know why it's a 0Ω resistor in that place (we can speculate, but that'd be mostly idle speculation), but we could spend a lot of time designing our own PCB that contains similar compensation/adjustment elements.

I'm very sorry to tell you this, but the comments to all your power metering questions have been so far:

This project is both too technologically involved and to dangerous for your current state of understanding.

Using an IC that you don't understand and that doesn't even come with documentation that you can read makes it even less sensible to try and do this.

Simply pick a different project. You've demonstratably (your own questions!) haven't made any significant progress at understanding the problems at hand. You need to start somewhere simpler, less hazardous. Thank you for understanding, and I hope you don't hurt yourself during your experiments with grid power.


Not the answer you're looking for? Browse other questions tagged or ask your own question.