The PZEM-017 is a multifunctional energy meter manufactured by Pacefair (Part ID: 017). It is designed to measure key electrical parameters in AC circuits, including voltage, current, power, energy, and frequency. The device features a digital display for real-time monitoring and supports UART communication for seamless integration with microcontrollers and other systems.
The following table outlines the key technical details of the PZEM-017:
Parameter | Specification |
---|---|
Voltage Range | 80V - 260V AC |
Current Range | 0A - 100A (requires external CT) |
Power Range | 0W - 22kW |
Energy Range | 0kWh - 9999kWh |
Frequency Range | 45Hz - 65Hz |
Communication Interface | UART (9600 baud rate, 8N1 format) |
Power Supply | 5V DC (external power required) |
Accuracy | ±0.5% (under standard conditions) |
Operating Temperature | -10°C to 60°C |
Dimensions | 79mm x 43mm x 25mm |
The PZEM-017 has a 4-pin interface for power and communication. The pinout is as follows:
Pin | Name | Description |
---|---|---|
1 | VCC | 5V DC power supply input |
2 | GND | Ground connection |
3 | TXD | UART Transmit (connect to RX of microcontroller) |
4 | RXD | UART Receive (connect to TX of microcontroller) |
Below is an example Arduino sketch to interface the PZEM-017 with an Arduino UNO:
#include <SoftwareSerial.h>
// Define RX and TX pins for SoftwareSerial
SoftwareSerial pzemSerial(10, 11); // RX = Pin 10, TX = Pin 11
void setup() {
Serial.begin(9600); // Initialize Serial Monitor
pzemSerial.begin(9600); // Initialize UART communication with PZEM-017
Serial.println("PZEM-017 Energy Meter Example");
}
void loop() {
// Send a command to request data from the PZEM-017
byte request[] = {0x01, 0x04, 0x00, 0x00, 0x00, 0x0A, 0x70, 0x0D};
pzemSerial.write(request, sizeof(request));
delay(100); // Wait for the response
// Read the response from the PZEM-017
byte response[25];
int index = 0;
while (pzemSerial.available() > 0) {
response[index++] = pzemSerial.read();
if (index >= 25) break; // Prevent buffer overflow
}
// Check if a valid response is received
if (index > 0) {
Serial.print("Received Data: ");
for (int i = 0; i < index; i++) {
Serial.print(response[i], HEX);
Serial.print(" ");
}
Serial.println();
} else {
Serial.println("No response from PZEM-017");
}
delay(1000); // Wait 1 second before the next request
}
SoftwareSerial
library to communicate with the PZEM-017. Ensure the RX and TX pins are correctly connected.request
array is a Modbus RTU query to read data from the PZEM-017. Modify this command as needed for specific data requests.No Data Received
Incorrect Readings
Device Not Powering On
Intermittent Communication
Q: Can the PZEM-017 measure DC circuits?
A: No, the PZEM-017 is designed specifically for AC circuits and cannot measure DC parameters.
Q: What is the maximum current the PZEM-017 can measure?
A: The PZEM-017 can measure up to 100A using an external current transformer (CT).
Q: Can I use the PZEM-017 with a Raspberry Pi?
A: Yes, the PZEM-017 can be interfaced with a Raspberry Pi using its UART interface. Ensure proper voltage level shifting if required.
Q: How do I reset the energy reading to zero?
A: The energy reading can be reset by sending a specific Modbus RTU command to the PZEM-017. Refer to the manufacturer's protocol documentation for details.