Continue to Site

Welcome to

Welcome to our site! 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.

calculation of power factor

Not open for further replies.


Member level 4
May 19, 2010
Reaction score
Trophy points
Chennai, India
Activity points
hello every one
i am doing a project for power factor correction using 8051 microcontroller, it will calculate the power factor and will correct the power factor accordingly by switching on and off capacitor banks. but i dont know how to calculate power factor in real time. can any one help me on this?

---------- Post added at 10:39 ---------- Previous post was at 09:32 ----------

hello every one
can somebody help me

---------- Post added at 11:56 ---------- Previous post was at 10:39 ----------

hello every one
is there no one to help me

measure time between zero crossings of voltage and current using a zero crossing detector. The output from zero crossing detector can be used trigger interrupts in 8051


At least to me, still is not clear if you are concerning to control PF at input of SMPS, or to control PF at output of Inverter.


power factor can be given by the equation . . . . .
Power Factor Pf= Cosθ = KW/KVA
where ,Real Power (KW), Complex Power (KVA)

Try this link
**broken link removed**
**broken link removed**
andre_teprom i am trying to reduce pf at the output .so pf = apparent power/real power. but i don't know how to measure real power and apparent power. i think we can get apparent power by multiplying voltage and current in the circuit but what about real power? can you help me?

---------- Post added at 05:51 ---------- Previous post was at 05:49 ----------

hai demetal
how to measure real power and apparent power ? can you help me?

I'll assume the following:
1.) you have a sampling system.
2.) you can sample voltage and current.
3.) you have synchronized the sampling system to the line frequency.
4.) you are only concerned with fundamental power factor.

in this case, you can determine power factor from the classic equations above. you can take several samples from voltage and current and find the sum of v(0)*i(0) + v(1)*i(1) + ... + v(n)*i(n) to find real power. you can use sqrt(v(0)^2 + ... + v(n)^2) * sqrt(i(0)^0 + ... + i(n)^2) to find apparent power.

keep in mind the following:
1.) the above only works for specific lengths of data.
2.) it only works for synchronized frequencies.
3.) it may be affected by elements at non-line frequencies.

The reason is because the operation is essentially a decimating FIR filter on a signal A + A*cos(2t). the filter's rejection of the double-frequency component is critical. the standard moving average works when the filter length is the same as the cycle length, as this places a zero at this double frequency component. however, off-frequency signals or different filter lengths correspond to the case where the filter length is not the same as the cycle length. The filter no longer provides the high attenuation of the double frequency component. as a result, the measurement will not be correct in most cases. Likewise, the design is fairly broadband, so it is possible that harmonics on the line will also be included. The error in the equation is based on the filter length in cycles. eg, if 60 cycles of data is analyzed, the effects of being off-frequency or analyzing slightly more/less data will be small. if one cycle is analyzed, then the error due to being off-frequency might be unacceptably high. This first case has a long delay and would be less suitable for real time control. the latter is more suitable for the slow but not very slow outer control loop used in power factor control.

Try searching: power measurement IC

Multiplying V and I gives the real power.

In the past, I used an analogue mutiplier IC (MC1494) to measure the real power that my PC (old one) needs (since its current is not continuous). This gave me a good idea on the power that I should consider when I was designing a suitable 24Vdc-220Vac inverter for it.

Last edited:


The only way I know is measuring phase drift.
The system must be capable to detect some reference point ( for instance, zero crossing ) to perform that.

Maybe there are some other technique, but I don´t know.


Read the synchronous reference frame theory.. this is best to calculate power factor in real time. you can find IEEE papers or some material in google.

Not open for further replies.

Part and Inventory Search

Welcome to