230V power metering on rpi

i am currently busy with pond demotics. (relays,temp sensors,buttons, water level, lights and flow meter etc)

And i would like to add a current sensor so i can messure how mush power the whole pond uses.
what sensor do i need to attach and how to configure this ?

I all doing this on one raspberry pi 3

If you use you internet search engine of choose to search for “power metering raspberry pi” you’ll find lots of guides to help you

You could use a Sonoff POW [1] re-flashed with the Tasmota software. That will send data back to MQTT for access in node-red.

[1] https://www.itead.cc/sonoff-pow.html

1 Like

it is for a pond where they will be at least 4 high power pumps large UV light, pond lights etc so it will be way over the rated Amp of a sonoff and i dont want to be a relay in front off the other relays.

what is the easiest way to get an SCT on node red and how to wire it ? any boards that are available ?

One device many have used is the Current Cost smart meter - ( mainly in UK ). They are relatively inexpensive and have a simple serial port that is easy to listen to. Or maybe look at the openenergymonitor site - who, as well as a range of products, have some great info for DIY - https://learn.openenergymonitor.org/electricity-monitoring/ac-power-theory/introduction

You realise the Sonoff POW is approx 3600w (i.e. 16A) although i would not push it that far.

For the sake of simplicity - why not deploy more than 1 - which would give you better metrics as to the electricity per pump/light.

Each provides a MQTT controllable relay as well as current monitoring etc - so you would be able to remove your current relay soluton and simplify it to one device (relay and monitor) per device


Hi @tarbax,

I implemented power measurement on RasPi 3 with ADS1115 (4-channel ADC converter) and Split Current Transformers. I measure the current assuming voltage is 230V.

Comparing to suggested Sonoff POW, this method had disadvantage: the assumption of voltage, not measurement. This can be satisfied with a little more additional circuitry (was not required in my case).
The advantage of this method is: no special HW (Sonoff) required neither software-related mess with it.

Just to note that I was not suggesting the Sonoff POW is the best solution for this application, just throwing it into the mix. There is no correct answer for this class of problem, different applications will require different solutions.

Hi Tarbax,

Power measurement can also be done using a Belkin Wemo Insight Switch. There is an american and european version:


Don't use a normal Wemo Switch, because that only allows you to turn on/off a 230 Volt device.

Wemo devices have a HTTP interface (see here and here), which can be called e.g. using a HttpRequest node. Or you can use the node-red-node-wemo nodes out-of-the box.


i found this Gravity Analog AC Current Sensor from DF robot.
is this implementable into node red ?

i also planning to get IoTaWatt so i can measure voltage on 3 phases and current of each room, solar and grid separately

I'm not a specialist about this area, but there is the similar SCT-013 on Aliexpress, which is wired to a Raspberry in this tutorial. They put one of the RPICT boards as a hat on top of a raspberry (which seems to be compatible), to connect it to the gpio pins. Such boards allow up to 7 SCT-013 modules to be connected.

Haha, I wouldn't push a SONOFF to even 1/2 that - at least not in any location susceptible to fire!

Interesting. But the boards seem to cost around ÂŁ35 and for that it might be better to us a bunch of cheap ESP8266's - I expect someone has connected up those current sensors.

Igrowing , can you PLEASE share your code ??

@nlebidakis sure.


In Australia here (240v) - but have now had a Sonoff POWr2 running our clothes dryer (2000w) for over a year and not one issue

Also a 2nd running our dishwasher - peaks at 2400w

And a 3rd running a Hot water service at 2400w for a year now - that one gets warm but nothing to worry about

So i have to say i am very impressed with them so far and how robust they are