M5Core problem with UART0
-
I use PZEM V4.0 for my project, so I want to use it for 2 and I connect to TXRXD0,TXRXD2 and this is my code.
#include <PZEM004Tv30.h> PZEM004Tv30 pzem(&Serial); PZEM004Tv30 pzem2(&Serial2); void setup() { Serial.begin(115200); Serial.print("Reset Energy"); pzem.resetEnergy(); pzem2.resetEnergy(); Serial.print("Set address to 0x42"); pzem.setAddress(0x42); pzem2.setAddress(0x42); } void loop() { float cur = pzem.current(); Serial.print("Current: "); Serial.print(cur); Serial.println("A"); float cur2 = pzem2.current(); Serial.print("Current 2: "); Serial.print(cur2); Serial.println("A"); delay(1000); }
The result is not showing the value of UART0 (pin GPIO1,3).
How can I fix this? -
Level converter is required for connection.
-
resistor to connect
Meter PZEM-004T with Arduino ESP32 ESP8266 Python & Raspberry Pi
Modification TTL UART from 5v to 3.3v
http://pdacontrolen.com/meter-pzem-004t-with-arduino-esp32-esp8266-python-raspberry-pi/ -
level converter to connect
Measuring home energy consumption with the PZEM004T and ESP8266
https://primalcortex.wordpress.com/tag/pzem004t/
-
-
@nikza5566 said in M5Core problem with UART0:
PZEM V4.0
Also, Im not sure about your wiring, but you're using software serials, you should keep speed at 9600. My multiple experiments with rs485 and software serial show unstable results on speed beyond 9600
-
@thrasher Sorry for my bad writing.
So I want to use 2 piece of PZEM for my project and I test PZEM that connect to UART2 it can send value to monitor with speed 115200 and then I test to PZEM that connect to UART0 it not show any value excpet "NaN" from my monitor. how can I fix this?