How to connect pzem 017 DC with nodemcu

I have a question. Can I also measure negative current with PZEM-017? I would like to measure the charging and discharging of a battery in a solar system with it.

Hello, it’s not like INA22x, it measure current/power only one way. Thus is useful to measure energy from PV panels, for example.

Just read the manual :wink: https://thesunpays.com/downloads/files/Battery%20SOC%20meters/PZEM-003%20017User%20Manual(MEDC300V).pdf

I’m using this power monitor with modbus integration, because haven’t found a way how to use this integration with RS485 adapter without automatic flow control, like standalone MAX485. It requires flow_control_pin. Any suggestions?

EDIT:

I’ve got it…

# ESP32     MAX485  PZEM-017
#
# GPIO10    DI
# GPIO20    RI
# GPIO21    DE+RE
# GND       GND     GND
# 3V3       VCC
# 5V                5V
#           A       A
#           B       B

uart:
  baud_rate: 9600
  data_bits: 8
  stop_bits: 2
  parity: NONE
  tx_pin: GPIO10
  rx_pin: GPIO20

modbus:
  flow_control_pin: GPIO21

modbus_controller:
  address: 30