SCT-013-000 with Arduino MKR 1300

Has anyone tried to use this particular sensor with that particular Arduino? Cause I keep getting different results when connecting Arduino UNO and then trying the MKR, both connected to the 5V.
As for the resistors I have been using both 10k ohm resistors and the 33 ohms for burden, calibration at 60.6 and sampling at 1480. Basically, everything configurated with the help of the guide on this website.

But this isn’t the only issue with this particular set (MKR 1300 + Sensor), I tested with an amperometric clamp a 6A heater and the sensor values were also quite different (8A on the sensor instead of around 6A), only when I got the calibration to 38.8 it got close values, but I don’t think it works for every current, but since the calibration should be a fixed value based on the burden resistor and the sensor it doesn’t make much sense for me.

Also somehow I busted the sensor (when I connect it to the sound jack it only give a bold 0.0A current so I assume it’s broken, I hope it’s the sensor…) so I might not be able to test any new ideas today but I’ll answer whatever I can but any tests will only be done Monday.

Thanks in advance fellas.

Are you using a shield with the circuit configuration from the ‘Learn’ section?

I have no experience with this particular Arduino, but I don’t see why there should be a problem.
You design the circuit like this:

From what little information I can quickly find, the MKR runs at 3.3 V, like our emonTx.

Choose R1 & R2 to be any convenient value. What the value is, is not critical. What is critical is both are the same value. You feed those resistors from 3.3 V, not from the 5 V.
Choose the burden so that you get about 1.1 V rms across it at the maximum current you want to measure. For your YHDC SCT-013-000, it’s 22 Ω to measure 100 A. That 1.1 V rms gives you close to 3.3 V peak - peak to feed into the analogue input pin. The calibration constant is the actual current that gives you 1 V (both measured as rms) across the burden resistor.

1480 might not be the ‘best’ number to use. That was the best for the Uno when it was written, but it depends on the speed of sampling and on emonLib. (See Sampling rate of emonLib) But that should not make a big difference to the numbers.

Is “an amperometric clamp” one something like this:
https://www.edwardes.co.uk/media/image/5096/161/133/0/Fluke-323-400a-600v-AC-Digital-Clamp-Meter/jpg
Three possible reasons for the difference:
1 - Your heater is not what it says it is!
2 - What is the current range of your meter? If the current you are measuring is small compare to the maximum on the range you were using, the meter will not be accurate.
3 - Were the jaws clean and closed completely? Any dirt will cause a big error.

Unless you have cracked the ferrite core, it is not likely that it is broken. I have tested one to 250 A and it is still good. If you use a multimeter, or the Ohms range on your clamp ammeter, you should measure approximately 100 Ω between tip and sleeve of the plug. If you do, the c.t. is OK.

1 Like

Thank you for answering. As you said the MKR runs at 3.3 V but it can output 5V, so I assumed it would work if I used the 33 Ω burden value, but I’ll try to pin it from the Vcc (3.3V) and try with both an 18 Ω burden and a 22 Ω burden. Thing is, I don’t have them here either, so I’ll get back to you Monday.

Three possible reasons for the difference:
1 - Your heater is not what it says it is!
2 - What is the current range of your meter? If the current you are measuring is small compare to the maximum on the range you were using, the meter will not be accurate.
3 - Were the jaws clean and closed completely? Any dirt will cause a big error.

Yes, it indeed is that which you showed me.

  1. The heater is also connected to a smart plug and the values are about the same as the clamp.
  2. I am using the range from 2/20A also the clamp is this one: https://www.uni-t.cz/en/p/clamp-multimeter-uni-t-ut202
    It’s a pretty good one in my opinion, it also measures quite accurately values such as 50mA, tested it one a lightbulb
  3. Yep I try to give it a clean each time I’m going to use it.

Unless you have cracked the ferrite core, it is not likely that it is broken.

This was stupidity on my part, sorry for wasting your time, in the heat of my tests I may have accidentally connected the GND cable to the 5v and vice versa, So basically it was flowing backward…

Also, if you don’t mind me asking too, does the power of the resistance matters? As in 1/4 W or 1/2 W?

Yes, but it’s all about the range of voltage that the analogue input can accept, and I’m fairly sure that will be 0 - 3.3 V.

That’s a bad idea! But did you mean only the c.t? If that’s the case and you are measuring only current (not power), it makes no difference.

The burden value is not critical for it working - if you keep the test current below 65 A with the 33 Ω burden, there is no need to worry.

You can calculate that for yourself: P = V2 ÷ R, so with a maximum of 3.3 V anywhere in your circuit, 0.1 W resistors are OK above 110 Ω, or 220 Ω to have a 100% safety margin (recommended). But 0.1 W is even OK for your burden, because it will not see more than 1.1 V. So ¼ W or 0.3 W will be fine everywhere, and easier to find.

That’s a bad idea! But did you mean only the c.t?

Nope I meant the whole thing, basically I have this on a breadboard following the image from here and instead of connecting that red line that connects to 5v on the UNO to the 5v output I had it connected to the GND and the GND was connected to the 5V, and basically that’s why i was getting solid 0.0s.

You can calculate that for yourself: P = V2 ÷ Rr

Ah got it, thanks, I mostly asked because I have been using 1/4 W ones but apparently there are no 18 Ω 1/4 W where I normally buy them so I’ll have to get the 1/2 W option for those, and I really had no idea if it had more of an issue besides affecting the max voltage it can go to.

That is not good - you will have put the wrong polarity of voltage on the electrolytic capacitor. Fortunately, the current is limited, so it’s not likely to have done much harm. Had the resistors not been there, it would have overloaded your Arduino output, and the capacitor could possibly have exploded.

If you buy an emonTx Shield, emonTx or emonPi and need to change the burden resistor, you’ll need to use a ¼ W or 0.3 W, because there won’t be room for anything larger.

Had the resistors not been there, it would have overloaded your Arduino output, and the capacitor could possibly have exploded.

Oh, good to know this way I’ll probably be way more careful when handling these things.

If you buy an emonTx Shield, emonTx or emonPi and need to change the burden resistor, you’ll need to use a ¼ W or 0.3 W, because there won’t be room for anything larger.

Yeah it’ll probably not be happening, I’ll have to use MKRs with 3 sensors each, the thing is this wasn’t even supposed to be my work (another guy’s thesis was done with this but he got the calibration and resistance values wrong, basically an excuse for my lack of knowledge in eletrical engineering), and my area is computer science so until now I barely ever touched anything electronics and this whole deal with resistors and capacitors have been basically me trying to figure out how most of this stuff works (meanwhile I have to keep working on the framework where the data will be sent to which will be the main part of my project). And well while my advisor isn’t that much concerned with precision I would like to have this as close to real values as possible with the sensors and the reason we won’t be using EmonTx is because in this university they are way too cheap to buy that stuff while I did try to get them to buy a few of them. And besides, to buy anything in here you have ask the pope and then have the president of the united states agree with it…and then wait 2 months.

Sorry for the background but just know I really appreciate the help and the information you have been providing.

So, update: I got 22 and 18 Ω resistors and I’ve changed the calibration to 90.9 (for the 22) and plugged into the VCC, which I checked and gives ou 3.3V, thing is, with a hairdryer that gives 8.08A through the phase, the sensor is picking up these values:

Power Irms (A)
3507.67 15.25
3436.07 14.94
3400.69 14.79
3400.79 14.79
3398.95 14.78
3410.08 14.83
3393.31 14.75
3392.27 14.75
3405.54 14.81
3394.38 14.76
3392.86 14.75
3390.74 14.74
3414.15 14.84
3391.17 14.74
3392.68 14.75
3386.85 14.73
3408.00 14.82
3388.23 14.73
3387.80 14.73

With 18 Ω and calibration 111.1

4158.40 18.08
4176.55 18.16
4153.68 18.06
4176.81 18.16
4156.74 18.07
4157.29 18.08
4152.57 18.05
4163.34 18.10
4160.59 18.09
4159.35 18.08
4188.47 18.21
4160.26 18.09
4161.69 18.09

As for the Arduino Uno with 18 Ω and calibration 111.1

16115.05 70.07
16130.07 70.13
16072.24 69.88
16045.23 69.76
16123.20 70.10
16183.62 70.36
16118.60 70.08
16140.30 70.18
16106.72 70.03
16129.20 70.13
16100.41 70.00
16071.30 69.88
16209.82 70.48
16123.24 70.10

It appears that the ADC in your Arduino MKR 1300 can be switched between 8, 10 & 12 bits. That obviously changes the number range that comes out of the ADC. 0 V will always be 0 (or nearly), but 3.3 V will be 255, 1023 or 4095. EmonLib expects a 10-bit value, but if the compiler defines “arm”, then it assumes a 12-bit ADC. (This is in emonLib.h). This in turn defines the value of ADC_COUNTS, and that is used to scale the resulting count to engineering units. What do you have it set to?

It looks to me as if your MKR is giving about 2 times the value expected, but the Uno is giving nearly 10 times. What is the colour code on your 18 Ω resistor? It should be brown - grey - black - [gold | red | brown]. Have you checked the value with an ohmmeter?

Very many people have used emonLib and the sketches that we publish, so I am confident that there is no mistake there. The problem lies either with converting the sketch or the library to suit your MKR 1300, or with your hardware.

Can you post the sketch, please?

What do you have it set to?

That’s something I never touched so I assume it’s default, will check it now in the lib.

Have you checked the value with an ohmmeter?

Unfortunately I do not have one of those, the color code is brown - grey - black - gold -brown, basically, 18 ± 5%, 0.6W.

Very many people have used emonLib and the sketches that we publish, so I am confident that there is no mistake there.

Oh yes, definitely, I’m 100% sure the problem is on my end, I just have no idea what it is.

Also sketch:

#include "EmonLib.h"
 // Include Emon Library
 EnergyMonitor emon1;
 // Create an instance
 void setup()
 {
   Serial.begin(9600);

   emon1.current(1, 111.1);             // Current: input pin, calibration. 111.1 for 18
 }

 void loop()
 {
 double Irms = emon1.calcIrms(1480);  // Calculate Irms only
 Serial.print(Irms*230.0);           // Apparent power
   Serial.print(" ");
   Serial.println(Irms);             // Irms
}

Alright used analogReadResolution(9) and apparently now the values are:

2069.96 9.00
2069.15 9.00
2081.03 9.05
2061.07 8.96
2063.03 8.97
2075.96 9.03
2070.96 9.00
2071.25 9.01
2070.60 9.00
2071.32 9.01
2067.44 8.99
2068.47 8.99
2071.69 9.01
2063.41 8.97
2060.74 8.96
2075.75 9.02
2065.81 8.98
2065.98 8.98
2078.54 9.04
2065.69 8.98
2066.39 8.98
2004.54 8.72

But still when it goes to 4.95 on the clamp, the values that appear are about:

1462.59 6.36
1473.16 6.41
1465.72 6.37
1473.11 6.40
1465.22 6.37
1460.96 6.35

You must expect the calibration values we publish to be close, but not absolutely correct. There are many components that affect the calibration, and all are subject to manufacturing tolerances. For example, your SCT-013-000 gives the correct output current ±3% over the range 10 A - 120 A. Outside of that range, the makers do not say how well or how badly it will perform. In your case, that is the largest error, your burden resistor is a 1% tolerance, then there’s the reference voltage of the ADC. I don’t know what the tolerance of that is. You need to adjust the calibration constant to correct for the components that are not exactly what they should be.

But I do not think that explains why your 5 A measurement should come to 6.3 - 6.4 A. My first thought is the 5 V power supply has some noise on it, and you are adding noise to the signal you are trying to measure. If you have access to an oscilloscope, look at the 5 V, the 3.3 V and the 1.65 V ‘bias’ and check that they are free of interference or ripple.

I think my university might have one of those I’ll see if I can get them to let me use it. For now I’ll try to adjust the calibration to see if I can get closer results, either way, thank you very much for the help.

1 Like