You are on page 1of 84

Republic of the Philippines

University of Antique
COLLEGE OF ENGINEERING AND ARCHITECTURE
Sibalom, Antique

CHAPTER 1

INTRODUCTION

1.1 Background of the study

Power quality and efficiency are still a concern of certain individuals in

the world of power sector. Increasing the use of inductive loads generate

lagging currents that result into poor power factor of an electrical system. In

most system, a poor power factor is often overlooked, but if an electrical

system has a poor power factor, it will draw higher current than an electrical

system with a power factor close to unity. This might be a cause of losses,

decrease in efficiency and low quality of electricity.

Higher currents can also result into voltage fluctuation that could

shorten the life span of an equipment sensitive into voltage fluctuation.

Isolating heavy inductive loads and connecting a microcontroller based power

factor improvement with voltage monitoring is the proposed solution. This

study will be useful for this study will improve the power factor which at the

same time monitor the voltage and alert the end user when voltage fluctuation

occur.

The current device used in monitoring and improving power factor

available in the market are too expensive. In this study, the researchers will

design and construct a device which is easy to assemble and cheaper than

what is available in the market.

1
The researcher will also investigate the use of the said microcontroller

to monitor the voltage and power factor of electricity. To improve the poor

power factor by switching capacitor in parallel with the line supplying

inductive loads. Four capacitors will be used, each capacitor is connected

into separate relay to improve the power factor of an electrical system. This

research will try to help solve the above mentioned problem. Which would

create a good quality of electricity for an equipment, gadgets and all other

electrically operated machines especially those which are using inductive

loads to maintain your machines in good conditions and extend their life

span.

1.2 Objectives of the study

This study aimed to construct a portable device which will help improve
the power factor of an electrical system focusing on inductive linear loads and
also alert the user about voltage fluctuation.

Specifically, it aimed to monitor the power factor, current, voltage and


reactive power; minimize the excess current drawn by a poor power factor
electrical loads; alert the user about the status of power factor and voltage
fluctuation; and evaluate the performance of a microcontroller-based power
factor improvement and voltage monitoring system as to its functionality,
usability, reliability, efficiency and maintainability.

1.3 Significance of the Study

The device in this study will be beneficial to the following:

2
1. End-user-of electricity

The end user will benefit on the device constructed in this study for

once the power factor of electrical system was improved, the current drawn

by the long line which supplies the inductive loadings will be reduced. This

means that it will free up some more capacity into the system then increase

the efficiency and quality of an electricity. This is a big factor in maintaining

their equipment’s condition and longevity for it decreases the voltage drop of

the system which reduce the fluctuation. This will be more economical in the

part of the end-user.

2. Distribution Utilities

The device in this study can be used as a power factor correction in the

distribution system. The improvement of the power factor from the load side

of every end user free up some capacity in the transformer that supplies

electricity to the residential units. Lowering the current supplied by the

transformer will decrease losses in the system, and improvement of power

factor is cost economic because it reduces the parameters used to follow the

rating of the equipment. Thus, distribution utilities will no longer install

higher capacity transformer.

3. Facilities with heavy inductive loads.

If an electrical system in a certain building sometimes experienced

voltage fluctuations, it might be caused by greater voltage drop in the main

3
line supplying the building due to high current running through those long

cables. Power factor improvement reduces current drawn by poor power factor

circuit. This study could somehow correct a power factor to reduce voltage

fluctuations.

1.4 Scopes and Limitation

This study aimed to construct a device that could be able to provide

power factor improvement and voltage monitoring for which load it is

connected. The status (Voltage, Current, Reactive Power and Power Factor)

will be displayed in the liquid crystal display (LCD) Module and the user of

the system will be notified via SMS about the power factor or if there is a

voltage fluctuation in an electrical system.

This device focused only on 230VAC, 60 hertz (Hz), Single-phase

electrical system where the maximum current drawn is 10A. The triggering

reactive power will depend on the individual capacitance of the capacitor. This

would mean that if the reactive compensation of the smallest capacitor is 240

volt-ampere reactive (VAR), the system need to detect at least 240VAR of

reactive power before the first capacitor is connected into the line. This system

should be able to compensate at most 2kVAR of reactive power from inductive

loads.

The device focused on improving the poor power factor of a 1.5 horse

power (HP) AC kenzo capacitor start motor type YC90L-4. In this study,

Improvement of the power factor was done by connecting four capacitor in

4
parallel with the line supplying inductive loading. Then the system notified

the user via global system for mobile communication (GSM) when both the

power factor was not in the range programmed in the device and when the

reactive power must at least meet the reactive compensation that can be

supplied by the smallest capacitor.

This device will be initialized around 5-7seconds for the GSM to register

to a network. However, this device is not capable of sending short message

service (SMS) when the user is out of reach and/or the Subscriber Identity

Module (SIM) Card in the GSM module has not been loaded. The mobile

number of the recipient will be pre-installed during the programming.

The monitoring of voltage and power factor will be done by PZEM-004T

with monitoring capability with voltage (ranging from 80-260VAC), current

(ranging from 0-100A) and power (22 kilowatts (kW)). The amount of

capacitor to be switched will be determined by the equation programmed in

the microcontroller.

This portable device is capable of notifying the user if a voltage

fluctuation occurred and or if the power factor was not within the range

programmed in this device. It is not designed to constantly send an SMS to

the user about the current voltage or the power factor. The power factor

improvement of this device also depends on the amount of reactive power is

needed.

5
Due to the limitation in the rated capacitance of the capacitors the

minimum reactive power needed to be improved must be at least 240VAR at

230VAC (Changes in voltage may vary the reactive compensation of each

capacitor). Thereby, this device is suitable for inductive loads whose reactive

power is above 240VAR. The power factor improvement of this device depends

on the reactive compensation of the power factor correcting capacitor and the

reactive power consumed by the load. The closer the reactive power of the

load to the reactive power compensated by the device the better the

improvement will be

This device will be enclosed with a portable and metal casing to protect

the system from any natural disturbances and also to ensure the safety of the

user as the casing could be grounded. Any interference caused by magnetic

waves is not a concern of this study. It could be a subject for future studies.

Signal interruption is also a hindrance for the proper communication of the

SMS. In case of power interruption, there is no need for the system to work

since there is no power factor to improve and no voltage to monitor.

6
1.5 Conceptual Framework

Input Process OUTPUT

Knowledge Requirement

1. Arduino Programming

2. Power Factor
calculations

3. Reactive power
Design
calculations

4. Construction works

Software Requirements

1. Arduino IDE

Hardware requirements
Microcontroller Based
1. Microcontroller Power Factor
Fabrication improvement with
2. AC Power Monitoring
Voltage Monitoring
Module

3. LCD module

4. Relay Module

5. Capacitors

6. GSM module

Material Requirement Evaluation

1. Soldering Iron

2. Multimeter

3. Wires

4. Bolts

5. Screw Drivers, etc.


7
1.6 Definition of Terms

For the purposes of better understanding and clarification of the

study the following terms are defined.

Active Power, refers to the power which is actually consumed or

utilized in an AC Circuit is called True power or Active Power or real power.

It is measured in kilo watt (kW) or MW. It is the actual outcomes of the

electrical system which runs the electric circuits or load.

Apparent Power, refers to the product of root mean square (RMS)

value of voltage and current is known as Apparent Power. This power is

measured in kVA or MVA.

Arduino Uno, refers to an open-source electronics platform based on

easy to use hardware and software.

Current, refers to the flow of electrical charge carriers like electrons.

Current flows from negative to positive points. The SI unit for measuring

electric current is the ampere (A). One ampere of current is defined as one

coulomb of electrical charge moving past a unique point in a second.

Electricity, refers to the presence and flow of electric charge. Its best-

known form is the flow of electrons through conductors such as copper

wires.

8
Electrical systems, refers to the groups of electrical components

connected to carry out some operation.

Electric Power Quality, refers to the steadiness of voltage.

GSM SIM800l, refers to the SIM800L module supports quad-band

GSM/GPRS network, available for GPRS and SMS message data remote

transmission.

Inductive loads, refers to an electrical loads that resist changes in

current and as such, when you measure the current, it lags (is behind) the

voltage.

Linear Loads, refers to an AC electrical loads where the voltage and

current waveforms are sinusoidal. E.g. Motors, Inductors etc.

Load, refers to an electrical components or portion of a circuit that

consumes electric power.

Power Factor, refers to the ratio of the real power flowing to the load

to the apparent power in the circuit.

Pzem-004t, refers to an electric monitoring test module with a

current transformer and USB adapter. The module can be used to test

power, energy, voltage as well as current, and then display on a PC or other

terminals.

9
Reactive Power, refers to the power which flows back and forth that

mean it moves in both the direction in the circuit or react upon itself, is

called Reactive Power. The reactive power is measured in kilovolt ampere-

reactive (kVAR) or megavolt-ampere (MVAR).

Root Mean Square (RMS), refers to the RMS value is the square root

of the mean (average) value of the squared function of the instantaneous

values. The amount of AC power that produces the same heating effect as

an equivalent DC power.

Relay, refers to an electrical device, typically incorporating an

electromagnet, that is activated by a current or signal in one circuit to open

or close another circuit.

Voltage, refers to the pressure from an electrical circuit's power

source that pushes charged electrons (current) through a conducting loop,

enabling them to do work such as illuminating a light.

Voltage dips, refers to the situation when voltage goes beyond a

standard level.

Voltage swell, refers to the situation when voltage goes above a

standard level.

10
CHAPTER 2

REVIEW OF RELATED LITERATURE AND STUDIES

This chapter presents the review of related literature and studies.

2.1 Review of Related Literature

Low power factor of electrical loads cause high current drawn from

power supply. The effect of this situation is affected by impedance of electrical

load. In this manner, the key thought of this examination is the way

impedance of electrical loads impact power factor of electrical loads (Syirrazie,

Hasim, & Ahmad A, 2015).

According to Edisto Electric Cooperative power factor is a measure of

how effectively you are using electricity. Various types of power are at work

to provide us with electrical energy. Enhancing the power factor can maximize

current-carrying capacity, enhance voltage to equipment, reduce conductor

losses, and lower electric bills. The least difficult approach to enhance power

factor is to add power factor correction capacitors to the electrical system.

Power factor correction capacitors act as reactive current generators. They

help counterbalance the non-working force utilized by inductive loads,

11
thereby enhancing the power factor. The connection between power factor

capacitors and specific equipment, for example, variable speed drives,

requires a very much structured system (edistoelectric.com).

Moreover, Jim Plourde (2011) stated that the first and most obvious

opportunity for motor energy saving is power factor correction. The power

factor of an AC electrical system is the ratio of the "real" power setting off to

the load to the "apparent" power in the circuit. Loads with a low power factor

will draw more current than a load with a high power factor for a similar

measure of energy exchange. He also stated that the addition of a capacitor

does not affect the magnetizing current or the leakage reactance of the motor,

but it offsets the inductive component at the point where the capacitor is

installed. As more capacitance is added, the power factor angle, θ, becomes

smaller until a unity power factor is achieved (θ = 0). At unity power factor,

the electrical system is at its optimum performance for maximum power

transfer.

It is a great concern that this loss would be compensated by improving

the power factor because in most power systems, a poor power factor resulting

from an increasing use of inductive loads is often overlooked. A poor power

factor correction unit would allow the system to restore its power factor close

to unity for economical operation. There are many methods of improving the

power factor that have been proposed such as capacitor banking, using

synchronous motors or condensers and phase advancers.

12
LCD MODULE (LIQUID CRYSTAL DISPLAY)

LCD (Liquid Crystal Display) screen is an electronic display module and

find a wide range of applications. A 16x2 LCD display is very basic module

and is very commonly used in various devices and circuits. A 16x2 LCD

means it can display 16 characters per line and there are 2 such lines. In this

LCD each character is displayed in 5x7 pixel matrix.

13
Figure 1. LCD Module

https://www.engineersgarage.com/electronic-components/16x2-lcd-module-datasheet

RELAY MODULE

This is a 5V 4-channel relay interface board, and each channel needs

a 15-20mA driver current. It can be used to control various appliances and

equipment with large current. It is equipped with high-current relays that

work under AC250V 10A or DC30V 10A. It has a standard interface that

can be controlled directly by microcontroller.

14
Figure 2. 4 channel 5v relay module

http://wiki.sunfounder.cc/index.php?title=4_Channel_5V_Relay_Module

PZEM-004T

This is an electric monitoring test module with a current transformer

and USB adapter. The module can be used to test power, energy, voltage as

well as current, and then display on a PC or other terminals. Designed with

one key reset button, you can reset energy data by simply pressing one

button. Moreover, it can store data when power off, and store the

accumulated energy data before power off, so it is very convenient to use it.

15
Figure 3. PZEM – 004T module

https://www.amazon.com/PZEM-004T-Current-Voltage-Multimeter-80-260V/dp/B074QF7PGM

ARDUINO UNO

The Arduino Uno is a microcontroller board based on the

ATMega328.It has 14 digital input/output pins (of which 6 can be used as

PWM outputs), 6 analog inputs, a 16 MHz crystal oscillator, a USB

connection, a power jack, an ICSP header, and a reset button.

16
Figure 4. Arduino Uno

https://www.trossenrobotics.com/p/arduino-uno.aspx

GSM SIM 800L

The SIM800L module supports quad-band GSM/GPRS network,

available for GPRS and SMS message data remote transmission. The

SIM800L communicates with microcontroller via UART port, supports

command including 3GPP TS 27.007, 27.005 and SIMCOM enhanced AT

Commands.

Figure 5. GSM SIM800L module

17
https://robokits.co.in/wireless-solutions/gsm-gprs/sim800l-gprs-gsm-module-micro-sim-card-core-

board-quad-band-ttl

CBB65A-1 40UF (40 MICROFARAD) CAPACITOR

Motor capacitor, such as a start capacitor or run capacitor is an

electrical capacitor that alters the current to one or more windings of a single

phase AC induction motor.

Figure 6. CBB65A-1 40UF CAPACITOR

18
https://www.aliexpress.com/item/CBB65A-1-40uF-5-AC-450V-50-60Hz-Non-Polar-Motor-Capacitor-

for-Air-Conditioner/32538327757.html

SOCKETS

AC power plugs and sockets allow electric equipment to be connected to the

primary alternating current (AC) power supply in buildings and at other sites.

Figure 7. 3-GANG SOCKET

19
https://en.wikipedia.org/wiki/AC_power_plugs_and_sockets

2.2 Review of Related studies

Thirst for energy sources is unquenchable, but we hardly realize that

we are wasting a part of energy every day due to lagging power factor. The

researcher implement a device to prevent this kind of situation by improving

the power factor. There are many methods of improving a power factor have

been proposed with the growth of technological revolution. This thesis

describes the design and development of power factor improvement with

microcontroller (Sayed, Ferdous and Shobug, 2015).

The improvement method in this device is described by synchronous

condenser instead of capacitor bank because of long life, achieve step less

power factor by changing the magnitude of current with change in excitation,

faults in synchronous condenser can be removed easily, and the motor

windings offer higher thermal stability for higher short circuit currents. But

the disadvantages of this method is that the maintenance cost is high due to

rotating component, produces noise, there are losses in the motor, at low

power rating the cost is high compared to static capacitor method, and it

needs extra excitation equipment to function. This method involves

continuous measurement and monitoring the power factor and generation of

required control signal from microcontroller for controlling the DC excitation

20
of synchronous condenser so as to improve power factor (Sayed, Ferdous &

and Shobug, 2015).

People are not aware of energy wastage thus having poor power factor

is often overlooked. Power factor measures how efficient a system is and is an

important factor in improving a good quality of electricity. A poor power factor

resulting from an increasing use of inductive loads creates high amount of

current that may damage wire cables, voltage fluctuation due to voltage drop

and several losses are greatly ignored. A power factor correction unit would

allow the system to restore its power factor close to unity to minimize losses

and wastage.

The advantages or benefits of power factor correction include reduced

demand charges, increased load carrying capabilities in existing circuits,

improved voltage, reduced power system losses, and reduced carbon

footprint. Power factor correction was designed to build a device which is able

to monitor the energy consumption of a system and automatically improved

its power factor. An open source energy monitoring library was implemented

in the design for accurate power calculation. The device calculates the

reactive power consumed by a system’s inductive load and compensates the

lagging power factor using capacitance from a capacitor bank (Yasin Kabir,

Yusuf Mohammad Mohsin & Mohammad Monirujjaman Khan, 2017).

21
Automatic Power Factor Controller using Pic Microcontroller

In this project, power factor correction prototype is developed using pic

microcontroller, relays, potential transformer, current transformer and zero

crossing circuit. PIC16F877A microcontroller calculate power factor and take

necessary actions based on power factor. Relay driver IC UNL2003 is

connected with microcontroller and which is used to drive relays.

Microcontroller sends high signal to relay driver IC whenever power factors

falls less than 0.9. ULN2003 turn on relays which in return connects

capacitor banks with the load. First of all the phase difference between voltage

and current waveforms are measured and then power factor is calculated. In

case of low power factor capacitors are added to improve it (Malik, 2015).

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

AC Digital Multifunction Smart Meter using Arduino and PZEM- 004T

Every management system is trying to make an automatic, portable,

accurate and reliable system to for measurement. This project work presents

a novel smart meter for an automatic and superior metering, billing and

warning system. The integration of the Arduino and LCD provide the meter

reading system with some automatic functions that are predefined. The

proposed energy meter system can incorporate with an embedded

microcontroller and PZEM-004T AC Digital Multifunction Meter designed by

22
Peacefair. PZEM-004T having the ability to measure Electrical parameters

such as voltage, current, active power and energy (Wakchaure, 2017).

https://innovatorsguru.com/ac-digital-multi-function-smart-meter-using-arduino-and-pzem-004t/

Automatic Power Factor Controller using Microcontroller

When load is connected the power factor is calculated by the PIC

microcontroller. If the calculated power factor is less than 0.9 then the relay

switches on the capacitor. The relays are switched using ULN2003 which is

basically a driver IC. ULN2003 consists of seven DARLINGTON PAIRS. The

current lead in capacitor compensates the corresponding current lag which

is usually present in loads. Hence the phase difference between the current

and voltage will be reduced (Syamala, 2016).

https://electrosome.com/automatic-power-factor-controller-using-microcontroller/

GSM Based Automatic Energy Meter Reading

This paper presents the design of a simple low cost wireless GSM energy

meter and its associated web interface, for automating billing and managing

the collected data globally. The proposed system replaces traditional meter

reading methods and enables remote access of existing energy meter by the

energy provider. Also they can monitor the meter readings regularly without

the person visiting each house. A GSM based wireless communication module

is integrated with electronic energy meter of each entity to have remote access

over the usage of electricity (Ashna, 2017).

23
https://ieeexplore.ieee.org/document/6526385

CHAPTER 3

RESEARCH METHODOLOGY

This chapter details the step-by-step procedure of the project design, project

development, operation and testing procedures conducted by the

researcher.

3.1 Design Criteria

The following criteria were considered in the construction of the

microcontroller based power factor improvement and monitoring system.

1. The system was connected to 230V 60Hz power source.

2. The device have three direct current (DC) power supply inside one for

arduino and GSM module and LCD, one for the relay, and one for the

sensor and LCD..

3. The microcontroller was supplied by 5V DC power source.

4. The power supply of the microcontroller, sensor and the relay was

different.

5. The sensor module used is PZEM- 004T.

6. The housing were metal and grounded.

7. The housing have a fan for exhaust of heat.

8. The capacitance of four capacitors were 12uF, 20uF, 40uF and 40uF.

24
9. GSM module used was Sim800l. The number of the recipient will be

installed during the program.

10. The relay module used is a 4 Channel relay.

11. The step correction of the device were as follow. At 230V AC, 60Hz

the reactive compensation are 240VAR, 399VAR, 780VAR, 1400VAR,

1200VAR wherein 240 VAR is the minimum and 2000VAR is the

maximum.

3.2 Parameters analyzed.

The following parameters were essential for functionality of the device.

1. Current and voltage output of the power supply.

2. Current, Voltage and Active Power reading of the system

3. The microcontroller program data.

4. The amount of reactive power to be compensated.

5. The amount of the capacitor’s capacitance required.

3.3 Design Analysis

Reactive power

Complex power(S) composed of the Real power (P) and the Reactive

power (Q). Calculation for the amount of capacitor to be switched into the

line will be determined by the amount of reactive power needed to be

compensated by the system.

25
Mathematically, reactive power (Q):

Q = tan (Ө) * P

Where:

Ө = cos-1(P.F.)

𝑅𝐸𝐴𝐿 𝑃𝑂𝑊𝐸𝑅(𝑃)
P.F. = 𝐴𝑃𝑃𝐴𝑅𝐸𝑁𝑇 𝑃𝑂𝑊𝐸𝑅(𝑆)

Real Power (P), Vrms and Irms will be provided by the PZEM – 004T

AC multi meter module. Equation for calculation of capacitance required in

a single phase electrical system.

𝑉2 𝑉2
Xc = = ;
𝑄 tan(⊖)∗𝑃

1
C= 2𝜋𝑓𝑋𝑐

𝑃(tan(⊖))
C= 2𝜋𝑓𝑉 2

Where:

C = Capacitance, f = Frequency, V = Voltage, P = Active Power and P.F =

Power Factor.

Reactive Compensation of individual Capacitor. The following values

are calculated assuming that the voltage is at nominal value of 230VAC.


26
Equation for the calculation of Reactive Power:

Q = 𝑉𝑜𝑙𝑡𝑎𝑔𝑒 2 * 2π*(Frequency)*(Capacitance)

Capacitor 1:

C = 12uF

Q = 2302 * 2π*(60Hz)*(12*10−6 𝐹)

Q = 239.31 VAR

Capacitor 2:

C = 20uF

Q = 2302 * 2π*(60Hz)*(20*10−6 𝐹)

Q = 398.86VAR

Capacitor 3:

C = 40uF

Q = 2302 * 2π*(60Hz)*(40*10−6 𝐹)

Q = 797.71VAR

Capacitor 4:

C = 40uF

Q = 2302 * 2π*(60Hz)*(40*10−6 𝐹)

27
Q = 797.71VAR

Total Reactive Compensation = 239.31VAR + 398.86VAR + 797.71VAR +

797.71VAR

Total Reactive Compensation = 2233.59 VAR

Therefore the minimum and the maximum reactive power compensation of

this device is 240VAR and 2.2KVAR respectively.

28
MICROCONTROLLER BASED POWER FACTOR IMPROVEMENT WITH
VOLTAGE MONITORING

GSM LCD POWER


SUPPLY

POWER ARDUINO PZEM-004T


SUPPLY

POWER
RELAY
SUPPLY

CAPACITORS LOAD

Figure 8. Block Diagram.

29
MICROCONTROLLER BASED POWER FACTOR IMPROVEMENT WITH
VOLTAGE MONITORING

START

T
INITIALIZE
T

READ PARAMETERS
T

DISPLAY
T

CHECK VOLTAGE
T

IS V < 207 IS 207< V < 253 IS V >253


T T
CHECK SMS
STATUS IS SMS SENT
T ONCE
YES
DISPLAY
T NO
YES
IS 0.80< PF <1 and VAR < 240
SEND SMS
NO T

SEND SMS
T
SWITCH CAPACITOR
T
SEND SMS
T

DISPLAY
T

Figure 9. Flow Chart

30
FABRICATION DESIGN

PZEM-004T Source

Lcd
Switch
Input
GSM

SOCKET
RELAY ARDUINO

CAPACITORS

Switch

LCD Source
Input

Top View
SOCKET
FAN

Front View Right View Back View Left View

Figure 10. Fabrication Design

31
SCHEMATIC DIAGRAM

Figure 11. Schematic Diagram.

32
Tools and Equipment Used

1. Multimeter

2. Pliers

3. Soldering Iron

4. Soldering Lead

5. Soldering Pump

6. Wires

7. Electric Drill

8. Breadboard

Construction Procedure

1. Prepare the tools for the device.

2. Prepare the components.

3. Program the Microcontroller

4. Assemble the components together.

5. Turn on the device

6. Check each components of the device.

7. Final Test the device.

8. Use the device.

33
3.4 OPERATION AND TESTING PROCEDURE

The following procedures were followed for the test ‘run’ of the device:

1. Assemble the parts as designed.

2. Remove any connected Loads. Which is not a part of the system.

3. Check every module if properly connected.

4. Check the GSM if the Sim Card is inserted.

5. Final check all components.

6. Connect to the power source.

7. Upload the program in the PC and run the program.

8. See if the LCD module display the following. (Voltage, Current,

Reactive power and Power Factor).

9. Test the whole operation of the system.

In testing the operation of the system, the following procedures were done,

1. Connect the system into the AC source;

2. Microcontroller will measure the voltage, current, reactive power

and power factor then displays it on LCD.;

34
3. If the voltage is not within the range specified in the program a

SMS will be sent to the user as well as when the power factor is not

within the range specified in the program.

4. If the relays remains off because the power factor is not out of

range, wait for the LCD to update. This is indicated by brief flashing of

LCD module.

5. Connect inductive load across AC power supply (Reactive Power

must be greater than 240 VAR).

6. If power factor is less than 0.80 with Reactive Power greater than

240 VAR, microcontroller will send a message to the user and turn on

relays with the equivalent amount of capacitor.

7. After the relays turn on and the capacitors connects with load, an

SMS sent with the information on improved power factor, so keep

checking the power factor on LCD.

8. Microcontroller again reads power factor and displays it on LCD.

9. Now you will notice that power factor is improved.

10. The microcontroller will display it on LCD.

35
Instrumentation-Tools

a. Pliers – is a hand tool with two hinged arms ending in jaws that are

close by hand pressure to grip something. It is used to splice the wires

and grab or hold an electronic component in circuit.

b. Multimeter- is combination of a voltmeter, ammeter, and

ohmmeter. It can also be used to test diode and continuity test.

c. Breadboard- is used as a temporary board in testing of the project

beforepermanently placing it to the PCB.

d. Hand drill- is a tool fitted with a cutting tool attachment or driving

tool attachment usually a drill bit or driver bit, use for boring holes in

various materials or fastening various materials together with the use of

fasteners.

e. Soldering iron – is a tool that electrical heated and used for joining

parts with solder.

f. Screw Driver – is a tool, manual or powered, for screwing and

unscrewing (inserting and removing) screws.

36
Cost Estimate

ITEM UNIT QUANTITY UNIT COST TOTAL COST

(Php.) (Php.)

Arduino Uno Pc. 1 600 600

PZEM-004T Pc. 1 600 600


module

Relay Module Pc. 1 400 400

LCD module Pc. 1 400 400

Capacitor Pcs. 4 300 1200

GSM module Pc. 1 450 450

Soldering Pc. 1 200 200


Iron

Soldering Meter 2 15 30
Lead

Wires Meter 3 20 60

Power Supply Pcs. 2 200 400

12V fan Pc. 1 50 50

Casing Pc. 1 1000 1000

PCB 9 Sq. Inches 1 60 60

Breadboard Pc. 1 170 50

Paint Pc. 1 105 105

Case Pc. 1 1050 1050

Case Handle Pc. 1 25 25

Switch Pc. 1 40 40

Screw Pc. 24 120 120

37
Total 6840

Figure 12. Cost Estimate

Cost Analysis

COST ANALYSIS AMOUNT(Php.)

Project Cost 7000

Travel Expenses 600

Circuit Construction 5000

Research Expenses 300

Printing 500

TOTAL 13400

Figure 13. Cost Analysis

3.5 Evaluation procedure

A survey was made after a satisfactory result of the testing procedure

using qualitative analysis of determining the acceptability of the project.

Questionnaires were distributed to ten (10) respondent. Prior to the

evaluation proceeding, a demonstration of the operation and features of the

project was conducted and captured on video camera. Respondents were

present during the said activity and were given evaluation copy. Respondents

38
who weren’t there during the demonstration were shown a video containing

the said demonstration.

Treatment of Data

From the data gathered, the mean (x) for each criterion was computed.

Then scoring system was employed in the scale of one (1) to five (5) with one

being lowest and five as the highest. The state criteria were scored and rated

using the following rating:

5 Very Acceptable

4 Acceptable

3 Moderately Acceptable

2 Inacceptable

1 Very Inacceptable

The mean (x) for every criterion was computed and from it, the grand mean

(X) was computed to check the overall acceptability of the project. The

formula shown below was used:

Grand Mean (X) = sum (x)/n

Where:

x = the individual mean

n = number of criteria for the evaluation

39
TIME TABLE

Figure 14. Time Table

40
CHAPTER 4

TEST AND EVALUATION

This chapter details the presentation and discussion of the results of

the project.

4.1 Project Description

The Microcontroller Based Power Factor Improvement with Voltage

Monitoring is designed to be portable, and have an easy way to monitor

voltage via GSM and automatically improved the power factor. The system

used the Arduino IDE to program the microcontroller-based system to correct

the low power factor by triggering-on and off a relay depending on how much

the capacitor is needed to improve the power factor. The project used PZEM-

004T to measure the voltage, current and real power.

4.2 Project Structure

The Power Factor Correction was enclosed in a metal casing. The GSM

Sim8001, Relay, Capacitors, Arduino Uno, Power Supply, PZEM-004T and

fan were placed inside for the better arrangement and for protection. The LCD

Module was mounted in the casing and connected to the devices inside the

case, also a 3-Gang Socket was mounted at the front of the casing and is

connected to the devices inside. The 12-volts power supply that supply the

fan to avoid heating the system was inside the case. The GSM Sim-8001,

41
Relay, Capacitors, Arduino, Power Supply, PZEM-004T was supplied by a 5-

volts power supply to work the system.

Figure 15. Front view of the device

Figure 16. Back view of the device

42
Figure 17. Right view of the device

Figure 18. Left view of the device

43
4.3 Project Evaluation

The performance of this project was evaluated by 10 individuals. They

tested the project based on the different criteria concerned with Functionality,

Reliability, Usability, Maintainability and Efficiency. The individual scores for

the following criteria were found on Appendix for reference. The data shown

below are the mean scores for each criteria from 10 respondents. From the

scale of 1 to 5 the respondents rated the device on the following criteria.

Table 4. Functionality

CRITERIA MEAN REMARKS

1.Suitability 4.7 ACCEPTABLE

2.Accurateness 4.7 ACCEPTABLE

3.Compliance 4.4 ACCEPTABLE

4.Interoperability 4.7 ACCEPTABLE

MEAN 4.625 ACCEPTABLE

Table 5. Reliability

CRITERIA MEAN REMARKS

1. Maturity 4.1 ACCEPTABLE

44
2. Fault Tolerance 4.1 ACCEPTABLE

3. Recoverability 4.4 ACCEPTABLE

MEAN 4.2 ACCEPTABLE

Table 6. Usability

CRITERIA MEAN REMARKS

1. Understandability 4.8 ACCEPTABLE

2. Learn Ability 4.7 ACCEPTABLE

3. Operability 4.6 ACCEPTABLE

MEAN 4.7 ACCEPTABLE

Table 7. Efficiency

CRITERIA MEAN REMARKS

1. Time behavior 4.8 ACCEPTABLE

MEAN 4.8 ACCEPTABLE

Table 8. Maintainability

45
CRITERIA MEAN REMARKS

1. Analyze Ability 4.5 ACCEPTABLE

2. Changeability 4.7 ACCEPTABLE

3. Stability 4.5 ACCEPTABLE

4. Testability 4.4 ACCEPTABLE

MEAN 4.525 ACCEPTABLE

Table 9. Grand Mean

CRITERIA MEAN REMARKS

1.Functionality 4.625 ACCEPTABLE

2. Reliability 4.2 ACCEPTABLE

3.Usability 4.7 ACCEPTABLE

4.Effectivity 4.8 ACCEPTABLE

5.Maintainability 4.525 ACCEPTABLE

MEAN 4.57 ACCEPTABLE

46
Device Application

VOLTAGE CURRENT

REACTIVE POWER
POWER FACTOR

Figure 19. Device Display

Figure 20. Device Display

47
Data Gathered.

BEFORE POWER FACTOR IMPROVEMENT ( 1.5 horse power (HP) motor)

TRIALS VOLTAGE CURRENT POWER REACTIVE


FACTOR POWER

FIRST TRIAL 207.40 V 2.13 A 0.56 366 VAR

SECOND TRIAL 240.40 V 3.44 A 0.43 744 VAR

THIRD TRIAL 218.50 V 2.53 A 0.52 473 VAR

FOURTH TRIAL 219.00 V 2.53 A 0.52 473 VAR

FIFTH TRIAL 216.50 V 2.51 A 0.53 462 VAR

AFTER POWER FACTOR IMPROVEMENT ( 1.5 HP motor)

TRIALS VOLTAGE CURRENT POWER REACTIVE


FACTOR POWER

FIRST TRIAL 207.90 V 1.51 A 0.78 196 VAR

SECOND TRIAL 240.00 V 1.77 A 0.85 255 VAR

THIRD TRIAL 218.50 V 1.54 A 0.85 178 VAR

FOURTH TRIAL 219.90 V 1.54 A 0.85 179 VAR

FIFTH TRIAL 217.50 V 1.55 A 0.85 177 VAR

48
The inductive load that were tested.

Figure 21. Device with the Inductive load

Figure 22. Device with the Inductive load

49
The first trial

Figure 23. Before Power Factor Improvement (PFI)

Figure 24. After Power Factor Improvement (PFI)

50
The second trial

Figure 25. Before Power Factor Improvement (PFI)

Figure 26. After Power Factor Improvement (PFI)

51
The third trial

Figure 27. Before Power Factor Improvement (PFI)

Figure 28. After Power Factor Improvement (PFI)

52
The fourth trial

Figure 29. Before Power Factor Improvement (PFI)

Figure 30. After Power Factor Improvement (PFI)

53
The fifth trial

Figure 31. Before Power Factor Improvement (PFI)

Figure 32. After Power Factor Improvement (PFI)

54
Messages that were received by the user.

Figure 33. Message received

Figure 34. Message received

55
Figure 35. Message received

Figure 36. Message received

56
Figure 37. Message received

Figure 38. Message received

57
Figure 39. Message received

Figure 40. Message received

58
CHAPTER 5

CONCLUSION AND RECOMMENDATION

This chapter presents the conclusion and recommendation drawn

from the study.

Conclusion

The Microcontroller-Based Power Factor Improvement with Voltage

Monitoring was implemented completely. The system provided for power

factor improvement and voltage monitoring in low power factor inductive

loads. Arduino UNO controller was very popular at this event, likewise it is

easy to write the program by using the high level language.

An Inductive linear load (1.5 HP motor) was tested for this system. The

Voltage, Current, Reactive power and Power factor were shown in the LCD

module. The data gathered clearly shows the benefit of using the system. The

power factor of motor was improved from 0.52 to 0.85 and the current that

the motor draws were reduced to about 61% of the current drawn at lower

power factor. The device was also able to notify the user about the power

factor of the inductive linear loads. The researchers also received a

notification via SMS about the voltage fluctuation of the line. However, there

are times that the message containing the value of unimproved power factor

was failed to send due to no reception of GSM. This observed weakness would

be a subject for future improvement.

59
By using the device the system could raise the power factor of an

electrical system and at the same time notify the user when a voltage

fluctuation occurs. This study gave awareness to the user of the excess

current drawn of the poor power factor loads will enable them to do necessary

action in improving the power factor to minimize the current drawn by the

inductive loads.

Recommendation

Based from the aforementioned conclusions, the following

recommendation were advised.

a. Improvement in the configuration of this device will be developed to

suit with the different standards of any electrical system.

b. Addition of keypad module is suggested to register the recipient of

the message to improve this device for there is a possibility that mass

production of this device will become a reality in the near future.

c. Careful and calculated selection of the capacitor must be taken

before the system is built for the closer the value of reactive power consumed

by the load to the reactive power compensated by the system the better the

improvement would be.

d. Since there is a possibility of flaws in the design of the device, to

make precise selection of capacitor to be triggered-on, a production of

capacitor with small gap in capacitance (between the capacitance of the first

60
capacitor to the preceding capacitor) will be developed to have a numerous

selection of capacitance.

REFERENCES

Edisto Electric Cooperative Retrieved (n.d.) Understanding Power Factor and


why it’s important. Retrieved November 14 2018, from
http://edistoelectric.com.

Kabir, Y., Mohsin, M.M., & Khan, M.M. (2017, February) Automated Power
Factor correction and Energy Monitoring System. Retrieved November
14, 2018, from http://www.researchgate.net.

Plourde, J. (2011). Monitoring induction motors for energy savings. Retrieved


November 14 2018, from https://www.controleng.com.

Sayed, R., Ferdous, A.I., & Shobug, M.A. (2015, April) 2 automatic power
Factor correction by using synchronous condenser with continuous
monitoring. Retrieved November 14, 2018, from
https://www.researchgate.net.

Syirrazie CS1, H.Hasim1 Ahmad Asraf AS2 (2015) Impact Study on Power
Factor of Electrical Load in Power Distribution System. Retrieved
November 14 2018, from http://inis.iaea.org.

Amazon (n.d.) Current Voltage Power Energy Multimeter Module. Retrieved


November 15, 2018 from http://www.amazon.com

AliExpress (2015) CBB65A-1 40uF 5% AC 450V 50/60Hz Non Polar Motor


Capacitor for Air Conditioner. Retrieved November 15, 2018 from
http://www.aliexpress.com

Kushagra. (n.d) LCD. Retrieved November 15, 2018, from


http://www.engineersgarage.com

Robokits India (2018) SIM800L GPRS GSM MODULE MICRO SIM CARD CORE
BOARD QUAD-BAND TTL. Retrieved November 15, 2018 from
http://robokits.co.in

Sunfounder (2017) 4 Channel 5V Relay Module. Retrieved November 15, 2018,


from http://wiki.sunfounder.cc

61
Trossen Robotics (n.d.) Arduino Uno R3 Microcontroller. Retrieved November
15, 2018 from http://www.trossenrobotics.com

Wikipedia (2018) AC power plugs and sockets. Retrieved November 15, 2018
from htttp://en.wikipedia.org

62
APPENDIX A

EVALUATION CRITERIA

EVALUATION CRITERIA FOR THE PROJECT “MICROCONTROLLER BASED

POWER FACTOR IMPROVEMENT WITH VOLTAGE MONITORING SYSTEM”

Name: (optional) _____________________________________________________

ID No. : (optional) __________________ Address __________________________

Direction:

Put check (✔) to indicate your answer on the following statement:

1. Assessment of “Microcontroller Based Power Factor Improvement

with Voltage Monitoring System” process in items of:

Legend:

5 - Very Acceptable 2 – Inacceptable

4 - Acceptable 1 – Very Inacceptable

3 – Moderately Acceptable

5 4 3 2 1

I.FUNCTIONALITY

63
Function required for the system are

implemented(Suitability)

Function accuracy is provided(Accurateness)

Function meet specification(Compliance)

Easy to connect to other systems is

provided(Interoperability

II.RELIABILITY

Software includes no bug(Maturity)

A certain system level is maintained even when a

trouble occurs(Fault tolerance)

Normal operations are restored readily when a

failure occurs(Recoverability)

III.USABILITY

Easy to operate(Understandability)

Easy to remember(Learn Ability)

Allow easy operation management(Operability)

IV.EFFICIENCY

64
Provides good responses and high

throughput(time behavior)

V.MAINTAINABILITY

Allows easy analysis of design documents and

programs when a bug is found(analyse ability)

Allows easy expansion and modification of the

system(Changeability)

Modification of the system does affect

others(stability)

Laborious tests are not required after a

modification is made(testability)

Summary: Average:

A.Functionality

B.Reliability

C.Usability

D.Efficiency

E.Maintainability

65
Total Score_________ ÷5 = ____________

Equivalent meaning ___________________________________

2. When testing, do you encounter any problem?

YES _____ NO ______ if yes please specify:

___________________________________________________________________________

___________________________________________________________________________

___________________________________________________________________________

___________________________________________________.

3. Based on your finding what enhancement should be made for

implementation and maintenance?

___________________________________________________________________________

___________________________________________________________________________

___________________________________________________________________________

___________________________________________________.

__________________________________________

(Signature)

Evaluator

Date: ______________________

66
APPENDIX B

EVALUATED RESULT OF THE QUESTIONARIES USED

Reps. A1 A2 A3 A4 B1 B2 B3 C1 C2 C3 D1 E1 E2 E3 E4

1 5 5 5 5 4 5 5 5 5 5 5 5 5 5 5

2 4 4 3 4 4 3 4 5 4 3 4 4 4 3 4

3 5 5 5 5 3 4 5 5 5 5 5 4 5 5 5

4 5 5 5 5 5 5 5 5 5 5 5 4 5 4 3

5 5 4 4 5 5 5 5 5 5 5 4 4 5 4 5

6 5 5 4 5 4 5 5 5 5 5 5 5 4 4 5

7 5 5 5 4 5 5 4 4 4 3 4 5 4 5 3

8 5 4 4 5 5 5 4 4 4 4 5 4 4 5 5

9 4 4 4 4 5 4 4 4 5 5 5 4 4 4 4

10 5 5 5 5 4 4 5 5 5 5 5 4 5 5 5

Total 48 46 44 47 44 45 46 47 47 45 47 43 45 44 44

Mean 4.8 4.6 4.4 4.7 4.4 4.5 4.6 4.7 4.7 4.5 4.7 4.3 4.5 4.4 4.4

Table 17. Tabulated result of the questionnaire’s used

APPENDIX C

67
ARDUINO PROGRAM

#include <SoftwareSerial.h> // Arduino IDE <1.6.6


#include <PZEM004T.h> // for pzem
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2); //A4,A5 connection
#include <Sim800l.h>
Sim800l Sim800l; //(10,11),(rx,TX)
PZEM004T pzem(2,3); // (RX,TX) connect to TX,RX of PZEM
IPAddress ip(192,168,1,1); //PZEM ip Address

int cap1 = 4; // connect to 12uF


int cap2 = 5; // 20uF
int cap3 = 6; // 40uF
int cap4 = 7; // 40uF
float Voltage = 0; // initialize
float Current = 0; // initialize
float RealPower = 0; // initialize
float PowerFactor; // initialize
int ReactivePower = 0; // Variable for reactive
String msg; // string to store msg
String Combination; // String to combine
char buffer1[50]; //buffer for converting string to char to send in sms
char buffer2[50]; //Buffer for converting string to char to send in sms
char buffer3[50]; //Buffer for converting string to char to send in sms
char* text; //Storing Text
char* number; // Storing number
const int Frequency = 60; //Frequency in phillipines
const float pi = 3.14159265;// Value of pi

boolean error; // return sms


boolean isPf;
boolean pastPf = HIGH;
boolean pastPf2 = HIGH;
boolean isV; //for limiting sms
boolean pastV = HIGH;//for limiting sms
boolean pastV2 = HIGH;//for limiting sms
boolean CapState = LOW; // STore Capacitor sstatus
boolean Reset = HIGH; // For reading condition
boolean AllCap = HIGH; // for status
boolean threeCap = LOW; // for status
boolean twoCap = LOW; // for status
boolean oneCap = LOW; // for status
boolean cap20 = LOW;

68
boolean cap40 = LOW;

float Cap20 = 399;


float Cap12 = 240;
float Cap40 = 798; // Store vAlue of reactive
float CapAll = 2200;
float CapThree= 1402;
float CapTwo = 639;
float CapOne = 240;

void setup()
{
pzem.setAddress(ip); // Set ip Pzem
lcd.begin(); // Begin lcd
lcd.backlight(); // Backlight
Sim800l.begin(); //initialize GSM
pinMode(cap1,OUTPUT); //Pinmode Output //40
pinMode(cap2,OUTPUT); //Pinmode Output
pinMode(cap3,OUTPUT); //Pinmode Output
pinMode(cap4,OUTPUT); //Pinmode Output
number = "09058795441"; // SEt the number
digitalWrite(cap1,HIGH); // SET ALL CAP INITIALLY HIGH / OFF
digitalWrite(cap2,HIGH);
digitalWrite(cap3,HIGH);
digitalWrite(cap4,HIGH);
Welcome(); //Call Welcome message
}
void Welcome()
{
lcd.clear(); //clear lcd
lcd.print("Group 4 Thesis"); //print in lcd
lcd.setCursor(0,1); // set cursor in lcd
lcd.print("BSEE- 5A"); //print lcd
delay(2000); // delay
lcd.clear(); // clear
lcd.print("C. Zabala");
lcd.setCursor(0,1);
lcd.print("R. Necesito");
delay(2000);
lcd.clear();
lcd.print("F. Patino");
lcd.setCursor(0,1);
lcd.print("B. Pancubila");
delay(2000);
lcd.clear();
lcd.print("Please Wait..");
69
delay(4000);
}
void Display()
{
ReadParameters();
lcd.clear(); // clears LCD
lcd.print(Voltage); //print voltage
lcd.setCursor(6,0); // setCursor in lcd
lcd.print("V");
lcd.setCursor(8,0);
lcd.print(Current); // print current
lcd.setCursor(14,0);
lcd.print("A");
lcd.setCursor(0,1);
lcd.print(ReactivePower); //print reactive power
lcd.setCursor(4,1);
lcd.print("VAR");
lcd.setCursor(8,1);
lcd.print("PF=");
lcd.setCursor(12,1);
if(PowerFactor>1) PowerFactor = 1;
lcd.print(PowerFactor); //print powerfactor
delay(100);
}
void response(boolean res)
{
if(res == 1) // if sms is succesfully sent
{
lcd.clear();
lcd.print("Msg Sent"); //print msg sent if sms succesfully sent
delay(1000); //delay for 1 second
}
else if(res == 0) // if sms is notsent
{
lcd.clear();
lcd.print("Msg Not Sent"); //print msg not sent if sms not sent
delay(1000);
}
else
{
lcd.clear();
lcd.print("GSM DAMAGED");
delay(1000);
}
}

70
void SendCurrentPowerFactor()
{
isPf = LOW; //this serve as to limit the number of sms to be sent
if(isPf == LOW && pastPf == HIGH) // same as voltage
{
Sim800l.begin(); //initialize GSM
msg = "Power Factor: "; //msg to be sent
Combination = msg + (String)(PowerFactor); // process in combining two
string
Combination.toCharArray(buffer2,50); //buffer to store string temp and
to convert it to char
text = buffer2;
error = Sim800l.sendSms(number,text); //Send Sms command
response(error); // get sms responce
delay(2000);
Sim800l.end(); //end gsm
}
pastPf = isPf; // set past pf to current value of ispf to limit the number of
message sent to one
}
void SendImprovedPowerFactor()
{
isPf = LOW; // same goes here
ReadParameters();
if(isPf == LOW && pastPf2 == HIGH) // same as voltage
{
Sim800l.begin();
msg = "PowerFactor: ";
Combination = msg + (String)(PowerFactor);
Combination.toCharArray(buffer2,50);
text = buffer2;
error = Sim800l.sendSms(number,text);
response(error);
delay(2000);
Sim800l.end();
}
pastPf2 = isPf; // same goes here
}
void SendOverVoltage() // Function to send OverVoltage
{
isV = LOW;
if(isV == LOW && pastV == HIGH)
{
Sim800l.begin();
msg = "Over Voltage: ";
Combination = msg + (String)Voltage;
71
Combination.toCharArray(buffer1,50);
text = buffer1;
error = Sim800l.sendSms(number,text);
response(error);
delay(2000);
Sim800l.end();
}
pastV = isV;
}

void SendLowVoltage() // Function to sendLOwVoltage


{
isV = LOW; // set isV to low
if(isV == LOW && pastV == HIGH) // condition for sending only once
{
Sim800l.begin(); //begin port 2 GSM
msg = "Under Voltage: "; //message
Combination = msg + (String)Voltage; //combining two string in one
message
Combination.toCharArray(buffer1,50); // converting string into char
array
text = buffer1; // nothing
error = Sim800l.sendSms(number,text); // sending SMS
response(error); //Responce status
delay(2000);
Sim800l.end(); //close port 2 GSM
}
pastV = isV; //set past V to isV
}
void SendNormalVoltage() // Function to send OverVoltage
{
ReadParameters();
isV = LOW;
if(isV == LOW && pastV2 == HIGH)
{
Sim800l.begin();
msg = "Normal Voltage";
Combination = msg;
Combination.toCharArray(buffer1,50);
text = buffer1;
error = Sim800l.sendSms(number,text);
response(error);
delay(2000);
Sim800l.end();
}
72
pastV2 = isV;
}

void ReadParameters() // FUnction to read parameters


{
Voltage = pzem.voltage(ip); // read Voltage
if(Voltage<0) Voltage =0;
Current = pzem.current(ip); // read Current
if(Current<0) Current = 0;
RealPower = pzem.power(ip); // read active power
PowerFactor = (RealPower/(Voltage*Current));// Equation for calculating
power factor
//Angle = acos(PowerFactor);
ReactivePower = sqrt((pow((Voltage*Current),2))-(pow(RealPower,2))); //
equation for reactive
// ReactivePower = RealPower*tan(Angle);

}
void ReactRead()
{
Cap12 = (pow(Voltage,2)*0.004523893);
Cap20 = (pow(Voltage,2)*0.007539822);
Cap40 = (pow(Voltage,2)*0.0150796);
CapAll = Cap12+Cap20+Cap40+Cap40;
CapThree = Cap12+Cap20+Cap40;
CapTwo = Cap12+Cap20;
CapOne = Cap12;
}
void loop() //main loop
{
//first read parameters
Voltage = pzem.voltage(ip); // read Voltage
if(Voltage<0) Voltage =0;
Current = pzem.current(ip); // read Current
if(Current<0) Current = 0;
RealPower = pzem.power(ip); // read active power
PowerFactor = (RealPower/(Voltage*Current));// Equation for calculating
power factor
ReactivePower = sqrt((pow((Voltage*Current),2))-(pow(RealPower,2))); //
equation for reactive
Display(); // call display function
// test if voltage fluctuate
if(Voltage <= 207 && Voltage > 0) // if voltage is low
{
SendLowVoltage();
pastV2 = HIGH;
73
delay(1000);
}
else if(Voltage >= 253)
{
SendOverVoltage();
pastV2 = HIGH;
delay(1000);
}
else if((Voltage<253 && Voltage >207))
{
SendNormalVoltage();
pastV =HIGH; //resetting condition for nxt voltage fluctuation
delay(1000);
}
delay(100);
ReadParameters(); //read parameters again
Display();
delay(1000);
// check for power factor
if((PowerFactor<0.80 && PowerFactor > 0 && ReactivePower> 10)|| Reset
== HIGH) // Check power factor
{
delay(3000);
if(CapState == LOW && PowerFactor < 0.85 && PowerFactor > 0 &&
ReactivePower > 240)
{
SendCurrentPowerFactor(); // send the value of power factor
pastPf = HIGH;
delay(100);
}
ReadParameters();
Display();
delay(2000);
ReactRead();
delay(1000);
if( ReactivePower >= CapAll ) // if all caps needed
{ //2100 VAR compensation
delay(2000);
digitalWrite(cap1,LOW);
digitalWrite(cap2,LOW);
digitalWrite(cap3,LOW);
digitalWrite(cap4,LOW);
Reset = LOW;
CapState = HIGH; //for status purposes
threeCap =LOW;
twoCap =LOW;
74
AllCap = HIGH;
oneCap =LOW;
cap20 = LOW;
cap40 = LOW;
delay(3000);

}
if( ReactivePower < CapAll && ReactivePower >= CapThree )
{
delay(2000);
digitalWrite(cap1,LOW);
digitalWrite(cap2,LOW);
digitalWrite(cap3,LOW);
digitalWrite(cap4,HIGH);
Reset = LOW;
CapState = HIGH;//for status purposes
threeCap =HIGH;
AllCap = LOW;
twoCap =LOW;
oneCap =LOW;
cap20 = LOW;
cap40 = LOW;
delay(3000);
}
if(ReactivePower < Cap40 && ReactivePower >= CapTwo)
{
delay(2000);
digitalWrite(cap1,LOW);
digitalWrite(cap2,LOW);
digitalWrite(cap3,HIGH);
digitalWrite(cap4,HIGH);
Reset = LOW;
CapState = HIGH; //for status purposes
threeCap =LOW;
twoCap =HIGH;
AllCap = LOW;
oneCap =LOW;
cap20 = LOW;
cap40 = LOW;
delay(3000);
}
if(ReactivePower <Cap20 && ReactivePower >= Cap12 && threeCap ==
LOW && cap40 == LOW && cap20 == LOW && AllCap == LOW)
{
delay(2000);
digitalWrite(cap1,LOW);
75
digitalWrite(cap2,HIGH);
digitalWrite(cap3,HIGH);
digitalWrite(cap4,HIGH);
Reset = LOW;
CapState = HIGH;//for status purposes
twoCap =LOW;
AllCap = LOW;
threeCap =LOW;
oneCap =HIGH;
cap20 = LOW;
cap40 = LOW;
delay(3000);
}
// this
if(ReactivePower <CapTwo && ReactivePower >= Cap20)
{
delay(2000);
digitalWrite(cap1,HIGH);
digitalWrite(cap2,LOW);
digitalWrite(cap3,HIGH);
digitalWrite(cap4,HIGH);
Reset = LOW;
CapState = HIGH;//for status purposes
twoCap =LOW;
AllCap = LOW;
threeCap =LOW;
oneCap =LOW;
cap20 = HIGH;
cap40 = LOW;
delay(3000);
}
if(ReactivePower <CapThree && ReactivePower >= Cap40)
{
delay(2000);
digitalWrite(cap1,HIGH);
digitalWrite(cap2,HIGH);
digitalWrite(cap3,LOW);
digitalWrite(cap4,HIGH);
Reset = LOW;
CapState = HIGH;//for status purposes
twoCap =LOW;
AllCap = LOW;
threeCap =LOW;
oneCap =LOW;
cap20 = LOW;
cap40 = HIGH;
76
delay(3000);

}
//this
if(ReactivePower < Cap12)
{
digitalWrite(cap1,HIGH);
digitalWrite(cap2,HIGH);
digitalWrite(cap3,HIGH);
digitalWrite(cap4,HIGH);
CapState = LOW; //for status purposes
AllCap = LOW;
pastPf2 = HIGH;
twoCap =LOW;
threeCap =LOW;
oneCap =LOW;
Reset = HIGH;
cap20 = LOW;
cap40 = LOW;
delay(1000);
}
if(ReactivePower > Cap12 && ReactivePower < Cap20 && oneCap == HIGH)
{
digitalWrite(cap1,HIGH);
digitalWrite(cap2,HIGH);
digitalWrite(cap3,HIGH);
digitalWrite(cap4,HIGH);
CapState = LOW; //for status purposes
AllCap = LOW;
pastPf2 = HIGH;
twoCap =LOW;
threeCap =LOW;
oneCap =LOW;
Reset = HIGH;
cap20 = LOW;
cap40 = LOW;
delay(1000);
}
if(oneCap == HIGH && PowerFactor<= 0.79)
{
digitalWrite(cap1,HIGH);
digitalWrite(cap2,HIGH);
digitalWrite(cap3,HIGH);
digitalWrite(cap4,HIGH);
CapState = LOW; //for status purposes
AllCap = LOW;
77
pastPf2 = HIGH;
twoCap =LOW;
threeCap =LOW;
oneCap =LOW;
Reset = HIGH;
cap20 = LOW;
cap40 = LOW;
delay(2000);
}
}
ReadParameters();
Display();
if((PowerFactor>=0.83 && PowerFactor < 1 && PowerFactor !=0 )&&
CapState == HIGH)
{
SendImprovedPowerFactor();
Reset = LOW;
delay(1000);
}
if(PowerFactor>1 && CapState == HIGH)
{
pastPf = HIGH;
}
else if(PowerFactor>=0.85 && CapState == HIGH)
{
Reset = LOW;
}
if(CapState == HIGH && ReactivePower == 0 && PowerFactor == 0)
{
Reset = HIGH;
ReadParameters();
Display();

}
if(AllCap == HIGH && RealPower<CapAll)
{
digitalWrite(cap1,HIGH);
digitalWrite(cap2,HIGH);
digitalWrite(cap3,HIGH);
digitalWrite(cap4,HIGH);
CapState = LOW;
delay(1000);
}
if( Current == 0 && Voltage == 0 )
{
digitalWrite(cap1,HIGH);
78
digitalWrite(cap2,HIGH);
digitalWrite(cap3,HIGH);
digitalWrite(cap4,HIGH);
CapState = LOW;
pastPf2 = HIGH;
delay(1000);
}
if(CapState == HIGH && PowerFactor < 0.4 && PowerFactor > 0)
{
digitalWrite(cap1,HIGH);
digitalWrite(cap2,HIGH);
digitalWrite(cap3,HIGH);
digitalWrite(cap4,HIGH);
CapState = LOW;
delay(1000);
pastPf2 = HIGH;
Reset = HIGH;
}
if( CapState == HIGH && PowerFactor <= 0 && Current == 0)
{
digitalWrite(cap1,HIGH);
digitalWrite(cap2,HIGH);
digitalWrite(cap3,HIGH);
digitalWrite(cap4,HIGH);
CapState = LOW;
delay(1000);
}
else if(CapState == HIGH && RealPower <Cap12)
{
digitalWrite(cap1,HIGH);
digitalWrite(cap2,HIGH);
digitalWrite(cap3,HIGH);
digitalWrite(cap4,HIGH);
CapState = LOW;
delay(1000);
pastPf2 = HIGH;
}
if(Current == 0 && CapState == HIGH)
{
digitalWrite(cap1,HIGH);
digitalWrite(cap2,HIGH);
digitalWrite(cap3,HIGH);
digitalWrite(cap4,HIGH);
CapState = LOW;
delay(1000);
}
79
if(Current == 0 && CapState == LOW)
{
digitalWrite(cap1,HIGH);
digitalWrite(cap2,HIGH);
digitalWrite(cap3,HIGH);
digitalWrite(cap4,HIGH);
CapState = LOW;
pastPf2 = HIGH;
delay(1000);
}
if( threeCap == HIGH && RealPower < CapThree)
{
digitalWrite(cap1,HIGH);
digitalWrite(cap2,HIGH);
digitalWrite(cap3,HIGH);
digitalWrite(cap4,HIGH);
CapState = LOW;
pastPf2 = HIGH;
delay(1000);
}
if(AllCap == HIGH && PowerFactor<0.85) // just a condition for sending
the value of power factor
{
delay(2000);
ReadParameters();
SendImprovedPowerFactor();
}
if(threeCap == HIGH && CapState == HIGH)
{
delay(2000);
ReadParameters();
SendImprovedPowerFactor();
}
if(twoCap == HIGH && CapState == HIGH )
{
delay(2000);
ReadParameters();
SendImprovedPowerFactor();
}
if(oneCap == HIGH && CapState == HIGH )
{
delay(2000);
ReadParameters();
SendImprovedPowerFactor();
}
if(cap20 == HIGH && CapState == HIGH )
80
{
delay(2000);
ReadParameters();
SendImprovedPowerFactor();

}
if(cap40 == HIGH && CapState == HIGH )
{
delay(2000);
ReadParameters();
SendImprovedPowerFactor();
}
if(PowerFactor > 0 && PowerFactor < 0.83 && CapState == LOW)
{
pastPf = HIGH; // reset sms limit for nxt occurance
}
delay(100);
ReadParameters();
Display();
}

APPENDIX D

81
CONSTRUCTION OF THE SYSTEM

APPENDIX E

82
HOW TO OPERATE THE SYSTEM

APPENDIX F

83
DATA SHEET

PZEM – 004T

LCD I2C MODULE

GSM SIM800L

ARDUINO UNO

RELAY

84

You might also like