Closed michelebossa closed 5 years ago
I'm not sure I understand what is the problem exactly? Is your Wemos rebooting? If that is the case it is most likely a bad voltage regulator on the D1 mini. Connect PZEM to a separate power supply.
RX and TX have to be switched and your first example shows everything working. TX to TX is just sending to the D1's serial out pin and data won't show since D1 isn't receiving any. Check our wiki, there are three examples of a PZEM004 setup with various devices
The problem it is at moment i'm using the software serial but if i'm try to use the HW serial there is no data from PZEM (Voltage,Current.. display 0). How can i use the HW Serial? I have tried to swap RX/TX into configuration and the cable on PZEM in all possible combination without success. Thanks
Try without level shifter as described here https://github.com/arendst/Sonoff-Tasmota/wiki/PZEM004T,-Wemos-D1-Mini-and-a-1602-I2C-display
@michelebossa You can use 3.3V directly for PZEM004T, No need level shifter by adding 1KΩ as below picture. My energy monitor with PZEM004T is running fine with this type of modification.
This is from wiki:
Wiring Diagram:
Check images below for more information about the 1kOhm resistor needed to shift the voltage to 5V from 3V3 for the PZEM-004T serial connection. ALTERNATIVE: No modification required on the PZEM-004T. Rather than using the 3.3V output from the Wemos D1 Mini to power the PZEM-004T serial interface, use the same 5V buck converter output (also used to supply power to the display and the Wemos D1 Mini) as VDD on the PZEM-004T serial interface. This eliminates the need for the resistor and the need to modify the PZEM-004T in any way at all.
I have the same problem with the level converted. @michelebossa, did you solve your restart problems? I think the alternative feeding PZEM-004t directly with 5V is not good (wemos d1 mini has no 5v tolerance)
Adding other question, did you notice than using level coverter you get very high reactive power values? I did some probes with a tri-phase pzem-004t proyect and I think I get not good values.
Thanks
@ricargr Level converting has no way input to measured values this is impossible because values are transfered digital encoded via serial...
Thanks @Jason2866 Could be the problem I use GPIO D5 and D0 instead TX and RX?
Yes since hardware serial is only supported at Gpio 1 and 3
Closing this issue as it has been answered.
See Wiki for more information. See Chat for more user experience. See Community for forum. See Code of Conduct
@michelebossa
@michelebossa You can use 3.3V directly for PZEM004T, No need level shifter by adding 1KΩ as below picture. My energy monitor with PZEM004T is running fine with this type of modification.
This is from wiki:
Wiring Diagram:
Check images below for more information about the 1kOhm resistor needed to shift the voltage to 5V from 3V3 for the PZEM-004T serial connection. ALTERNATIVE: No modification required on the PZEM-004T. Rather than using the 3.3V output from the Wemos D1 Mini to power the PZEM-004T serial interface, use the same 5V buck converter output (also used to supply power to the display and the Wemos D1 Mini) as VDD on the PZEM-004T serial interface. This eliminates the need for the resistor and the need to modify the PZEM-004T in any way at all.
Hi @michelebossa,
I am a bit confused. I am making a similar project with a Wemos D1 Mini and Tasmota and the PZEM-004T, but not sure how to proceed with the serial connection. Some Internet sites say the ESP8266 is 5v tolerant on the I/O pins so they connect to 5v and tx/rx direct to the esp, others use level shifters. You mention a 1K resistor solution, assuming you provide the PZEM unit with 5v? Or als alternative use 3.3v directly to power the PZEM and no use of a resistor. Is this correct? i.e. does the PZEM TTL part run on 3.3v?
Thanks
Hi @martin072, I have used the 1K resistor solution and power the PZEM with 5v. Thanks
Thanks,
Do you know if it also works with 3.3v? that would be a bit easier for me (as I have a custom pcb with already a 3.3v, GND and I/O header present).
No :(
Works with 3.3V see https://github.com/arendst/Tasmota/issues/3626#issuecomment-670952578 The 1k resistor mod looks like this in new SMD power meters: https://github.com/arendst/Tasmota/issues/6050#issuecomment-510130142