This document describes a proposed distributed power factor correction system and an automated power factor correction system design using a microcontroller. The proposed distributed system would install small power factor correction devices at the user level rather than just at substations. This would inject reactive power closer to the load to improve efficiency. The design uses an ATmega16 microcontroller to measure the phase angle between voltage and current using a zero crossing detector. It also measures the load current using an current sensor and ADC. Based on these measurements, it calculates the required capacitance and controls a capacitor bank to improve the power factor.