esphome / issues

Issue Tracker for ESPHome
https://esphome.io/
294 stars 38 forks source link

PZEM 004T V1.0 wiring problem #862

Closed MariusLaurinaitis closed 5 years ago

MariusLaurinaitis commented 5 years ago

Operating environment/Installation (Hass.io/Docker/pip/etc.): Hass.io

ESP (ESP32/ESP8266, Board/Sonoff): ESP8266

Affected component:

Description of problem: Do I need a PZEM soldering resistor (Pzem 004t V1.0)? And what do you use ESP8266 or ESP32? I try everything with the Wemos d1 mini, nothing can be seen. Maybe you can show me the wiring diagram. Are you using the resistor soldered to PZEM?

Problem-relevant YAML-configuration entries:

PASTE YAML FILE HERE
uart:
  tx_pin: D1
  rx_pin: D2
  baud_rate: 9600
  stop_bits: 2

sensor:
  - platform: pzem004t
    current:
      name: "PZEM-004T Current"
    voltage:
      name: "PZEM-004T Voltage"
    power:
      name: "PZEM-004T Power"
    update_interval: 60s

Logs (if applicable):

PASTE DEBUG LOG HERE

Additional information and things you've tried:

sendorm commented 5 years ago

Can you try with stop_bits: 1? Can you also try to change to:

logger:
  baud_rate: 0
uart:
  - tx_pin: GPIO1
    rx_pin: GPIO3
    baud_rate: 9600
    stop_bits: 1

While connecting to the TX and RX pins.

MariusLaurinaitis commented 5 years ago

And what about 5 or 3 V? Do I need resistor?

sendorm commented 5 years ago

You should use 5V's for the PZEM's. You can use the VU pin on your 8266. I am using the PZEM's without a 1K resistor. And they work. For safety, try with a resistor first. If it works, fine. If not try without the resistor.

MariusLaurinaitis commented 5 years ago

Thanks, I will try.

MariusLaurinaitis commented 5 years ago

Thank, after ESPhome update to 14.3 it's started to work. Wemos D1 mini, no resistor.


uart:
  id: uartpz
  tx_pin: D6
  rx_pin: D5
  baud_rate: 9600
  stop_bits: 1

sensor:
  - platform: pzem004t
    uart_id: uartpz
    current:
      name: "PZEM-004T-1 Current"
    voltage:
      name: "PZEM-004T-1 Voltage"
    power:
      name: "PZEM-004T-1 Power"
    update_interval: 5s