Reading PZEM-004T current sensor | LabJack
 

Reading PZEM-004T current sensor

2 posts / 0 new
Last post
Zyjas
Zy Jas's picture
Reading PZEM-004T current sensor

Good afternoon,

Maybe someone has used LJ T7 for reading the PZEM-004T sensor (https://github.com/mandulaj/PZEM-004T-v30)? The documentation of the sensor tells, it uses Modbus-RTU protocol in the application layer. The physical layer uses UART so I suppose I can physically connect it to RX TX in FIO0 FIO1 inputs. 

If someone has an example or any tip of how to interact with such a sensor I would highly appreciate it.

Side note, I use Python to interact with the T7 board.

LabJack Support
labjack support's picture
Unfortunately, you will not

Unfortunately, you will not be able to use Modbus RTU. For UART, it looks like that will work as long as the sensor IO is electrically compatible. If you have a datasheet for the sensor, it should describe the logic levels and UART commands. The T7 uses TTL level logic. You would use the Asynch feature as described in the following documentation:

https://labjack.com/support/datasheets/t-series/digital-io/asynchronous-...

It looks like you could probably work out the basics of the sensor operation through the source you previously linked. For example, it looks like the main update command and return interpretation is described here:

https://github.com/mandulaj/PZEM-004T-v30/blob/master/src/PZEM004Tv30.cp...