0% found this document useful (0 votes)
11 views34 pages

Mid Year Report (Group 15) Final

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views34 pages

Mid Year Report (Group 15) Final

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 34

UNDERGRADUATE FINAL YEAR PROJECT REPORT

Department of Electrical Engineering


NED University of Engineering and Technology

A Scalable Real-Time Non-Intrusive Load Monitoring


System for the Estimation of Power Consumption in
Household Appliances.

Group Number: 15 Batch: 2020 – 2024

Group Member Names:

Aiman Mahmood EE-20052


Areesha Zafar EE-20054
Syed Bassam Ejaz EE-20078
Areeb Haque EE-20080

Approved by
……………………………………………………………………………………………...
Dr. Abdullah Munir
Lecturer
Electrical Engineering Department

© NED University of Engineering & Technology. All Rights Reserved – 2024


Author’s Declaration

We declare that we are the sole authors of this project. It is the actual copy of the project
that was accepted by our advisor(s) including any necessary revisions. We also grant
NED University of Engineering and Technology permission to reproduce and distribute
electronic or paper copies of this project.

Signature and Date Signature and Date Signature and Date Signature and Date

.............................. .............................. ................................. .................................

Aiman Areesha Zafar Syed Bassam Ejaz Areeb Haque


Mahmood

EE-20052 EE-20054 EE-20078 EE-20080

mahmood4302087 Zafar4300588@cl ejaz4304977@cloud. haque4305184@cloud


@ oud.neduet.edu.pk neduet.edu.pk .neduet.edu.pk
cloud.neduet.edu.p
k

ii
Statement of Contributions

1. Mr. Syed Bassam Ejaz and Mr. Areeb Haque, along with Ms. Aiman Mahmood and
Ms. Areesha Zafar, actively participated in the data recording process from the smart
meter.
2. All team members, including Mr. Syed Bassam Ejaz, Mr. Areeb Haque, Ms. Aiman
Mahmood, and Ms. Areesha Zafar, actively participated in event detection activities.
3. The collaborative efforts of the entire team extended to the crucial task of report
writing.
4. The combined contributions ensured a comprehensive and well-documented approach
to the entire project.

iii
Executive Summary

This project encounters the challenge of monitoring and estimating power consumption in
household appliances through a scalable Non-Intrusive Load Monitoring (NILM) system.
Existing NILM solutions, face issues like computational intensity and delays. In response, the
project aims to offer a transformative solution that prioritizes scalability and real-time
efficiency in estimating appliance power usage.
The report emphasizes the need for a practical and efficient NILM system, considering the
drawbacks of existing solutions. It highlights the potential impact on automation, energy
conservation, user behavior analysis, and detailed insights into power consumption patterns.
The project's objectives focus on implementing scalable hardware solutions and developing
algorithms for real-time event detection, energy disaggregation, and power estimation. The
proposed system intends to provide a cost-effective and adaptable approach to load monitoring.
Key findings reveal the system's effectiveness in real-time load monitoring, precise event
detection, and accurate power estimation. The event detection algorithm successfully identifies
turn-on and turn-off events, ensuring timely monitoring of electrical appliances. The system's
scalability and minimal hardware requirements make it suitable for various applications and
integration into low-cost chipsets.
In conclusion, the project introduces an innovative NILM system addressing the limitations of
existing solutions. The system's efficiency, scalability, and real-time capabilities mark a
significant advancement in energy consumption monitoring, offering valuable insights for
informed decision-making in energy management practices. The report underscores the
system's reliability and potential positive impact on energy efficiency.

iv
Acknowledgments

We begin by expressing our heartfelt gratitude to Allah Almighty, whose guidance and
support have been instrumental in helping us navigate through the challenges encountered
during this endeavor.

Our sincere appreciation goes to our supervisor, Dr. Abdullah Munir, and our Co-Supervisor,
Mr. Hassan-ul-Haq, for their invaluable support, mentorship, and cooperation throughout the
course of this project. Their guidance has been crucial in shaping our efforts.

We would also like to extend our acknowledgment to our families, friends, and teachers for
their unwavering support. Their encouragement and understanding played a pivotal role in
making this project a reality. Without their support, this achievement would not have been
possible.

In gratitude, we recognize and thank all those who have contributed to our journey, providing
the strength and encouragement needed to overcome challenges and reach this milestone

v
Table of Contents
Contents
Author’s Declaration..................................................................................................................ii
Statement of Contributions ...................................................................................................... iii
Executive Summary .................................................................................................................. iv
Acknowledgments...................................................................................................................... v
Table of Contents ...................................................................................................................... vi
List of Figures ........................................................................................................................ viii
List of Tables ............................................................................................................................ ix
List of Abbreviations ................................................................................................................. x
United Nations Sustainable Development Goals ...................................................................... xi
Similarity Index Report............................................................................................................xii
Chapter 1 .................................................................................................................................... 1
Introduction ................................................................................................................................ 1
1.1 Background of Project:................................................................................................... 1
1.2 Significance and Motivation: ......................................................................................... 2
1.3 Aims and Objectives: ..................................................................................................... 2
1.4 Problem Statement: ........................................................................................................ 2
1.5 Scope of the Project: ...................................................................................................... 3
1.6 Methodology: ................................................................................................................. 3
1.6 Report Outline: ............................................................................................................... 4

Chapter 2 .................................................................................................................................... 5
Literature Review ...................................................................................................................... 5
2.1 Introduction: ................................................................................................................... 5
2.2 Event Detection and Classification Algorithms for NILM: ........................................... 5
2.3 Methodology Incorporating Event Detection, CNN Classifier, and Energy
Consumption Estimation: ............................................................................................... 5
2.4 Performance Evaluation of NILM System for Appliance Energy Consumption
Estimation ....................................................................................................................... 6
2.5 Real-Time Event-Based Energy Disaggregation Using CNN Classifier ....................... 6
2.6 Evaluation of Sampling Frequency on Appliance Transient Responses........................ 6
2.7 Efficiency and Scalability in NILM Systems ................................................................. 6
2.8 Performance Metrics for Appliance Classification ........................................................ 7
2.9 Datasets for NILM System Testing................................................................................ 7
Chapter 3 .................................................................................................................................... 8
Methodology .............................................................................................................................. 8
3.1 Introduction .................................................................................................................... 8

vi
3.2 Block Diagram of the Methodology............................................................................... 8
3.3 Blocks Explanation ........................................................................................................ 8
3.3.1 Record Data from Smart Meter: ............................................................................ 8
3.3.1.1 Hardware Setup: .............................................................................................. 9
3.3.1.2 DDS238-1 ZN Single Phase Smart Energy Meter .......................................... 9
3.3.1.3 Hardware Integration: ................................................................................... 11
3.1.1.4 RS485 Converter to USB Converter: ............................................................ 11
3.3.2. NILM: ................................................................................................................. 14
3.3.21 Data Acquisition:............................................................................................ 14
3.3.22 Event Detection: ............................................................................................. 15
3.3.23 Disaggregation: .............................................................................................. 16
3.3.24 Appliance Classification: ............................................................................... 16
3.3.25 Power Estimation: .......................................................................................... 16
3.3.3. Display Output: ................................................................................................... 16
3.4 Conclusion:................................................................................................................... 16
Chapter 4 .................................................................................................................................. 17
Results...................................................................................................................................... 17
4.1 Data Acquisition Results: ............................................................................................. 17
4.2 Event Detection Results: .............................................................................................. 18
Chapter 5 .................................................................................................................................. 19
Conclusion ............................................................................................................................... 19
5.1 Conclusion:................................................................................................................... 19
5.2 Summary: ..................................................................................................................... 19
5.3 Future Work: ................................................................................................................ 19
References .............................................................................................................................. xiii

vii
List of Figures

1 Figure 1-1 Report Outline ....................................................................................................... 4


2 Figure 3-1 Block Diagram of the proposed Methodology ...................................................... 8
3 Figure 3-2 DDS 238-1-Zn Smart Energy Meter [8] ............................................................... 9
4 Figure 3-3 DDS-238-1-Zn Smart Energy Meter Wiring Connection [8] ............................. 11
5 Figure 3-4 RS-485 to USB Converter [9] ............................................................................. 12
6 Figure 4.1 Data Stored in CSV file format ........................................................................... 17
7 Figure 4.2 Event Detection Output ....................................................................................... 18

viii
List of Tables
1 Table 3-1 Technical Specifications of DDS-238-1 Zn Smart energy Meter [8] .............................. 10
2 Table 3-2 Accuracy percentages of various parameters in DDS-238-1-Zn Smart Energy Meter [8]
.............................................................................................................................................................. 10

ix
List of Abbreviations

NILM Non-Intrusive Load Monitoring


CSV File Comma Separated file

x
United Nations Sustainable Development Goals

The Sustainable Development Goals (SDGs) are the blueprint to achieve a better and
more sustainable future for all. They address the global challenges we face, including
poverty, inequality, climate change, environmental degradation, peace and justice. There is
a total of 17 SDGs as mentioned below. Check the appropriate SDGs related to the
project.

□ No Poverty

□ Zero Hunger

□ Good Health and Well being

□ Quality Education

□ Gender Equality

□ Clean Water and Sanitation

□ Affordable and Clean Energy

□ Decent Work and Economic Growth

 Industry, Innovation and Infrastructure

□ Reduced Inequalities

 Sustainable Cities and Communities

 Responsible Consumption and Production

□ Climate Action

□ Life Below Water

□ Life on Land

□ Peace and Justice and Strong Institutions

□ Partnerships to Achieve the Goals

xi
Similarity Index Report
Following students have compiled the final year report on the topic given below
for partial fulfillment of the requirement for Bachelor’s degree in Electrical
Engineering.
Project Title A Scalable Real-Time Non-Intrusive Load Monitoring System for
the Estimation of Power Consumption in Household Appliances.

Signature

S.No Student Name Seat Number


1. Aiman Mahmood EE-20052
2. Areesha Zafar EE-20054
3. Syed Bassam Ejaz EE-20078
4. Areeb Haque EE-20080

This is to certify that Plagiarism test was conducted on complete report, and
overall similarity index was found to be less than 20%, with maximum 5% from single
source, as required.

Signature and Date

..................................

Dr. Abdullah Munir

xii
Chapter 1
Introduction

1.1 Background of Project:

Load monitoring and identification is a method used to determine the electrical energy
consumption and operating condition of individual appliances in a building. This is achieved
through the analysis of composite load data measured from the main power meter. The
information obtained from load monitoring includes details such as the type of load,
electricity consumption, and the running conditions of the appliances. Both consumers and
utility companies can benefit from this information, as it allows for the development of load
plan strategies that optimize energy utilization.

There are two main approaches to load monitoring: intrusive and non-intrusive. Intrusive load
monitoring provides accurate results. However, this method is costly as it requires the
manufacturing and installation of a large number of specific equipment. To address this issue,
non-intrusive load monitoring systems have been introduced. Non-intrusive load monitoring
is a cost-effective and convenient option, as it requires fewer components to install and
smaller space requirements

NILM emerged as a revolutionary solution, offering a non-intrusive method for monitoring


and analyzing energy consumption.
However, existing NILM solutions based on deep learning techniques present their own set of
challenges, including a high computational burden and delays in disaggregation.
In response to these challenges, the proposed NILM system is designed to provide a scalable
and real-time solution for estimating appliance power consumption. Comprising four key
blocks – the power signal acquisition block, event detection block, network classifier, and
power estimation algorithm – the system aims to reduce the computational burden associated
with deep learning techniques. The envisioned outcome is a transformative approach to
energy consumption monitoring, providing valuable information for energy services and
data-driven business models, thereby enabling more efficient energy consumption and
management in households.

1
1.2 Significance and Motivation:
The project addresses the need for a scalable and real Non-Intrusive Load Monitoring (NILM
system to estimate power consumption of household appliances. Existing NILM solutions
often utilize deep learning techniques that are computationally intensive and involve a large
number of parameters. Additionally, some solutions require the entire operation cycle or
experience delays in disaggregation, which hinders their real-time capabilities.
Deep learning, with its complex neural network architectures, has shown promising results in
NILM applications by learning intricate patterns and relationships within power consumption
data. However, the computational demands associated with previous deep learning algorithms
can be prohibitive, especially when dealing with the extensive datasets commonly
encountered in household energy monitoring. The need for significant computational
resources may hinder the deployment of such solutions in real-time scenarios and limit their
scalability to larger datasets.
Furthermore, certain existing NILM solutions exhibit limitations related to the requirement of
the entire operation cycle or delays in the disaggregation process. Delays in disaggregation
can impede the instantaneous feedback necessary for timely decision-making and effective
energy management within households.
1.3 Aims and Objectives:
The following objectives pertain to this project:
1. To implement and integrate scalable hardware solutions for comprehensive appliance
monitoring and power analysis.
2. To develop efficient algorithms for real-time appliance event detection and energy
disaggregation.
3. To implement power estimation algorithm inorder to analyze the total aggregated data
measurements and estimate appliance power consumption in real-time.
1.4 Problem Statement:
The problem addressed in the system is the non-intrusive load monitoring (NILM) of
household appliances. NILM is the process of disaggregating the electricity consumption on
an appliance level by analyzing the total aggregated data measurements monitored from a
single point. Existing solutions for NILM often rely on techniques, which can be
computationally burdensome due to the large number of parameters. Additionally, some
solutions require delay or only work for past events. The system aims to propose a NILM
system that can detect the turning-on of a target appliance and estimate its consumption in
real-time, while being computationally and memory efficiency.

2
1.5 Scope of the Project:
The scope of this project holds significant importance in revolutionizing appliance
monitoring and Non-Intrusive Load Monitoring (NILM) by developing a scalable system.
 Advanced appliance recognition and classification will increase automation and energy
conservation in homes and industries.
 Developing more precise event detection algorithms will enable sophisticated user behavior
analysis, improving user experiences and appliance maintenance.
 Enhanced energy disaggregation will provide users with detailed insights into power
consumption patterns, allowing them to make informed decisions for cost savings and
environmental impact reduction.
 Accurate power estimation can help detect appliance malfunctions early, reducing
maintenance costs and improving appliance longevity.
 This project offers the potential for significant advancements in energy efficiency, user
convenience, cost savings, and the scalability of NILM technology for various applications
and settings.

1.6 Methodology:
The Non-Intrusive Load Monitoring (NILM) system presented comprises key components for
detailed analysis of energy consumption from smart meter data. Initial data recording from a
DDS238-1 ZN smart meter involves a Python script and a USB to RS485 converter.
Hardware integration includes a smart energy meter with an extension board for multiple
device connections. The DDS238-1 ZN specifications outline its capabilities and wiring
connections. The power acquisition phase involves real-time data capture and organization
into a CSV file. The NILM block encompasses event detection, disaggregation, appliance
classification, and power estimation. The event detection algorithm identifies appliance
activations based on active power changes. Disaggregation breaks down total power
consumption into individual appliance contributions, followed by classification and accurate
power estimation. The system's output is displayed through user-friendly interfaces using
tools like Visual Studio Code and Jupyter Notebook. In conclusion, the NILM system
provides continuous monitoring, event detection, appliance-specific energy breakdown, and
user-friendly insights for informed energy management.

3
1.6 Report Outline:

1 Figure 1-1 Report Outline

This project report follows a structured outline in which Chapter 1 introduces the challenge of
Non-Intrusive Load Monitoring (NILM) and encounters the need for efficient real-time
solutions, proposing a novel system.

Chapter 2 conducts a comprehensive literature review on NILM evolution, deep learning


techniques, and existing challenges.

Chapter 3 outlines the methodology, detailing the proposed real-time NILM system and the
experimental setup.

In Chapter 4, results from experiments, emphasizing system performance and efficiency, are
presented. Chapter 5 draws conclusions, summarizing contributions, discussing implications.
The report concludes with reflections on potential applications and recommendations for
future NILM research.

4
Chapter 2
Literature Review
2.1 Introduction:

Numerous research papers and studies have focused on Non-Intrusive Load Monitoring
(NILM) techniques utilizing various methodologies to disaggregate energy consumption data
and identify individual appliances in residential buildings. These studies aim to enhance
energy efficiency and provide valuable insights for smart grid applications.

2.2 Event Detection and Classification Algorithms for NILM:

A methodology was proposed for NILM utilizing event detection and classification
algorithms. The event detection algorithm demonstrated strong performance in identifying
appliance events. The classification algorithm achieved high accuracy in recognizing
appliances like the fridge and microwave, although it faced challenges with the washing
machine due to similar transient response patterns. Real household data testing showcased
accurate power estimation for the fridge and microwave, albeit with lower performance for
the washing machine. Overall, the NILM system exhibited promising results in
disaggregating energy consumption in residential settings. [1]

2.3 Methodology Incorporating Event Detection, CNN Classifier, and Energy


Consumption Estimation:

The proposed NILM methodology integrates event detection, a CNN classifier for appliance
classification, and energy consumption estimation. Transient responses generated by
appliance activations serve as load signatures for classification. The CNN classifier is trained
to associate these transient responses with specific appliances, while the energy consumption
estimation algorithm approximates power consumption based on detected transient responses.
Evaluation on a private dataset featuring transient responses from various household
appliances demonstrated the effectiveness of the approach in classifying and estimating
energy consumption for appliances like the fridge, washing machine, and microwave oven
.[2]

5
2.4 Performance Evaluation of NILM System for Appliance Energy Consumption
Estimation

The NILM system designed for estimating energy consumption of fridges, washing
machines, and microwave ovens exhibited promising outcomes compared to existing
methods. It achieved high accuracy and precision in identifying fridges, moderate
performance for washing machines, and high precision for microwaves. The system also
demonstrated low mean absolute error in energy estimation for all three appliances,
indicating its efficacy in estimating household appliance energy consumption .[3]

2.5 Real-Time Event-Based Energy Disaggregation Using CNN Classifier

A novel real-time event-based energy disaggregation methodology employing a


convolutional neural network classifier was introduced. The system displayed strong
performance for specific appliances and was noted for its computational and memory
efficiency. Operating on the edge without necessitating high-end microprocessors, the system
is deemed suitable for large-scale deployment. Meeting criteria for accuracy, data resolution,
and computational efficiency, it presents a scalable solution for real-time NILM services . [4]

2.6 Evaluation of Sampling Frequency on Appliance Transient Responses

The effectiveness of NILM systems is influenced by the sampling frequency used to capture
appliance transient responses [6]. At a sampling frequency of 100 Hz, distinct characteristics
of appliance transient responses are clearly visible, enhancing the system's ability to
differentiate between appliances.

2.7 Efficiency and Scalability in NILM Systems

Efficiency and scalability are crucial for the deployment of NILM systems[1] . Recent trends
suggest a shift towards edge computing to optimize costs and enhance scalability, making
NILM services more viable for large-scale deployment.

6
2.8 Performance Metrics for Appliance Classification

Performance metrics such as accuracy, precision, recall, and F1-score are essential for
evaluating the classification algorithms in NILM systems [5]. High accuracy and precision
are observed for appliances with unique transient response patterns, while simpler appliances
may present lower scores due to similarities with other types.

2.9 Datasets for NILM System Testing

Datasets play a vital role in testing and validating NILM systems[2] . Utilizing datasets like
the BLUED dataset, which contains detailed appliance power measurements and event
timestamps, enables researchers to assess the performance of event detection algorithms and
the overall effectiveness of NILM systems.

7
Chapter 3
Methodology
3.1 Introduction

The block diagram outlines a comprehensive Non-Intrusive Load Monitoring (NILM) system
designed to analyze and interpret energy consumption patterns from smart meter data. This
system is vital for providing detailed insights into appliance-level power usage without the
need for intrusive hardware. The core components of the block diagram include recording
data from a smart meter, the NILM process itself encompassing power acquisition, event
detection, disaggregation, appliance classification, and power estimation, and finally, the
display of the system's output.

3.2 Block Diagram of the Methodology

2 Figure 3-1 Block Diagram of the proposed Methodology

3.3 Blocks Explanation

3.3.1 Record Data from Smart Meter:

The initial stage involves the recording of data directly from the DDS238-1 ZN smart meter.
Subsequently, this data is transmitted to a computer using a USB to RS485 converter. To
automate the data capture process, a Python code has been developed, facilitating
communication with the smart meter and extracting real-time data streams. The Python script
efficiently captures and organizes the data, saving it in a CSV file format for structured
storage.The recorded data will be utilized in for event detection and subsequent stages in the
Non-Intrusive Load Monitoring process.

8
3.3.1.1 Hardware Setup:

We established a hardware configuration that comprises several key components essential for
our project. The core of this setup is a smart energy meter, a sophisticated device designed to
measure and monitor electricity consumption. To expand the capabilities of our system, we
integrated an extension board, providing additional power outlets for connecting various
appliances and devices.

Facilitating the connectivity between the smart energy meter and the extension board, a wire
was employed to establish a secure and efficient electrical interface. In addition, a plug was
utilized to connect the entire system to the power source. This plug serves as a crucial
component in enabling the seamless flow of power from the source to the smart energy meter
and the connected appliances on the extension board.

3.3.1.2 DDS238-1 ZN Single Phase Smart Energy Meter

Description:
The meter is designed to measure single phase two wire AC active energy and suitable for
users of secondary circuits with flat rate tariff or single phase electric equipment with narrow
interior space. It is produced by SMT (Surface mounting technology) process and is in
accordance with international standard IEC62053-21. RS-485 data communication terminal is
available upon request to perform remote data collection.[8]

3 Figure 3-2 DDS 238-1-Zn Smart Energy Meter [8]

9
Technical Specifications:

Rate voltage 110V,120V,220V,230V,240V

Working voltage 0.8~1.2Un


range

Rate Current 5(40)A,5(45)A

Frequency 50Hz or 60Hz +10%

Display LCD

Communication RS485 port , baud rate 1200~9600 bps ,default is 9600bps ,address 1~
port 247,None parity , stop bits 1 , data bits 8 .
1 Table 3-1 Technical Specifications of DDS-238-1 Zn Smart energy Meter [8]

Accuracy:

Voltage 0.5%

Current 0.5%

Frequency 0.5%

Power Factor 1%

Active power ±1%

Reactive Power ±2%

Active Energy (kWh) Class 1.0


2 Table 3-2 Accuracy percentages of various parameters in DDS-238-1-Zn Smart Energy Meter [8]

10
Wiring Connection:
The wiring connection for DDS238-1 ZN has been demonstrated in the figure below:

4 Figure 3-3 DDS-238-1-Zn Smart Energy Meter Wiring Connection [8]

3.3.1.3 Hardware Integration:

The integration of hardware is achieved through the utilization of a USB to RS485 converter,
enabling the recording of real-time data on the computer. This process involves establishing a
Python script designed to capture real-time data from the DDS238-1 ZN smart energy meter
via the USB to RS485 converter.

3.1.1.4 RS485 Converter to USB Converter:

The USB to RS485 is a fully automatic plug-and-play USB module that connects to your PC
via the Universal Serial Bus (USB) port and provides robust bidirectional USB to RS-485
protocol conversion with automatic RS-485 flow control. [9]

11
5 Figure 3-4 RS-485 to USB Converter [9]

Specifications:
Directional control: Automatically determine and control the data transmission direction.
Baud rate:300-921,600bps, Automatically adapt serial port signal speed.
Transmission distance: 1.2KM (at 9,600bps)
Interface protection: 600W lightning strike, surge protection and ±15KV ESD protection
Operating system: Windows, Mac OS, Linux
Environment: -40℃-85℃, relative humidity 5%-95%

Python Script for Hardware Integration

from pymodbus.client import ModbusSerialClient as ModbusClient


import time
import json
import csv

def read_registers(client, address, unit, quantity):


try:
data = client.read_holding_registers(address, quantity, unit=unit)
return data.registers
except Exception as e:
print(f"Modbus register error: {e}")
return None

def clean_data(data_array):
for data in data_array:

12
data[0] = data[0]/10
data[1] = data[1]/100
data[2] = data[2]/1
data[3] = data[3]/1
data[4] = data[4]/1000
data[5] = data[5]/100
power = data[0]*data[1]*data[4]
data.append(power)

if __name__ == "__main__":
header = ['Voltage', 'current', 'active power',
'reactive power', 'power factor', "frequency", "time",'power']
method = "rtu"
port = "/dev/tty.usbserial-1410"
baudrate = 9600
stopbits = 1
bytesize = 8
parity = "N"
timeout = 30
retries = 5

client = ModbusClient(method=method, port=port, stopbits=stopbits, bytesize=bytesize, parity=parity,


baudrate=baudrate, timeout=timeout, retries=retries)
data = []
try:
client.connect()
start_time = time.time()

while time.time()-start_time < 240:


registers_data = read_registers(client, 12, 0, 6)
# if registers_data is not None:
registers_data.append(time.time())
# print("Received data:", registers_data)
data.append(registers_data)
# break
time.sleep(.91)

13
3.3.2. NILM:

The main block of the system, the NILM block, consists of multiple integral processes:

3.3.21 Data Acquisition:

This stage collects and processes the raw power consumption data obtained from the smart
meter, setting the foundation for subsequent analysis.

In the data acquisition phase, the recorded information is systematically stored into a CSV
(Comma-Separated Values) file. This meticulous process involves the use of a Python script
that not only captures real-time data from the DDS238-1 ZN smart energy meter but also
organizes it in a structured format.The recorded data contains values of Current, Voltage,
Frequency, Power Factor, Active Power, Reactive power and Time. The CSV file, being a
widely used and accessible format, ensures a systematic arrangement of the acquired data,
allowing for easy retrieval and subsequent analysis. This step not only captures the data but
also sets the stage for comprehensive data management and utilization in further stages of the
project.

Python Script for Data Acquisition:

except KeyboardInterrupt:
# Handle KeyboardInterrupt (Ctrl+C) to gracefully close the connection
print(" Exiting due to user interruption.")
except Exception as e:
print(f"An error occurred: {e}")
finally:
# Close the connection when the loop is interrupted
if client.is_socket_open():
client.close()
clean_data(data)
print(data)
print(len(data))
json_file_path = 'output_areeb.json'
csv_file_path = 'output_areeb.csv'
# Write the array to the JSON file
with open(json_file_path, 'w') as json_file:
json.dump(data, json_file)

14
with open(csv_file_path, 'w', newline='') as csv_file:
csv_writer = csv.writer(csv_file)
csv_writer.writerow(header)
for d in data:
csv_writer.writerow(d)

3.3.22 Event Detection:

Event detection in the proposed real-time Non-Intrusive Load Monitoring (NILM) system
refers to the process of identifying the turning-on of a target appliance by analyzing the
measured active power transient response. The event detection algorithm is responsible for
detecting changes in the active power that correspond to appliance turn-on events. This
algorithm is designed to find time instants when an appliance is turned on and extract
transient responses. The algorithm plays a crucial role in identifying the start of appliance
operation, which is essential for accurate load disaggregation and power estimation.

Event Detection Algorithm

import json

with open('/Users/erlystagestudios/Desktop/FYP/output_areeb.json') as f:
data_array = json.load(f)

# Assuming the first index represents power


power_data = [row[-1] for row in data_array]

# Event Detection
threshold = 40 # watts
events = []
for i in range(1, len(power_data)):
change_in_power = abs(power_data[i] - power_data[i-1])
print(change_in_power,i)
if change_in_power > threshold:
events.append((i, change_in_power))

# Print detected events


for event in events:

15
print(f"Event detected at index {event[0]}, Change in power: {event[1]} watts")

In the above algorithm, the threshold value has been set at 40 Watt, this threshold is defined
for the allowable change in power. If the change in power exceeds the threshold value, the
event is detected.

3.3.23 Disaggregation: In this phase, the system distinguishes between the aggregated total
power consumption and allocates it to specific appliances. It involves breaking down the
overall power signal into individual appliance contributions.

3.3.24 Appliance Classification: The system classifies the disaggregated data, associating
each segment with a specific appliance. Accurate identification is often achieved using
machine learning or pattern recognition techniques.

3.3.25 Power Estimation: After classification, the system estimates the power consumption
of each identified appliance, providing granular details about their individual energy usage.

3.3.3. Display Output:

In the final phase, processed information is presented through user-friendly displays using
software such as Visual Studio Code and Jupyter Notebook. These tools showcase real-time
insights on energy consumption patterns via interactive charts and graphs. The interfaces
enable users to easily interpret data, empowering them to make informed decisions and
efficiently manage household appliances. Visual Studio Code and Jupyter Notebook
specifically contribute to creating visually appealing and interactive displays, enhancing the
overall practical utility of the system.

3.4 Conclusion:

In conclusion, the project's block diagram introduces a meticulously designed Non-Intrusive


Load Monitoring (NILM) system. This system is equipped to perform various tasks
seamlessly. Initially, it can capture real-time data, allowing us to continuously monitor
energy consumption patterns. This data is then efficiently transmitted to a computer for
further analysis. The system utilizes this information to detect events, such as when
appliances are turned on or off, providing insights into our daily energy usage habits.

16
Chapter 4
Results
4.1 Data Acquisition Results:

The CSV file, shown below, encapsulates crucial data points such as Current, Voltage,
Frequency, Power Factor, Active Power, Reactive Power, and Time. This format ensures a
structured and accessible organization of the acquired information. Users can easily retrieve,
analyze, and visualize the data using Python scripts integrated with tools like Visual Studio
Code or Jupyter Notebook. The simplicity and widespread support of the CSV format
enhance the efficiency of data management and further analysis in the project.

Output in CSV File Format:

6 Figure 4.1 Data Stored in CSV file format

17
4.2 Event Detection Results:

The code utilizes a threshold of 40 watts for event detection in power consumption data
stored in a JSON file. It calculates the change in power between consecutive data points, and
if this change exceeds the threshold, an event is detected. The results display the index and
the corresponding change in power for each detected event, indicating instances where
significant deviations in power consumption occurred, surpassing the predefined threshold of
40 watts

Output in Jupyter Notebook:

7 Figure 4.2 Event Detection Output

18
Chapter 5
Conclusion
5.1 Conclusion:

In conclusion, our system represents a significant advancement in real-time load monitoring


and power estimation for various appliances. The core strength lies in the effectiveness of our
event detection algorithm, which accurately identifies turn-on and turn-off events based on
changes in power consumption. This capability ensures timely and precise monitoring of
electrical appliances.

Additionally, our proposed system stands out as a real-time and scalable solution, requiring
minimal hardware resources. This characteristic makes it not only efficient but also adaptable
to integration into low-cost chip-sets. The implication of this scalability is that our system can
seamlessly operate on the edge, demonstrating its practicality and versatility in diverse
applications.

In conclusion, our system is strong and reliable, offering real-time insights into how we use
energy. It's efficient because it needs very little hardware and can adapt to different needs.
This makes our solution affordable, easy to use, and compatible with edge devices. We
believe our innovative approach can bring positive changes to how we manage energy,
making it more efficient and accessible for everyone in different places.

5.2 Summary:

In summary, our mid-year progress report highlights significant achievements in the


development of a non-intrusive load monitoring system. While we have successfully
designed and implemented key components such as data recording and event detection, there
are ongoing challenges and further work required to optimize system performance and ensure
seamless integration with various appliances. We are committed to addressing these
challenges and continuing our efforts to deliver a robust and efficient NILM system.

5.3 Future Work:

In the current phase of our project, we've successfully implemented real-time data recording
from a smart meter, integrated hardware components like the DDS238-1 ZN smart energy
meter with an extension board, and developed a Python script for efficient data acquisition.
Our system has demonstrated proficiency in event detection using a specified power change

19
threshold. Moving forward, we aim to expand our system's capabilities by integrating
scalable hardware solutions, refining algorithms for faster event detection and improved
energy disaggregation, and creating a real-time power estimation algorithm for precise
assessment of appliance power consumption. These planned advancements will further build
upon the established foundation of our Non-Intrusive Load Monitoring (NILM) system.

20
References
[1] Nalmpantis, C.; Vrakas, D. Machine learning approaches for non-intrusive load
monitoring: From qualitative to quantitative comparison. Artif. Intel. Rev. 2018, 52.

[2] Lu, M.; Li, Z. A Hybrid Event Detection Approach for Non-Intrusive Load Monitoring.
IEEE Trans. Smart Grid 2020, 11.

[3] Huang, Y.; Wang, L.; Guo, W.; Kang, Q.; Wu, Q. Chance Constrained Optimization in a
Home Energy Management System. IEEE Trans. Smart Grid 2018, 9, 252–260,

[4] Buzau, M.M.; Tejedor-Aguilera, J.; Cruz-Romero, P.; Gómez-Expósito, A. Detection of


Non-Technical Losses Using Smart Meter Data and Supervised Learning. IEEE Trans. Smart
Grid 2019, 10, 26.

[5] Ruano, A.; Hernandez, A.; Ureña, J.; Ruano, M.; Garcia, J. NILM Techniques for
Intelligent Home Energy Management and Ambient Assisted Living: A Review. Energies
2019, 12.

[6] Kolter, J.Z.; Jaakkola, T. Approximate Inference in Additive Factorial HMMs with
Application to Energy Disaggregation. In Proceedings of the Fifteenth International
Conference on Artificial Intelligence and Statistics, La Palma, Canary Islands, 21–23 April
2012; Volume 22, pp. 1472–1482.

[7] Nalmpantis, C.; Vrakas, D. Machine learning approaches for non-intrusive load
monitoring: From qualitative to quantitative comparation. Artif. Intel. Rev. 2018, 52,

[8]www.chinaenergymeter.com/1-1-12-dds238-1-zn-single-phase-din-rail-type-watt-hour-
meter.html

[9] https://store.fut-electronics.com/products/usb-to-rs-485-converter

[10] Christos Athanasiadis , Dimitrios Doukas 2 , Theofilos Papadopoulos and Antonios


Chrysopoulos ; A Scalable Real-Time Non-Intrusive Load Monitoring System for the
Estimation of Household Appliance Power Consumption. https://www.mdpi.com/1996-
1073/14/3/767

xiii
xiv

You might also like