# Zero Crossing Detector

Hello guys,

I am Sudarshan HT from Bangalore, India. I am working on a project on Thyristors and one of the things that I am working on is finding out the Power Factor of the circuit which has a bulb load. In order to find the power factor I need to find the Zero Crossing of both the voltage waveform and the current waveform. After this I will be able to find the phase difference and then the Power Factor.

Project Specifications:

Voltage Input - 415V which is stepped down to 5V before sending it to the Arduino.
Current Input - Given through a Current Transformer
Arduino - Arduino Mega 2560
The input is level shifted and is given to the Analog Pins A0 and A1.

Can anyone help me with the Zero Crossing Detector Code?

Thank you.
Sudarshan HT.
+91-8105401569.

sudarshanht:
In order to find the power factor I need to find the Zero Crossing of both the voltage waveform and the current waveform. After this I will be able to find the phase difference and then the Power Factor.

Eh, I don't know if finding the PF based on zero crossing is the best idea. The problem is that if you have a non-linear load, your waveform's zero crossings won't give you an accurate PF reading. What you need to do is compare when your voltage and current waveforms reach their peak values. The time difference between their peak values will give a better measurement of PF.

Can you please give me the code for the same, in case you have one.

Thank you.
Sudarshan.

For non-linear load, the the effective PF is usually computed in the following ways:

1. Compute Real Power by integrating vi over the period T and then dividing by T..
This requies sampling of the voltage and current waves.

2. Compute VA by sampling method.

3. PF = Real Power/VA

4. For situations where voltage-current waves are clean, we may follow the procedure of the attached
file for computing PF.

sudarshanht:
Hello guys,

I am Sudarshan HT from Bangalore, India. I am working on a project on Thyristors and one of the things that I am working on is finding out the Power Factor of the circuit which has a bulb load. In order to find the power factor I need to find the Zero Crossing of both the voltage waveform and the current waveform. After this I will be able to find the phase difference and then the Power Factor.

When you have thyristor switching the zero crossings are not useful to calculate power factor since that
only works for sinusoidal waveforms.

Power factor is actual power / (rms current x rms voltage)
For switched waveforms you need to measure true rms current, power and true power.

Only if the waveforms are pure sinusoids can you use amplitudes and phases as proxy measurements
for this.

Hello Mark,