How to isolat cf ,cf1 and sel from esp in hlw8012 ic?

Hi everyone,

I am designing an energy monitoring circuit using the HLW8012 metering IC interfaced with an ESP microcontroller (ESP32 / ESP8266).

Because the HLW8012 has its reference ground directly tied to mains neutral/line, I want to fully isolate the low-voltage MCU side from the high-voltage mains side for safety.

I need advice on how to properly connect optocouplers (or digital isolators) for the three digital lines:

  • CF (Output from HLW8012): Active power pulse output.

  • CF1 (Output from HLW8012): Voltage/Current RMS pulse output.

  • SEL (Input to HLW8012): MCU signal to toggle current/voltage reading mode.

Specifically:

  1. Which optocouplers or high-speed isolators (e.g., PC817 vs. 6N137) work best given the pulse frequencies of CF/CF1?

  2. How should the pull-up resistors and emitter/collector configurations be wired across both isolated power domains?

Thanks in advance for any schematics, component recommendations, or guidance!

Why?

I have a similar power meter with the ESP inside an enclosure, directly connected to mains.
The isolation is the wireless link.

Arte you re-inventing a US$10 smart plug?

https://www.digikey.com/en/products/detail/texas-instruments/ISOM8710DFFR/21298742

@praneshmechatronics
Still need help?