current sensor

i am using the yhdc sct013 current transformer to measure the current flows through the 660 ohm resistor(i used the multimeter to mesaure current about 51mA). i have basically everything set up properly, but when i run the sketch "a single Ct" there is a column of zero shown in the serial monitor.  i am in australia, so the three pin power plug is like line(brown),netural(blue) i have tried clipping the CT on either line or netural cable with both directions, but there isstill no result shown.  

 

Robert Wall's picture

Re: current sensor

So you mean the c.t's burden resistor is 660 Ω? That is far too large and will restrict the range of current that you can read to about 3 A before distortion and errors start to creep in. What is the rest of the hardware that you are using, an emonTx or what? I think you must have an assembly error somewhere. Carefully check what you have built against the photographs and component lists.

chunyang's picture

Re: current sensor

i upload the photo of the set up, the load(resistor) is 660ohms, but i changed it to 30 ohms and current through the resistor is 1.5 A when i applied the voltage 50v. still does not work.

chunyang's picture

Re: current sensor

i am using the emontx shield which i think it is the same as the emontx... what is the minimun current that the CT can detect.

Robert Wall's picture

Re: current sensor

The emonTX shield is NOT the same as the emonTx, the inputs are arranged differently. You need to get the emonTx SHIELD example from Github.

Note: I have deleted the other thread you started because you will waste everyone's time by having two threads about the same problem.

chunyang's picture

Re: current sensor

ok, but the emonTx shield example only has the sketch for  CT1234 and i have only one CT. so the "single CT " sketch only works for emonTX not emonTX shield? could you plz tell me the minimum current that the CT can detect because i am testing with 1.5A  , is it will be detected by CT or not.

dBC's picture

Re: current sensor

I hate to ask the obvious, but just in case, your 50V is AC right?  Assuming yes, then you should be able to put an AC voltmeter across the burden resistor and see what sort of response you're getting from the CT.

chunyang's picture

Re: current sensor

my applied voltage 50 v is AC definitely.  if i place the AC voltmeter in parallel with the load , there was the correct reading.  i dont quite understand what u mean by response from CT, do u mean put the meter to the output pin that was plugged into the shield?

dBC's picture

Re: current sensor

Leave the CT plugged into the shield, and put an AC voltmeter across the burden resistor, then you'll see what sort of swing you're getting out of the CT.

chunyang's picture

Re: current sensor

i will try what you said appreciate first !

but i think i am using the wrong sketch, i am current running the sketch"single CT" as i have only only CT, but this sketch is not actually for the emontx shield. so the correct sketch for emontx shield that i am guessing should be"emontxshield _CT1234" but this one has the four CTs plugged in. so can i still using this code for one CT testing. 

the burden resistor you mean is the load(such as lihgt bulb, in my case i am using the 30ohms resistor instead for testing only), right? 

Robert Wall's picture

Re: current sensor

[Moved from a new thread]

Submitted by chunyang on Tue, 10/09/2013 - 13:58

i am using emontx shield and i have only one CT to use. i try to measure the current flow through the 30ohm resistor with the applied voltage 50v. the flow current would be about 1.5A . i set up the test and run the sketch "single CT" , however there is "zero" keep poping up on the serial monitor. so for my situation, am i suing the correct sketch for emontx shield just for measuring the current first and later will be voltage,power factor so on....

i have also looked at the code for emontx shield CT1234 but since it is for 4 CTs and as i mentioned that i am only using on CT so far.

chunyang: you are making it difficult by starting a new thread each time. Please use THIS thread then all of us can see the whole picture.

 

I think chunyang is using a wirewound mains dropper resistor as his test load, and running it at reduced voltage (50 V). He's not using the voltage yet so there should be no problem with this test rig.

The burden is the special name for the load for the current transformer, in this case it is a 33 Ω resistor on the Shield p.c.b. The c.t. is a current source - the current out of the secondary winding is proportional to the primary current. The burden converts that secondary current to a voltage suitable for the analogue to digital converter.

You will not get the standard emonTx sketches to work with the shield, because the inputs are different. The shield uses AI 0 for the voltage, AI 1 - 4 for ct inputs 1 - 4.  The emonTx uses AI 2 for the voltage, AI 3 for CT1, AI 0 for CT2 & AI 1 for CT3.

Use the sketch emonTxShield_CT1234 if you are not measuring voltage, or emonTxShield_CT1234_Voltage if you are measuring voltage with an AC-AC adapter. If you are not using CT 2, CT3 & CT4, near the top of the sketch you should change

CT2 = 1;  to  CT2 = 0;

CT3 = 1; to  CT3 = 0;

CT4 = 1; to  CT4 = 0;

If you have the standard emonTx Shield (you have not changed anything) then you should be able to read 1.5 A reasonably accurately.

chunyang's picture

Re: current sensor

i did what u told me. but without clipping anything on the CT why there is still reading. and i guess that the reading printed out on the serial monitor is the power instead of the current because in the sketch i didnot see code such as"serial.print(current)"

Robert Wall's picture

Re: current sensor

In line 55 you have:

EnergyMonitor ct1,ct2,ct3, ct4;

If you look at emonLib.h (and we know to look there because of  "#include EmonLib.h" in the line before) you see EnergyMonitor is defined as a class. In there "Public" means all the quantities listed can be used outside the class, the ones listed as "Private" can only be used inside. The one you are interested in is:

double calcIrms(int NUMBER_OF_SAMPLES, long refCal=1126400L);

calcIrms is  "method" - the same as a function in "C" - that does a calculation for us and returns a value.

In the sketch, line 55 makes 4 separate "instances" of EnergyMonitor called ct1, ct2, ct3 & ct4. You are only using ct1.

In line 95 you have:

if (CT1) {
    emontx.power1 = ct1.calcIrms(1480) * 240.0;       //ct.calcIrms(number of wavelengths sample)
                                                                                            //   * AC RMS voltage
    Serial.print(emontx.power1);                                       
  }

calcIrms( ... ) does the calculation and returns a value - the rms current in this case. To get the one associated with ct1, you write "ct1." in front of the name. Therefore, if you change that to:

if (CT1) {
     Serial.print(ct1.calcIrms(1480));
}

you will print the current.

If you want both current and power, you must invent a new variable to store the current, otherwise if you do calcIrms( ... ) again, you will read 1480 samples again.

if (CT1) {
     double Irms = ct1.calcIrms(1480);
     Serial.print("Irms = "); Serial.print(Irms);
     Serial.print("  Power = "); Serial.println(Irms * 240.0);        // If your voltage is 240 V
}

 

There will always be a small reading because electronic noise from the processor is picked up by the analogue input. It will get smaller when you add the voltage sensor and calculate real power.

calypso_rae's picture

Re: current sensor

chunyang: have you tried running the sketches that I mentioned a few days ago?  This will demonstrate whether your current and voltage sensors are working correctly or not. 

If you were to run MinMaxAndRangeChecker.ino and RawSamplesTool_4ss_2.ino from my Summary Page, and post the results here, I would hope to be able to guide you in the right direction.  Many constructors have found these tools to be helpful.  I regularly use them myself to check the operation of any new hardware.

chunyang's picture

Re: current sensor

thank you i will try

chunyang's picture

Re: current sensor

ok i will definitely try both of them so firstly i have to upload them to my arduino just like the normal sketch ?

calypso_rae's picture

Re: current sensor

Blimey, you are keen - it must be 4 am where you are now!

Yep, just upload those sketches and run.  If using the emonTx Shield, you will need to amend the pin allocations in the RawSamplesTool sketch.  The MinAndMax sketch is a generic tool for analog inputs 0 to 3, so should work fine as posted.

Comment viewing options

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