UPDATE. I just tried now the code from the example of PZEM library, which uses the hardware serial and connected the pins to RX and TX pin of arduino, and now I can see the voltage !!! Really really happy I can see something now But I need to make it work with software serial too, as on the ESP8266 (Wemos D1 mini) that is what I need, or it should work using this line on ESP too ?
I started with a Mega2560p. Any DMX library I install (DMXSerial, DMXSerial2, DMXSimple) conflicts with the serial ports of the Mega. Therefore rendering any other serial comms impossible due to vector conflicts.
If you use the DMXSerial.h when trying an Arduino (Mega in my case) it will not allow you to also use the PZEM004Tv30.h library. It suffers several vector clashes. The DMXSerial.h does not allow you to use any serial port, not even for debugging.
Never found a solution to that problem.
SO.. I know the TeensyDMX.h library will allow you to use serial ports. I have done that before on another project.
But, when you again declare the PZEM004Tv30.h library you then get a 'conflicting declaration 'HardwareSerial Serial' error.
I can apparently change the address of these voltage monitors using pzem.setAddress(addr);
There was going to be more than one on software serial addresses, but I can daisy chain them on the same serial port.
PZEM-004T V3 module has passive serial communication to connect Arduino Uno. Its RX and TX pin needs an external power supply. Connect the 5V pin to Arduino 5V pin, Rx pin to D11 of Arduino and Tx pin to D12 pin of Arduino, GND to GND. In the below diagram, PZEM004T V3 is connected to Arduino using Software serial. Use the following Program to test the module. Before compile download and install the PZEM-004T V3 library.
This pzem004t Arduino code enable you to measure AC voltage, AC current, Power, Energy, Frequency and Power Factor on serial interface with arduino microcontroller. The library of PZEM-004t V30 works on hardware serial as well as software serial. The result of all parameters are printed on serial monitor of Arduino IDE. I tested this library code with arduino uno, arduino mega,and nano board.
PZEM-004T V3 module serial communication to connect NodeMCU or Wemos. (Connection is same for ESP8266 NodeMCU) Its RX and TX communication pin needs external 5V power. Connect the 5V pin of Wemos D1 mini to PZEM004T 5V pin, Rx pin to D6 of arduino and Tx pin to D5 pin of Wemos, gnd to gnd. In the below diagram, we connect PZEM004T V3 to Wemos D1 Mini using Software serial. Use the program to test the module. Before compile, download and install the library.
This pzem-004t NodeMCU ( ESP8266 based development board ) code allows you to measure voltage, current, Kw, kwh, Frequency and PF display data on the Blynk app. The purpose of this code is to learn to connect PZEM-004T v3.0 to NodeMCU or Wemos Mini D1.
I have tried to use: pzem.setPowerAlarm(220); to set the alarm wattage to 220watts.
Then I tried: uint16_t AlarmValue = pzem.getPowerAlarm(); to try to confirm the actual alarm wattage that was programmed
by the first function.
Hello sir,
I want to communicate pzem004t v3.0 to raspberry pi 3 model B (with HDMI led display)
1) will it communicate ?
2) if it communicate, I want to take 3 Board of pzem004t v3.0 for 3phase connection, so how to connect and how to communicate ?
3) can u please help me out for the code required for (if)communicate to raspberry pi 3 model B ?
What platform are you intending to use this library with?
The PZEMHardSerial example uses Serial3 which is not available on most Particle devices but you can use Serial1 (tied to RX/TX pins on all Particle boards) in place of it.
As also my previous post regarding framework and libraries versions, I needed to block the ESP8266 framework version and the SoftwareSerial library because the combination of these with the PZE-004T library was (is ?) broken of more recent versions. As is currently defined on the platformio.ini file, the current set of versions, work fine.
A lot of people had problems working with the use of SoftwareSerial library for the PZEM library to communicate with the hardware. The issue, that I accidentally found out, are related with timing issues to communicate with the PZEM hardware. There are periods of time that the PZEM is not responsive, probably because is making some measurement.
I need help with using pzem 004t in stm32f405 with uart communication. i have check this source willyvamp/STM32F103C8T6-PZEM004T-DHT11: HAL STM32 (github.com) but still dont get the data form uart. please help
Repeat the Internet search. Look at the first few entries and see if one of those looks as if it might be helpful. Is the code in C or come other language? Is there a library that does the clever stuff - if there is, get it, look at it and see how it works, then use that knowledge to write your code.
760c119bf3