WT32-ETH01 With ESPHome Driving "CircuitSetup Expandable 6 Channel ESP32 Energy Meter Main Board"

Wanted to post how I got this all working because I couldn’t find anything on the web about enabling SPI on a wt32-eth01 OR how to use a wt32-eth01 with a 6-channel energy monitor because you wanted to get off wi-fi.

  1. Connect your wt32-eth01 board to your usb serial adapter like pictured:


  1. Install the ESPHome ADD-ON to your home assistant, so you can program blank esp32 boards.

  2. Plug your usb serial adapter into a computer that can access your home assistant WEB GUI.

  3. In your ESPHome add-on, add a new device.

  4. When It asks how to install it, choose the USB serial option, for me it was (COM6)

  5. Once successful, you now need to add an ESPHome INTEGRATION in home assistant NOTE: you must do this each time you add a new ESPHome board to your house. The add-on is only for programming the boards, not for utilizing them, thats what the integration is for.

  6. Next wire up the wt32-eth01 to your energy board like pictured:


  1. At the bottom of this post is the code that got it working. NOTE: for some reason if you try to use GPIO12 for something, it prevents the ethernet port from initializing.

  2. You may have to reboot your home assistant instance if auto discovery isn’t working properly, but you can now go to your settings > devices/services > integrations tab > ESPHome > Devices, and see your values.

HERE is the code to paste into your wt32-eth01 via the ESPHome Add-on:

esphome:
  name: "esp32-home-1"
  friendly_name: "esp32-home-1"

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: ".........................................................."

ota:
  password: "...................................................."

ethernet:
  type: LAN8720
  mdc_pin: GPIO23
  mdio_pin: GPIO18
  clk_mode: GPIO0_IN
  phy_addr: 1
  power_pin: GPIO16
  manual_ip:
    static_ip: 192.168.1.10
    gateway: 192.168.1.1
    subnet: 255.255.255.0


spi:
  clk_pin: GPIO15
  miso_pin: GPIO35
  mosi_pin: GPIO14

  
sensor:
  - platform: atm90e32
    cs_pin: GPIO4
    phase_a:
      voltage:
        name: "EMON Line Voltage A"
      current:
        name: "EMON CT1 Current"
      power:
        name: "EMON Active Power CT1"
      gain_voltage: 7305
      gain_ct: 29300
    phase_b:
      current:
        name: "EMON CT2 Current"
      power:
        name: "EMON Active Power CT2"
      gain_voltage: 7305
      gain_ct: 29300
    phase_c:
      current:
        name: "EMON CT3 Current"
      power:
        name: "EMON Active Power CT3"
      gain_voltage: 7305
      gain_ct: 44500
    frequency:
      name: "EMON Line Frequency"
    line_frequency: 60Hz
    current_phases: 3
    gain_pga: 1X
    update_interval: 30s

  - platform: atm90e32
    cs_pin: GPIO2
    phase_a:
      current:
        name: "EMON CT4 Current"
      power:
        name: "EMON Active Power CT4"
      gain_voltage: 7305
      gain_ct: 44500
    phase_b:
      current:
        name: "EMON CT5 Current"
      power:
        name: "EMON Active Power CT5"
      gain_voltage: 7305
      gain_ct: 44500
    phase_c:
      current:
        name: "EMON CT6 Current"
      power:
        name: "EMON Active Power CT6"
      gain_voltage: 7305
      gain_ct: 44500
    line_frequency: 60Hz
    current_phases: 3
    gain_pga: 1X
    update_interval: 30s

Hope this can help someone!

5 Likes

Good work!

Someone needs to make adapter boards that can go over the existing pins on the CircuitSetup board and then can adapt to newer boards for simple swap outs.

At last. This is exactly what I am looking for for a long time.
Thank you.
By the way, where did you buy the 6-channel energy monitor ?
Regards
Ed

1 Like

I’m actually working on one for the T-ETH-Lite ESP32-S3. It has enough GPIOs for the add-on board CS pins (12 are needed for 6 add-on boards to measure 42 current channels).

The WT32-ETH01 will only work with the a single main board, but I still may make an adapter for that too if there is enough interest.

1 Like

Something like that would be great! I am afraid I will not have good Wi-Fi reception at my panel (but I haven’t tried yet, either).

Would it fit right on the existing boards or require a new board?

It will fit on existing, and be a bit higher than a regular esp32 dev board.

I got the test boards a couple days ago and will start testing shortly.

1 Like

Completed the testing! More info here: CircuitSetup 42 channel energy meter stack over ethernet!

Not entirely true, the WT32-ETH01 can support 1x Main Board, AND 2x Expander Boards. To get it all together, I developed this wiring harness. I may get together with you later on your adaptors. Here are my wiring diagrams:

And here is my code:

esphome:
  name: "esp32-home-1"
  friendly_name: "esp32-home-1"

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

ota:
  platform: esphome
  password: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

ethernet:
  type: LAN8720
  mdc_pin: GPIO23
  mdio_pin: GPIO18
  clk_mode: GPIO0_IN
  phy_addr: 1
  power_pin: GPIO16
#  manual_ip:
#    static_ip: 192.168.1.XX
#    gateway: 192.168.1.1
#    subnet: 255.255.255.0


spi:
  clk_pin: GPIO15
  miso_pin: GPIO35
  mosi_pin: GPIO14

  
sensor:
  #CS:CS
  - platform: atm90e32
    cs_pin: GPIO4
    frequency:
      name: "EMON Line Frequency"
    phase_a:
      voltage:
        name: "EMON Line Voltage A"
      current:
        name: "EMON CT01 Current"
      power:
        name: "EMON Active Power CT01"
      gain_voltage: 7305
      gain_ct: 29300
    phase_b:
      current:
        name: "EMON CT02 Current"
      power:
        name: "EMON Active Power CT02"
      gain_voltage: 7305
      gain_ct: 29300
    phase_c:
      current:
        name: "EMON CT03 Current"
      power:
        name: "EMON Active Power CT03"
      gain_voltage: 7305
      gain_ct: 44500
    line_frequency: 60Hz
    current_phases: 3
    gain_pga: 1X
    update_interval: 30s



  #CS:CS2
  - platform: atm90e32
    cs_pin: GPIO2
    phase_a:
      current:
        name: "EMON CT04 Current"
      power:
        name: "EMON Active Power CT04"
      gain_voltage: 7305
      gain_ct: 44500
    phase_b:
      current:
        name: "EMON CT05 Current"
      power:
        name: "EMON Active Power CT05"
      gain_voltage: 7305
      gain_ct: 44500
    phase_c:
      current:
        name: "EMON CT06 Current"
      power:
        name: "EMON Active Power CT06"
      gain_voltage: 7305
      gain_ct: 44500
    line_frequency: 60Hz
    current_phases: 3
    gain_pga: 1X
    update_interval: 30s



  #CS:00
  - platform: atm90e32
    cs_pin: GPIO5
    phase_a:
      current:
        name: "EMON CT07 Current"
      power:
        name: "EMON Active Power CT07"
      gain_voltage: 7305
      gain_ct: 29300
    phase_b:
      current:
        name: "EMON CT08 Current"
      power:
        name: "EMON Active Power CT08"
      gain_voltage: 7305
      gain_ct: 29300
    phase_c:
      current:
        name: "EMON CT09 Current"
      power:
        name: "EMON Active Power CT09"
      gain_voltage: 7305
      gain_ct: 44500
    line_frequency: 60Hz
    current_phases: 3
    gain_pga: 1X
    update_interval: 30s



 #CS:16
  - platform: atm90e32
    cs_pin: GPIO17
    phase_a:
      current:
        name: "EMON CT10 Current"
      power:
        name: "EMON Active Power CT10"
      gain_voltage: 7305
      gain_ct: 44500
    phase_b:
      current:
        name: "EMON CT11 Current"
      power:
        name: "EMON Active Power CT11"
      gain_voltage: 7305
      gain_ct: 44500
    phase_c:
      current:
        name: "EMON CT12 Current"
      power:
        name: "EMON Active Power CT12"
      gain_voltage: 7305
      gain_ct: 44500
    line_frequency: 60Hz
    current_phases: 3
    gain_pga: 1X
    update_interval: 30s


  #CS:15
  - platform: atm90e32
    cs_pin: GPIO32
    phase_a:
      current:
        name: "EMON CT13 Current"
      power:
        name: "EMON Active Power CT13"
      gain_voltage: 7305
      gain_ct: 47000
    phase_b:
      current:
        name: "EMON CT14 Current"
      power:
        name: "EMON Active Power CT14"
      gain_voltage: 7305
      gain_ct: 47000
    phase_c:
      current:
        name: "EMON CT15 Current"
      power:
        name: "EMON Active Power CT15"
      gain_voltage: 7305
      gain_ct: 47300
    line_frequency: 60Hz
    current_phases: 3
    gain_pga: 1X
    update_interval: 30s



  #CS:17
  - platform: atm90e32
    cs_pin: GPIO33
    phase_a:
      current:
        name: "EMON CT16 Current"
      power:
        name: "EMON Active Power CT16"
      gain_voltage: 7305
      gain_ct: 44500
    phase_b:
      current:
        name: "EMON CT17 Current"
      power:
        name: "EMON Active Power CT17"
      gain_voltage: 7305
      gain_ct: 44500
    phase_c:
      current:
        name: "EMON CT18 Current"
      power:
        name: "EMON Active Power CT18"
      gain_voltage: 7305
      gain_ct: 44500
    line_frequency: 60Hz
    current_phases: 3
    gain_pga: 1X
    update_interval: 30s
1 Like

I stand corrected. For some reason I didn’t think that many GPIO’s were available.

Thanks for following up!

1 Like