power factor measurement using pic microcontroller http://microcontrollerslab.com/power-factor-measurement-using-microcontroller/