Page 1 of 1

SCT013 Current measuring with esp

Posted: 11 Jan 2016, 15:28
by har
Hello,

I have a CT for measuring current, type SCT013, voltage output type.

And I was wondering if the analoge input of the ESP can be used for this purpose?

And if yes what is the best way?
regards
Har

Re: SCT013 Current measuring with esp

Posted: 11 Jan 2016, 15:56
by costo
The answer is NO.

This is an AC current transformer which has an AC output.
Analog input of ESP can do nothing with a 50/60Hz AC signal which comes from STC013.
The output state of ESP would be undefined, varying values.

You could add a detector circuit to make a DC voltage which is more or less an indication of the amount of AC current.

Re: SCT013 Current measuring with esp

Posted: 14 Jan 2016, 11:19
by har
Thanks for the answer.

I left the idea and change to a http://www.ebay.de/itm/111871746810 (XTM18SA series energy meters)

With this I can use a Pulse counter.
There a have 2 options:
1) Use a pulse counter with LDR.

2) The measuring unit can give pulse if connected to a 5V line. That would be the nice way if it would not be 5 volt. What would be the best way to convert it to 3,3 volt for the esp, a level shifer or divider with resistors?

kínd regards and thanks
Har

Re: SCT013 Current measuring with esp

Posted: 15 Jan 2016, 08:18
by VasilijHCN
I use XTM18SA meters, i can not see current, but power meter working great in domoticz, using 3.3v for pulse reading(S0 pins).
Connect ESP8266 gpio2 to pulse S0 directly, without any resistors to 20&21 connectors.

Re: SCT013 Current measuring with esp

Posted: 15 Jan 2016, 10:12
by har
Thanks
Thats great to hear it works with 3,3 Volt. :D

regards
Har

Re: SCT013 Current measuring with esp

Posted: 15 Jan 2016, 11:18
by mkotek
VasilijHCN wrote:I use XTM18SA meters, i can not see current, but power meter working great in domoticz, using 3.3v for pulse reading(S0 pins).
Connect ESP8266 gpio2 to pulse S0 directly, without any resistors to 20&21 connectors.
When you are saying - connect directly, I understand, one needs to connect GPIO2 to connector 20 or any other way?

Re: SCT013 Current measuring with esp

Posted: 15 Jan 2016, 12:22
by VasilijHCN
i dont remember exactly 21 or 20, one to GND, other to GPIO2, if u connect this wrong nothing happens - u not destroy esp not power meter. try connect, then watch in web interface i pulses are counting, if not working change connection(swap wires) 20 with 21.
Be careful on AC live circuits, also remember change pulse count per kWh in domoticz settings.(2000 i/kWh in my case)

Re: SCT013 Current measuring with esp

Posted: 15 Jan 2016, 22:35
by har
That last remark raised another question.
I have already a power meter with 1000imp/kWh . when I as another with 2000imp/kWh it will show a double value.
Can espeasy the calculation option be use for counters?
Regards
Har

Re: SCT013 Current measuring with esp

Posted: 18 Jan 2016, 07:26
by VasilijHCN
I also use 1000 and 2000 imp/kWh power meters, for me espeasy formula not working in pulse counter, in domoticz i set 2000 power meter as water counter, changed pulsecount to 2000 for water. Now domoticz counters can not set separately pulsecount for each counter.

Re: SCT013 Current measuring with esp

Posted: 21 Nov 2016, 13:44
by DeNB3rt
Bumping this topic ;) ,

I want to measure/calculate AC power usage with my ESPEasy.
I found out this article:
http://www.homautomation.org/2013/09/17 ... d-arduino/

It's using a Non-invasive AC Current Sensor (type SCT-013-000 like in this topic title).
Burden resistor and an voltage devider to create an analog value between 0 -> 5V.
I think the same can be done to read the value with the ESP's ADC with voltage devider.

Anyone that tried this?

Re: SCT013 Current measuring with esp

Posted: 21 Nov 2016, 15:04
by DeNB3rt
maybe read the SCT031 with the ADS1115 supported by ESPEasy?

Re: SCT013 Current measuring with esp

Posted: 21 Nov 2016, 15:39
by papperone
DeNB3rt wrote:maybe read the SCT031 with the ADS1115 supported by ESPEasy?
SCT013 can be used with ESP8266 with proper voltage divider, you can add ADS1115 if you need to read multiple analog sensors.
This is one of the project I'm working with but as not enough time I'm not advancing at right speed... :(

Re: SCT013 Current measuring with esp

Posted: 21 Nov 2016, 17:03
by DeNB3rt
papperone wrote:
DeNB3rt wrote:maybe read the SCT031 with the ADS1115 supported by ESPEasy?
SCT013 can be used with ESP8266 with proper voltage divider, you can add ADS1115 if you need to read multiple analog sensors.
This is one of the project I'm working with but as not enough time I'm not advancing at right speed... :(
Nice to hear that you also try to get SCT013 working with ESP :-).
Yes with proper divider, it should be possible to read directly on ESP.
I've read that directly on ESP, ADC input is 0-1 V scaled 0-1023,
with nodeMCU (like me) it should be 0-3.3V (not sure).

Re: SCT013 Current measuring with esp

Posted: 21 Nov 2016, 18:04
by papperone
DeNB3rt wrote:
papperone wrote:
DeNB3rt wrote:maybe read the SCT031 with the ADS1115 supported by ESPEasy?
SCT013 can be used with ESP8266 with proper voltage divider, you can add ADS1115 if you need to read multiple analog sensors.
This is one of the project I'm working with but as not enough time I'm not advancing at right speed... :(
Nice to hear that you also try to get SCT013 working with ESP :-).
Yes with proper divider, it should be possible to read directly on ESP.
I've read that directly on ESP, ADC input is 0-1 V scaled 0-1023,
with nodeMCU (like me) it should be 0-3.3V (not sure).
ESP8266 ACD pin range is not changing (0-1V), only difference is that NODEMCU/WEMOS have a voltage divider already onboard to bring the range to 0-3.3V but still 1024 steps due to the conversion on chip.

Re: SCT013 Current measuring with esp

Posted: 23 Nov 2016, 00:52
by costo
DeNB3rt wrote:Bumping this topic ;) ,

I want to measure/calculate AC power usage with my ESPEasy.
I found out this article:
http://www.homautomation.org/2013/09/17 ... d-arduino/

It's using a Non-invasive AC Current Sensor (type SCT-013-000 like in this topic title).
Burden resistor and an voltage devider to create an analog value between 0 -> 5V.
I think the same can be done to read the value with the ESP's ADC with voltage devider.

Anyone that tried this?
I have to spoil the party here.
The link you gave puts this line in the loop of the program.: double Irms = emon1.calcIrms(1480); // Calculate Irms only
I suggest you read this page for better understanding what this means https://openenergymonitor.org/emon/node/846

The point is that you need to measure the momentary voltage of the sinusoidal AC waveform more than thousand times per second, that is a necessity to calculate the RMS value of the alternating voltage.
ESPEasy can do about one measurement per second. With so few measurements it is impossible to calculate the RMS value of a 50Hz AC waveform.

Re: SCT013 Current measuring with esp

Posted: 23 Nov 2016, 17:04
by DeNB3rt
costo wrote:
DeNB3rt wrote:Bumping this topic ;) ,

I want to measure/calculate AC power usage with my ESPEasy.
I found out this article:
http://www.homautomation.org/2013/09/17 ... d-arduino/

It's using a Non-invasive AC Current Sensor (type SCT-013-000 like in this topic title).
Burden resistor and an voltage devider to create an analog value between 0 -> 5V.
I think the same can be done to read the value with the ESP's ADC with voltage devider.

Anyone that tried this?
I have to spoil the party here.
The link you gave puts this line in the loop of the program.: double Irms = emon1.calcIrms(1480); // Calculate Irms only
I suggest you read this page for better understanding what this means https://openenergymonitor.org/emon/node/846

The point is that you need to measure the momentary voltage of the sinusoidal AC waveform more than thousand times per second, that is a necessity to calculate the RMS value of the alternating voltage.
ESPEasy can do about one measurement per second. With so few measurements it is impossible to calculate the RMS value of a 50Hz AC waveform.
Party breaker ;)
No, many thanks for the hint!
You are correct, the RMS value must be measured with 1480 samples per second.

Could I do this with a seperate arduino pro mini (MiniProExtender) with the code and via I2C send the result to the ESP?
I have an pro mini 5v laying around.

Code: Select all

#include "EmonLib.h"                   // Include Emon Library
EnergyMonitor emon1;                   // Create an instance
 
void setup()
{  
  Serial.begin(9600);
 
  emon1.current(5, 60);             // Current: input pin, calibration.
  //calibration is explained bellow
}
 
void loop()
{
  double Irms = emon1.calcIrms(1480);  // Calculate Irms only
 
  Serial.print(Irms*230.0);	       // Apparent power
  Serial.print(" ");
  Serial.println(Irms);		       // Irms
}
The ESPeasy can handle the received value over to e.g. domoticz?

The party must go on :ugeek:

Re: SCT013 Current measuring with esp

Posted: 24 Nov 2016, 23:39
by costo
DeNB3rt wrote: Party breaker ;)
No, many thanks for the hint!
You are correct, the RMS value must be measured with 1480 samples per second.

Could I do this with a seperate arduino pro mini (MiniProExtender) with the code and via I2C send the result to the ESP?
I have an pro mini 5v laying around.

Code: Select all

 code 
The ESPeasy can handle the received value over to e.g. domoticz?

The party must go on :ugeek:
Ofcourse you can do such things with an small Arduino board and the PME plugin. I have no experience with the emon library but it should work.

Some time ago I did a measuring AC-current project, you can read about that here:

viewtopic.php?f=4&t=627&start=10#p6463
viewtopic.php?f=2&t=1078&p=6462#p6462

The results I got with a ACS712 i.c.w. a Pro-Mini were not impressive, a lack of resolution and accuracy. Not good for measurering small currents.
But good enough to see if a motor, lamp or heater is turned on.
To measure AC reasonable accurate you need a 12-bit AD-converter. Arduino boards have only 10-bit resolution. , only Arduino DUE has 12-bit AD converters and I guess it is possible to use that board with the PME plugin instead of a Pro-Mini board.

Re: SCT013 Current measuring with esp

Posted: 29 May 2019, 03:45
by temitope1234
har wrote: 11 Jan 2016, 15:28 Hello,

I have a CT for measuring current, type SCT013, voltage output type.

And I was wondering if the analoge input of the ESP can be used for this purpose?

And if yes what is the best way?
regards
Har
please can you help me with the circuit diagram of how to connect an esp8266 with sct013

Re: SCT013 Current measuring with esp

Posted: 10 Jun 2019, 12:53
by alkakamble
This is an air conditioner current transformer which has an air conditioner yield.

Simple contribution of ESP can do nothing with a 50/60Hz Air conditioning signal which originates from STC013.

The yield territory of ESP would be vague, fluctuating qualities.

You could add an indicator circuit to make a DC voltage which is pretty much a sign of the measure of air conditioning current.