Skip to content

Firmware to control pzem004t modules and send via LAN module (w5100/w5200/w5500) to and mqtt broker. Can display values on an ssd1306 display.

License

Notifications You must be signed in to change notification settings

technyon/pzemctl

Repository files navigation

pzem energy monitor firmware

About

This is the source code for a three phase energy monitor based upon three pzem-004t modules. It reads energy values from those modules and sends them over LAN to an mqtt server. Optionally, values can be displayed on an SSD1306 display. The included 3D printable space houses all required hardware.

A word of caution

The pzem-004t modules used need to be connected to mains power. Mains power is dangerous and there's danger to receive a potentially lethal electric shock. Furthermore, fire can be the result of incorrectly connecting the modules. Only connect the pzem-004t if you know what you are doing! If not, ask someone who does.

Also, please read the paragraph about liability in the provided LICENSE file.

Hardware

Required

Optional

Compilation

Prerequisites

Running cmake

In the pzemctl directory, create a cmake build directory in change into it.

  • cmake -D CMAKE_TOOLCHAIN_FILE=/path/to/Arduino-CMake-Toolchain/Arduino-toolchain.cmake ..
  • Run make

cmake should now be setup. Run make to compile.

Wiring

  • Connect pzem-004t modules to Mega uart ports 1-3 (Mega pins 14-19)
  • connect W5500 LAN module to SPI PINS (Mega pins 50-53)
  • connect W5500 CS pin to Mega Pin 53
  • connect W5500 Reset pin to Mega Pin 49
  • connect display to Mega I2C pins (optional; Mega pins 20 and 21)
  • Connect LEDs to Mega pins 5-8 (optional; PIN 7 is for network status)
  • Connect Buttons to GND and Mega pins 44-48 (optional)

Enclosure

The enclosure is seperated into two levels. The bottom levels holds the pzem-004t modules. Use M3 ~4mm screws. The upper layer has room for the Arduino mega and the W5500 module. Again, uses M3 screws. Optionally, 3 LEDs can be mounted here. They point inside the case, I used white PETG so they can shine through. The lid allows to mount the display (use M2 screws and nut) and the buttons.

About

Firmware to control pzem004t modules and send via LAN module (w5100/w5200/w5500) to and mqtt broker. Can display values on an ssd1306 display.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published