I am working on AC Ammeter. To sense the current a current transformer is used which has 2500 Turns and sensing range up to 50A.

200 ohm Burden Resistor is used between the Ground and the Output Pin of Current Transformer.

I have previously worked on AC voltmeter and it worked fine and I used the same way to sense the current. As OUTPUT of current transformer is Sine wave, so I used RMS method to take out the value.

Here is what I have done :


     if(adc_data_index >= ADC_BUFFER_LENGTH )
            adc_data_index = 0;

            // Time to Process and Display Data
            adc_buf_local = 0;
            adc_filter_val_current = 0.00;
            for(i=0; i<ADC_BUFFER_LENGTH; i++ )
                adc_buf_local = adc_data[i];
                adc_filter_val_current += ((float)(adc_buf_local*(float)adc_buf_local ));
            // 625*625 = 390625
            // 128*128 = 16384
            // 625^2 / 128^2 = 23.8414
            adc_filter_val_current = (unsigned long)((float)adc_filter_val_current * 23.84);
            adc_filter_val_current /= ADC_BUFFER_LENGTH;      // mean squared sum
            adc_filter_val_current *= 2; //To even Negative Pulse
            ac_value_current = (float)sqrt(adc_filter_val_current);// root mean square
            ac_value_current /= 1000;    

What am I missing?

  • \$\begingroup\$ Unless the current transformer manufacturer really REALLY specifies it can be that high, 200 Ohms is a very high burden resistor value. And, the resistor should be directly across the CT terminals. I'd probably start with 2 ohms and see how that works. \$\endgroup\$
    – R Drast
    Dec 5 '17 at 10:29
  • \$\begingroup\$ The circuit is already made and working fine with another microcontroller and I am just replacing the controller with Low-cost one and writing code from scratch. \$\endgroup\$ Dec 5 '17 at 10:35
  • \$\begingroup\$ What are you missing? Test inputs, predicted output and actual test output for a start. \$\endgroup\$ Dec 5 '17 at 11:47

adc_filter_val_current *= 2; //To even Negative Pulse; this doesn't make sense, given that ADC values over a full cycle of the wave are peak to peak.

As you are sampling Voltage over time then averaging the ADC readings (your for loop ) and dividing by the resistor value should give you the instantaneous current.

However, again depending on sampling rate, you could measure the current over 1 full cycle with a zero crossing detector. Easy enough to do in code, as you do know what bit value, zero volts AC is. At which point you could either calculate the peak current or RMS current.

  • \$\begingroup\$ Negative half cycle is clipped using diode, so if we calculate the rms of this clipped signal, we will get half the value of real rms. So to compensate that, multiply by 2 is used. Assuming that negative and positive cycle are exactly similar. \$\endgroup\$ Dec 5 '17 at 14:32
  • \$\begingroup\$ Don't see the reason for the negative score for you not providing this information in the first place. So you are half wave rectifying before you take measurements. If you are going down that route and not sampling the full cycle, wouldn't it be better to full wave rectify first, given your samples stand a 50% chance of reading 0, depending on sample rate. \$\endgroup\$
    – LateDev
    Dec 6 '17 at 1:03

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.