-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding support for PZEM004T energy monitor for 3 phase - request #2315
Comments
Hi, Is it possible to add 3 PZEM004T in one node? Rgds, |
I'm looking for the same thing. As long as I can tell, each PZEM004T can be directly addressed, so you can hookup as many PZEM004T as you can in the same UART, when you read, you send the "ip address" of each module. But the code in |
Hi, Thanks, |
I mean plugging all the 3 PZEM in the same hardware/soft serial, like this: The diode can be a BAT45, the pullup resistor can be a 10K to 5V. But you need to program the PZEM address before using this method, the address can be sequential, like 0.0.0.1,0.0.0.2,0.0.0.3, it is not really a IP address. But the tasmota must be changed to accommodate multiple meters, you can test using an arduino. |
Hi, Many thanks, but I have a question, may be stupid, Master UART means tasmota serial ? Yes ? And all of the slaves there are PZEMs Am I right ? Have you got it on your Arduino/ESP connected ? I will try it ofcource but first of all I am working for MQTT bridge through serial bridge of Tasmota - I have Nodes based on it: https://github.com/artekw/sensnodetx and receiver basenode which prints output to serial as JSON, I am working on www displaing all recaived data as normal sensors pluged to tasmota, next one task will be the hook of PZM004 ino. and also see that: https://github.com/apreb/eNode/issues/1#issuecomment-354369777 |
Yes, Tasmota master, PZEM slaves. Yes, connected to ESP. |
Hi, Could you share Your ino code for PEZM for further testing, I have 3 already :-) after 2 months shipment :-) ? |
Well, I don't have it actually, but here is some to start with: #include <PZEM004T.h>
PZEM004T pzem(10, 11);
IPAddress ip[3];
void setup() {
Serial.begin(9600);
ip[0] = IPAddress(0, 0, 0, 1);
ip[1] = IPAddress(0, 0, 0, 2);
ip[2] = IPAddress(0, 0, 0, 3);
}
void loop() {
for (uint8_t j ; j < 3 ; j++) {
Serial.print("ID: ");
Serial.print(j);
Serial.print(": ");
float v = pzem.voltage(ip[j]);
if (v < 0.0)
v = 0.0;
Serial.print(v);
Serial.print("V; ");
float i = pzem.current(ip[j]);
if (i >= 0.0) {
Serial.print(i);
Serial.print("A; ");
}
float p = pzem.power(ip[j]);
if (p >= 0.0) {
Serial.print(p);
Serial.print("W; ");
}
float e = pzem.energy(ip[j]);
if (e >= 0.0) {
Serial.print(e);
Serial.print("Wh; ");
}
Serial.println();
}
delay(1000);
} Remember to call |
Hi, Many thanks, but what do you mean 👍 I did not catch you, it means that I have to set the pzem.setAddress(ip[X]) step by step with plug only one PZEM for initial setup of IP ? And next plug all of them for finale mastering am I right ? |
Buddy, dont get me wrong, but you should do your homework... Each PZEM have an Address. You must set a unique address to each one, individually. That's what I meant with setAddress. Create another sketch to set the addresses. Then run the one I provided. |
Hi, " but you should do your homework" yes I will :-), thanks for explanation, I let you know about my results :-) |
Great, as soon as I get my sonoffs, I'll let you know my findings. |
Any updates ? but in this way we would never be able to poll 3 Phases Simultaneously to Make Graph/Trend 3 Phases. Each Consecutive reading will have 1 Second Interval so wont be able to correlate voltage on each phase to each other. |
I'm looking to do the readings in the same time slice. But I'll need to change the code. I'm on vacations now, next week I'll work on it. |
Here I'm again. I read the code and believe that create another xdrv for this is the best option to me. Change a code that is shared with other devices to add 2 more phases will require a lot of effort and will not benefit the others. I'm looking to create a I've only an hour at night to work on side projects, but will give it some attention. @arendst , do you believe that this is the right thing to do? What is your direction on this matter? Thanks! |
Hi, Where is xdrv_13_energy_3phases.ino ? |
There is no xdrv_13_energy_3phases.ino, I'm about to write it. |
aaaaaaa :-) |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Well, I changed to ESPurna, and in that firmware, it's simply not possible, it is too slow to read all magnitudes from all sensors. I'm working in a custom board with an Arduino Pro Mini that will read all PZEM(Max 6 devices) and will communicate using I2C, all measurements will be read in a single call. I'll let you know the progress. |
any new with this ? |
I'm finishing the custom board, the board will read up to 6 PZEM004T and will communicate using I2C/SPI. It constantly read the PZEM and buffer the responses, when asked the response is instantaneous. In my board I also added a ESP-01 module, so I don't need a Sonoff Basic or alike. But it is not finished yet... |
Probably I will use this repo: https://github.com/0x3333/powermeter But the code probably will change... |
https://github.com/apreb/eNode |
Yes, I saw that. In my case, the arduino pro mini(Not running arduino) is connected to a ESP-01(Running Espurna, but can work with any other firmware) using a spi connection. The arduino is only doing the hard work. |
Hi, Great, but will you add that to tasmota as a 3 phase module ? |
Sure, @arendst will need to approve a custom driver, but sure. |
There would be no option to buy a ready-made soldered plate? |
Is 1N60, 1N60P diode compatable? I have it working with them currently but was trying to compare the datasheet with a bat54ws and dont really know about diodes. I got some BAT54WS diode but they are smd type and cant really use them in my application. Would be good to know if 1N60, 1N60P diode can do the job. |
Any reason why reactive power is not the same on all. Right now in the testing phase and just using one phase connected to 3 devices and all load clamp on the same load. Edit: Edit2: Edit3: |
Split Total Energy is supported now. Docs: https://tasmota.github.io/docs/Commands/#setoption128
|
So128 is Http API |
After reading all the content from this topic i am confused. What wiring diagram did you use to make it work ? Did you add every pzem module like this ( ModuleAddress x) without changing pzem address with factory software ?
|
|
Sorry Theo but i was asking about the correct wiring diagram of the pzems to theESP 8266 and how to add them to Tasmota. |
@grappini so don't uselessly quote previous message There is a how-to in Github Discussion where everything is explained with diagrams and commands |
Sorry , i'm not so familiar with github interface , i'll not quote again long messages. I know how to connect 1 pzem with esp8266 but i can't find any diagram for connecting 2 or 3 pzems to one esp 8266. |
Thanks @blackscreener for trying to help me. |
So looking for a way to connect PZEM 17 that are RS485 in a topic dedicated to PZEM 004 that are RS232/TTL...... Doesn't sound good idea. |
I apologize for the confusion , i thought pzem 004 is also RS485. I'm using pzem 016 and 017 for my aplications. |
I have a device set up as described in this thread, running three PZEM 004 on 3 Phases and it has been working fine for over a year. |
|
thanks a lot, upgrading to the latest versio of tasmota and setting Option129 worked like a charm |
Trying to make 3-phase work using ESP32 C3. |
Did you configured each PZEM on its separated address one after the other, with onely 1 PZEM connected at a time to the ESP ? |
Yes, one PZEM connected, but after issuing the command, the serial interface silences. Normal serial communication (reading of the power values) resumes after 5-6 seconds. It is like something is blocking the sending of the command to PZEM. Using the standard RX, TX of the ESP32 C3 module. |
hey folks did anyone else got this problem? |
@phmll
Thanks |
Hello, Is that possible? |
You can have up to 8 phases on an ESP32 so that should be possible to extend the system to 4 but with using an additional RX pin, still use the same pin and have the PZEM on address 1, 2, 3 and 4 I can't tell for sure but that seems possible |
Can anyone succesfully setup 3 PZEMs with "wemos s2 mini" I tried everything (with diodes and 10k pullup, 3.3v with 1k resistor hack or 5v) but it is working only with one PZEM. |
Hi, I couldn't make even one working. |
D1 mini Tasmota V13 no pullup resistor, BAT85 diodes , 1K resistor on Pzem 5V. |
Hi,
Is it possible add USE_PZEM004T and add support for PZEM004T Energy monitor for 3 phase by using
USE_SERIAL_BRIDGE and report each phase through that functionality ? May be there is possibility to use 3 phase config for USE_PZEM004T as it is in that project:
https://github.com/apreb/eNode
The text was updated successfully, but these errors were encountered: