ESP32 DEV wall outlet gpio pin layout

Hello all, hoping this is the right place to post this. I have been searching for months for a good US wall outlet with usb and energy monitoring. Ordered a few different products from alibaba for testing. I found one I like but I am struggling finding the gpio layout and hoping I can get some help.



I have been able to go through and find the relays for on and off of the outlets and usb, but I have struggled finding the energy monitoring. Does some form of scanner exist that doesnt take a crap load of build and configuration?

This is the outlet I ordered

Interesting they are using a ESP32 MCU for a new design. And their own wifi mesh systems? So you flashed tasmota on the device? Seems a fairly common chip for power monitoring in smart sockets.
HLW8012

These pins (below) seem to be used with this chip on a number of devices, however your devices seems rather new and not much info (and I guess you figured out). I’ve not seen a probing tool for ESP family chips I/O pins. The Open Beken project has a pin scanner sub systems for the Tuya type MCU’s, but that would not help you.

  - platform: hlw8012
    sel_pin: 5
    cf_pin: 14
    cf1_pin: 13

Good hunting!

Thanks for the tips. Here is what I know based off of trial and error with the relays.

GPIO14, relay 1 is the USB on and off.
GPIO15, relay 3 is something because when i click on and off, I hear a click on the board. The front of the outlet does have a power button so it could be that?
GPIO 27, Relay 2 is both outlets on and off.

I have a few open beken devices and was hoping something like that existed for this scenario, but it doesn’t appear to. So I guess its just down to trying the different options with all the gpio pins.

Any chance it could be any of the pins labeled TX, RX, FL, AO, IA? I know what the tx and rx do, but I have never selected anything with FL, IA or AO.

I think I am finally getting somewhere but I cant get the calculations to stay consistent



The Voltage seems to go between 120 and 240. I am using a Kill A Watt to validate my settings and following the tasmota power calibration guide.

My Watts stay pretty close and consistent, kill a watt showing 8.3 and tasmota is showing 8. The current and volts just dont stay close or consistent, I have even had the voltage show 60 and 80.

Another thing I have noticed is that I can change the HLWBL SEL between gpio 34 and 36 and nothing seems to change. I read a few forums of people who have had the hlw8012 calibrated and a new product update changed the gpio pin layout so I wonder if I still dont have the gpio config correct.

Finally got it, lol about 7 hours of trial and error


This is with a 95 watt light bulb. I also have the kill a watt plugged in and will check later on the accuracy

1 Like

What is your assessment of the following about the device, if may:

  1. How hard was it to open the case and flash Tasmota? I am guessing you had to flash via a USB to serial device.

  2. Safety/Quality?

  3. How tight a fit into a standard USA single gang wall opening?

  4. Price value?

Thx!

Ill do a better write up tomorrow. I can say definitely well worth it. Having a US wall outlet with esp instead of that tuya garbage is great. Easy flash, has 2 outlets, 2 usb, on and off for both and active power monitoring is worth the cost on alibaba. Dont get it on aliexpress. This is the 4th device I have ripped apart looking doe all these very specific pieces. Didnt have to do any soldering, the pins have a 5 piece header on the underside to just shove 5 jumper wires in and flash

1 Like

Well I had hoped I had figured it out but this is how it looks now.

A few random tips with my recent adventure with HLW8012.

  • SEL output from ESP is 3.3V level, and HLW8012 spec require min of 4V as level high. Depends on the logic shifter circuit, when the SEL signal arrives HLW8012 could be inversed, try SEL_i instead.