You are on page 1of 88

DEVELOPMENT OF LOW-COST MICROCONTROLLER-BASED LOAD

SHEDDING DEVICE

A Thesis Presented to the Faculty of Electrical Engineering


College of Engineering, Architecture and Technology
De La Salle University – Dasmariñas
Dasmariñas, City

In Partial Fulfillment of the Requirement for the Degree of


Bachelor of Science in Electrical Engineering

Adriel John I. Capiral


Bonn Carlo O. Martinez
Prnz Smaell B. Primero

July 2019
ACKNOWLEDGEMENT

This thesis becomes a reality with the kind support and help of many individuals.

We would like to extent our sincere thanks to all of them.

Foremost, we want to offer this endeavor to our Almighty God for the wisdom he

bestowed upon us, the strength, peace of our mind and good health in order to finish

this research.

We would like to thank our adviser Engr. Albert C. Velasco and our co-adviser

Mr. John Ferdinand G. Osorio for their time, effort, patience and overwhelming

guidance. Without them this study would not have been possible.

Lastly. we express our very profound gratitude to our family and friends for

providing us with unfailing support and continuous encouragement throughout our

years of study and through process of researching and writing this thesis. This

accomplishment would not have been possible without them. Thank you.

We dedicate this dissertation to our beloved parents; Alex & Arleen Capiral,

Fernando & Virginia Martinez, and Legaspi & Ma. Evangeline Primero. This is for us.
ABSTRACT

In modern time the demand for electricity is very high, almost anything is

powered by electricity, thus making our life highly dependent on it. Today, world power

management plays a significant role in reducing the power consumption and increasing

the efficient utilization of the available resources. In fact, there are power saving

devices available in the market, some of them may be too expensive, some are

affordable but doesn't guarantee a remarkable result and some requires a professional

for it to be properly operated.

Automatic load shedding is categorized as one of the power saving practice

applied to large scale factories that maintains a specific load usage. Automatic load

shedding automatically disconnects loads to lessen the power usage and be able to

save electricity. This study aims to develop a low-cost microcontroller-based load

shedding device that can be used in industrial or commercial purposes. Further, the

device will promote power saving and load shedding. The prototype device can display

the real-time power consumption and is also capable to set the desired consumption

limit for a specific branch circuit. Once the branch circuit power usage is near its power

consumption limit it will automatically cut the electricity flow on that said branch.
LIST OF TABLES

Table 2.1: Various Electricity Meters ………………………………………………….…………… 11

Table 2.2: Types of Power Limiters ………………………………………………….…………….. 22

Table 3.1: Prototype Recording Sheet …………………………………………………………….. 31

Table 4.1: Loads Used to Test the Monitoring Function of the Device ………………… 34

Table 4.2: Branch Circuit Loads and Measurement …………………………………………… 34

Table 4.3: Percent Difference Between Actual Power and Measured Power ………… 36
LIST OF FIGURES

Figure 1.1: Conceptual Framework ……………………………………………………………………. 7

Figure 2.1: Picture of an Electricity Meter …………………………………………………………. 10

Figure 2.2: Example Image of a Smart Meter ……………………………………………………. 13

Figure 2.3: Block Diagram of a Smart Meter ……………………………………………………… 13

Figure 2.4: Difference Between Traditional Meters vs. Smart Meters …………………… 15

Figure 2.5: Block Diagram Illustrating the Different Steps

Involved in Basic NILM Implementation …………………………………………… 19

Figure 3.1: Current Sensor ……………………………………………………………………………… 26

Figure 3.2: Arduino Mega 2560 ……………………………………………………………………….. 27

Figure 3.3: Arduino Compatible 5V Relay Board ………………………………………………… 28

Figure 3.4: Digital Multimeter ……………………………………………………………………….... 29

Figure 3.5: Clamp Meter …………………………………………………………………………………. 30

Figure 5.1: Schematic Diagram of Prototype of Load Shedding Device ………………… 37

Figure 5.2: Connection Diagram of Prototype of Load Shedding Device ………………. 38

Figure 5.3: System Block Diagram …………………………………………………………………… 39

Figure 5.4: Assembly Diagram ………………………………………………………………………… 41

Figure 5.5: Prototype Layout Design ………………………………………………………………… 42


LIST OF APPENDICES

Appendix A: Lines of Codes Used in the Device ………………………………………………….. 48

Appendix B: User Manual of the Device ……………………………………………………………… 77

Appendix C: Budget Allocation ………………………………………………………………………….. 78

Appendix D: Specification Sheet of Current Sensor and Arduino Mega 2560 ………….. 79

Appendix E: About the Researchers ……………………………………………………………………. 91


TABLE OF CONTENTS

TITLE PAGE ………………………………………………………………………………………………………… i

ACKNOWLEDGEMENT …………………………………………………………………………………………. ii

ABSTRACT ………………………………………………………………………………………………………… iii

TABLE OF CONTENTS ………………………………………………………………………………………... iv

LIST OF TABLES …………………………………………………………………………………………………. v

LIST OF FIGURES ………………………………………………………………………………………………. vi

LIST OF APPENDICES ………………………………………………………………………………………… vii

CHAPTER 1 : INTRODUCTION
1.1 BACKGROUND OF THE STUDY .........................................................1
1.2 OBJECTIVES OF THE STUDY ............................................................3
1.3 SIGNIFICA NCE OF THE STUDY .......................................................4
1.4 SCOPES AND LIMITATIONS .............................................................5
1.5 CONCEPTUAL FRAMEWORK .............................................................7
1.6 DEFINITION OF TERMS ...................................................................8

CHAPTER 2 : REVIEW OF RELATED LITERATURE


2.1 TRADITIONAL ELECTRIC METER .................................................... 10
2.2 SMART METERING ........................................................................ 12
2.3 SMART METER VS. TRADITIONAL METERS ..................................... 14
2.4 LOAD SHEDDING .......................................................................... 16
2.5 LOAD MONITORING ...................................................................... 18
2.6 LOAD MANAGEMENT ..................................................................... 20
2.7 LOAD LIMITING ............................................................................ 21
2.8 REAL-TIME CLOCK ........................................................................ 22

CHAPTER 3 : METHODOLOGY
3.1 GATHERING OF DATA ................................................................... 23
3.2 METHODS OF RESEARCH............................................................... 24
3.3 INSTRUMENTATION ...................................................................... 26
3.4 STATISTICAL ANALYSIS ................................................................ 31

CHAPTER 4 : DATA AND RESULTS


4.1 DATA AND RESULTS...................................................................... 33

CHAPTER 5 : DESIGN AND ASSEMBLY PROCEDURE


5.1 Design Procedure .......................................................................... 37
5.2 Assembly Procedure ...................................................................... 41

CHAPTER 6 : CONCLUSION AND RECOMMENDATION


6.1 Conclusion .................................................................................... 44
6.2 Recommendation .......................................................................... 44

BIBLIOGRAPHY ..………………………………………………………………………………………………. 46

APPENDIX A …………………………………………………………………………………………………….. 48

APPENDIX B …………………………………………………………………………………………………….. 77

APPENDIX C …………………………………………………………………………………………………….. 78

APPENDIX D …………………………………………………………………………………………………….. 79

APPENDIX E …………………………………………………………………………………………………….. 92
Chapter 1

INTRODUCTION

1.1 BACKGROUND OF THE STUDY

To maintain the life of the human community, and to facilitate life, many

important inventions were discovered and made to make life easier. There is no

doubt that the most important of all inventions is electricity. People became

dependent on it over time. People now live in a time where electricity is used

everywhere, from big transportation vehicles, such as railway system, up to a

very simple device like a toothbrush. Along with the technological advancement

in everyday life, almost everything today is powered by electricity, the

productivity of people highly depends on the availability of electricity. Because

of the availability of electricity, people neglect the importance of it. People take

it for granted and only see the importance of electricity during power outages,

when everything seem to slow down. Due to irresponsible consumption there

are a lot of energy wasted on unnecessary things.

Today, one of the main consumers of electricity in the country are

industrial plants. Industrial plants are the ones responsible in production,

1
manufacturing, processing, and etcetera of the things that people use in their

everyday life. Industrial plants use machines/ equipment daily, these machines

are not the typical machines that can be seen anywhere, these are big

machines/ equipment that are humongous, state of the art, and powerful. Even

though these machines/ equipment acts as the heart and soul of an industrial

plant its electricity consumption is severe, making industrial plants as the main

consumers of electricity in the country.

Power saving is achievable without the use of power saving devices like

Electricity Energy Power Saving Box and renewable energy devices. It can be

achieved through load management and load shedding. Load management is a

process in which the system balances the electricity supply with the demand.

Load shedding is a system in which it will automatically disconnect devices

which are not used or less priority and will maintain only those that are

essential. Load prioritization is a way to determine which loads are highly

prioritized and must be maintained most of the time, so that the less significant

loads will be sorted out in way it can be easily unloaded once the power

consumption limit is near its maximum allocated consumption.

2
1.2 OBJECTIVES OF THE STUDY

The main goal of this study is to give industrial plants an option to use

microcontroller based automatic load shedding device, which is cheaper and

easier to maintain, rather than Programmable Logic Circuit (PLC).

Programmable Logic Circuit (PLC) are the commonly used controlling device

today, but Programmable Logic Circuit (PLC) are very expensive, quite hard to

maintain, and requires an expert to operate. Putting this in mind, the

researchers desired to make this device easy to use, understand and

economical.

The main objective of this study is to develop a low- cost microcontroller- based

load- shedding device. The specific objectives are:

1. To come up and test a proto- type capable of shedding an industrial

load;

2. To program the load- shedding device in order to manage and control

power consumption of industries; and

3. To test the device using simulation

3
1.3 SIGNIFICANCE OF THE STUDY

The results of this research would help the industrial consumers on

monitoring their power consumption, to limit their load and prioritize their

preferred process. The researchers want to develop a device that would help

industrial plants control and manage their energy consumption which would not

only lessen the chance of demand charges but also helps maintain a specific

amount of consumption. With the application of load shedding on industrial

plants, there would be substantial amount of electricity saving, and would also

lessen the impact on the environment, as this means that there will be lesser

demand for electricity which in turn would also lessen the demand for electricity

generation that can be harmful for the environment.

The results of this research would not only be beneficial to industrial

consumers but also to residential and commercial consumers also. When power

consumption is lessened, the balance of the supply demand system would be

easier to manage, thus, preventing power outages nationwide. An example of

the situation would be like what happened last 2017 when there was a power

shortage all over Luzon because some of the generators underwent

maintenance. The lesser the demand for electricity, the lesser demand also for

the fossil fuels burned in power plants and produces pollution.

4
The consumers would also benefit from this study. Once the industrial

plants were able to achieve their desired power consumption, their electricity

consumption will show a drastic decrease. Industrial plants expenses will be

lessened because hiring an expert to control PLCs would not be necessary

because microcontrollers would be used instead, and the high-cost

maintenance would be lessened because the maintenance of microcontrollers is

cheaper compared to PLCs. Given these considerations, operating cost of

industrial plants will greatly decrease, decrease in operating cost means the

manufacturers can lower the prices of their products which is very beneficial to

the consumers.

This research will be a useful reference for the researchers who would

plan to make any related study precisely the standard underlying the Bachelor

of Science in Electrical Engineering program.

1.4 SCOPES AND LIMITATIONS

The scope of the study is for prototype making, testing and simulation

only. This research involves the use of microcontrollers which would be used to

monitor the power consumption, and automatic power cut-off. There are three

functions that the researchers want in the device: Load monitoring and

Automatic load shedding.


5
This study would focus on developing the device for commercial/

industrial use but will be tested on using a small representation of an electrical

system due to number of reasons, namely: Time constraints, money, and most

importantly, the permission of the owner due to safety concerns. The testing of

the device would be on a small representation only wherein the researchers will

produce a system that would simulate the electrical system of an industrial load.

This research would require a lot of resources if implemented on an

industrial plant particularly, the permission to use the researcher’s device on an

industrial plant. Fabrication of a prototype is the main goal of this study.

The main function of the device would be automatic load shedding,

shedding of loads by limiting the power that can be consumed by each branch

circuit will help the users optimize their electrical usage and prioritize critical

loads such as motors in an industrial building. In an industrial building, the loads

that are important to the operation should be prioritized as shutting them off

may cause several problems.

6
1.5 CONCEPTUAL FRAMEWORK

INPUT
1. Current reading of branches
2. Setting of limits by the user
3. Concurrence to standards (PEC 2017)

PROCESS
4. Prioritization of the loads
5. The researchers will provide an estimation of demand
loads.

OUTPUT
6. Automatic load-shedding device
7. Active monitoring of the power consumption of each
branch circuit

Figure 1.1 Conceptual Framework

7
The inputs in this research will be the current drawn by the branch

circuits and the limit that is set by the consumers/users. The device will make

use of current sensor to detect and monitor the current and the data taken by

the sensors will then be feed to the Arduino and calculated to be displayed as

power consumed. The other input would be the limit that is set by the users.

Depending on the current financial standing of the user, he/she can set the

limit to a high or low value.

For the process, the researchers will design a system by using an

Arduino microcontroller that can automatically turn on/off the loads, monitor

the power consumption, and manage their electrical system. The output of this

system will be a prototype or a device that would satisfy the objective of the

researchers for this study.

1.6 DEFINITION OF TERMS

Arduino- An Arduino is a type of microcontroller and can be programmed based

on the needs of the user.

Microcontroller- A Microcontroller is a compact integrated circuit designed to

govern a specific operation in an embedded system.

8
Load Shedding- It is a process wherein a load or a circuit is terminated to

stabilize the system.

Smart Meter- It is a device which measures and record the energy consumption

and transmit the information to the electrical supplier.

Load Profiling- It is a graph of the variation in the electrical load versus time.

Load Demand- It is the sum of the operational load and non-operational load.

9
Chapter 2

REVIEW OF RELATED LITERATURE

2.1 TRADITIONAL ELECTRIC METER

The name of the device that can detect, measure and display energy

consumption is called “Electricity Meter”. Electricity meters have been used

since way back late 19th century and has many types including the electrolytic

meter and the commutator meter which operates differently with each other.

For most of the traditional electric meters, an aluminum disc is used to

determine the power usage. (Vadda & Seelam, 2013) A Simple electricity meter

is shown below.

Figure 2.1 This is a picture of an electricity meter.


Source: https://en.wikipedia.org/wiki/File:Hydro_quebec_meter.JPG

10
Limitations of a traditional electricity meters are the following:

1. Traditional electricity meters are hard to understand/read.

2. In order to be read and billed, a number of employees have to be

dispatched to manually inspect the meters.

3. The meter is mechanical and uses a kind of disc which revolves

continuously to measure the power consumption, and after a certain

time, the disc will slow down a few percentage making the reading

slightly inaccurate.

Different types of electricity meters are stated in the table below.

Table 2.1 Various electricity meters


Source: https://www.diva-portal.org/smash/get/diva2:829754/FULLTEXT01.pdf

11
2.2 SMART METERING

According to Gandhi and Bansal (2013), that people today does not

really care about their own consumption of electricity in their everyday living

and will only bothered when they received their electricity bill or in case of

power shortage. During the early days of measuring electricity consumption,

Electromechanical Induction meter was used in which the meter operates by

counting the revolution of a metal disc rotating at a speed proportional to the

power. As time goes by, technological advancement was consistent, along with

it is the introduction of a convenient, accurate and, time saving metering device

which is now called Smart meters. Smart Metering System consists of three

main components: Advanced Measuring Device, Communication Network, and

Meter Data Management. Smart metering has many advantages especially for

the consumers. Smart metering system provides an efficient way for the

consumers to access all their transaction history and pay on time. Smart

metering also reduces the risk of tampering with the meter and gives a security

that electric theft will be lessen so tariff rates will go down.

12
Figure 2.2 This is an example image of a smart meter
Source: https://www.smart-energy.com/magazine-article/global-trends-in-smart-metering/

Figure 2.3 Block diagram of a smart meter


Source:
https://www.researchgate.net/publication/271556180_Smart_Metering_in_electric_power_distri
bution_system

13
From “Smart Metering for Intelligent Buildings” by Zivic et al. (2016),

service providers obtain instant and accumulative data on the consumers with

the help of smart metering, at the same time the consumers are also able to

see the information obtained. Smart metering promotes reduction of costs,

energy consumptions and etcetera. Smart meters provide both real-time and

near real-time readings on the consumption of the user, it helps in detecting

anomalies, sorting out which energy wasting equipment can be laid off, and can

help in improving the consumption efficiency of the consumer. It does not only

help the end consumer to identify and remedy the sources of high energy

consumption but also helps the provider to determine the times of peak energy

demands and sources of energy wastage.

2.3 SMART METER VS. TRADITIONAL METERS

According to Bimenyimana & Asemota (2018), some countries and

organization is now modernizing the power consumption measurement by

replacing the traditional electricity meters with a digital meter also called the

smart meter which measures and records the power consumption hourly.

14
In traditional electricity meters, the reading is done manually by

inspectors, the consumers would have to wait for their monthly electric bill to

know their usage, no power outage detection, and the connections and

disconnections must also be done manually. However, for smart meters, meter

reading is done remotely from a location, energy consumption reading is

provided near real time, and connections and disconnections are faster as they

can be managed remotely. Smart meters are also more accurate than

traditional meters, has more features and also provides security as smart

meters are harder to be manipulated rather than the traditional meters which

still uses a disc. Although smart meters have many advantages and benefits, it

still has some disadvantages such as, smart meters have shorter life expectancy

of just less than 10 years compared to the traditional meters which can last 30

to 40 years, and also the ‘human-less’ system which would result to

unemployment to thousands.

Figure 2.4 Difference between traditional meters vs. smart meters


Source:
https://www.researchgate.net/publication/325669617_Traditional_Vs_Smart_Electricity_Meterin
g_Systems_A_Brief_Overview

15
2.4 LOAD SHEDDING

According to Syadli et al. (2016), load shedding is done as the last resort

of the utility company to prevent the collapse of a power system. Load

shedding is done when there is not enough electricity to supply the demand of

the consumers. When power supply cannot meet the demand, it could cause an

unbalance in the power system resulting to a blackout and that could take a

large period of time to recover and to be repaired. When power is not enough,

the first step the utility company takes is to ask large consumers (industrial &

commercial buildings) for permission to reduce their power consumption

voluntarily. However, if the shortage is sudden, the utility company might go to

load shedding immediately to prevent an unstable system.

Nevertheless, of the description being applied to large scale power

system, load shedding can be also applied into a small-scale system such as

residential buildings so that energy consumption and electric bills will go lower.

In that process, some of the appliances used might turn off temporarily for the

cost of saving power and budget.

According to Syadli et al. (2016), there are 2 widely used methods for

load shedding schedule. That is the ‘Shortest Job First’ or SJF and the Round

Robin Scheduling or RR. For the SJF, each process is determined based on their

16
‘importance’, the least priority process will then be cut-off until the power

system can supply the demand again. Meanwhile in RR, each process will be

executed routinely until the system can handle it all again.

Supervisory controller, secondary controller, and smart plugs are used in

implementing smart home control system. Supervisory controller plays as the

power utility, commonly gives the appropriate load shedding

commands. Secondary controller acts as the central controller of the smart

home which is connected to smart power meter that signals to turn off or on

appliances optimally or automatically. Smart plugs are the one that applies the

commands given by the supervisory and secondary controller. Monitoring and

controlling the electrical appliances with the help of appropriate sensors and

actuators can help improve load shedding. Some of the best strategies that can

be used in saving electricity is by controlling the consumption of electrical

appliances/ loads, setting the desirable start and end time of certain device,

controlled maximum and minimum consumption of devices during standby

mode, and etcetera. Time-of-use (TOU) tarrifs should be considered because

different techniques or strategies that will be used is highly dependent on it.

(Parsa et al., 2018)

17
2.5 LOAD MONITORING

One of the important aspects of the energy management is energy/load

monitoring. Understanding first the electrical loads and knowing the energy

consumption is needed in order for the consumer to estimate and minimize

their energy consumption.

According to Berges et al. (2011), last 2008, 40% of the total energy

consumption in United States was used to generate electricity, majority of this

energy, 68%, is lost during the process of generation and distribution.

Reducing the consumption in residential and commercial facilities would give a

drastic effect on the total energy consumption. Despite the introduction of

Green Buildings, electric consumption will consistently increase because of the

ever-growing population that consumes electricity. New building codes, utility

energy-efficiency programs, and appliance standard, combined can reduce 30%

of the electrical usage over the next decade.

Automated Meter Reading (AMR) system provides more frequent update

compared to the service providers monthly reports, this gives the consumer

real-time energy feedback on their current consumption, which can help them

plan or strategize on how they’re going to be able to save electrical energy.

Hardware submetering is a way to determine the detail appliance usage

18
information, so that the user can point out which specific appliances consumes

the most energy. Load monitoring can be categorized into two. Intrusive load

monitoring (ILM) and Non-intrusive load monitoring (NILM). ILM is a process in

which each single appliance energy consumption is to be analyzed individually

and to be communicated into a central hub while NILM is a process in which

each individual appliance energy consumption is analyzed based on the total

load consumption. NILM is a process in which a system is installed in the main

feed of a residential house or a building’s power distribution system that is

capable of extracting detailed information by carefully processing it, because

not all loads have the same characteristic in drawing current. NILM provides

high level of detail and yet it costs less than the hardware-based submetering.

Figure 2.5 Block diagram illustrating the different steps involved in basic NILM implementation
Source: https://ascelibrary.org/doi/10.1061/%28ASCE%29CP.1943-5487.0000108

19
Based on the study made by Devlin and Hayes (2018), Non-Intrusive

Load Monitoring is the process of disintegrating total building electricity mains

measurement into individual appliances.

2.6 LOAD MANAGEMENT

According to Rauf et al. (2016), Demand side load management plays a

big role in a smart grid. Demand side load management enables the users to

determine their energy consumption during peak and off-peak hours, it does

not only give a much more reliable system with an improvement on efficiency,

but also has a low emission of CO2 in smart grids. Because of Information and

communication technology (ICT), grids today are more advanced and efficient.

With the availability of new sensor and the ability to communicate real time

power, monitoring and controlling grids today are much more reliable and

productive.

Based on a study by Matthew (2018), there are different approaches for

maximum demand control. Load curve generation is a process by recording the

load consumption every hour for 24 hrs. Rescheduling of loads, is the process

by shifting the schedule of large electric loads into different scheduled time to

minimize the simultaneous maximum demand. By preparing an operation flow

20
chart and a process chart will give the user a more accurate schedule on when

to operate the equipment that ensures an improved load factor which reduces

the maximum demand. Another means of reducing maximum demand is by

using electricity during off peak periods. Off peak hour promotes energy saving

due to its favorable conditions, such as lower ambient temperature.

2.7 LOAD LIMITING

For load limiting, a limiter device is used to restrict the flow of electricity

but will still allow a minimal amount of power to pass through the meter in

order to maintain service instead of completely shutting off the power. By

setting a limit on how much power can the consumer consume, they can assure

that their power consumption would not exceed past the limit set. The power

will stay on as long as the consumer stays within their set limit (e.g. only 350-

watt hours in a 15-minute period) but when they do exceed the limit, the

limiter will shut off the electricity, from EPCOR (2018).

21
There are 4 types of power limiters available

Table 2.2 Types of power limiters


Source: https://www.epcor.com/learn/meters/Pages/power-meter-limiters.aspx

2.8 REAL-TIME CLOCK

A real-time clock (RTC) is a digital clock and calendar that uses minimal

amount of energy in which it gathers data in real-time. RTC is necessary to be

used in smart metering as energy is proportional to the unit of time. Utility

companies such as MERALCO and Maynilad charges the bill at the end of the

month. Based on a study of Morad et al. (2018). If the time reaches to the set

time, the count will reset to zero and start count back the pulse. Which means

that with the help of RTC, the smart meter should reset the metering and

should be able to notify the users total amount of energy consumed for the

whole month at the end of every month.

22
Chapter 3

METHODOLOGY

3.1 GATHERING OF DATA

The researchers will make use of the following equipment to gather data

that is needed in order to create the device:

1. Current sensor and clamp meter

- The current sensor and clamp meter will be used to measure

current. The current sensor is a part of the device and will be

responsible for the current measurement for the loads

connected to the device while the clamp meter is used directly

on the load/s in order to measure the accuracy of the data

gathered by the device.

2. Arduino

- The Arduino will be responsible for all the data gathering. All

the data that will be gathered such as the limits set by the

user, time, current measured, and the computed parameters

such as power.

23
3.2 METHODS OF RESEARCH

The researchers first step is to identify the common loads on an

industrial building, this step is done to determine the components used in the

device whether it can handle the load/s that will be used. Due to the

unavailability of industrial loads some of the loads chosen were typical

household appliances.

The next step would be choosing the appropriate components that will

be used; it is also a priority to make the device as inexpensive as possible.

Knowing that the researchers would not be able to find a residential house that

the device can be installed, a representation of a residential house electrical

system with three-phase capability will be made.

The next step is to design a device which would be able to automatically

turn on and off the supply for every branch circuits, and a device that can

monitor the total power consumption of each branch circuits. The device will

make use of an Arduino MEGA, RTC module, Relay, and Current Sensor to

achieve the desired functions. The Arduino is responsible for the process that

will be done to shed load, manage load, and/or limit load, the RTC module is

24
used to keep track of the time and relay to act as a switch which will cut off the

power being supplied to each branch circuit.

Once the design is finalized and the proper components were chosen,

the researchers will create a code for the Arduino Mega 2650 for it to operate

properly and accomplish the task that is tasked to do.

After coding the device, the researchers will now calibrate the current

sensor for it to accurately read the current consumption of each branch circuit.

It is necessary to calibrate the current sensor so that there would be an

accurate reading and at the same time the device will be able to shed the

branch circuit precisely.

Assembly would be the last part of creating the project before the

testing. In this part the researchers will now combine all the components to

build the system; everything will be placed in a casing that has contactors,

circuit breakers, receptacle, and etcetera to create a representation of an

electrical system.

The last part would be the testing of the prototype. The researchers will

now test the chosen load/s. The researchers will conduct 3 tests on the two

25
single-phase branch circuits, and 2 tests on the three-phase branch circuit. The

researchers will assign a specific amount of consumption to a specific branch

circuit and will check if the system will automatically shut of the electricity on

that said branch circuit. The researchers will record the power consumption,

time, and whether the device successfully lay-off the branch circuit.

3.3 INSTRUMENTATION

Figure 3.1 Current Sensor


Source: https://solarbotics.com/product/33530/

A current sensor module will be used by the researchers to measure the

current being drawn by the branch circuits. The current sensor will detect the

26
current passing through the wires and will generate a signal based on the

current detected.

Figure 3.2 Arduino Mega 2560


Source: https://www.robotshop.com/en/arduino-mega-2560-microcontroller-rev3.html

Arduino Mega 2560 will be used as the main microcontroller of the

device. It will serve as the brain of the device, because it is the one responsible

in every operation of the device.

27
Figure 3.3 Arduino Compatible 5V Relay Board
Source: https://www.jaycar.com.au/arduino-compatible-5v-relay-board/p/XC4419

Relay will be used as the main switching device of the prototype. Relay is

the one that will trigger the electricity on the branch circuit, it is also the one

that will cut the electricity once the limit is reached.

28
Figure 3.4 Digital Multimeter

Source: https://www.fluke.com/en-ph/product/electrical-testing/digital-multimeters/fluke-87v

A Digital Multimeter will be used to measure the current consumption


and the voltage of the load.

29
Figure 3.5 Clamp Meter
Source:
https://www.indiamart.com/proddetail/fluke-302-plus-digital-clamp-meter-9049752297.html

The clamp meter will be the major instrument used in this study so that

the researchers will have a much more accurate measurement on the current of

each device, rather than conducting manual computations.

30
BRANCH TEST # LOAD/S LIMIT TIME LOAD SHED
CIRCUIT
(YES/NO)

1 Y

BRANCH 1 2 Y

SINGLE-
PHASE 3 Y

BRANCH 2 1 Y

THREE-
PHASE
2 Y

1 Y

BRANCH 3 2 Y

SINGLE- 3 Y
PHASE

Table 3.1 Prototype Testing Record Sheet

This table will be used to record all the results of each test that will be

conducted. This table gives the researchers the reliability and the accuracy of

the device.

3.4 STATISTICAL ANALYSIS

In this research, the data taken from the measurements are analyzed

and compiled in a table. The researchers will use quantitative research method

to determine if the device works as it is supposed to. The data gathered will be

31
tabulated and analyzed once all the testing has been conducted. The device will

be connected between the load and the circuit breakers to monitor the

consumption of individual branch circuits, and temporarily turn it off

individually. The researchers will make use of 3 branch circuits for testing

purpose of the device and will use a combination of resistive loads such as

lamps and inductive loads such as motors for the tests. The researchers will

purposely reach the assigned consumption limit that is set in order to test the

function of the device, the results will be monitored and stored. All in all, 5 tests

for each branch circuit will be conducted on the device so that the researchers

will be able to determine the reliability rate of the device.

The device will display the power consumption, since the device will only

measure the current, the researchers will set the voltage at fixed 230 volts.

With this, the researchers will use Dependent Variable, the current and the

voltage will be the independent variable, while the power will be the dependent

variable. A change in the independent variable directly causes a change in the

dependent variable.

32
Chapter 4

DATA AND RESULTS

4.1 DATA AND RESULTS

This chapter presents and analyzes the data gathered by the researchers

throughout the research. The study aims to create a device/prototype which

can shed load on industrial buildings by using an Arduino controller which

makes it a low-cost alternative to the PLC.

The device is tested in a residential house/commercial setup with a bit of

modifications to simulate industrial operations rather than an actual industrial

building due to limited budget and safety reasons.

Note that for branch circuits 1 and 3, the configuration is in single-phase

configuration while branch circuit 2 is in three-phase configuration.

Here are the following loads used in the testing process:

1. Flat iron

2. Hair dryers

3. Laptop charger

33
4. Three-phase induction motor

LOAD RATED CURRENT MEASURED CURRENT (RMS)

Laptop Charger 0.5 Amperes 0.3 Amperes

Clothes Iron 4 Amperes 3.9 Amperes

Hair Dryer 4 Amperes 4 Amperes

Induction Motor 1.15 Amperes 1.3 Amperes

Table 4.1 Loads used to test the monitoring function of the device

The loads used in the testing process are loads typically used not just in a

residential house but also in an industrial building. A small three phase

induction motor is also used in order to mimic the load on an industrial building.

The current measured using the device is not a 100% accurate but the margin

of error is ±0-10%.

BRANCH TEST LOAD/S LIMIT TIME LOAD


CIRCUIT NO. SHED
(Wh) (Seconds)
(YES/NO)

1 Hair Dryer 5 Wh 32.65 secs Y

BRANCH 1 2 Clothes 10 Wh 383 secs Y


Iron
(SINGLE-

34
PHASE) 3 Laptop 5 Wh 379 secs Y
Charger

Three- 100 Wh 317 secs


phase
BRANCH 2 1 Induction Y
Motor
(THREE-
PHASE) Three- 150 Wh 473 secs
phase
2 Induction Y
Motor

1 Hair Dryer 3 Wh 25.22 secs Y

BRANCH 3 2 Clothes 5 Wh 187 secs Y


Iron
(SINGLE-
PHASE) 3 Laptop 5 Wh 382 secs Y
Charger

Table 4.2 Branch Circuit loads and measurement

The study requires at least 3 branch circuit to be tested in order to make

the testing as close as possible to real life situations. As seen on the table

above, different loads are connected to each branch circuit and they are

measured independently in order to determine the power consumption of each

branch circuit and turn it off once the assigned limit is reached.

35
Branch no. Test no. Actual Measured Percent

Power Power Difference

(Watts) (Watts) (%)

Branch Circuit 1 1 680.8 watts 623 watts 8.5%

(Single-phase) 2 736 watts 731.3 watts 0.63%

3 55.2 watts 52.78 watts 4.38%

Branch Circuit 2 1 1115 watts 1100 watts 1.35%

(Three-phase) 2 1115 watts 1100 watts 1.35%

Branch Circuit 3 1 680.8 watts 623 watts 8.5%

(Three-phase) 2 736 watts 731.3 watts 0.63%

3 55.2 watts 52.78 watts 4.38%

Table 4.3 Percent Difference between Actual Power and Measured Power

This table shows the difference between actual power and measured power.

The measured power came from the reading consumption of the device.

36
Chapter 5

DESIGN AND ASSEMBLY PROCEDURE

5.1 Design Procedure

Figure 5.1 Schematic Diagram of Prototype of Load Shedding Device

The current sensor is connected in series with the relay / contactor in order to

simultaneously measure the current of the branch circuit while turning off / on

37
the circuit. The current sensors are connected on pins A11, A12, and A13 of the

Arduino MEGA as input. The relays are connected on pins 41, 42, and 43 of the

Arduino MEGA as output. The 4x4 keypad is connected in a matrix and has 4

column pins and 4 row pins which are connected to pins 22, 24, 26, and 28,

and pins 30, 32, 34, and 36 for column and row pins respectively. The LCD and

RTC module both use I2C (Inter-integrated circuit) and are connected to SDA

(Serial data) and SCL (Serial clock) pins of the micro-controller.

Figure 5.2 Connection Diagram of Prototype of Load Shedding Device

The device will make use of Arduino MEGA as its microprocessor; the

Arduino MEGA will be the “brain” of the device as it is the one responsible for

making every function that the researchers will set be satisfied.

There will be a total of 3 branch circuits that will be used in the testing

process. In between each branch circuits and load, a current sensor and relay

38
will be connected. The current sensor will monitor and measure the current

flowing on the branch circuit and the data taken will then be transmitted into

the Arduino and will be processed accordingly. The relay is also connected in

order to satisfy the function load shedding, the relay will be responsible for the

actuation of the circuit.

Figure 5.3 System Block Diagram

The device is capable of doing the following:

1. Continuous load monitoring

2. Turning on/off of power

The Arduino Mega 2560 microcontroller is determined to be suitable for

this operation as it fits all the needed characteristics. Based on the device’s

39
features, the researchers determined the needed components which are the

following:

5. RTC Module for the clock function

6. LCD Screen to display the data

7. Relay will act as a switch

8. Current sensor to measure the current being drawn

9. Keypad for interfacing the arduino

10. Contactor will act as a switch for the 3-phase branch circuit

11. 15AT Circuit Breaker

12. 60AT three-phase Circuit Breaker

The next step would be the encoding of the commands necessary for the

function of the device into the Arduino. The codes will dictate the actions that

the Arduino will do based on the conditions set by the researchers.

The device will be able to measure the current, the researchers set the

voltage specifically at 230 volts. Power can be computed with this formula

P=VRMS*IRMS*pf, voltage will be fixed at 230 volts, power factor will be set to

0.8 and the current is the one that will be measured by the device.

Sample computation:

𝑃 = 𝑉 × 𝐼 × 𝑝𝑓

40
𝑃 = 230 𝑣𝑜𝑙𝑡𝑠 × 35 𝑎𝑚𝑝𝑒𝑟𝑒 × 0.8 = 6,440 𝑤𝑎𝑡𝑡𝑠

The last step would be to test the functionality of the device in a small-

scale representation of load/s used in industrial and/or on commercial buildings.

The loads used during the testing procedures are flat iron, hair dryers, laptop

charger, and a three-phase induction motor.

5.2 Assembly Procedure

Figure 5.4 Assembly Diagram

There is a total of 5 specific components that will be used and will be

connected into the Arduino MEGA microcontroller. The electronic components

that will be used are RTC Module, Relay, Current sensor, Keypad, and LCD

screen. All these components will be connected to the Arduino individually as

each of the components has different functions.

41
After planning, laying out and designing the circuit, the components will

be installed and soldered in its designated location. Upon the installation of the

components, wiring will be done to connect the components. Once all the

electronic components are done and fully operational, the researcher will design

an enclosure/ casing for the prototype for it to look presentable. The

researchers will ensure that all the components will fit perfectly in a casing to

ensure the safety and protection of the device.

Figure 5.5 Prototype Design Layout

On the presentation of the prototype, the researchers will make a

representation of the electrical system of an industrial unit excluding the

42
wattmeter. All of the equipment, prototype, protective devices, and receptacle

outlets will be placed in a wooden sheet. There will be three receptacles that

will represent each branch circuit, two will be in single-phase outlet and the

remaining will be a three-phase terminal.

43
Chapter 6

CONCLUSION AND RECOMMENDATION

6.1 Conclusion

The researchers were able to develop a low-cost microcontroller-based

load shedding device that can be used in industrial application. The researchers

were able to create a load shedding device using Arduino Mega 2560. The

device can cut the electricity consumption of a specific branch circuit once it

reaches its assigned value. The researchers were also able to create a load

shedding device that is less expensive compared to PLC’s, thus, satisfying the

‘low-cost’ part of the research.

6.2 Recommendation

However, the testing was done only on small scale representation

meaning that if the device developed by the researchers will be used on proper

buildings, the relay and the current sensor must be replaced with the same

components but with different capacity as the relay used in the device can only

handle up to 30 Amperes while the current sensors can only handle 5 amperes

44
for the branches 1 and 3, while 30 amperes for branch 2. Future researchers

can also include a backup power supply for the prototype in case of unexpected

power outage. Future researchers can improve the device by eliminating the

unwanted delays of measuring in between branch circuits.

A pin-code security should be added if ever the device will be used in

dormitories or apartments, so that if the proprietor is not available and a tenant

wishes to adjust his/ her energy consumption, another person could fill-in

his/her position.

A SMS system should be added so that the owner can remotely adjust

the consumption limits.

45
BIBLIOGRAPHY

1. Yao, Runming & Steemers, Koen. (2005). A method of formulating

energy load profile for domestic buildings in the UK. Energy and

Buildings. 37. 663-671. 10.1016/j.enbuild.2004.09.007.

2. Bimenyimana, Samuel & Norense Osarumwense Asemota, Godwin.

(2018). Traditional Vs Smart Electricity Metering Systems: A Brief

Overview. 46.

3. Raghu, C.N. & Manjunatha, A. (2017). Assessing Effectiveness of

Research for Load Shedding in Power System. International Journal of

Electrical and Computer Engineering. 7. 3235-3245.

10.11591/ijece.v7i6.pp3235-3245.

4. Syadli, Husna & Abdullah, Md Pauzi & Faridiansyah, Iqbal & Hassan,

Mohammad Yusri & Hussin, Faridah. (2016). An improved load shedding

scheduling strategy for solving power supply defisit. Jurnal Teknologi.

78. 10.11113/jt.v78.8714.

5. Gandhi, Karan & Bansal, Hari. (2013). Smart Metering in electric power

distribution system. CARE 2013 - 2013 IEEE International Conference on

Control, Automation, Robotics and Embedded Systems, Proceedings. 1-6.

10.1109/CARE.2013.6733756.

46
6. Montana, Johny & Candelo-Becerra, John & Racines, Diana. (2018). Non-

Intrusive Electrical Load Monitoring System Applying Neural Networks

with Combined Steady-State Electrical Variables. Tehnicki Vjesnik. 25.

1321-1329. 10.17559/TV-20170317203817.

7. Racines, Diana & Candelo-Becerra, John. (2014). Non Intrusive Load

Identification with Power and Impedance obtained from Smart Meters.

International Journal of Engineering and Technology. 6. 1867-1876.

8. Figueiredo, Marisa & De Almeida, Ana & Ribeiro, Bernardete. (2011). An

Experimental Study on Electrical Signature Identification of Non-Intrusive

Load Monitoring (NILM) Systems. 31-40. 10.1007/978-3-642-20267-4_4.

9. Zunnurain, Izaz & Maruf, Md. Nasimul Islam & Rahman, Md Moktadir &

Shafiullah, Gm. (2018). Implementation of Advanced Demand Side

Management for Microgrid Incorporating Demand Response and Home

Energy Management System. Infrastructures. 3. 50.

10.3390/infrastructures3040050.

10. Rivera, Pico. (2018)

“Https://Www.electricitylocal.com/States/California/Pico-Rivera/.” CA

Electricity Pico Rivera, CA Electricity Statistics, 2018,

www.electricitylocal.com/states/california/pico-rivera/.

47
APPENDIX A

LINES OF CODES USED IN THE DEVICE

#define One A11

#define Two A12

#define Three A13

#define relayOne 41

#define relayTwo 42

#define relayThree 43

#include <DS3231.h>

#include <SPI.h>

#include <SD.h>

#include <Keypad.h>

#include <LiquidCrystal_I2C.h>

int lastState1;

int lastState2;

int lastState3;

unsigned long currentTime = 0;

48
unsigned long previousTime = 0;

double lastSample = 0;

double sampleSum = 0;

int sampleCount = 0;

unsigned long num = 0;

int pos = 0;

const int thirtyA = 66;

const int fiveA = 185;

const float mvpc = 5000 / 1023;

float oneAmps = 0;

float oneVA = 0;

float oneVAEnter = 0;

double oneVAh = 0.00;

double oneVAhnew = 0.00;

double oneVAhLeft = 0.00;

float twoAmps = 0;

float twoVA = 0;

float twoVAEnter = 0;

double twoVAh = 0.00;

double twoVAhnew = 0.00;

double twoVAhLeft = 0.00;

49
float threeAmps = 0;

float threeVA = 0;

float threeVAEnter = 0;

double threeVAh = 0.00;

double threeVAhnew = 0.00;

double threeVAhLeft = 0.00;

double tBetMeasurements = 0.00;

double hBetMeasurements = 0.00;

const long msToHours = 3600000;

int ave1 = 0;

int ave2 = 0;

int ave3 = 0;

const byte ROWS = 4;

const byte COLS = 4;

char keys[ROWS][COLS] = {

{'1', '2', '3', 'A'},

{'4', '5', '6', 'B'},

{'7', '8', '9', 'C'},

{'*', '0', '#', 'D'}

};

50
byte rowPins[ROWS] = {36, 34, 32, 30};

byte colPins[COLS] = {28, 26, 24, 22};

char key;

File thesis;

DS3231 rtc(SDA, SCL);

LiquidCrystal_I2C lcd(0x26, 20, 4);

Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS

);

void setup() {

Serial.begin(9600);

SD.begin(4);

rtc.begin();

pinMode(One, INPUT);

pinMode(Two, INPUT);

pinMode(Three, INPUT);

pinMode(relayOne, OUTPUT);

pinMode(relayTwo, OUTPUT);

51
pinMode(relayThree, OUTPUT);

pinMode(A10, INPUT);

pinMode(A14, INPUT);

lcd.init();

lcd.backlight();

//importdata();

void loop() {

Serial.println(String(analogRead(A11)) + ", " + String(analogRead(A12)) + ", "

+ String(analogRead(A13)));

displayrtc();

base();

unitOne();

keyInterrupt();

base();

VoltAmpHour();

keyInterrupt();

base();

displayUnitOne();

keyInterrupt();

52
base();

VoltAmpHour();

keyInterrupt();

base();

unitTwo();

keyInterrupt();

base();

VoltAmpHour();

keyInterrupt();

base();

displayUnitTwo();

keyInterrupt();

base();

VoltAmpHour();

keyInterrupt();

base();

unitThree();

keyInterrupt();

base();

VoltAmpHour();

keyInterrupt();

53
base();

displayUnitThree();

keyInterrupt();

base();

VoltAmpHour();

keyInterrupt();

base();

//exportdata();

void unitOne() {

sampleCount = 0;

sampleSum = 0;

lastSample = 0;

/*if (ave1>=517){

ave1=523;

}*/

do {

if (millis() > lastSample + 1) {

sampleSum += (sq(mvpc * (analogRead(One) - ave1) / fiveA));

sampleCount++;

54
lastSample = millis();

keyInterrupt();

while (sampleCount < 1000);

oneAmps = sqrt(sampleSum / sampleCount);

if (oneAmps < 0.07 || oneVAhLeft == 0) {

oneAmps = 0;

oneVA = oneAmps * 230 * 0.8 * 1.3;

if (String(oneVA) == " NAN") {

oneVA = 0;

sampleSum = 0;

sampleCount = 0;

void unitTwo() {

sampleCount = 0;

sampleSum = 0;

lastSample = 0;

55
/*if (ave2>=517){

ave2=523;

}*/

do {

if (millis() > lastSample + 1) {

sampleSum += (sq(mvpc * (analogRead(Two) - ave2) / thirtyA));

sampleCount++;

lastSample = millis();

keyInterrupt();

while (sampleCount < 1000);

twoAmps = sqrt(sampleSum / sampleCount);

if (twoAmps < 0.15 || twoVAhLeft == 0) {

twoAmps = 0;

twoVA = sqrt(3) * twoAmps * 230 * 0.8 * 2;

if (String(twoVA) == " NAN") {

twoVA = 0;

sampleSum = 0;

56
sampleCount = 0;

void unitThree() {

sampleCount = 0;

sampleSum = 0;

lastSample = 0;

/*if (ave3>=517){

ave3=523;

}*/

do {

if (millis() > lastSample + 1) {

sampleSum += (sq(mvpc * (analogRead(Three) - ave3) / fiveA));

sampleCount++;

lastSample = millis();

keyInterrupt();

while (sampleCount < 1000);

threeAmps = sqrt(sampleSum / sampleCount);

if (threeAmps < 0.07 || threeVAhLeft == 0) {

57
threeAmps = 0;

threeVA = threeAmps * 230 * 0.8 * 1.3;

if (String(threeVA) == " NAN") {

threeVA = 0;

sampleSum = 0;

sampleCount = 0;

void VoltAmpHour() {

currentTime = millis();

tBetMeasurements = (currentTime - previousTime);

if (tBetMeasurements >= 0) {

hBetMeasurements = tBetMeasurements / msToHours;

oneVAh = oneVA * hBetMeasurements;

oneVAhLeft -= oneVAh;

if (oneVAhLeft <= 0) {

digitalWrite(relayOne, 0);

digitalWrite(12, 1);

lastState1 = 0;

58
oneVAhLeft = 0.00;

else if (String(oneVAhLeft) == " NAN") {

oneVAhLeft = 0.00;

twoVAh = twoVA * hBetMeasurements;

twoVAhLeft -= twoVAh;

if (twoVAhLeft <= 0) {

digitalWrite(relayTwo, 0);

lastState2 = 0;

twoVAhLeft = 0.00;

else if (String(twoVAhLeft) == " NAN") {

twoVAhLeft = 0.00;

threeVAh = threeVA * hBetMeasurements;

threeVAhLeft -= threeVAh;

if (threeVAhLeft <= 0) {

digitalWrite(relayThree, 0);

59
lastState3 = 0;

threeVAhLeft = 0.00;

else if (String(threeVAhLeft) == " NAN") {

threeVAhLeft = 0.00;

previousTime = millis();

void keyInterrupt() {

num = 0;

key = keypad.getKey();

if (key == '*') {

while (key != 'B') {

menu1:

lcd.clear();

menu1();

key = keypad.getKey();

while (key != 'B') {

switch (key) {

60
case NO_KEY:

break;

case '1':

lcd.clear();

menu2:

menu2();

key = keypad.getKey();

while (key != 'B') {

switch (key) {

case '1':

lcd.clear();

menu3();

GetNumber();

oneVAEnter = num;

oneVAhLeft = oneVAEnter;

base();

digitalWrite(relayOne, 1);

base();

digitalWrite(12, 0);

lastState1 = 1;

goto disp;

61
break;

case '2':

lcd.clear();

menu3();

GetNumber();

twoVAEnter = num;

twoVAhLeft = twoVAEnter;

base();

digitalWrite(relayTwo, 1);

base();

lastState2 = 1;

goto disp;

break;

case '3':

lcd.clear();

menu3();

GetNumber();

threeVAEnter = num;

threeVAhLeft = threeVAEnter;

base();

digitalWrite(relayThree, 1);

62
base();

lastState3 = 1;

goto disp;

break;

key = keypad.getKey();

goto menu1;

break;

case '2':

lcd.clear();

menu2();

key = keypad.getKey();

while (key != 'B') {

switch (key) {

case '1':

lcd.clear();

menu3();

GetNumber();

oneVAEnter += num;

oneVAhLeft += num;

63
base();

digitalWrite(relayOne, 1);

base();

digitalWrite(12, 0);

lastState1 = 1;

goto disp;

break;

case '2':

lcd.clear();

menu3();

GetNumber();

twoVAEnter += num;

twoVAhLeft += num;

base();

digitalWrite(relayTwo, 1);

base();

lastState2 = 1;

goto disp;

break;

case '3':

lcd.clear();

64
menu3();

GetNumber();

threeVAEnter += num;

threeVAhLeft += num;

base();

digitalWrite(relayThree, 1);

base();

lastState3 = 1;

goto disp;

break;

key = keypad.getKey();

goto menu1;

break;

key = keypad.getKey();

lcd.clear();

lcd.clear();

65
}

key = keypad.getKey();

disp:

int a = 0;

void displayUnitOne() {

lcd.clear();

lcd.setCursor(2, 0);

lcd.print("UNIT 1 REMAINING");

lcd.setCursor(0, 1);

lcd.print(String(oneVAhLeft, 2) + "/" + String(oneVAEnter, 2) + " Wh");

lcd.setCursor(1, 2);

lcd.print("CONSUMING " + String(oneVA, 2) + " W");

lcd.setCursor(2, 3);

lcd.print("PRESS * FOR MENU");

void displayUnitTwo() {

lcd.clear();

lcd.setCursor(2, 0);

66
lcd.print("UNIT 2 REMAINING");

lcd.setCursor(0, 1);

lcd.print(String(twoVAhLeft, 2) + "/" + String(twoVAEnter, 2) + " Wh");

lcd.setCursor(1, 2);

lcd.print("CONSUMING " + String(twoVA, 2) + " W");

lcd.setCursor(2, 3);

lcd.print("PRESS * FOR MENU");

void displayUnitThree() {

lcd.clear();

lcd.setCursor(2, 0);

lcd.print("UNIT 3 REMAINING");

lcd.setCursor(0, 1);

lcd.print(String(threeVAhLeft, 2) + "/" + String(threeVAEnter, 2) + " Wh");

lcd.setCursor(1, 2);

lcd.print("CONSUMING " + String(threeVA, 2) + " W");

lcd.setCursor(2, 3);

lcd.print("PRESS * FOR MENU");

67
void menu1() {

lcd.setCursor(8, 0);

lcd.print("MENU");

lcd.setCursor(2 , 1);

lcd.print("PRESS THE FF TO");

lcd.setCursor(4, 2);

lcd.print("1. NEW LIMIT");

lcd.setCursor(4, 3);

lcd.print("2. ADD LIMIT");

void menu2() {

lcd.setCursor(2 , 0);

lcd.print("PRESS THE FF TO");

lcd.setCursor(4, 1);

lcd.print("1. TO UNIT 1");

lcd.setCursor(4, 2);

lcd.print("2. TO UNIT 2");

lcd.setCursor(4, 3);

lcd.print("3. TO UNIT 3");

68
void menu3() {

lcd.setCursor(5 , 0);

lcd.print("HOW MUCH?");

lcd.setCursor(0, 1);

lcd.print(" Wh");

lcd.setCursor(0 , 2);

lcd.print("A - ACCEPT");

lcd.setCursor(0 , 3);

lcd.print("C - CLEAR");

lcd.setCursor(0, 1);

unsigned long GetNumber() {

key = keypad.getKey();

while (key != 'A') {

switch (key) {

case NO_KEY:

break;

case '0': case '1': case '2': case '3': case '4':

case '5': case '6': case '7': case '8': case '9':

69
lcd.setCursor(0, 1);

lcd.print(" ");

lcd.setCursor(0, 1);

num = num * 10 + (key - '0');

lcd.print(String(num) + " Wh");

Serial.println(num);

break;

case 'C':

num = 0;

lcd.setCursor(0, 1);

lcd.print(" ");

break;

key = keypad.getKey();

/*void exportdata() {

SD.remove("lastLimit1.txt");

SD.remove("lastLimit2.txt");

SD.remove("lastLimit3.txt");

70
SD.remove("lastLeft1.txt");

SD.remove("lastLeft2.txt");

SD.remove("lastLeft3.txt");

SD.remove("lastState1.txt");

SD.remove("lastState2.txt");

SD.remove("lastState3.txt");

thesis = SD.open("lastLimit1.txt", FILE_WRITE);

if (thesis) {

thesis.println(oneVAEnter);

thesis.close();

thesis = SD.open("lastLimit2.txt", FILE_WRITE);

if (thesis) {

thesis.println(twoVAEnter);

thesis.close();

thesis = SD.open("lastLimit3.txt", FILE_WRITE);

if (thesis) {

thesis.println(threeVAEnter);

thesis.close();

71
thesis = SD.open("lastLeft1.txt", FILE_WRITE);

if (thesis) {

thesis.println(oneVAhLeft);

thesis.close();

thesis = SD.open("lastLeft2.txt", FILE_WRITE);

if (thesis) {

thesis.println(twoVAhLeft);

thesis.close();

thesis = SD.open("lastLeft3.txt", FILE_WRITE);

if (thesis) {

thesis.println(threeVAhLeft);

thesis.close();

thesis = SD.open("lastState1.txt", FILE_WRITE);

if (thesis) {

if (lastState1 == 1) {

thesis.println("1");

else if (lastState1 == 0) {

72
thesis.println("0");

thesis.close();

thesis = SD.open("lastState2.txt", FILE_WRITE);

if (thesis) {

if (lastState2 == 1) {

thesis.println("1");

else if (lastState2 == 0) {

thesis.println("0");

thesis.close();

thesis = SD.open("lastState3.txt", FILE_WRITE);

if (thesis) {

if (lastState3 == 1) {

thesis.println("1");

else if (lastState3 == 0) {

thesis.println("0");

73
}

thesis.close();

void importdata() {

String()

thesis = SD.open("lastLimit1.txt");

if (thesis) {

while (thesis.available()) {

oneVAEnter = (thesis.read()).toInt;

myFile.close();

}*/

void displayrtc() {

delay(2000);

String DATE = rtc.getDateStr();

String TIME = rtc.getTimeStr();

lcd.clear();

74
lcd.setCursor(0, 1);

lcd.print("DATE: " + DATE);

lcd.setCursor(0, 2);

lcd.print("TIME: " + TIME);

void base(){

int asd = 0;

long mean1 = 0;

long mean2 = 0;

long mean3 = 0;

ave1=0;

ave2=0;

ave3=0;

do {

mean1 = mean1 + (analogRead(One));

mean2 = mean2 + (analogRead(Two));

mean3 = mean3 + (analogRead(Three));

asd++;

while (asd <= 1000);

75
ave1 = mean1 / asd;

ave2 = mean2 / asd;

ave3 = mean3 / asd;

/*if (ave1>=540){

ave1=512;

if (ave2>=525){

ave2=512;

if (ave3>=540){

ave3=512;

}*/

Serial.println(asd);

Serial.println(String(mean1) + ", " + String(mean2) + ", " + String(mean3));

Serial.println(String(ave1) + ", " + String(ave2) + ", " + String(ave3));

76
APPENDIX B

USER MANUAL

1. Turn-on the system by turning on the main switch.


2. Using the keypad, press * to access the menu.
3. In the menu you can choose between “Add Limit” or “New Limit”.
4. After selecting, you can now choose which branch circuit are you
planning to modify.
5. After choosing the branch circuit, you can now assign the limit
that you want to have.
6. Turn-on the circuit breaker.
7. Plug your appliances/ loads on the outlet.
8. The device will automatically cut the electricity once the limit is
met.
9. If you wish to set new limit or edit your assigned limits, repeat
steps 2-5.

77
APPENDIX C

BUDGET ALLOCATION

Equipment/ Price per Piece Quantity Total price (Php)

Material (Php)

Arduino Mega 2560 Php 1,159 1 Php 1,159

RTC Module Php 125 1 Php 125

20x4 LCD Screen Php 197 1 Php 197

Current Sensor Php 139 3 Php 417

Relay Module Php 65 3 Php 195

I2C LCD Module Php 99 1 Php 99

Wires Php 600 Php 600

Electronic Php 800 Php 800


Components
Construction Php 1320 Php 1320
Materials
60AT Three-phase Php 1980 1 Php 1980
Circuit Breaker

15AT Single-phase Php 350 2 Php 350


Circuit Breaker

Contactor Php 500 2 Php 1,000

78
APPENDIX D

Specification Sheet of Current Sensor and Arduino Mega 2560


GANTT CHART

You might also like