Problem PZEM-004T Version 3.0

Maybe say “thank you” by sharing the final code, wiring diagram etc etc so that others can benefit?



Hi Pete,

Yes, I will post the final code, wiring and instructions on another thread so other users can follows and don’t have to go through all kind off issue that I had :slight_smile:


Congratulations, it would be interesting if you would like to share the project with the related code and wiring. So you can do it. Thank you so much .

Anyone knows how to reset energy pzem 004t V.3.0???

if you are using Tasmota your answer is “HERE”

Физически НЕТ ! В v1. была кнопка , а в v3 только програмно.

Without the use of Tasmota and MQTT, but directly connected to Nodemcu, the whole thing is working properly like version V.1.0. Finally after so much sacrifice I succeeded.:smiling_face_with_three_hearts:

Could you share wire connect!
3v3 nodemcu --> 5V pzem?
Tx --> Rx
Rx–> Tx
Gnd --> gnd pzem


Thank you very much your quick reply. Thank you 1000 times

1 Like

Could you share the code!

Please share the code…

Please don’t keep spamming this thread with requests for the code,



Hi All,

Sorry for all the delay on posting the code as I was out of town for 2 months.

I have create a new topic on how to make the wiring connection and the source code for PZEM-004T with ESP8266 so it can display all the data on Blynk app.

Enjoy and have fun with Blynk app and PZEM


Check out the topic HERE:

One useful feature of the PZEM-004T V3 is that it will retain energy usage data even if you have a power failure. You could just let the KWH increase month by month up to the maximum of 9999 KWH but the assumption is that you will reset the value each time you receive an electric bill. How can i reset this pzem004t v3 ?

make a wiring connection for PZEM-004 v3.0 and ESP8266: (either NodeMCU and Wemos)
ESP8266 5V ==> PZEM 5V
ESP8266 G ==> PZEM GND
ESP8266 Rx ==> PZEM_Rx -> D6(GPIO12 - Tx)
ESP8266 Tx ==> PZEM_Tx -> D5(GPIO14 - Rx)

#include <SoftwareSerial.h>     
SoftwareSerial pzem(14,12);     // (RX,TX) connect to TX,RX of PZEM for ESP8266 bare board

void resetEnergy(uint8_t slaveAddr){
  //The command to reset the slave's energy is (total 4 bytes):
  //Slave address + 0x42 + CRC check high byte + CRC check low byte.
  uint16_t u16CRC = 0xFFFF;
  static uint8_t resetCommand = 0x42;
  u16CRC = crc16_update(u16CRC, slaveAddr);
  u16CRC = crc16_update(u16CRC, resetCommand);
  Serial.println("Resetting Energy");

@jaggil you appear to have posted the same thing twice, and in both cases you have omitted the triple backticks necessary for the code to display correctly.

Please edit your posts using the pencil icon at the bottom.
If one of the posts is not required then please delete it and add triple backticks at the beginning and end of your code.
Triple backticks look like this:

If there is a subtle difference between the two sets of code then please explain the difference between them, and when to use which one.


Hello blynk comm. i also have a problem with pzem 004t v3. i use tasmota on a nodemcu… i have fluctuating readings on my tasmota gui! by the way i have two hot wires on my wall … two 120v and no neutral. i got a reading for a few secs… then zero reading after 2 - 3 secs… i also think the power readings are wrong…

I think you might be in the wrong forum, the Tasmota community is here: