Current monitoring with ESPEasy

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Olfried
Normal user
Posts: 11
Joined: 05 Nov 2023, 21:49

Current monitoring with ESPEasy

#1 Post by Olfried » 05 Nov 2023, 21:55

Hi,
i made a little 4 channel amplifier for "Current transformators" like the "SCT-013-010".

Instead of sampling the voltage of the ct with the ESP32 or an arduino it uses a "precission rectifier" and generates a DC Voltage which can easily processed by the ESP32.

If you are interested have a look at

https://github.com/olfried/Current-Tran ... /tree/main

I will order some PCB now and if someone wants to get one let me know.

Olaf

bidrohini
Normal user
Posts: 106
Joined: 03 Nov 2022, 16:24

Re: Current monitoring with ESPEasy

#2 Post by bidrohini » 07 Nov 2023, 13:17

Thanks for sharing. Could you please tell me what is the advantage of using a precision rectifier instead of CT? Does it make the coding easier?

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Current monitoring with ESPEasy

#3 Post by TD-er » 07 Nov 2023, 16:20

Those current transformers (CT) clamps output an AC voltage which is linear to the AC current through the cable clamped by the CT.

However this is still an AC voltage and thus is relatively hard to measure as you need to continuously sample it.
Converting it to DC makes it a lot easier to sample as it is no longer time-critical.

However I wonder how this circuit responds to a non-resistive load.
Inductive and capacitive loads only shift the phase, so they introduce a factor where the estimated power consumption will be off.
However when you don't have a nice sinus shape, I don't know what the output will be.

Olfried
Normal user
Posts: 11
Joined: 05 Nov 2023, 21:49

Re: Current monitoring with ESPEasy

#4 Post by Olfried » 07 Nov 2023, 20:47

You're absolutely right!

This circuit only works "perfect" with a pure sinus, with no phase shifting.
But it produces good results if you calibrate it with the power consumer you know, what should be the normal behaviour.

You could use a truee RMS chip of course, but that is not what i wanted to achieve (and much too expensive for me!)

My friend has just a pump in his cellar and only wants to know if it is running or not.
He wants to use ESP Easy and i use the ADC input for voltage, so this might be the right solution.

BTW, i tried it with my drilling machine. That is far away from a sinus, but it worked good enough for me.

Greetings
Olaf

Olfried
Normal user
Posts: 11
Joined: 05 Nov 2023, 21:49

Re: Current monitoring with ESPEasy

#5 Post by Olfried » 07 Nov 2023, 20:50

bidrohini wrote: 07 Nov 2023, 13:17 Thanks for sharing. Could you please tell me what is the advantage of using a precision rectifier instead of CT? Does it make the coding easier?
Oh, sorry for the confusion.
I don't replace the CTs. It is just the electronics behind it.

The solutions which are out there also use CTs. But they just add an offset to the AC output of the CTs and measure the curve directly.

With my circuit the AC is rectified and produces a DC voltage which can be easely measured with ESP Easy. That's all!

Olaf

Olfried
Normal user
Posts: 11
Joined: 05 Nov 2023, 21:49

Re: Current monitoring with ESPEasy

#6 Post by Olfried » 07 Nov 2023, 21:52

Olfried wrote: 07 Nov 2023, 20:47 You're absolutely right!

This circuit only works "perfect" with a pure sinus, with no phase shifting.
But it produces good results if you calibrate it with the power consumer you know, what should be the normal behaviour.

You could use a truee RMS chip of course, but that is not what i wanted to achieve (and much too expensive for me!)

My friend has just a pump in his cellar and only wants to know if it is running or not.
He wants to use ESP Easy and i use the ADC input for voltage, so this might be the right solution.

BTW, i tried it with my drilling machine. That is far away from a sinus, but it worked good enough for me.

Greetings
Olaf
BTW, this is nearly, how my drilling machine looked like. A lot of noise, but this seems to be no problem because the rektifier measures just the peak voltage (which you have to interprete of course).

Click here:
https://www.falstad.com/circuit/circuit ... Pg3N4GHxQA

Olfried
Normal user
Posts: 11
Joined: 05 Nov 2023, 21:49

Re: Current monitoring with ESPEasy

#7 Post by Olfried » 07 Nov 2023, 22:00

Olfried wrote: 07 Nov 2023, 21:52
Olfried wrote: 07 Nov 2023, 20:47 You're absolutely right!

This circuit only works "perfect" with a pure sinus, with no phase shifting.
But it produces good results if you calibrate it with the power consumer you know, what should be the normal behaviour.

You could use a truee RMS chip of course, but that is not what i wanted to achieve (and much too expensive for me!)

My friend has just a pump in his cellar and only wants to know if it is running or not.
He wants to use ESP Easy and i use the ADC input for voltage, so this might be the right solution.

BTW, i tried it with my drilling machine. That is far away from a sinus, but it worked good enough for me.

Greetings
Olaf
BTW, this is nearly, how my drilling machine looked like. A lot of noise, but this seems to be no problem because the rektifier measures just the peak voltage (which you have to interprete of course).

Click here:
https://www.falstad.com/circuit/circuit ... Pg3N4GHxQA
Ok, i admit. It looks much nosier, but it's ok for my purpose.

User avatar
chromo23
Normal user
Posts: 827
Joined: 10 Sep 2020, 16:02
Location: germany

Re: Current monitoring with ESPEasy

#8 Post by chromo23 » 07 Nov 2023, 22:04

Olfried wrote: 07 Nov 2023, 20:47 My friend has just a pump in his cellar and only wants to know if it is running or not.
Hey Olaf,

for that purpose i flashed several Gosund SP1.
I wrote rules for them and used "easyfetch" as a dashboard.
They now monitor if a Pump is running and detect if the pump is running dry and turn off the pump if so.
Furthermore since the pumps we use have membrane container (i don´t know if this is the right term but you probably know what i mean) it also detects when the time between activations become shorter. This is a sign for checking the counter pressure.
All this works really well with the power of ESPeasy rules!

(this is a bit more pro but i also added a flow switch for detecting the running water. It is really sensitive. If the water runs for 30min the pump gets turned off)

I unfortunately have only a screenshot of the dashboard but not of the installation
Bildschirmfoto 2023-11-07 um 22.00.25.png
Bildschirmfoto 2023-11-07 um 22.00.25.png (29.74 KiB) Viewed 3749 times

Olfried
Normal user
Posts: 11
Joined: 05 Nov 2023, 21:49

Re: Current monitoring with ESPEasy

#9 Post by Olfried » 07 Nov 2023, 22:18

chromo23 wrote: 07 Nov 2023, 22:04
Olfried wrote: 07 Nov 2023, 20:47 My friend has just a pump in his cellar and only wants to know if it is running or not.
Hey Olaf,

for that purpose i flashed several Gosund SP1.
I wrote rules for them and used "easyfetch" as a dashboard.
They now monitor if a Pump is running and detect if the pump is running dry and turn off the pump if so.
Furthermore since the pumps we use have membrane container (i don´t know if this is the right term but you probably know what i mean) it also detects when the time between activations become shorter. This is a sign for checking the counter pressure.
All this works really well with the power of ESPeasy rules!

(this is a bit more pro but i also added a flow switch for detecting the running water. It is really sensitive. If the water runs for 30min the pump gets turned off)

I unfortunately have only a screenshot of the dashboard but not of the installation
Bildschirmfoto 2023-11-07 um 22.00.25.png
Thx! Sounds cool!

The problem is, that my friend doesn't want to break up the electric wiring for his Pumps. They are wired directly to the electric cabinet and he doesn't want anything between the pumps and power source.
That's why i wanted to use CTs.

Thx anyway!

User avatar
chromo23
Normal user
Posts: 827
Joined: 10 Sep 2020, 16:02
Location: germany

Re: Current monitoring with ESPEasy

#10 Post by chromo23 » 07 Nov 2023, 23:14

Olfried wrote: 07 Nov 2023, 22:18 The problem is, that my friend doesn't want to break up the electric wiring for his Pumps. They are wired directly to the electric cabinet and he doesn't want anything between the pumps and power source.
That's why i wanted to use CTs.
Oh.. i see :)
And thanks for sharing your project!

bidrohini
Normal user
Posts: 106
Joined: 03 Nov 2022, 16:24

Re: Current monitoring with ESPEasy

#11 Post by bidrohini » 09 Nov 2023, 14:52

Olfried wrote: 07 Nov 2023, 20:50
bidrohini wrote: 07 Nov 2023, 13:17 Thanks for sharing. Could you please tell me what is the advantage of using a precision rectifier instead of CT? Does it make the coding easier?
Oh, sorry for the confusion.
I don't replace the CTs. It is just the electronics behind it.

The solutions which are out there also use CTs. But they just add an offset to the AC output of the CTs and measure the curve directly.

With my circuit the AC is rectified and produces a DC voltage which can be easely measured with ESP Easy. That's all!

Olaf
Oh. Thanks for your clarification.

Olfried
Normal user
Posts: 11
Joined: 05 Nov 2023, 21:49

Re: Current monitoring with ESPEasy

#12 Post by Olfried » 14 Nov 2023, 15:20

The project goes on!

Testing on the breadboard
Image

The Olimex POE with ESP Easy
Image

My test loads. A heater, a drilling machine and the pump
Image

The ct
Image

The pump with the recitified and amplified (by factor 3) signal
Image

The curve of the heater. Nearly a sinus :-)
Image

Frontside of the PCB
Image

Backside
Image

Olfried
Normal user
Posts: 11
Joined: 05 Nov 2023, 21:49

Re: Current monitoring with ESPEasy

#13 Post by Olfried » 15 Nov 2023, 00:10

The show goes on.

Image

Image

Image

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Current monitoring with ESPEasy

#14 Post by TD-er » 15 Nov 2023, 08:35

Hmm the accessibility of the USB connector is a bit tricky
Or are you powering via PoE?

Olfried
Normal user
Posts: 11
Joined: 05 Nov 2023, 21:49

Re: Current monitoring with ESPEasy

#15 Post by Olfried » 15 Nov 2023, 20:55

Oh, sorry...

Yes, it is a POE device.

It was a little bit tricky to bring ESP Easy on it but it works.

About 20€, nice little deivce.
https://www.olimex.com/Products/IoT/ESP ... e-hardware

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Current monitoring with ESPEasy

#16 Post by TD-er » 15 Nov 2023, 23:35

I know these Olimex boards :)
Have them myself and also made some boards based on their schematics.

Just take care when hooking up those small PoE boards. They have no isolation, so if you power them via PoE and at the same time connect them to your PC, you may fry stuff.

There are "ISO" versions, but I don't think yours is an isolated one.

Olfried
Normal user
Posts: 11
Joined: 05 Nov 2023, 21:49

Re: Current monitoring with ESPEasy

#17 Post by Olfried » 16 Nov 2023, 22:35

Thx for the advice!
I did not connect the olimex via POE yet. And i will not in future!
Greetings
Olaf

Post Reply

Who is online

Users browsing this forum: No registered users and 36 guests