There are specialized chips for this. An easy one is this:It is a Power monitor, measure and control ouputs. It's a box with 4 sockets think of an extension cable.
https://www.cirrus.com/products/cs5490/
https://www.digikey.com/en/products/det ... SZ/2797394
This chip measures voltage, current, power etc etc. You can read the values via a simple UART interface. The IC will have mains voltage attached, so you will need galvanic isolation for power supply and data. It's assumed that you need solid knowdege about layout rules, minimal creepage and air distances, trace width, voltage ratings etc etc. otherwise it's going to be dangerous. If you want to go this route I've got a working design available.
If you don't have solid knowledge about this, you really should use complete units:
https://www.eastrongroup.com/product/si ... meter.html
This is for DIN rails. It has RS485 output and uses MODBUS protocol. You can use many devices on a single RS485 line - you have to set a unique address on each device. On a Pi, you need libmodbus and a RS485 hat. Simple. Most of the work has already been done, and you don't risk electrocuting yourself.
There are many devices available for DIN rails - relays, line breakers, RCDs/GFCIs, Raspberry Pi cases, wall mount cases, power plugs,...
Statistics: Posted by fchk — Sun Apr 13, 2025 1:05 pm