arduino SCT-013-030

Hi,

I'm a little confused how to setup EmonLib for Arduino using a SCT-013-030. According to http://openenergymonitor.org/emon/node/2447 it's calibration value must be 30 and it already has a internal burden resistor, so I'm using the following code:

#include <EmonLib.h>

EnergyMonitor emon1;                   // Create an instance
 
void setup()
{  
  Serial.begin(9600);
  emon1.current(1, 30);             // Current: input pin, calibration.
}
 
void loop()
{
  double Irms = emon1.calcIrms(1480);  // Calculate Irms only
  Serial.println(Irms);		       // Irms
}

with this schema :

I'm reading between 0.04 and 0.06 constantly without any load. It's just noise / not or it's just not accurate enough to read that there's no load? Maybe I'm missing something else...

Anyone can give me some insight?

 

thanks,

 

Robert Wall's picture

Re: arduino SCT-013-030

It is just noise.

If you use an Arduino variant that has good filtering between the analogue and digital sides, and has good noiseless power supplies, and you pay very careful attention to grounding, screening and filtering, you will hopefully see an improvement. But you will probably never read a true zero current.

This is because the rms calculation in emonLib rectifies the wave, so the slightest amount of noise is added to the wanted signal. If you add a voltage input and measure real power, there is no rectification, and you will see an improvement because the negative noise spikes and the positive noise spikes will tend to balance each other out.

Don't ask me which particular Arduino is best, I don't know. But I'm told that some makes/builds/clones are better than others.

dave-in-nj's picture

Re: arduino SCT-013-030

my application is to measure the blower of my oil burner and also the oil burner and of course when both are on, blower and burrner.

in a past life, working with many industrial sensors, we incorporated a 'zero-drop-out circuit.

we typically used % of full span accuracy., often 1/4 of a percent.

below that point, the ZDO circuit would just bring the reading to 0.00. this was more for the on-looker to feel good as most did not understand the concept of tolerance and accuracy.

in my sketch, I added 

  if(Irms <= 0.25){                   // added for zero dropout
    IrmsDisplay=0;

and then 

Serial.println(IrmsDisplay);

this way, the actual match was never effected, only the reading on the display.

 

rody2571's picture

Re: arduino SCT-013-030

HI guys,

I have implemented the same circuit, the same  program in my arduino mega 2560 and  I used the SCT-013 30A with output 0-1Volt.

I try with calibration value=30 but I'm reading between 0.29and 0.31 constantly without any load.

I connected a soldering of 30 Watts and I  get  reads  0.34-036 amperes, this reads sre fake because 0.35*220v=77Wats

How I can calibrate this program?

johlhausen's picture

Re: arduino SCT-013-030

Hi Rody, calibrating with such a small load is difficult. If you haven't looked at the calibration resource here yet, you should do so - it's really helpful. Try a space heater, toaster, or some other resistive (not a motor) load above 1kW rather than a lamp or soldering iron.

kodak's picture

Re: arduino SCT-013-030

Hi, I will attach here as I am having problems with this sensor and emon lib on arduino duemilanove. I read ~70A without any load attached (sensor brings that 2.5V basically down to zero). Setup is usual (two R10k for diving 5V into two + 10uF pull down). When I disconnect the sensor and short circuit its pins inside the socket I see just a noise (>0.1A) so it looks ok. I am also using SD shield + one wire temp sensor (at the end I am trying to debug a fridge). Any idea what am I doing wrong?

* I measure 38.5R on sensor's output

 

/*
  SD card test

 This example shows how use the utility libraries on which the'
 SD library is based in order to get info about your SD card.
 Very useful for testing a card when you're not sure whether its working or not.

 The circuit:
  * SD card attached to SPI bus as follows:
 ** MOSI - pin 11 on Arduino Uno/Duemilanove/Diecimila
 ** MISO - pin 12 on Arduino Uno/Duemilanove/Diecimila
 ** CLK - pin 13 on Arduino Uno/Duemilanove/Diecimila
 ** CS - depends on your SD card shield or module.
        Pin 4 used here for consistency with other Arduino examples

 created  28 Mar 2011
 by Limor Fried
 modified 9 Apr 2012
 by Tom Igoe
 */
// include the SD library:
#include <SPI.h>
#include <SdFat.h>

// set up variables using the SD utility library functions:
SdFat sd;
StdioStream csvStream;

// change this to match your SD shield or module;
// Arduino Ethernet shield: pin 4
// Adafruit SD shields and modules: pin 10
// Sparkfun SD shield: pin 8
const int chipSelect = 4;

#include <OneWire.h>
#include <DallasTemperature.h>

// Data wire is plugged into pin 2 on the Arduino
#define ONE_WIRE_BUS 2

// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
OneWire oneWire(ONE_WIRE_BUS);

// Pass our oneWire reference to Dallas Temperature. 
DallasTemperature sensors(&oneWire);

#include <EmonLib.h>

// current sensor input (analog)
#define A_SENSOR_ANALOG_PIN 3

EnergyMonitor emon1;

void setup() {
  pinMode(7, OUTPUT);
  digitalWrite(7, HIGH);
  
  // Open serial communications and wait for port to open:
  Serial.begin(57600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }
  Serial.println(F("setup start"));

  // Start up the library
  sensors.begin(); // IC Default 9 bit. If you have troubles consider upping it 12. Ups the delay giving the IC more time to process the temperature measurement

  emon1.current(A_SENSOR_ANALOG_PIN, 30);             // Current: input pin, calibration.

  pinMode(chipSelect, OUTPUT);
  while(!sd.begin(chipSelect, SPI_HALF_SPEED)) {
    Serial.println(F("SD initialization failed!"));
    sd.initErrorPrint();
    delay(1000);
  }
  Serial.println(F("SD wiring is correct and a card is present."));

  while (!csvStream.fopen("data.csv", "a+")) {
    Serial.println(F("open csvStream failed!"));
    delay(1000);
  }
  Serial.println(F("csvStream opened."));
}

unsigned long start;
long tick = 0;
double temp, Irms;

void loop(void) {
  start = millis();

  digitalWrite(7, !digitalRead(7));
  
  tick++;
    
  sensors.requestTemperatures(); // Send the command to get temperatures
  temp = sensors.getTempCByIndex(0);
    
  Irms = emon1.calcIrms(1480);

  csvStream.print(tick);
  csvStream.putc(',');
  csvStream.print(temp);
  csvStream.putc(',');
  csvStream.print(Irms);
  csvStream.println();
  if (tick%10==0) {
    csvStream.fflush();
  }

  Serial.print(tick);
  Serial.print(',');
  Serial.print(temp);
  Serial.print(',');
  Serial.print(Irms);
  Serial.print(',');
  Serial.print(millis() - start);
  Serial.println();
 
  delay(3000 - (millis() - start));
}

Robert Wall's picture

Re: arduino SCT-013-030

Have you told emonLib that your ADC has a 12-bit resolution? I can't see that in your code. Look at emonLib.h to see what to do.

kodak's picture

Re: arduino SCT-013-030

I have taken unconnected pin from 3.5mm jack... So embarrassing :)

It is not Due but Duemilanove so 10b ADC resolution only

 

Funny thing - I got two sensors (5A/1V and 30A/1V, first due to supplier mistake):

when connecting ~1A load (it is a dryer so a motor + heater) 5A sensor gives me 0.5A while only 30A sensor providing expected load. Calibrating 5A sensor as 10A gives proper result - maybe this time it is manufacturer's mistake with marking 10A/1V as 5A/1V or picking wrong burden resistor? Anyone having any similar story?

BTW Have anyone experienced those sensors working with currents higher then nominal? I guess linearity can be problematic?

Robert Wall's picture

Re: arduino SCT-013-030

"maybe this time it is manufacturer's mistake"
That sounds likely, but without actually measuring the CT directly, it's hard to tell. You could open it up (it's quite easy and non-destructive) to read the burden value, then calculate what it should be - or measure the resistance you see, bearing in mind the secondary winding resistance is in the order of 100 Ω and in parallel with the burden. We think all versions use the same winding 100 A : 50 mA. I can't remember anyone reporting a similar problem.

"Have anyone experienced those sensors working with currents higher then nominal? I guess linearity can be problematic?"
You can see the answer to that in the test report in Resources.

kodak's picture

Re: arduino SCT-013-030

Yes, I have already disassembled 5A/1V version.

You are probably referring to saturation graph? That would answer my doubts only if all versions use the same winding and just differ with a burden resistor. Thanks.

emjay's picture

Re: arduino SCT-013-030

@kodak,

That would answer my doubts only if all versions use the same winding and just differ with a burden resistor.

Don't you have this already? If the core cross-section is the same, the driving flux is from the single turn primary, hence saturation is independent of how many turns in the secondary.

 

Robert Wall's picture

Re: arduino SCT-013-030

"Yes, I have already disassembled 5A/1V version."
But you're not telling us what value the burden resistor was, so I can't help you.

emjay:
Only partly true - remember the secondary current actually reduces the core flux, so in a lightly loaded/unloaded CT all the primary flux is magnetising flux and the core saturates a lot earlier than a short-circuited one. (Hence the danger from having no burden: the rate of change of flux, hence voltage, is very large as the core switches from saturation one way to saturation the other. You can see the unburdened CT saturating, in the report.) 

kodak's picture

Re: arduino SCT-013-030

5A/1V: resistor's code is 3900

30A/1V: 62R0

Robert Wall's picture

Re: arduino SCT-013-030

Those do appear to be the correct burden resistor values for the stated rating, so unless the resistor in the 5 A one is wrongly marked, or just plain wrong (which is unlikely), the only possible explanation seems to be a parallel burden resistor, of 390 Ω. You don't have a second burden? - that too seems improbable if the other CT was correct.

So it looks as if that will have to remain a mystery.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.