How to use PZEM004T Energy Monitor with esphome

Would a diode with the following specifications work for this application?

or this one?

The spec you should be looking at is voltage drop. Around 0.3V is fine. Otherwise just give your diode a try.

1 Like

Thank you. Will try it out :slight_smile:

Hey pod

Do you have a wiring digram for this?

regards

:point_down:

Thanks for that?

Can i use any Schottky Diode?

:point_down:

Thanks for that kinda obvious and i didnt see it sorry

Everyone mentions NodeMCU

am i able to get away with a wemos with 3 PZEM?

Yes, virtually every esp (8266 or 32) should do the trick.

cool thanks for the help

Can you see any issues with this?

1 Like

Hello, is it possible to use PZEM-004T with Shelly EM 50A Current Transformer Clamp?

Probably not. The pzem004t comes with a coil or clamp included and that is probably factory calibrated to deliver a good accuracy. Also pzem004t versions only exist ether with 10A or 100A coils/clamps so a 50A clamp will most likely deliver wrong values.

If I am not mistaken you schematic is not quite correct.
From my understanding the point of the diodes is to protect Wemos Rx pin from overvoltage(5V from PZEM004T). Wemos pins are 3.3V tolearant. So you need to create 5V to 3.3V logic level shifter using those diodes and pull up resistor. The way you connected pull-up resistor (on 5V rail) defeats the purpose of the diodes. Should be connected to 3.3V.

ESP Pins logic is indeed 3.3V but they are 5V tolerant.

I typically use all sensors/actors that support 5V directly with esp’s since years without any problems. I also use pzem004t’s without any level shifter and they work a treat.

Search for JST-XH 2.54

3 Likes

Would there be any issue with extending the wires on the split core ct clamp?

Hello there, do i need to do for each PZEM at start-up and then do the normal configuration?

I don’t think so.

Here is how I made my devices.

So far I made 10 of these. I’m using a generic bar soap case as an enclosure. Soap cases are less than 1 USD.

I’m using a cheap bidirectional 5V-3V digital converter module to power the ESP01 with 5V and also to allow bidirectional communication with 5V serial TTL with PZEM. Also I’m using a simple USB TTL converter for ESP01 for programming. I’ve added a switch to put it into programming mode and a button to reset.

Power supplies are 5V USB chargers. I bought 25 of them from Amazon at 1 USD each when they were on sale. They are about 5 USD each now which is still a bit cheaper than they can go for.

I’m using computer power cables with IEC connectors. I cut the IEC connector and add a female mains connector. I using cable ties to keep the power cables from moving.

The way I wired the PZEM module allows me to measure its own consumption as well as the 5V power supply in addition to the load.

Here is the ESPHome code.

substitutions:
  device_description: "Fridge"

esphome:
  name: powermeter-10
  comment: '${device_description}'

esp8266:
  board: esp01_1m

# Enable logging
logger:
  baud_rate: 0

# Enable Home Assistant API
api:

ota:
  password: "*****"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Powermeter-10 Fallback Hotspot"
    password: "*****"

captive_portal:

uart:
  tx_pin: GPIO1
  rx_pin: GPIO3
  baud_rate: 9600

modbus:

sensor:
  - platform: pzemac
    current:
      name: "PM-${device_description} Current"
    voltage:
      name: "PM-${device_description} Voltage"
    power:
      name: "PM-${device_description} Power"
    energy:
      name: "PM-${device_description} Energy"
    frequency:
      name: "PM-${device_description} Frequency"
    power_factor:
      name: "PM-${device_description} Power Factor"
    update_interval: 2s   

Here are the pictures:

4 Likes