Skip to the content
PCBKitNew board
4 layers68.6 × 27.9 mmUART RS485 interface board, the printed circuit board in 3D

UART RS485 interface board

Jonny999999/powerMonitor-esp32

Firmware and hardware for measuring voltage, current, and power using PZEM-004T modules with ESP32, and publishing the data via MQTT.

Size
68.6 × 27.9 mm
Copper layers
4
Thickness
1.6 mm
Parts
18
Nets
7
Pads
37
Tracks, vias
48, 6
Routed
Yes
KiCad
KiCad 9.0 (file 20241229)
Created
25 May 2025
Updated
21 Jun 2026

Overview

UART RS485 interface board is an open-source printed circuit board by Jonny999999, from the Jonny999999/powerMonitor-esp32 repository on GitHub. It is a 4-layer board of 68.6 × 27.9 mm with 18 parts on 7 nets, routed with 48 tracks and 6 vias.

It is built around the MAX3485ED. Its parts include 4 resistors, 4 connectors, 2 capacitors and 1 IC. It belongs with the interfaces and adapters and home automation and IoT boards and the ESP32 boards of this library.

Main components

1

README

README.md

ESP32 PV Power Monitoring System

This project documents a system for monitoring photovoltaic (PV) power production and household power consumption using ESP32 and PZEM-004T / PZEM-016 power sensors, with data published over MQTT.

Included in this repo:

  • Firmware for several ESP32 individually configured breakout boards, built with ESP-IDF 5.3
  • Python utility for configuring PZEM modules over USB serial
  • Hardware project for a custom UART ↔ RS485 interface board (KiCad) for a simple stripboard

Dashboard Demo

The following screenshots show the resulting dashboard created using Node-RED where the sensor data is received via MQTT and stored in a database. The charts visualize all sensor values across multiple inverters and locations.

Live Chart View (Total sum, Active power, Current)

Dashboard Part 1


Live Chart View (Power factor, Voltage, Frequency)

Dashboard Part 2


Hardware Setup

Below are a few example photos of the current wiring and hardware setup.

3x PZEM-003T measuring total consumption (main distribution board)

3x PZEM
Used for measuring total consumption of the entire building. One module for each phase (L1, L2, L3).


Single PZEM-004T (inverter distribution box)

Single PZEM
Each module is wired to one phase of a single inverter output.


2× PZEM-016 via RS485 (distribution box Remote inverters)

2x PZEM-016
PZEM-016 modules connected via a shared RS485 bus and assigned separate Modbus addresses.
On the other side of a ~30 m 5×1.5 mm² power cable, an ESP32 with a custom RS485-to-UART PCB receives the data and publishes it via MQTT.


UART ↔ RS485 Interface (Custom PCB)

To interface the ESP32 with RS485-based PZEM-016 sensors, a small PCB based on the MAX3485 transceiver was created.

Photo while testing

Interface PCB


Firmware (ESP32)

Firmware for reading multiple PZEM modules and publishing the values via MQTT.
Tested with ESP-IDF 5.3.

Features

  • Supports PZEM-004T v3 (TTL UART) and PZEM-016 (RS485)
  • Configurable (per module):
    • Sensor address
    • GPIO pins (TX, RX, RTS)
    • MQTT topic prefix
    • Publish interval
    • Sensor type (TTL / RS485)
  • Reads and publishes:
    • Voltage
    • Current
    • Power
    • Energy
    • Frequency
    • Power factor

Build and Flash

Make sure ESP-IDF 5.3 is sourced:

bash
. /opt/esp-idf-v5.3/v5.3/esp-idf/export.sh
cd esp32_power-monitor
idf.py build flash monitor

Python Utility (power-meter.py)

Utility script for directly configuring and reading PZEM modules using a USB-to-Serial adapter.

Functions

  • Set or change Modbus address
  • Reset energy counter
  • Read live values

Requirements

bash
pip install pyserial

Usage

  1. Connect RX/TX of the FTDI adapter to the TX/RX of the PZEM module.
  2. Plug the adapter into your PC.
  3. Edit pzem_tool.py:
    • Set the correct serial port and slave ID
    • Uncomment the function you want to run (read, configure, reset)

Then run the script:

bash
python3 pzem_tool.py

Repository Structure

text
firmware/    # Several ESP-IDF projects for all instances running
hardware/UART-RS485_interface-board/   # KiCad project for interface PCB
doc/images/                            # photos and documentation

Notes

  • PZEM modules must be addressed and wired correctly (especially for RS485).
  • Each PZEM sensor input should be fused and installed safely. Here i used a 200 mA 5x20 mm fuse for each module in the gray WAGO fuse holders for DIN rail.
  • Wi-Fi credentials are configured via main/credentials.h which is not tracked in the repo.

Parts

18
QtyValueFootprintReferences
2GND, 3v3terminals_libJonny:ScrewTerminal_P5mm_2Pin_FP10x8J2, J3
1100nCapacitor_THT:C_Disc_D7.5mm_W5.0mm_P7.50mmC1
110kResistor_THT:R_Axial_DIN0309_L9.0mm_D3.2mm_P15.24mm_HorizontalR17
110ufCapacitor_THT:CP_Radial_D8.0mm_P5.00mmC2
1120Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P2.54mm_VerticalR36
13k3Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR37
13k3Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P5.08mm_VerticalR35
13v3Connector_PinHeader_2.54mm:PinHeader_1x01_P2.54mm_VerticalTP6
1DIRConnector_PinHeader_2.54mm:PinHeader_1x01_P2.54mm_VerticalTP4
1MAX3485Package_DIP:DIP-8_W7.62mm_LongPadsU2
1RS-AConnector_PinHeader_2.54mm:PinHeader_1x01_P2.54mm_VerticalTP3
1RS-BConnector_PinHeader_2.54mm:PinHeader_1x01_P2.54mm_VerticalTP5
1RXConnector_PinHeader_2.54mm:PinHeader_1x01_P2.54mm_VerticalTP2
1TXConnector_PinHeader_2.54mm:PinHeader_1x01_P2.54mm_VerticalTP1
1[GND, A, B] RS485 (Sensor)terminals_libJonny:ScrewTerminal_P5mm_3Pin_FP15x8J8
1[TX, DIR, RX] UART (ESP32)terminals_libJonny:ScrewTerminal_P5mm_3Pin_FP15x8J1
1gndConnector_PinHeader_2.54mm:PinHeader_1x01_P2.54mm_VerticalTP7

Questions

How big is the UART RS485 interface board PCB?

It measures 68.6 × 27.9 mm and has 4 copper layers, 1.6 mm thick.

What parts does the UART RS485 interface board use?

18 parts, built around the MAX3485ED. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the UART RS485 interface board KiCad files?

From the Jonny999999/powerMonitor-esp32 repository on GitHub, at the commit this page was made from: the board is hardware/UART-RS485_interface-board/UART-RS485_interface-board.kicad_pcb and its schematic hardware/UART-RS485_interface-board/UART-RS485_interface-board.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the UART RS485 interface board design in my own project?

Its repository states no licence, so its author keeps all rights: ask Jonny999999 before reusing the design.

Similar boards

  • 2 layers100 × 100 mmExplorer, the printed circuit board in 3D

    Explorer

    anyshake/explorer

    🌏 Detecting seismic wave using 3 geophones and 3-axis accelerometer, pack & send data to AnyShake Observer over RS232 / RS485 serial.

    266 parts100
  • 2 layers120 × 80 mmRx72t 100 pga usb, the printed circuit board in 3D

    Rx72t 100 pga usb

    hirakuni45/RX

    Renesas RX Microcontroller, C++ framework, Library, Sample

    113 parts86BSD-3-Clause
  • 4 layers106 × 63.5 mmBrineomatic, the printed circuit board in 3D

    Brineomatic

    hoeken/brineomatic

    Open Source Watermaker Controller.

    323 parts47LGPL-2.1
  • 4 layers100 × 75 mmOpenAirScope, the printed circuit board in 3D

    OpenAirScope

    emertcakir/OpenAirScope

    Open-source air quality and environmental monitoring node with STM32H743 + ESP32-C3, LoRaWAN, RS485, USB-C, Li-ion charging, and multi-sensor support.

    282 parts26MIT
  • 4 layers80 × 60 mm01 main, the printed circuit board in 3D

    01 main

    wgbowley/OpenLSM

    Low-Cost Linear Synchronous Permanent-Magnet Motor

    99 parts11MIT
  • 2 layers92 × 51 mmRs485-spy injector, the printed circuit board in 3D

    Rs485-spy injector

    rmingon/rs485-spy-injector

    RS485 Spy is an open-source hardware tool for real-time monitoring, logging, and testing of RS-485 networks

    44 parts7CERN-OHL-S-2.0
  • 2 layers50 × 20 mmM5stack board dynamixel ttl rs3485, the printed circuit board in 3D

    M5stack board dynamixel ttl rs3485

    kim-xps12/m5stack_board_dynamixel_ttl_rs3485

    When using this repository in your own environment, please import HY2.0-4P.kicadmod into the appropriate library. I import it into the global library so that it can be used from other projects as well.

    20 parts6MIT
  • 2 layers50.8 × 22.9 mmFeatherWing 485, the printed circuit board in 3D

    FeatherWing 485

    W8LID/RS-485-FW

    An RS-485 FeatherWing for the Adafruit Feather system.

    22 parts5