1 Introduction

Accurate power factor measurement from electrical energy is emerging topic to researcher because it distributes the electrical energy at reasonable cost. The cost of electrical energy increases due to power losses in transformer, transmission line and loads. Most of the loads are inductive where the current waveforms lagging the voltage. It consumes the reactive power which causes the real power to be less than the apparent power. The lower value of real power produces the poor power factor that can be used to measure the efficiency affecting by the phase lag [1,2,3]. A load with less power factor draws more current from the power line which is responsible for more losses.

The power factor directly relates to the system efficiency and performance. A large amount of load current results in lower voltage regulation of the system and provides a large joule loss in the power lines [4, 5]. The lower voltage level generates heat in the motor windings that reduces the lifetime, reliability and performance of the machine [6, 7]. The reduced system performance and efficiency generates poor value of power factor that results in increasing utility charge. The economic returns of the power factor can be easily noticeable in the lower utility charges. Another visible benefit of power factor is the released system capacity, decreasing line losses and improved voltage regulation. Though having lots of benefits of power factor, the power factor measuring device is not available with the range of consumers. With this in mind, the system introduces in this paper measures the power factor and plots a power diagram for further analysis. The proposed system also calculates the necessary capacitance needed to improve the power factor and improve it.

Fig. 1
figure 1

Basic block diagram of the proposed system

Figure 1 shows the basic block diagram of the proposed system. The system first converts the high value of load voltage and current to the proportional lower value. The conversion is done by using a PT of 20:1 trans ratio and a CT of 1:24 turns ratio. The output of CT and PT is fed into a comparator circuit designed with LM 311 IC, as shown in Fig. 2, for detecting the zero crossing. Its strobe terminal operation and low voltage handling capacity makes it possible to respond to the lower value of CT output. As a result, no additional amplifier circuit is needed between CT and comparator circuit. An X-OR gate is used in the proposed system for detecting the lagging time pulse and phase delay between the voltage and current. A precision full wave rectifier is used to convert AC to DC voltage and current. The output from rectifier is passed through the Arduino and measures the equivalent voltage and current. Arduino sends the data to the MATLAB through serial communication, and then the Matlab calculates active, reactive, and apparent power and plots a power triangle. The MATLAB also calculates the required capacitance value to improve the poor power factor to unity. In the case of improving the power factor, the system first estimates the necessary capacitance required to improve the power factor near unity. Three capacitors of values 5uF, 10uF and 20 uF are placed such a way that they can combine to form a new capacitance. A relay module performs the job of switching and combining the capacitors. After calculating the necessary capacitor value, the system searches for the minimum available capacitor and switch it.

Fig. 2
figure 2

A comparator circuit using LM 311

The rest of this paper is organized as follows. Related works are discussed in Sect. 2. Section 3 explains the problem formulation of power factor. In Sect. 4 the procedure of measuring power factor is described. The method of improving the power factor is expressed in Sect. 5. The experimental set up for proposed system is illustrated in Sect. 6. The experimental evaluation and cost analysis using the evaluated result is given in Sects. 7 and 8. This paper is concluded in Sect. 9.

2 Related work

Number of researches have been done to measure the power factor. In [8,9,10], a system is demonstrated which is used for measuring and correcting the power factor (PF). The system uses the required capacitance which is switched in or out by solid state relay and continuously monitors the PF. This system limits the application as a portable power factor meter. A PF measuring system based on Arduino is shown in [11] where the active power is calculated by taking the instantaneous value of voltage and current. It requires the high sampling rate. The higher sampling rate may cause sampling error, which affects the accuracy of measurement.

An ARM microcontroller based approach for monitoring the power factor is introduced in [12, 13]. The drawback of this approach is its high implementation cost. In [14] power factor control unit based on Arduino is presented where a fixed line frequency is assumed. Moreover, the power line frequency may vary within a small range. The variation of frequency may affect the calculation of the power factor.

Motivated by above difficulties, this paper presents a smart power factor metering system for measuring and improving the PF of load. The measuring of PF is done by using a controller which controls the variation of frequency of main line, while the number of capacitors on load terminal with relays decrease the utility charge by improving the measuring PF.

The contributions of this paper are as follows:

(i):

Design of a novel fractional order PF measurement unit that measures the accurate fractional frequency from the main line.

(ii):

Design of a high-speed differential strobe terminal base comparator that limits the use of the preamplifier circuit.

(iii):

Number of capacitors are used on the load terminal to improve the measured power factor which limits the use of variable capacitor that may increase the development cost and makes the bulky system.

The proposed system is able to eliminate the error due to rounding the frequency like 50 Hz. The aim of this work is to ensure the accurate PF by ploting a power triangle in the MATLAB environment. The power triangle is used to find the accurate PF by comparing the amount of power used in the load and consumed power from the transmission line.

Fig. 3
figure 3

Relation between the active, reactive and apparent power

3 Problem formulation

The power factor of the circuit \(\cos (\phi )\) is measured by taking the phase difference \(\phi\) between the voltage and current in an AC circuit. When the circuit is inductive, the current lags behind the voltage and the power factor is mentioned to as lagging. Most of the residential loads are inductive in nature and therefore have low lagging power factor. The power factor can also be calculated in terms of power drawn by the AC circuit. The ratio of active power to the apparent power is referred to as power factor. The relation between the active, reactive and apparent power is shown in Fig. 3 and discussed in (1), (2) & (3) as follows:

$$\begin{aligned} P&=V\,\times \,I\,\times \,\cos \left( \phi \right) \end{aligned}$$
(1)
$$\begin{aligned} Q&=\sqrt{ S^2-P^2 } \end{aligned}$$
(2)
$$\begin{aligned} S&=V\,\times \,I \end{aligned}$$
(3)
Fig. 4
figure 4

Strobe terminal base operation for comparator of Fig. 2

Fig. 5
figure 5

Phase angle generation using the time delay between the voltage and the current

For measuring the phase angle, the sinusoidal output from CT and PT are fed into two different comparator circuit. LM 311 is chosen to make a comparator circuit as shown in Fig. 2 because of its strobe terminal operation and faster response time of 165 nS [15]. The result from strobe terminal acts like a switching output and connecting between a voltage source \(V_+\) and ground. When the strobe switch is open, the LM 311 operates normally and gives the positive output voltage \(V_+\) for negative values of the input signal and 0 V for the positive values as reported in Fig. 4.

Figure 5 presents the phase angle generation using the time delay between the voltage and the current. A simulation result with the input and output wave shape of comparator circuit is presented in Fig. 6. Here the sinusoidal output of channel A shows the input wave shape and channel B shows the output of the comparator circuit. From Fig. 5, it is observed that the comparator generates an output of +5 volt for every negative value and returns 0 volts for the positive value of input wave. The switching outputs are passed through the X-OR gate to detect the time delay between the voltage and current. This logic gate detects the inequality between two pulses and generates another pulse. The on time of this pulse denotes the time delay between the voltage and current.

Fig. 6
figure 6

Comparators output of Fig. 2

Power factor improvement refers to the technology that recuperates the power factor close to unity as it is economically viable. This is performed by the addition of capacitors in parallel with the load which recompenses for the reactive power of the inductive load and therefore decrease the freight on the supply. The capacitors in the power factor improvement system draw a current that leads over the voltage and generates the leading power factor. The leading capability of capacitor decreases the lagging power factor proportionately in the circuit that results in improve the overall power factor for the load. In Fig. 7, S1 shows the apparent power before power factor improvement and S2 shows that afterward where S1 leads the S2. Here, Qc is the reactive power supplied by the capacitor.

Fig. 7
figure 7

Relation of lagging phase angle for power factor improvement

4 Power factor measurement

This section presents the brief discussion of the power factor measurement by using phase difference between the voltage and current of an inductive load. The phase difference is obtained by measuring the time delay with the help of Arduino board. After measuring the time delay, the phase difference between the voltage and the current is measured. The relation between the time delay and the phase difference is described by the following equations:

$$\begin{aligned} \phi _D&= 2\,\times \,180\,\times \,f\,\times \,T_D\,\times \,10^{-6} \end{aligned}$$
(4)
$$\begin{aligned} \phi _R&= \frac{\pi }{180}\phi _D \end{aligned}$$
(5)

Here, \(\phi _D\), Phase difference in degrees; \(T_D\), Time delay in μS; f, Frequency in Hz; \(\phi _R\), Phase difference in radians.

Fig. 8
figure 8

Flow chart for power factor measurement

A flow chart of the programme for measuring the power factor is shown in Fig. 8. The time delay between the voltage and the current is measured using the pulseIn() function of Arduino. The process of the pulseIn() function is that it waits until the rising edge of X-OR output is detected. While detecting the signal from low to high, it stocks the time in its memory using the function micros(). After that, a recursive function is called which call itself again and again until detecting the falling edge. If the signal goes low, it deducts the current time from the starting time. This process returns the on-time duration of the pulse. Based on this on-time duration, the power factor is then evaluated using (4) and (5). After that, taking the cosine of the phase angle and returns the power factor. The obtained power factor is then put in (1) and calculates the required active power for the load. From (1), it is seen that the load voltage and current also needs to be measured in order to calculate the active power. The proposed system is able to measure the load voltage and current. The measurement process of load voltage and current is discussed in the next section.

Fig. 9
figure 9

A precision circuit diagram of full wave rectifier

4.1 Voltage measurement

For measuring the voltage across the load, the output from the potential transformer is given to a rectifier circuit. A precision full wave rectifier circuit as shown in Fig. 9 is chosen for the rectification purpose.

The rectifier circuit excludes the additional voltage drop across the diode and rectifies low value of AC signal by adding the large gain of OP-Amp. A voltage divider is employed to convert the high value of DC signal into Arduino compatible form. The ratio of Arduino input to the total DC voltage is 0.4166 used for the proposed system. As the Arduino uses 10-bit ADC, it gives 0–1023 (1024 steps) for a 0–5 V input. After using this step, the Arduino calculates the load voltage by using the following equations:

Fig. 10
figure 10

Flow chart for load voltage measurement

$$\begin{aligned} V_{DC}&= \frac{{\hbox {ADC}}_{\mathrm{reading}} \times 0.00488}{0.4166} \end{aligned}$$
(6)
$$\begin{aligned} V_{RMS}&= \frac{\pi \times V_{DC}}{2 \sqrt{2}} \end{aligned}$$
(7)
$$\begin{aligned} V_{load}&= V_{RMS} \times N_{PT} \end{aligned}$$
(8)

Here, \(V_{DC}\), Rectified DC voltage; \(V_{RMS}\), RMS value of AC voltage at PT secondary; \(V_{load}\), Load voltage; \(N_{PT}\), Transformer ratio of PT.

A flow chart of the programme for AC voltage measurement is reported in Fig. 10. For measuring the AC Voltage, Arduino waits for the voltage pin to go high. When the voltage pin goes high, the programme starts sampling for 1000 times. This is done by using a “for” loop. Inside the “for” loop, the programme samples the analog input from the rectifier circuit and stocks it into the memory. When the “ for” loop is executed, the average value is computed by summing all the sampled data and dividing it by 1000 for obtaining the \({\hbox {ADC}}_{reading}\). After completing this step, the load voltage is calculated by using (6)–(8).

4.2 Current measurement

A current transformer (CT) of 1:24 turns ratio is used to obtain the high value of load current. As the output of CT is a current signal, it converts the current signal into a voltage signal. The required conversion is done by adding a 100-ohm resistance at the secondary windings of the CT. The converted signal is applied to the full wave rectifier circuit. Arduino reads the voltage in the similar way used in voltage measurement and calculates load current by using the following equations:

$$\begin{aligned} V_{DC}&= \frac{{\hbox {ADC}}_{\mathrm{reading}} \times 0.00488}{0.4166} \end{aligned}$$
(9)
$$\begin{aligned} V_{RMS}&= \frac{\pi \times V_{DC}}{2 \sqrt{2}} \end{aligned}$$
(10)
$$\begin{aligned} I_{RMS}&= \frac{V_{RMS}}{100} \end{aligned}$$
(11)
$$\begin{aligned} I_{load}&= I_{RMS} \times N_{CT} \end{aligned}$$
(12)

Here, \(I_{RMS}\), RMS value of AC current at CT secondary; \(I_{load}\), Load current; \(N_{CT}\), Transformer ratio of CT.

Fig. 11
figure 11

Flow chart for frequency measurement

4.3 Frequency measurement

The transmission line frequency is not exactly 50Hz in an ideal case. It may vary between 49 to 51 Hz. Thus, for better accuracy, the measurement of frequency is needed rather than assume it. The output of the comparator circuit is directly fed to the Arduino. Arduino then measures the on-time duration of the pulse output from the comparator circuit using pulseIn() function. The time period of the original sinusoidal signal is twice the on-time duration of that pulse. This duration is then converted into frequency using the below equations:

$$\begin{aligned} T&= t_{on} \times 2 \end{aligned}$$
(13)
$$\begin{aligned} f&= \frac{1}{T} \end{aligned}$$
(14)

Here, \(t_{on}\), On time duration of comparator pulse output; T, Time period; f, frequency.

Fig. 12
figure 12

Frequency measure using frequency counter

A flow chart of the frequency measurement is shown in Fig. 11. The flow chart is similar as the power factor measurement except that the input of the programme is given from the output of the comparator. After measuring the on time of the comparator output as discussed in the power factor measurement section the frequency is then calculated from the Eqs. (13) and (14). The actual measured frequency of power line is presented in Fig. 12.

5 Power factor improvement

In this section, the procedure of power factor improvement is presented. At the beginning of the power factor improvement the system first decides if the power factor is less than 0.9. If the condition approves, the system then calculates the KVar rating of the capacitor and then the uF rating using the Eqs. (1) and (2).

$$\begin{aligned} T_1&= \cos ^ {-1} \left( PF\right) \end{aligned}$$
(15)
$$\begin{aligned} T_2&= \cos ^ {-1} \left( PF_D\right) \end{aligned}$$
(16)
$$\begin{aligned} KVar&= P \times \left( \tan \left( T_1\right) -\tan \left( T_2\right) \right) \end{aligned}$$
(17)
$$\begin{aligned} C&= \frac{KVar}{2 \times \pi \times f \times V_{load}^{2}} \end{aligned}$$
(18)

Here, PF, Current power factor; \(PF_D\), Desired power factor; C Calculated capacitance.

Figure 13 presents the flow chart of the power factor improvement where the required capacitance is calculated for improving the power factor. After successfully calculating the capacitor value, the proposed system applies the minimum available capacitor across the load terminal. Three relays R1, R2, R3 are employed to switch the available capacitor across the load terminal which identify the minimum capacitance value for accurate power factor. The relay logic and the available capacitor value is listed in Table 1. Here, the value 1 and 0 represents the “ON” and “OFF” state of relay respectively.

Fig. 13
figure 13

Flow chart for the power factor improvement

Table 1 Field test of required capacitor value using GPS units with relay module

6 Experimental setup

This section presents the experimental setup for measuring the power factor as shown in Fig. 14. The setup consists of a power board, frequency counter, computer, oscilloscope, potential transformer and load. A 200 W hair drier is used as an inductive load which contains a motor that shows dynamic behavior along with the time. The function of frequency counter is to measure the actual frequency of main line. A computer is used for plotting the power triangle curve with the help of MATLAB that provides the support of analyzing of power factor. The wave shape of voltage, current, and time difference are observed in an oscilloscope. The performance of proposed system is evaluated by comparing its output and the measuring instrumental output.

7 Performance analysis

Fig. 14
figure 14

Experimental set up for power factor measurement

7.1 AC power measured by the measuring device

Fig. 15
figure 15

Generation of pulse wave using high differential comparator

Fig. 16
figure 16

Experimental output of the proposed system

The power factor, frequency, and the AC power are first measured from the instrumental data. The performance of the proposed system with an inductive load is verified in Fig. 15 and Fig. 16. Here, the channel-1 (yellow wave) presents the voltage wave and channel-2 (blue wave) presents the current wave. From Fig. 16, it is seen that the time delay between voltage and current is 2.96 ms. The frequency counter gives the accurate line frequency value of \(50.41\,{\hbox { Hz}}\) as shown in Fig. 12 and the phase difference between voltage and current is \(53.716^\circ\) obtained from (4). After collecting the instrumental data and finishing some calculations, the system obtains some parameters, as shown in Table 2.

Table 2 Quantitative measurement using the conventional system

7.2 AC power measured by the system

The obtained results displays on the computer screen where the actual AC power for power factor is calculated by using the proposed system. The MATLAB in proposed system plots a power triangle which is shown in Fig. 17. Here, The green, blue and the red line presents the active, apparent and reactive power respectively. The other calculated parameter is also displayed on the MATLAB command window. Table 3 presents the obtained parameters measured by the proposed system.

Fig. 17
figure 17

Power triangle curve generated using measured data from MATLAB

Table 3 Quantitative measurement by the proposed system

After comparing the results, it is observed that the proposed system is able to ensure the required power needed to the load. The proposed system also meets the accurate utility charge within the reasonable range by calculating the appropriate power factor.

7.3 Power factor corrected by the system

Figure 18 displays the experimental setup of the power factor improvement system. Three capacitors C1, C2 and C3 are connected in parallel on the load terminal through the relays. The function of relay is to switch capacitor value during the operation of load. It also ensures the minimum required value for the running of load.

Fig. 18
figure 18

Experimental set up for power factor improvement

In Fig. 19, the waveforms of the voltage, current and the power is presented after the power factor improvement. The yellow wave shape of the channel represents the voltage, where the white wave shape denotes the current. It is observed that the current is lagging the voltage which originates the lagging power factor. By performing the math operation, the instantaneous power wave shape can be visualize on the oscilloscope. The red wave shape denotes the instantaneous power. The negative portion of instantaneous power may be omitted because the current lagging the voltage where the power is always considered as positive value.

Fig. 19
figure 19

Experimental improvement results using the proposed system

8 Cost analysis

In this section, the savings from the developed system for an inductive load is analyzed. The optimal design of the power factor improvement system saves money and enhances the utilization of electrical energy. Power factor improvement system recompenses the consumed reactive power and consequently reduces the transmission losses. Most of the cases the consumers need to pay an additional surcharge for the non-usable reactive energy or pays the bill for the apparent electric power.

Fig. 20
figure 20

Comparison of KW-h consumed at different power factor

In this analysis, the size of the power factor improvement unit is selected by considering a 250 W domestic inductive load. This load is assumed to run at 220 volts. The system first calculates the reactive power required to improve the power factor to 0.9. At this stage, the end users are not additionally charged with oscillating reactive power. Following this, the required capacitance is calculated and the minimal available capacitance is connected in parallel to the load. The added capacitance supplies the capacitive power which compensates the low power factor.

A comparison of KW-h consumption, between the corrected and uncorrected power factor with the KW-h savings is illustrated in Fig. 20. From the result, it is seen that the KW-h savings is more if the load operates with a very low power factor. The charge of the grid and the end user infrastructure is gradually reduced with the increment of the power factor. By assuming the 8 BDT of per unit charge of apparent power, the reactive power to improve the power factor, the required capacitance, the added capacitance to proposed, and the monetary savings are tabulated in Table 4.

Table 4 Monetary savings at different power factor

A break-even analysis is shown to obtain the time needed to start making a profit from the proposed power factor correction metering system. The biggest challenge of the system development cost is to estimate which is 1100 BDT approximately. The break-even analysis is shown graphically in Fig. 21. WIth this fixed installation cost, the system needs to provide 540 h of service with 0.4 PF to make a profit. The profit-making takes a longer time for 0.5 PF. From the break-even analysis, it is manifested that the economic outcome of the system is achieved shortly for a comparatively lower power factor.

Fig. 21
figure 21

Break-even analysis of the system

A comparison table between the earlier reported approaches and proposed strategy is added based on frequency measurement, PF correction, cost analysis, power triangular visualization, methods implementation complexity in Table 5. References [8,9,10,11,12,13,14] has been provided the methodology to correct the PF. These papers have not investigated the other parameters. Frequency measurement, PF correction, cost analysis, power triangular visualization are the main contribution of our paper with respect to the others. It also reduces the utility charge and complexity as compared to the existing system as shown in Table 5.

Table 5 Comparisons between the existing work and the proposed system

9 Conclusion

A design of high differential strobe terminal based smart power factor correction metering system is presented in this paper for measuring the power factor of an inductive load. This is done by measuring the load voltage, current and time delay between the voltage and current. In many cases, the variation of line frequency limits the calculation of accurate power factor that may result in higher utility charges. The proposed metering system is able to measure the accurate line frequency and find out the appropriate power factor with higher saving of utility charge. The experimental results are used to proof the validation of proposed system. The obtained result confirms the high effectiveness of proposed system.