Page 1 of 1

Current monitoring with ESPEasy

Posted: 05 Nov 2023, 21:55
by Olfried
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

Re: Current monitoring with ESPEasy

Posted: 07 Nov 2023, 13:17
by bidrohini
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?

Re: Current monitoring with ESPEasy

Posted: 07 Nov 2023, 16:20
by TD-er
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.

Re: Current monitoring with ESPEasy

Posted: 07 Nov 2023, 20:47
by Olfried
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

Re: Current monitoring with ESPEasy

Posted: 07 Nov 2023, 20:50
by Olfried
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

Re: Current monitoring with ESPEasy

Posted: 07 Nov 2023, 21:52
by Olfried
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

Re: Current monitoring with ESPEasy

Posted: 07 Nov 2023, 22:00
by Olfried
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.

Re: Current monitoring with ESPEasy

Posted: 07 Nov 2023, 22:04
by chromo23
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 5043 times

Re: Current monitoring with ESPEasy

Posted: 07 Nov 2023, 22:18
by Olfried
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!

Re: Current monitoring with ESPEasy

Posted: 07 Nov 2023, 23:14
by chromo23
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!

Re: Current monitoring with ESPEasy

Posted: 09 Nov 2023, 14:52
by bidrohini
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.

Re: Current monitoring with ESPEasy

Posted: 14 Nov 2023, 15:20
by Olfried
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

Re: Current monitoring with ESPEasy

Posted: 15 Nov 2023, 00:10
by Olfried
The show goes on.

Image

Image

Image

Re: Current monitoring with ESPEasy

Posted: 15 Nov 2023, 08:35
by TD-er
Hmm the accessibility of the USB connector is a bit tricky
Or are you powering via PoE?

Re: Current monitoring with ESPEasy

Posted: 15 Nov 2023, 20:55
by Olfried
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

Re: Current monitoring with ESPEasy

Posted: 15 Nov 2023, 23:35
by TD-er
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.

Re: Current monitoring with ESPEasy

Posted: 16 Nov 2023, 22:35
by Olfried
Thx for the advice!
I did not connect the olimex via POE yet. And i will not in future!
Greetings
Olaf