Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Harmonic value and Total Harmonic Measurement THD Using Micro-controller (Arduino)

Status
Not open for further replies.

Miteshdesai86

Newbie level 2
Joined
Aug 10, 2016
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
33
Hello

I am working on Project of AC power Analyzer Using Micro-controller (Arduino) , in which i need to Measure RMS Voltage , RMS Current , Active power, Reactive power , Power Factor and Harmonic value of 1st to 10Th Odd Harmonic and Last THD.

at present status I am Abel to measure RMS Voltage , RMS Current , Active power, Reactive power , Power Factor.

But i dont Know How To measure Value of Harmonic Like 3rd , 5th , 7th and THD.

I am converting 120 V ac signal to 0-5 V For Arduino / ADC and Doing Sampling of Analog signal in ADC

Bellow is logic/Program for That

Average power


Code C - [expand]
1
2
3
4
5
6
for (n=0; n<number_of_sample; n++){
  // inst_voltage and inst_current calculation from raw ADC goes here
  inst_power = inst_voltage * inst_current;
  sum_inst_power += inst_power;
}
Average_power = sum_inst_power / number_of_samples;





RMS Voltage / CUrrent


Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
for (n=0; n<number_of_sample; n++){
   // inst_voltage calculation from raw ADC input goes here.
    squared_voltage = inst_voltage * inst_voltage;
    sum_squared_voltage += squared_voltage; 
 }
 mean_square_voltage = sum_squared_voltage / number_of_samples;
 root_mean_square_voltage = sqrt(mean_square_voltage);
 
apparent_power = root_mean_square_voltage * root_mean_square_current;
 
power_factor = real_power / apparent_power;



Now Need Help for Calculating 3rd , 5th , 7th and THD.

Please Advise me How to do that.

Thank you
 
Last edited by a moderator:

Hi,

That´s the way to measure true values.
Good job!

******

what is your sampling frequency? Is it mad by a crystal oscillator?

You are measuring AC mains? What frequency?
What AC frequency range do you expect?

**
My idea:
Do some DFTs. It´s not that difficult as it sounds.
You need some lookup tables for calculated sine values...

But when AC frequency or sampling frequency is not stable, then it´s becoming more difficult.

****

Do you know there are special IC´s that help to do the calculations above? But not the overtones...

Klaus
 

IEC 1000-3-2 (limits for harmonic current emissions) defines conditions for harmonic measurements using DFT in appendix B.4. It assumes that the measurement window is synchronized to the mains period and an integer multiple of it.
 

My frequency is 60Hz and 120V signal

So Fundamental freq is 60Hz

Need to measure odd No of Harmonics 3rd at 180Hz, 5th at 300Hz ,7th at 420Hz 9th 540Hz

so maximun freq is 9*60hz = 540Hz

so According to Ni quest Criteria of Sampling Frequency , We need to take
Fs=2 * 540 Hz

Fs = 1080Hz

i am taking 2560 Hz Sampling frequency at 100ms Sample rate

Now What to do Next for Calculating Magnitude of Each Harmonic??

How to do DFT or FFT operation ??

can any one guide me

Thanks
 

Hi,

* In Europe and Germany DIN EN 50160 consider overtones up to the 25th harmonic...

* According nyquist 1080Hz is not enough. You need more than this.

*
i am taking 2560 Hz Sampling frequency at 100ms Sample rate
--> 2560 is no integer multiple of 100Hz, nor of 60Hz, you will have problems...

What about sampling clock source? And what about AC frequency range?

Klaus
 

I presume it's o.k. for a basic power analyzer project to restrict the analysis to e.g. 9th harmonic. Using a higher sampling rate than 1080 is however appropriate. I'm not familiar with Arduino libraries but assume a higher timer based rate should be possible.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top