0

I have a project where I will mount 6 non intrusive current sensor model SCT013 (100A/50mA) manufactured by yhdc.com on an Arduino Mega.

Virtual ground and Burden resistors are 1% tolerance.

To start testing I mounted 2 sensors using the principles of connection found at (http://www.homautomation.org/2013/09/17/current-monitoring-with-non-invasive-sensor-and-arduino/). Code below.

#include "EmonLib.h"                   // Include Emon Library
EnergyMonitor emon0;                   // Create an instance
EnergyMonitor emon1;                   // Create an instance

int Calib = 60;

void setup() {
  Serial.begin(9600);

  emon0.current(A0, Calib);             // Current: input pin, calibration.
  emon1.current(A1, Calib);             // Current: input pin, calibration.  

   }

   void loop(){

double Irms0 = emon0.calcIrms(1480);
double Irms1 = emon1.calcIrms(1480);

Serial.print("Sensor0: ");
Serial.print(Irms0);            
Serial.print(" Amps ");

Serial.print("Sensor1: ");
Serial.print(Irms1);            
Serial.println(" Amps ");  

}
//------------end------------

The code I found is for UNO and a single sensor and I just added a second, it works fine and sensors do independent readings well.

Both sensors are mounted on the same test live wire so I have to get more or less the same readings most of the times and it is precisely the case with readings floating between sensors on the order of 100s of miliamps.

My problems are:

  1. Even with no load I get, on both sensors, a reading that varies from 270 to 320mA

  2. When I connect a hair dryer that consumes in one mode 10A and in another mode 5A the readings are a lot closer to the expected (I am also checking with a clamp meter)

The problem seems to be the no load condition and the imprecise readings at low currents. I could exclude readings under a certain value on my code to solve the no load problem but them I would be ignoring real electrical measurement situations.

  • Paulo, to avoid confusion please edit the information in your comment into the question body. Click 'edit' in the "share edit close flag" group and change the question. Also please note that "a reading that rovers around 30mA" does not make sense in English. Do you mean that it hovers near 30mA, ie, stays near 30mA? Or do you mean that it roves, that is, moves at random, near 30mA? If so, say what the high and low readings are. Also show your ADC setup() code and the ADC reading code and say if you used shielding or shielded wire, etc – James Waldby - jwpat7 Nov 11 '17 at 3:34
0

Every time you use a real clamp meter, you should zero it out before measuring.

The hall effect sensors you describe are the same way. There's magnetic pull from the earth and other sources that need to be corrected for. When you draw 5 or 10 amps, that noise is masked out. They are likely still apart roughly the same # of ma as the baseline reading.

Once you subtract the no-load load from each, maybe on startup, you should get a lot better readings in terms of accuracy and precision.

  • Hi, I would like to understand where this imprecision comes from. Even with the sensor plug disconnected I get these 270 to 320mA readings. And these values are entirely dependent on the value I put on the variable Calib. The problem seems to start at the Arduino A0 pin inwards. What If I use an external AD converter? Thanks – Paulo Borges Nov 11 '17 at 9:56
  • offsets are common and needed. if you're sensor can read 10A, then each ADC level is ~40ma, and ACDs tend to bounce a few levels each each reading, sometimes more, particularly built-in ones. smoothing caps and an external ADC would help precision, but you still need to calibrate for accuracy. – dandavis Nov 11 '17 at 10:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.