Skip to content

Instantly share code, notes, and snippets.

@bandaangosta
bandaangosta / pzem_004t.py
Last active November 7, 2023 18:47
Reading PZEM-004t power sensor (new version v3.0) through Modbus-RTU protocol over TTL UART
# Reading PZEM-004t power sensor (new version v3.0) through Modbus-RTU protocol over TTL UART
# Run as:
# python3 pzem_004t.py
# To install dependencies:
# pip install modbus-tk
# pip install pyserial
import serial
import modbus_tk.defines as cst