Power Factor (PF) correction is a major power quality function in electrical distribution systems. This paper proposes a low-cost Automatic Power Factor Correction (APFC) system to increase the PF of both lagging and leading single-phase loads. The Arduino Mega 2560 microcontroller was used to calculate the PF and activate the relays that connect the capacitor/inductor banks to the load in parallel. Thus, the required capacitive or inductive reactive power was produced by the APFC system by automatically connecting the capacitor/inductor banks to the load in parallel. The APFC system can also measure and display many electrical parameters of the load such as the rms voltage, the rms current, PF, and the real, reactive, and apparent power on an LCD display. Two zero-crossing detector circuits are used to find the phase angle difference between voltage and current waveforms of the load. The measurement ability of the APFC system was tested for resistive, inductive, and capacitive loads with two different sizes. The measurement results were compared with the measurements of a commercial digital power meter and a measurement error of less than 8.0% was observed. The PF correction ability of the APFC system was verified for inductive and capacitive loads with two different sizes. The experiments show that the PF increased to close to unity for both lagging and leading loads.