At 02:07 PM 19/11/2012, you wrote: >Current project is an AC volt/amp/power/power factor meter using an >18F2620. It is a for-fun project. > >I digitize one complete cycle of the 60 Hz voltage and current waveforms >using the ADC, saving 256 8-bit samples. >I compute RMS voltage and current, and power factor by calculating the >phase shift. Life is good. > >But just for fun, I want to be able to calculate the power factor for >non-linear loads, such as a switching power supply. > >From what I have read, I need to determine the harmonic content of the >current waveform. Hi, Larry:- Power factor is just P/(Vrms*Arms). If you are calculating average power P correctly (the integral of v(t)*i(t) over a period) then I think you just need to do the same for v(t)^2 and i(t)^2 and crunch those three numbers with a multiply, sqrt and divide. --sp --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .