# Calculating Power Factor Using ARDUINO UNO

Hello,

I am new in ARDUINO field. Can somebody please help me with the code to find power factor ?

That's a pretty common calculation. Why are you looking for something specific to Arduino?

Power factor ? What is that ? Does it have to do with the mains ? Perhaps you can find information at the openenergymonitor site : http://openenergymonitor.org/emon/

power factor ?

Of what?

steinie44: Of what?

could you please share with me arduino uno programming for calculating power factor........ input to the arduino will be current zero crossing and voltage zero crossing ( for this i use the zero crossing detector)....... both are square wave and have zero and one(e.g 5v). my load is three phase induction motor and i am working on single phase and control the rest of two with them.

If you know the delay between zero crossings of current and voltage you need only convert delay to phase difference in degrees or radians to calculate the power factor.

i have problem for finding power factor from zero crossing circuit through arduino i have achieve the voltage and the current signal through zero crossing detector now the problem is to calculate the delay between these two signal and calculate power factor from them pleas help me in this programing

Um, I think you need a Fast Timer to understand Phase shift, if you want a PF with 0.01 precision your timer will need 50Hz of main * 100 = 5 kHz.

In that timer you will increase a phase shift variable.

With the square voltage cross you will activate an interrupt that put to zero the phase shift variable for next evaluation.

With the square current cross you will activate an interrupt that evaluate the PF.

With 50 Hz main you will get a 100 max value. I think this is the phase shift so needs to be normalized to radians: (pi)*(phase_shift/100)

EDITED: you need (pi) and not (2pi) because you are using a zero crossing detector without knowing if that voltage or current is a positive or negative value

After calculate PF as cos(value_normalized)

Some suggestion? I hope it helps, if you are using it on a motor :)

Hello… I am new for arduino uno microcontroller. I am working on power factor correction of single phase inductive load. I need a code for power factor calculation, I am using zcd circuit for voltage and current.

timings gives you all you need to calculate the phase difference in radians, power factor is cos(phase_delay).

Hello sir actually i am working on TCR(Thyristor controlled reactor) so that i am also using peak detector to sense 90 degree bcz in TCR SCR will conduct in 90 to 180 nd 270-360 interval. so my question is that can i use 2 ZCD and 1 peak detector with arduino uno microcontroller...??

Also in this case when my load will pure inductive at that time my current wave will be not pure sine wave so at that time zcd's result would be wrong..!!

give me a suitable suggetions

Then you need to sample at a high rate and sum up the power and calculate total power, rms current and rms voltage. power factor = true_power / (rms current x rms voltage)

Thanks for your suggetion. bt In my project i am getting both the value of Vrms and Irms by using voltage and current sensing circuits but what about True power..?? How can i find it..?? Can you give me some coding of it..?

i want to calculate the power factor using ardino.i need the code for this.
thankyou

SathishNirmal: i want to calculate the power factor using ardino.i need the code for this. thankyou

What sensor hardware do you have, or are proposing to use?

SathishNirmal:
i want to calculate the power factor using ardino.i need the code for this.
thankyou

1. (a) Collect voltage zero-crossing point (VZC).

(b) Find current zero-crossing point (CZC).

1. Configure TC0 as T0 to start counting pulses (CLK/prescalaer) once interrupted by the VZC.

2. Let VCZ interrupt the ATmega328 via INT0-pin. TO starts counting.

3. Let VCZ interrupt ATmega328 vis INT1-pin. Stop T0 and read its count (Say, N).

4. Compute power factor (pf) from the following formula using N of Step-4.

pf = E8D4A51000H – C0C4H * N*N (N = Counts of T0 for the time equivalent to
phase difference between voltage and current waves.)
; expansion of cosTHETA (phase angle mapped to count, (10+E12 times amplified).

1. The attached file may be useful.

Puedo ayudar un poco a resolver el problema del fp pero el detalle es que soy nuevo en el foro y no se como subir la informacion o el codigo como tambien no puedo ver los codigos que ustedes sugieren oara hacer mejoras o analizar y ayudar en cuanto a las respuestas

Yo puedo ayudar en este circuito de medicion solo necesito un tiempo para familiarizarme con el foro todavia no lo entiendo.....mas bien necesito ayuda para subir codigos o descargar codigos para mejorarlos o simplemente para aprender mas

I have some problems on it. Now I have a project about measuring the current and voltage to calculate the power consumption of the device which is plugged in the plug. The restriction is that I can just install the sensors in the plug. I have a AC712 sensor to measure the AC current. However, to calculate the power consumption of the device (like fans), I need to measure the AC voltage to find the power factor. (power = Vrms*Irms*Cos(theta)) The problem is how to measuring the 110V AC voltage?