#### pete

##### Member level 2

**power factor pic**

Hi! Am trying to design a PIC-based power factor meter. My problem is how to detect which wave comes first. Say, I have two sine waves,one for voltage and the other for current. I can convert these 2 waves into pulses. How would the PIC detects which one of the two pulses comes first. I can get the difference in times to get the power factor but how would I know if the current leads the voltage or the other way around? That is, how would I know if the power factor is leading or lagging without knowing in advance the type of load.

Any help would be much appreciated.

Thanks a lot...