0% found this document useful (0 votes)
61 views2 pages

Pzem-004T v3 0

The document details the specifications and communication protocols for the PZEM-004T AC communication module, which measures AC voltage, current, active power, frequency, power factor, and active energy without a display. It utilizes a TTL interface for data transmission and follows the Modbus-RTU protocol for communication, supporting various function codes for reading and writing data. Additionally, it outlines the measurement ranges, accuracy, and command formats for interacting with the module, including settings for power alarm thresholds and calibration procedures.

Uploaded by

lacos la
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
61 views2 pages

Pzem-004T v3 0

The document details the specifications and communication protocols for the PZEM-004T AC communication module, which measures AC voltage, current, active power, frequency, power factor, and active energy without a display. It utilizes a TTL interface for data transmission and follows the Modbus-RTU protocol for communication, supporting various function codes for reading and writing data. Additionally, it outlines the measurement ranges, accuracy, and command formats for interacting with the module, including settings for power alarm thresholds and calibration procedures.

Uploaded by

lacos la
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

AC connunication nodule

Oven'isv 1.8 Conmunication interfece

This document describes thc specification ofthe PZEM-O04TAC commmication module,


TTL interfrce"
the module is mainly used for measuring AC \oltage, current. rctive power, frequency, power
factor md active energy, the modulc is rvithout display function, the data is read through fte TTL 2 Comunication protocol
interfacc
2.l physicallayerprotocol
PZEM-004T-I0A: Measuring Rmge l0A (Built-in Shmt)
Physical layer use UART to TTL commmication interface
PZEM-004T-100A: Merowing Rmge l00A (extemal transfomer)
Bau<l rate is 9600. 8 data birs, l stop bit, no piliry
l'Function description
2.2 Applicrtionlayerprotocol
1.1 Voltagc

1. l. I Measuring range:80-260V The application la1'er use the Modbus-RTU protocol to communicate. At present, it only
supports function codes such as 0x03 (Read Holding Register). 0x04 (Read Input Register), 0x06
1.1.2 Resolution: O.lV (Write Single Register). 0x4l (Calibration). 0x42 (Reset energl,).etc.

0x41 function code is only for intemal use (adclress cm be onll' 0xF8). used for factorS'
l 1J Measurement accurac\': u )7o
oafibration md retum to factory maintenancc occaions. afler the function code to increroe l6-bit

1.2 Current prosrrord-thedefaultpms$ordis0x372l

Theaddressrmgeofthesla'eis0x0l-0xFT.Theaddress0x00isusedasthebroadcast
r.2.r Meauingrmge: 0_r0A(pzEM-004T_r0A);0_ro0A(pZEM_004T-'00A) address, the slar.e does not need to repll- the master The address 0xF8 is used as the general
address'thisaddresscmbeon!'usedinsingle-slaveenviromentmdcmbeusedforcalibration
r.2.2 Startingmeasurecurent: 0.01A(pzEM-004T-l0A);0.02A(PZEM-004T-100A)
etc, operation.

1.2.3 Resolution: 0.0014 2.3 Reed the measurenent re$lt

1.2.4 Measrcment accuracl': 0.5olo The commmd fomat of the mmter reads the meruurement result is(total of 8 bytes):

I .3 Active porver Slarc Address + 0x04 + Register Address High Byte + Register Address Lorv Byte + Number
of Registere High Blte + Nmber of Registers Low Byte + CRC Chmk High B1'te + CRC Chrck
1.3.1 Measuring rmge: 0-2.3k!V(PZEM-004T-I0A) : 0-23kW(PZEM-004T-100A) Lorv B1'te'

The commmd fomat of the reply from the slale is divided into hvo kinds:
1.3.2 starting measure porver: 0.4w
Conect Reply: Slare Address + 0x04 + Nmber of Bytes + Register I Data High Byte +
1.3.3 Resolution: o.llV Register I Data Lory Byte + ... + CRC Check High Byte + CRC Chck Lorv Byte

Enor Reply: Slave address + 0x84 +Abnomal code + cRC chok high byle + CRc check
1.3.4 Display fomat:
lorv byte

< 1000W, it display one decimal, such as: 999.9W Abnomal code ma\zed as follorving (the sme belorv)

;> 1000W, it display only inleger, such as: 1000W o 0xol,Illegal function
o 0x02,Illegal address
1.3.5 Mesuement accurrcy:O.SVo o 0x03.lllegal data
o 0x04,Slave enor

1.4 porver factor The register of the measrcment results is maged as the follorving table

Regi st et
1.4.1 Mcasuring range: 0.00-1.00 Descript ion Resolution
address

1.4.2 Resolution: 0.01


0x0000 Voltage value 1LSB correspond to 0.lV
0x0001 Cnrrent valne low 16 bits lt.SB corrcspond to
1.4.3 Measurement accuracv: lYo 0x0002 Current value hish 16 bits 0. 0014
0x0003 Power value low 16 bits
1LSB correspond to 0. llY
1.5 Frequencp' 0x0004 Pol'er value high 16 b ts
0x0005 Energr- value lor' 16 b ts
1.5.1 Measuring range: 45Hz-65H2 1LSB cor"respond to lWh
0x0006 Energv value high 16 rts
0x0007 Frequency value 1LSB correspond to 0. LHz
1.5.2 Resolution: 0.lHz
0x0008 Power fa.ctor valtte 1l-SB corresponcl to 0. 01
OxF'FIìF is alarn,
1.5.3 Measurement accuracr': 0.5olo 0x0009 Alarm status
0x0000is not alarm
1.6 Active energv For exmplc. the master sends the follorving commmd (CRC check code is replaced by
0xHH md 0rLL' the sme belorr)
1.6.1 Measuring rmgc: 0-9999.99kwh
0x0l + 0x04 + 0x00 + 0x00 + 0x00 + 0x0A+ 0xHH + OxLL
r'6 2 Resolution: lwh Indicates that the master needs to read l0 registen with slave a<tdress 0x0l ild the start
adtlress of the register is 0x0000
1.6.3 Meuwment accurac)': 0.5oó
The conect reply from the slare is u follorving:
l'6'4 Displayfomat:
0x0r +0x04+0x14 +0x08 +ox98 +0x03 +0xEE+0x00+0x00 +0x08 +0x9E+0x00+
<l0kWh,thedisplayunitiswh(lkwh=l000Wh). suchas:9999Wh 0x00+0x00 +0x00+0x00+0x00+0x01 +0xF4+0x00+0x64+ox00+0x00+OxHH+0xLL

The abole data shorvs


) l0kWh, the display unit is kWh, such as: 9999.99k1Vh
o Voltagc is 0x0898- converted to decinal is 2200, display 220.0V
1.6.5 Reset energy: use sofhvtre to reset. a Cunent is 0x000003E8- conerted to decinal is 1000, display 1.0004
a Power is 0x00000898, converted to decimal is 2200, display 220.0W
1.7 Over pow€r alam o Energy is 0x00000000, converted to deoinal is 0, display OWh
o Frequency is 0x0lF4. converted to decimal is 500, display 50.0H2
Active porver threshold oan be set- rvhen the measred actir t porver exceeds the threshold, it I poner factor is 0x0064. converted to decimal is 100. display 1.00
cm alm a Almn status is 0\0000- indicates that the crent powèr is lorver ihm the alm pol,er
thrcshold
2.4 Rcad and modify the slave parameters

At present.it only supports reading and modifying slave address and porver alarm threshold

The rcgister is arranged as the follorving table AC POWER

Regi stet
SUPPLY
t-;
l-'oi
Descript ion Resolut i on t8 di
adclt'ess
0x0001 Power alarm threshold 1LSB correspond to ll{ MTASUREMENT '1[ si"
SYSTEM lo sl
0x0002 Modbus-RTU address The ranse is 0x0001-0x00F7 lz;i
v Ljj
Thc command format of the master to read the slave parameters and read the measurement
results are same(descrybed in details in Section 2.3), only need to change the function code from i slcruRl I

0x04 to 0x03.

The command format of the master to modify the slat'e parameters is (total of 8 bytes):
Picture 3.2 PZEM-004T-100A Functional block diagram
Slave Address + 0x06 * RegisterAddress High Byte + RegisterAddress Lorv Byte * Register
Value High B;-te + Register Value Lorv Byte + CRC Check High B1'te * CRC Check Lorv B1'te. Wiring diagran
The command format of the reply from the slave is divided into hvo kinds: PZEM-004T-1 0A wiring diagram
load
Correct Response: Slave Address + 0x06 * Number of Bytes + Register Address Lorv Byte *
Register Value High Byte + Register Value Lorv Byte + CRC Check High Byte + CRC Check Lorv
B1,te.

lon'bvte.
Error Repll': Slave address + 0x86 +Abnormal code + CRC check high byte + CRC check

For example. the master sets the slave's power alarm threshold:
ry--ì&
rrLtoÎrr.,o,"T
0x0l + 0x06 + 0x00 + 0x0l + 0x08 + OxFC + 0xHH + 0xLL
îî
Indicates that the master needs to set the 0x0001 register (porver alarm threshold) to 0x08FC
LN U: ACSA-260V
(2300w). l: 0-10A
Picture 4.1 PZEM-004T-l 0A rviring diagram
Set up correctly. the slave return to the data rvhich is sent from the master.

For example, the master sets the address of the slave PZEM -004T- 1 00A wiring diagram
load
0x0l + 0x06 + 0x00 + 0x02 + 0x00 + 0x05 + OXHH + 0xLL

Indicates that the master needs to set the 0x0002 register (Modbus-MU address) to 0x0005

2.5
Set up correctll,. the slave return to the data rvhich is sent from the master.

Reset energy

The command format of the master to reset the slave's energl' is (total 4 b1'tes):
fu*L
îT
Slave address + 0x42 + CRC check high b1'te + CRC check lorv b1'te.

Correct reply: slave address + 0x42 + CRC check high b1'te + CRC check lorv byte.
U: AC80-260V
Error Repll': Slave address + 0xC2 * Abnormal code + CRC check high byte + CRC check l:0-100A
lorv byte Picture 4.2 PZEM-O04T-100Arviring diagralr

2.6 Calibration

The command format of the mastcr to calibrate the slave is (total 6 bytes):
5 Other instructions

5.lThe TTL interface of this module is a passive interface, it requires external 5V porver supply, w
0xF8 + 0x41 + 0x37 + 0x2l + CRC check high b1,te + CRC check lorv byte.
hich means. when communicating. all four ports must be connected (5V RX, TX. GND), otherwis
Correct reply: 0xF8 + 0x41 + 0x37 + 0x2l + CRC check high b1,te + CRC check lorv byte. e it cannot communicate.

Error Repll': 0sF8 + OxCl +Abnormal code + CRC check high b1'te + CRC check lorv byte. 5. 2 lforking temperature

It should be noted that the calibration takes 3 to 4 seconds. after the master sends the
-20.C _ +60'C.
command- if the calibration is successful. it rvill talie 3 - 4 seconds to receive the response from
the slave.

2.7 CRC check

CRC check use l6bits format, occupy two bytes, the generator polynomial is Xl6 + Xl5 +
X2 +1. the polynomial value used for calculation is 0x4001.
The value of the CRC check is a frame data divide all results of checking all the b1'tes except
the CRC check value.

3 Functional block diagran

MEASUREMENT
SYSTEM

Picture 3.1 PZEM-004T-l0A Functional block diagram

You might also like