SCT013 Current measuring with esp
Moderators: grovkillen, Stuntteam, TD-er
SCT013 Current measuring with esp
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
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
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.
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
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
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
-
- Normal user
- Posts: 18
- Joined: 08 Oct 2015, 18:02
Re: SCT013 Current measuring with esp
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.
Connect ESP8266 gpio2 to pulse S0 directly, without any resistors to 20&21 connectors.
Re: SCT013 Current measuring with esp
Thanks
Thats great to hear it works with 3,3 Volt.
regards
Har
Thats great to hear it works with 3,3 Volt.

regards
Har
Re: SCT013 Current measuring with esp
When you are saying - connect directly, I understand, one needs to connect GPIO2 to connector 20 or any other way?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.
Michal 'Kotek', greetings from Poland. Zapraszam na mój blog o automatyce domowej po polsku: http://www.ukotka.com.
-
- Normal user
- Posts: 18
- Joined: 08 Oct 2015, 18:02
Re: SCT013 Current measuring with esp
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)
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
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
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
-
- Normal user
- Posts: 18
- Joined: 08 Oct 2015, 18:02
Re: SCT013 Current measuring with esp
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
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 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?
Located in Belgium, Bruges. Working on a full DIY domoticz setup with ESPEasy.
Re: SCT013 Current measuring with esp
maybe read the SCT031 with the ADS1115 supported by ESPEasy?
Located in Belgium, Bruges. Working on a full DIY domoticz setup with ESPEasy.
Re: SCT013 Current measuring with esp
SCT013 can be used with ESP8266 with proper voltage divider, you can add ADS1115 if you need to read multiple analog sensors.DeNB3rt wrote:maybe read the SCT031 with the ADS1115 supported by ESPEasy?
This is one of the project I'm working with but as not enough time I'm not advancing at right speed...

My TINDIE Store where you can find all ESP8266 boards I manufacture --> https://www.tindie.com/stores/GiovanniCas/
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone
Re: SCT013 Current measuring with esp
Nice to hear that you also try to get SCT013 working with ESPpapperone wrote:SCT013 can be used with ESP8266 with proper voltage divider, you can add ADS1115 if you need to read multiple analog sensors.DeNB3rt wrote:maybe read the SCT031 with the ADS1115 supported by ESPEasy?
This is one of the project I'm working with but as not enough time I'm not advancing at right speed...

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).
Located in Belgium, Bruges. Working on a full DIY domoticz setup with ESPEasy.
Re: SCT013 Current measuring with esp
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.DeNB3rt wrote:Nice to hear that you also try to get SCT013 working with ESPpapperone wrote:SCT013 can be used with ESP8266 with proper voltage divider, you can add ADS1115 if you need to read multiple analog sensors.DeNB3rt wrote:maybe read the SCT031 with the ADS1115 supported by ESPEasy?
This is one of the project I'm working with but as not enough time I'm not advancing at right speed....
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).
My TINDIE Store where you can find all ESP8266 boards I manufacture --> https://www.tindie.com/stores/GiovanniCas/
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone
Re: SCT013 Current measuring with esp
I have to spoil the party here.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?
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
Party breakercosto wrote:I have to spoil the party here.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?
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.

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 party must go on

Located in Belgium, Bruges. Working on a full DIY domoticz setup with ESPEasy.
Re: SCT013 Current measuring with esp
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.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.
The ESPeasy can handle the received value over to e.g. domoticz?Code: Select all
code
The party must go on
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.
-
- New user
- Posts: 1
- Joined: 29 May 2019, 03:24
Re: SCT013 Current measuring with esp
please can you help me with the circuit diagram of how to connect an esp8266 with sct013
-
- New user
- Posts: 1
- Joined: 10 Jun 2019, 11:37
Re: SCT013 Current measuring with esp
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.
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.
Who is online
Users browsing this forum: Bing [Bot] and 14 guests