Uploaded by hamnah awan

IoT Based Smart Grid Monitoring & Management System Thesis

advertisement
IOT Based Smart Grid
Author
Name of students
Registration Numbers
Rimsha Sohail
21-EE-21
Hamnah Awan
21-EE-38
Rida Fatima
21-EE-161
Supervisor
Dr. Inamul Hasan Shaikh
Assistant Professor EED UET Taxila
DEPARTMENT OF ELECTRICAL ENGINEERING
FACULTY OF ELECTRONICS & ELECTRICAL ENGINEERING
UNIVERSITY OF ENGINEERING AND TECHNOLOGY
TAXILA
June 2025
i
IOT Based Smart Grid
Author
Name of students
Registration Numbers
Rimsha Sohail
21-EE-21
Hamnah Awan
21-EE-38
Rida Fatima
21-EE-161
Supervisor
Dr. Inamul Hasan Shaikh
Assistant Professor EED UET Taxila
DEPARTMENT OF ELECTRICAL ENGINEERING
FACULTY OF ELECTRONICS & ELECTRICAL ENGINEERING
UNIVERSITY OF ENGINEERING AND TECHNOLOGY
TAXILA
June 2025
2
IOT Based Smart Grid
Submitted to the Electrical Engineering Department of the University of Engineering
and Technology Taxila partial fulfillment of the requirements for the Degree of
Bachelor of Science Electrical Engineering
Author
Name of students
Registration Numbers
Rimsha Sohail
21-EE-21
Hamnah Awan
21-EE-38
Rida Fatima
21-EE-161
Supervisor:
Dr. Inamul Hasan Shaikh
Assistant Professor EED UET Taxila
External Examiner Signature:___________________________________________
Thesis Supervisor Signature:____________________________________________
DEPARTMENT OF ELECTRICAL ENGINEERING
FACULTY OF ELECTRONICS & ELECTRICAL ENGINEERING
UNIVERSITY OF ENGINEERING AND TECHNOLOGY,
TAXILA
June 2025
3
UNDERTAKING
We declare that the work contained in this synopsis is our own, except where
explicitly stated otherwise. In addition this work has not been submitted to
obtain another degree or professional qualification
Signature of Group Leader:
Name of Student: Rida Fatima
Registration Number: 21-EE-161
Signature of Student:
Name of Student:Rimshah Sohail
Registration Number: 21-EE-21
Signature of Student:
Name of Student: Hamnah Awan
Registration Number: 21-EE-38
Dated: 22-06-2025
4
DEDICATION
First and foremost, this project is dedicated to ALLAH ALMIGHTY, through whose
love and mercy we may accomplish our goal, who provided us with the knowledge to
work on this project and the strength to overcome the obstacles. Second, we would
want to give credit to our devoted parents, who taught us the value of a job well done
and provided us with moral, intellectual, and financial support. Finally, we'd want to
thank our supervisor and teachers for guiding us, expanding our technical expertise,
and being a continual source of inspiration. Last but not least, we would like to
dedicate this work to our good friends who inspired us and encouraged us to believe
in our potential.
5
ABSTRACT
IoT Based Smart Grid
Rimsha Sohail
21-EE-21
Hamnah Awan
21-EE-38
Rida Fatima
21-EE-161
Thesis Supervisor:
Dr. Inamul Hasan Shaikh
Assistant Professor EED UET Taxila
This thesis focuses on the development and implementation of an IoT-based smart
grid monitoring and management system. The system aims to enhance the efficiency,
reliability, and sustainability of modern power distribution networks. By leveraging
IoT technology, it collects real-time data from various sensors and smart meters that
monitor critical parameters such as voltage, current, frequency, power consumption,
and grid load. This data is analyzed using advanced algorithms to provide actionable
insights for optimizing energy distribution, fault detection, and demand-side
management. The system also supports remote monitoring and control via wireless
connectivity, allowing utility providers and consumers to interact with the grid
through mobile applications or web interfaces. Field testing demonstrates that the
system improves energy efficiency, reduces operational costs, and enhances the
resilience of power infrastructure. Overall, this thesis contributes to the evolving field
of smart grid technology by offering practical IoT-based solutions for intelligent
energy management.
Keywords: Internet of Things (IoT), smart grid, energy management, power
distribution, sustainability, sensor data analytics, grid monitoring.
6
ACKNOWLEDGEMENTS
First and foremost, we are highly obliged to ALLAH ALMIGHTY, the most Merciful
and the most Beneficial, for granting us knowledge and a chance to work and
complete this project. Without His benevolence and kindness, this task would have
been unachievable. Secondly, we would especially like to thank our Project
Supervisor. Prof. Dr. Inam-ul-Hassan provided us with all types of help in selecting a
suitable project and completing it on time. This milestone would not have been
achieved without his support, assistance, and direction during every thick and thin.
Thirdly, we are very much gratified to our parents who gave us financial assistance
and morals. Furthermore, we are also thankful to the faculty of the Electrical
Engineering Department U.E.T-Taxila for their suggestions and criticism that
encouraged us to achieve our desired goals. Lastly, we thank our family and friends
for the belief that we can achieve so much.
7
TABLE OF CONTENTS
CHAPTER 1
1.1. Introduction ...................................................................................................................................... 13
1.2. Problem Statement ............................................................................................................................14
1.3. Proposed Solution .............................................................................................................................15
1.4. Aims and Objectives .........................................................................................................................17
CHAPTER 2
2.Literature Review..................................................................................................................................18
2.1. IoT Technologies for Smart Grid Monitoring ................................................................................. 18
2.2. Resource Management and Automation in Smart Grids .................................................................18
2.3. Remote Monitoring and Control of Smart Grids .............................................................................18
2.4. Data Analytics and Visualization in Smart Grids ............................................................................19
2.5. Challenges and Future Directions in Smart Grid IoT Integration ................................................... 19
2.6. Data Analytics and Decision Support Systems in Smart Grids .......................................................19
2.7. Automation and Control Strategies in Smart Grids ..........................................................................20
2.8. Practical Applications and Case Studies of Smart Grid IoT ........................................................... 20
2.9. Challenges and Future Directions in Smart Grid IoT Integration .................................................... 20
2.10. Internet of Things (IoT) in Smart Grids ........................................................................................ 21
2.11. Smart Grid Effect .......................................................................................................................... 21
2.11.1 Voltage Control ............................................................................................................................ 22
2.11.2. Frequency Regulation .................................................................................................................22
2.11.3. Load Forecasting ........................................................................................................................ 22
2.11.4. Renewable Energy Integration ................................................................................................... 23
2.11.5. Cybersecurity ..............................................................................................................................23
2.11.6. Communication Protocols .......................................................................................................... 23
2.12. Intelligent Smart Grid Automation with IoT Support ................................................................... 24
CHAPTER 3
3. Components Description and Specifications .......................................................................................26
3.1. NodeMCU ESP8266 Wi-Fi Module ................................................................................................ 26
3.2. Current Transformer (CT).................................................................................................................26
3.3. Relay Modules..................................................................................................................................26
3.4. Power Supplies..................................................................................................................................27
3.5. Loads ................................................................................................................................................ 27
3.6. Digital Panel Meters..........................................................................................................................27
3.7. Tools Specifications..........................................................................................................................29
CHAPTER 4
4. Methodology ........................................................................................................................................30
4.1.Theoretical Background.....................................................................................................................30
4.2.System Design Strategy.....................................................................................................................31
8
4.2.1. Block Diagram of Complete System.............................................................................................31
4.2.2. Workflow Flowchart .....................................................................................................................32
4.2.2.1. Hardware Selection and Justification..........................................................................................32
4.2.2.2. Circuit Design and Simulation (Proteus)....................................................................................33
4.2.2.3. Firmware Development (Arduino IDE)......................................................................................33
4.2.2.4. MQTT Communication Protocol................................................................................................34
4.2.2.5. Android App Development (Android Studio)............................................................................34
4.2.2.6. System Integration and Testing...................................................................................................35
4.3. Theft Detection Algorithm................................................................................................................36
4.4. Communication and Software Framework.......................................................................................37
4.4.1. Communication Architecture.........................................................................................................37
4.4.2. MQTT Protocol..............................................................................................................................37
4.4.3. NodeMCU Firmware and Communication Logic.........................................................................38
4.4.4. Android Application Framework...................................................................................................39
4.4.5. Software Tools and Platforms........................................................................................................39
4.5. Power Conversion Stage...................................................................................................................39
4.5.1. AC to DC Conversion....................................................................................................................40
4.5.2. DC to DC Regulation.....................................................................................................................40
4.5.3. Safety Considerations....................................................................................................................41
4.6. Android Application Integration.......................................................................................................41
4.6.1. User Interface and Features............................................................................................................41
4.6.2. MQTT Communication in App......................................................................................................41
4.6.3. Tools Used in App Development...................................................................................................42
4.7. Software implementation.................................................................................................................42
4.7.1. Simulation Code.............................................................................................................................43
4.7.2. Observations...................................................................................................................................46
4.8. Hardware Implementation.................................................................................................................47
4.9. Results...............................................................................................................................................48
CHAPTER 5
5. Conclusion...........................................................................................................................................51
CHAPTER 6
6. Scope for future work..........................................................................................................................52
CHAPTER 7
7. References............................................................................................................................................53
9
LIST OF FIGURES
Fig 2.1: Advantages of IoT………………..…………………………………………..….....…..........29
Fig 2.2: Disadvantages of IoT…………………….…………....………………….………….……....30
Fig 3.1: NodeMCU ESP8266……………………………..……………......…………,…………...…33
Fig 3.2: Current transformer……………………………………...……………….………....……......34
Fig 3.3: Relay……...……………………………………………………...…………………………...35
Fig 3.4.1: AC to DC converter ………………………….……….....……...………………...……......35
Fig3.4.2:DC to DC converter..………………………….......................................................................35
Fig 3.6: Digital panel meter……………………………………..……....…………..............................36
Fig 4.1: system architecture…….….…………………………..............................……………………45
Fig 4.2.1: Block diagram of system design……………………………….....…………………………48
Fig 4.2.2:Workflow flowchart...…………………………......................................................................36
Fig 4.2.3:Cybersecurity framework in IOT-based smart grid......................……………………….......37
Fig 4.4.2:MQTT communication block diagram........................................……………………….........38
Fig 4.4: Indoor Temperature…….....………….……………………………………………..…………48
Fig 4.5.2: power flow block diagram …….....…………................…………………………..……..…49
Fig 4.7:circuit diagram of IOT based smart grid.........................……………………............................50
Fig 4.8:Hardware implementation of IOT based smart grid..............……………………......................47
Fig 4.8.1:Power distribution and after anti-theft system....................…………………….....................49
Fig 4.8.2:Theft detection......................................................................……………………....................49
Fig 4.8.3:Grid efficiency graph.................................................……………………...............................49
Fig 4.8.4:Reduction in theft events................................................................……………………..........49
Fig 4.8.5:Current distribution..............................................................................……………………....49
Fig 4.8.6:Number of thefts................................................................................……………………......49
10
LIST OF TABLES
Table no 1: Tools specification…………………………….………………………..……….....38
Table no 2: Softwares tools.…….……………………..…………..……………………............39
Table no 3: Sustainable devolpment goals……………..………..……………………...............39
11
Abbreviations:
IoT
Internet of things
MQTT
Message Queuing Telemetry Transport
UI
User Interface
MCU
Microcontroller Unit
12
CHAPTER 1
1.1. Introduction
The Internet of Things (IoT) refers to a network of interconnected devices embedded
with electronics, software, sensors, actuators, and connectivity, which enable them to
collect and exchange data. Each device within this system is uniquely identifiable and
capable of communicating with others via the internet. This integration of the physical
and digital worlds supports the development of intelligent systems and services that
enhance everyday life across multiple sectors, such as smart cities, intelligent
transportation, healthcare, and smart grids.
One of the most transformative applications of IoT is in smart grid systems. A smart
grid modernizes traditional power networks by integrating IoT technologies to enable
efficient, real-time monitoring and management of electricity generation, transmission,
and distribution. These systems help address the growing demand for energy, improve
grid stability, reduce energy loss, and enhance responsiveness to grid disturbances.
With the global population and energy consumption on the rise, the conventional grid
system struggles to meet demand efficiently. Traditional systems often suffer from
inefficiencies such as energy wastage, outages, and delayed response to faults. IoTbased smart grids allow for better load balancing, predictive maintenance, remote
fault detection, and user-side energy monitoring. Sensors and smart meters can detect
fluctuations in voltage, current, temperature, and frequency and send alerts or initiate
corrective measures without human intervention.
IoT-enabled smart grids offer improved reliability and security, optimize energy
usage, integrate renewable energy sources, and support two-way communication
between energy providers and consumers. Users can monitor consumption, reduce
13
unnecessary usage, and contribute to a more sustainable and eco-friendly energy
model. Ultimately, IoT-powered smart grids are shaping the future of energy
infrastructure.
1.2. Problem Statement
The conventional electrical power distribution infrastructure is increasingly facing
multifaceted challenges that hinder its efficiency, reliability, and sustainability. One
of the most pressing issues is the inability of traditional energy metering systems to
perform real-time monitoring of energy consumption. These legacy systems typically
rely on periodic manual readings which are not only time-consuming but also prone to
human error. The lack of real-time visibility into energy usage limits the capacity of
utility providers to detect abnormal consumption patterns or intervene in a timely
manner when issues arise.
Another major concern is electricity theft, which constitutes a significant portion of
non-technical losses in many developing countries. Theft occurs in various forms,
such as illegal tapping of distribution lines, meter tampering, or bypassing meters
entirely. In traditional setups, detecting these activities requires manual inspection and
is often reactive, occurring only after substantial revenue has already been lost.
Consequently, utility companies suffer severe financial losses, and honest consumers
are indirectly penalized through higher tariffs and unreliable service quality.
Moreover, conventional grids lack the intelligence to provide personalized
consumption data to individual households. This absence of granular data makes it
difficult to implement effective load balancing, demand response, and energy
14
optimization strategies. As urban populations grow and energy demands surge, these
limitations further strain the already overburdened electrical infrastructure.
Additionally, grid operators have limited tools to respond dynamically to faults or
emergencies, which affects the quality of service, increases downtime, and reduces
customer satisfaction. The absence of secure, automated, and integrated data
management systems makes the existing grid more vulnerable to disruptions, both
technical and malicious.
These compounding issues underscore the urgent need for a modern, intelligent power
distribution system that can proactively monitor, analyze, and control energy flow
while safeguarding against fraudulent activities. Without such an upgrade, the power
sector will continue to suffer from operational inefficiencies, financial losses, and
diminished trust from consumers.
1.3. Proposed Solution
To effectively resolve the limitations of traditional power distribution systems, the
project proposes the development and deployment of an IoT-Based Smart Grid
System with Anti-Theft Capabilities and Remote Monitoring Control. This intelligent
system harnesses the power of the Internet of Things (IoT), embedded electronics, and
cloud computing to enable real-time energy management, theft detection, and secure
two-way communication between users and the grid.
At the center of the proposed system is the NodeMCU ESP8266 microcontroller, a
Wi-Fi-enabled, low-power embedded platform suitable for smart sensing and control
applications. Each consumer unit or distribution node is equipped with a Current
Transformer (CT) sensor to continuously measure electrical current and monitor
15
energy usage patterns. The CT data is fed to the microcontroller, which processes the
readings and transmits them wirelessly to a cloud-based MQTT broker. The use of the
MQTT protocol ensures lightweight, reliable, and scalable communication with
minimal network overhead.
To prevent electricity theft, the system employs an intelligent theft detection
algorithm. This logic continuously compares the status of the connected relay module
(used to control the power line) with the current measurements. If the system detects
current flow while the relay is turned OFF, it instantly flags the event as unauthorized
consumption and sends an alert to the control center or mobile application. This
allows for immediate notification and intervention, significantly reducing revenue
losses and reinforcing system integrity.
In addition to theft detection, the system integrates a mobile application built using
Android Studio, which provides users and administrators with a real-time dashboard.
Through this application, users can view live power consumption data, receive
automated alerts, and remotely control power to individual nodes (e.g., turning off
appliances or disconnecting service). The app communicates securely with the MQTT
broker, ensuring that all messages are encrypted and authenticated, thus safeguarding
against cyber threats.
To power the entire system reliably, the hardware setup includes a dual-stage power
supply: an AC-to-DC converter to step down 220V AC mains to 12V DC, followed
by a DC-to-DC converter to provide stable 5V DC to the NodeMCU and relay circuits.
This ensures safe and efficient operation of the embedded devices.
16
The entire project is modeled, simulated, and validated using Proteus Design Suite,
where the circuit functionality is tested prior to hardware deployment. The firmware
is developed using Arduino IDE, and modular testing is performed for each functional
block such as current sensing, relay control, communication, and theft detection logic.
By combining real-time data acquisition, automated control, secure wireless
communication, and user-centric mobile access, the proposed system offers a
comprehensive, cost-effective, and scalable solution to modernize electrical power
distribution.
1.4. Aims and Objectives
1.4.1. Aims
To design and implement an IoT-enabled smart grid system with real-time monitoring,
fraud detection, and enhanced cybersecurity for efficient and secure energy
distribution.
1.4.2. Objectives
 To collect and maintain historical records of critical grid parameters (voltage,
current, temperature, energy usage) for analysis and fault detection.
 To facilitate remote access and simplify system maintenance through realtime alerts and predictive diagnostics.
 To enhance connectivity and communication among smart grid components
across a large-scale energy network using wireless technologies.
 To develop a prototype of a smart grid environment, integrating sensors,
actuators, and control systems for automated energy regulation.
17
CHAPTER 2
2. Literature Review
2.1. IoT Technologies for Smart Grid Monitoring
IoT technologies have been integrated into smart grid systems to enhance monitoring
and management capabilities. These technologies include remote sensing, cloud
computing, data analytics, and wireless sensor networks. Research has demonstrated
the effectiveness of these systems in real-time monitoring of electrical parameters
such as voltage, current, and power quality. This integration facilitates improved grid
stability, early detection of faults, and efficient energy distribution.
2.2. Resource Management and Automation in Smart Grids
Effective resource management is crucial in smart grid operations. IoT-based systems
provide automation and intelligent control methods for resource allocation and
utilization. Through data-driven algorithms, these systems optimize energy generation,
distribution, and consumption. By continuously monitoring and evaluating sensor data,
IoT systems can make intelligent decisions to achieve optimal resource usage, leading
to enhanced energy efficiency and reduced operational costs.[1,2]
2.3. Remote Monitoring and Control of Smart Grids
The integration of IoT devices enables remote monitoring and control of smart grid
systems. Researchers have developed web-based interfaces and mobile applications
that provide grid operators with real-time access to data, alarms, and system
management tools. This remote accessibility allows for quick adaptation to changing
conditions, efficient operation, and reduced need for on-site presence, thereby
improving overall grid management.[3]
18
2.4. Data Analytics and Visualization in Smart Grids
IoT sensors in smart grid systems generate vast amounts of data, necessitating
advanced data analytics methods. Data visualization tools, predictive modeling, and
machine learning algorithms have been employed to extract valuable insights from
sensor data. These insights support proactive maintenance, early fault detection, and
informed decision-making. Visualization techniques, such as dashboards and
graphical representations, assist grid operators in understanding complex data trends
and making data-driven choices.[4,5]
2.5. Challenges and Future Directions in Smart Grid IoT Integration
Despite promising advancements, IoT-based smart grid systems face several
challenges. Issues related to data security and privacy, interoperability, scalability,
and the need for standardized protocols are prevalent. Future research should focus on
addressing these challenges and exploring areas such as edge computing, AI-driven
decision support systems, and integration with emerging technologies like blockchain
and fog computing. These innovations have the potential to significantly enhance
smart grid performance and resilience.
2.6. Data Analytics and Decision Support Systems in Smart Grids
In IoT-based smart grid systems, data analytics plays a pivotal role. Researchers have
utilized machine learning algorithms, statistical models, and data fusion techniques to
filter and analyze the extensive sensor data. [6]These analytics-driven approaches
enable pattern recognition, anomaly detection, demand forecasting, and optimization
of energy distribution. Decision support systems provide grid operators with
19
actionable insights, facilitating informed decisions for improved grid performance and
resource allocation.
2.7. Automation and Control Strategies in Smart Grids
Automation and control of electrical parameters are achievable with IoT-based smart
grid systems. The use of actuators, such as circuit breakers, voltage regulators, and
load controllers, allows for dynamic adjustment of parameters like voltage, frequency,
and load balancing. Automation strategies, coupled with real-time sensor data, enable
these parameters to be adjusted based on predefined thresholds and control algorithms,
ensuring optimal grid conditions and minimizing the need for manual intervention.
2.8. Practical Applications and Case Studies of Smart Grid IoT
Several case studies have demonstrated the feasibility and benefits of IoT-based smart
grid systems. These studies showcase the effective implementation of technologies in
various settings, including urban, industrial, and rural areas. Applications encompass
energy demand response, fault detection and isolation, renewable energy integration,
and predictive maintenance. The findings from these case studies provide valuable
insights into the potential for widespread adoption of IoT-based smart grid
technologies.
2.9. Challenges and Future Directions in Smart Grid IoT Integration
Despite progress, challenges persist in the development and operation of IoT-based
smart grid systems. These challenges include issues with interoperability, data
security and privacy, energy efficiency, and scalability. Future research should
concentrate on addressing these issues and exploring future technologies such as edge
20
computing, blockchain, and AI-driven optimization methods. Furthermore, integrating
IoT with other technologies, such as advanced metering infrastructure and distributed
energy resources, has the potential to significantly enhance smart grid systems.
2.10. Internet of Things (IoT) in Smart Grids
The Internet of Things (IoT) refers to a network of interconnected devices, sensors,
and software applications that communicate and interact with one another without
human intervention. In the context of smart grids, IoT technologies are essential for
creating and maintaining the desired operational conditions. Devices such as smart
meters, sensors, and actuators are deployed throughout the grid to monitor and control
various parameters, including voltage, current, and power quality. These devices
collect data, which is transmitted to central control systems for analysis and decisionmaking. IoT enables real-time monitoring, fault detection, and optimization of energy
distribution, leading to enhanced grid reliability and efficiency.
2.11. Smart Grid Effect
A smart grid is an electricity network that uses digital technology to monitor and
manage the transport of electricity from all generation sources to meet varying
electricity demands of end-users. It integrates advanced communication, control, and
automation technologies to improve the efficiency, reliability, and sustainability of the
power grid. Smart grids enable two-way communication between utilities and
consumers, allowing for real-time monitoring and control of energy usage. This
facilitates demand response, integration of renewable energy sources, and enhanced
grid resilience.
21
2.11.1 Voltage Control
In a smart grid, voltage control is achieved through the use of advanced sensors,
actuators, and control algorithms. Devices such as voltage regulators, capacitor banks,
and on-load tap changers are employed to maintain voltage levels within specified
limits. Real-time data from IoT sensors allows for dynamic adjustment of these
devices, ensuring stable voltage profiles across the grid. This is particularly important
in accommodating the variable nature of renewable energy sources and maintaining
the quality of power supplied to consumers.
2.11.2. Frequency Regulation
Frequency regulation in a smart grid is achieved through the coordinated operation of
generation and storage resources. IoT-enabled systems monitor frequency deviations
and dispatch appropriate resources to correct imbalances. For instance, demand
response programs can be activated to reduce load during frequency dips, while
energy storage systems can inject power during frequency surpluses. This dynamic
balancing ensures that the grid operates within the required frequency range,
enhancing stability and reliability.
2.11.3. Load Forecasting
Accurate load forecasting is essential for efficient grid operation. IoT devices collect
real-time data on energy consumption patterns, which is analyzed using machine
learning algorithms to predict future demand. These forecasts enable utilities to plan
generation and distribution strategies effectively, minimizing costs and preventing
overloading of grid components. Incorporating factors such as weather conditions,
time of day, and historical usage patterns enhances the accuracy of load forecasts.
22
2.11.4. Renewable Energy Integration
Integrating renewable energy sources into the smart grid is facilitated by IoT
technologies that monitor and manage the variable output of these sources. Sensors
track parameters such as solar irradiance and wind speed, providing data to predict
energy production. This information allows for the adjustment of conventional
generation and storage systems to accommodate the fluctuating supply from
renewables. IoT-enabled demand response programs can also be employed to shift
consumption to periods when renewable generation is abundant, optimizing the use of
clean energy.
2.11.5. Cybersecurity
Cybersecurity is a critical concern in IoT-based smart grid systems due to the
increased connectivity and data exchange. Implementing robust security measures,
such as encryption, authentication, and intrusion detection systems, is essential to
protect against cyber threats. Regular security audits and compliance with industry
standards help in identifying vulnerabilities and ensuring the integrity and
confidentiality of grid operations. Collaboration between utilities, technology
providers, and regulatory bodies is necessary to develop and enforce comprehensive
cybersecurity frameworks.[6]
2.11.6. Communication Protocols
Effective communication is fundamental to the operation of IoT-based smart grids.
Utilizing standardized communication protocols ensures interoperability among
diverse devices and systems. Protocols such as MQTT, CoAP, and DDS are
commonly used for reliable data transmission. Incorporating low-power wide-area
network (LPWAN) technologies, like LoRaWAN and NB-IoT, enables long-range
23
communication with minimal energy consumption, making them suitable for remote
sensors and devices. Selecting appropriate communication protocols based on
application requirements is crucial for the efficiency and scalability of smart grid
systems. [7,8]
2.12. Intelligent Smart Grid Automation with IoT Support
2.12.1 Benefits of the Internet of Things:
IoT offers numerous daily advantages to organizations as well as consumers. We can
now see real-time data that was previously unattainable thanks to technology. By
lowering material waste and unscheduled downtime, businesses can increase
production efficiency. Artificial intelligence applications significantly reduce the time
Figure 2.1: Advantages of IoT
and effort required from humans. Infrastructure construction and infrastructure fault
finding can both be done with the use of sensors. Automated traffic management ease
traffic congestion, and external devices or sensors can be used to monitor the
environment and warn us of oncoming natural disasters.
IoT improves our lives by making our homes, workplaces, and cars smarter and more
measurably connected.
24
2.12.2 Negative aspects of the Internet of Things
The security of IoT devices is a two-edged sword. The system is fairly safe and
efficient now that we have a network of interconnected gadgets. Despite the fact that
connected devices generate large volumes of data and are continually sharing data
across devices, this results in massive amounts of internet traffic. These data can
make devices more helpful, but the open nature of the internet creates security and
privacy concerns. These issues arise due to a multitude of factors.[9]
Figure 2.2: Disadvantages of IoT
The security of IoT devices is a two-edged sword. The system is fairly safe and
efficient now that we have a network of interconnected gadgets. Despite considering
that connected devices constantly share enormous amounts of data among themselves
and generate a lot of data on their own, this generates a lot of internet traffic. The
openness of the internet raises security and privacy problems, but this data can render
devices more useful. Numerous variables contribute to these problems.[10]
25
CHAPTER 3
3. Components Description and Specifications
Each component used in the system is carefully selected based on functionality,
reliability, and compatibility. Detailed specifications and the purpose of each
component are described below.
3.1. NodeMCU ESP8266 Wi-Fi Module
In our IoT-Based Smart Grid System with Anti-Theft Detection, the NodeMCU
ESP8266 Wi-Fi module is used as the main controller for data processing and
wireless communication. It reads current and voltage data from sensors like current
transformers and sends this information to the cloud using the MQTT protocol over
Wi-Fi. The NodeMCU has a total of 17 GPIO pins, out of which 4 pins are used in
this project: one analog pin (A0) to read sensor data, two digital pins (D1 and D2) to
control relays for turning the load on/off, and one digital pin (D5) for theft detection
input. It is preferred in this project due to its low cost, built-in Wi-Fi, ease of
programming using the Arduino IDE, and ability to communicate with the mobile app
for real-time monitoring and control.
Figure 3.1 NodeMCU ESP8266 [22]
26
3.2. Current Transformer (CT)
In our IoT-Based Smart Grid System with Anti-Theft Detection, the Current
Transformer (CT) is used to measure the amount of current flowing through the
electrical load. It works on the principle of electromagnetic induction and converts
high current from the power line into a lower, proportional current that can be safely
measured by microcontrollers like the NodeMCU. In this project, a non-invasive CT
sensor (like SCT-013-000) is used, which clamps around the live wire without
breaking the circuit. The CT is connected to the analog input pin (A0) of the
NodeMCU through a burden resistor and signal conditioning circuit to convert the
current into a readable voltage signal. Only one CT sensor is used in the project to
monitor the total current usage, detect unusual current flow, and help identify
electricity theft or overuse.
Figure 3.2 Current Transformer
3.3. Relay Modules
In our IoT-Based Smart Grid System with Anti-Theft Detection, the relay module is
used to control the connection and disconnection of the electrical load based on the
system's logic or user commands from the mobile application. A 5V single-channel
relay module is connected to the digital pins (D1 and D2) of the NodeMCU ESP8266.
When the NodeMCU sends a HIGH or LOW signal to the relay input pin, it acts as a
27
switch, allowing or cutting off the flow of electricity to the connected appliance. This
enables the system to automatically turn off the power supply in case of theft
detection or overload conditions. The relay module operates on low voltage but can
control high-voltage AC appliances, making it ideal for remote energy control in
smart grid systems.
Figure 3.3 Relay[23]
3.4. Power Supplies
In our IoT-Based Smart Grid System with Anti-Theft Detection, the power supply
section includes multiple modules to convert and regulate voltages for different
components. First, an AC to DC converter module (220V AC to 12V DC adapter) is
used to step down the main AC supply and provide a safe 12V DC output. This 12V
DC is then fed into a DC-DC buck converter module (like LM2596), which steps
down the voltage further from 12V to 5V DC, suitable for powering the NodeMCU
ESP8266, relay modules, and other 5V sensors. The NodeMCU itself operates on
3.3V internally, but it is powered via its Vin or USB input which accepts 5V. The
digital wattmeter display module is directly powered from the AC mains, as it is
designed to operate at 220V AC. These power modules ensure that all components
operate within their required voltage ranges while maintaining electrical safety and
system stability.
28
Figure 3.4.1 AC to DC converter
Figure 3.4.2 DC/DC converter
3.5. Loads
In our IoT-Based Smart Grid System with Anti-Theft Detection, ceiling lights are
used as the electrical loads to demonstrate power consumption and control. These
lights are connected to the relay module, which allows the system to switch them ON
or OFF remotely through the NodeMCU based on real-time control commands or
theft detection logic. To simulate theft, a bypass connection is introduced where the
ceiling light receives power directly from the AC source, skipping the current sensor
and relay control. This helps in detecting unauthorized power usage, as the system
reads zero or low current from the CT sensor, while the wattmeter shows actual
consumption, indicating a mismatch. This condition triggers the anti-theft response,
29
and the system alerts the user via the Android app or MQTT platform, demonstrating
how the smart grid can identify and respond to electricity theft.
3.6. Digital panel meters
In our IoT-Based Smart Grid System with Anti-Theft Detection, a digital panel meter
is used to display real-time electrical parameters such as voltage (V), current (A), and
power (W) of the AC load. It is connected directly to the AC supply and the load and
functions as a standalone monitoring device. This module helps visually verify the
actual power consumption of the load during normal operation and also during theft
simulation. It operates independently from the NodeMCU and is powered directly
from the 220V AC mains. The digital panel meter plays a crucial role in detecting
theft, as it continues to show power consumption even when the current transformer
(CT) connected to the NodeMCU reads zero current, thereby indicating a mismatch
and triggering the anti-theft response in the system.
Figure 3.6 Digital panel meter
30
3.7. Tools Specification
Table 1 Tools Specification
Components
Specifications
NodeMCU ESP8266 Wi-Fi Module
32-bit LX106 microcontroller
Clock speed: 80 MHz
Flash memory: 4MB
Operating voltage: 3.3V
Current Transformer
Supports TCP/IP protocol
Rated input current: up to 30A AC
Relay Module
Output: low-voltage AC proportional to
current
Coil voltage: 5V DC
Switching capacity: 230V AC
Digital panel meter
SPDT configuration
Input voltage: 220V AC
Power Supply Module
Digital display (LCD/LED)
Input: 220V AC
Output: 5V DC, 2A
DC-DC buck converter with voltage
regulator (AMS1117/7805)
31
CHAPTER 4
4. Methodology
4.1. Theoretical Background
The foundation of the methodology for this smart grid project is grounded in
principles of power system monitoring, embedded systems, and wireless
communication technologies. At its core, a smart grid integrates traditional electrical
infrastructure with real-time data acquisition, automation, and user-centric control
mechanisms. The adoption of IoT (Internet of Things) enables decentralized sensing,
control, and communication between distributed energy nodes using microcontrollers
like the NodeMCU ESP8266. These nodes facilitate accurate load monitoring through
current transformers and manage power distribution via relay modules. The MQTT
protocol, a lightweight publish-subscribe messaging model, ensures efficient, secure,
and scalable data transmission across nodes and interfaces. Additionally, the Androidbased mobile application bridges user interaction with the electrical grid, offering a
practical implementation of ubiquitous computing and remote energy control. This
theoretical framework supports the project's objective of creating a reliable, anti-theft
smart grid system optimized for real-time monitoring and management.[11]
32
Distribution
Transformer
Anti-Theft Module
Main Grid Meter
House 2 Smart
Meter
House 1 Smart
Meter
IoT Gateway
Cloud Server
Figure 4.1 System Architecture
4.2. System Design Strategy
The development of the IoT-based smart grid system followed a modular and layered
design approach, which divided the system into key parts such as sensing, control,
communication, and monitoring. This structure made the system easier to design, test,
and upgrade. Sensors like current transformers and voltage sensors were used to
measure electrical values, which were sent to a microcontroller for processing. Based
on the data, control actions such as turning off illegal loads were performed using
relays. The NodeMCU ESP8266 module handled wireless communication, sending
data to a cloud platform for real-time monitoring. A web-based dashboard allowed
users to view energy usage, receive alerts, and check the system status from anywhere.
To ensure secure data transmission, AES-256 encryption was used, protecting the
33
system from unauthorized access. This modular design also allowed easy expansion,
making it flexible and reliable for future improvements.
4.2.1. Block Diagram of Complete System
AC Power
Supply
Current
Transfor
mer
Reads Current
Controls Relay
Sends Data
NodeMC
U
ESP8266
MQTT
Broker
(Cloud)
Android
App
Figure 4.2.1 Block diagram of System design
CT measures current from the load.NodeMCU receives this data, controls relays, and
publishes to MQTT.MQTT Broker handles real-time data distribution.App shows
energy data and alerts to the user.
4.2.2. Workflow Flowchart
4.2.2.1. Hardware Selection and Justification
34
The hardware was selected based on real-time energy monitoring needs:
CT Sensors: To sense current flow safely and accurately.
Relays: To enable on/off switching of the loads under software control.
NodeMCU: Chosen for its built-in Wi-Fi, GPIOs, and compatibility with IoT cloud
platforms.
Power supply was designed to step down 220V AC using a regulated adapter,
converting it first to 12V DC, and then regulated to 5V DC using buck converters for
NodeMCU and relay modules.
4.2.2.2. Circuit Design and Simulation (Proteus)
Circuit diagrams were built and simulated in Proteus to validate:
1.
Sensor connectivity
2.
Microcontroller logic
3.
Relay switching behavior
This prevented hardware errors and saved development time.
4.2.2.3. Firmware Development (Arduino IDE)
Each NodeMCU was programmed to:
1.
Read analog values from CT
2.
Control relays using digital output pins
3.
Calculate energy usage
4.
Connect to MQTT server using Wi-Fi
35
5.
Publish sensor data and receive control commands
Libraries Used:
1.
ESP8266WiFi.h for Wi-Fi connection
2.
PubSubClient.h for MQTT communication
4.2.2.4. MQTT Communication Protocol
1.
Lightweight, ideal for low-power devices
2.
Supports publish/subscribe model
3.
Easily scalable for multiple nodes
Working:
1) Each NodeMCU connects to the same MQTT broker using a unique topic like
/house1/load1
2) Publishes sensor data
3) Subscribes to control commands (e.g., ON/OFF instructions from the app)
Security Measures: TLS encryption and authentication tokens can be added for
secure transmission.
4.2.2.5. Android App Development (Android Studio)
The Android app was developed to:
1.
Display real-time power usage
2.
Show relay status (ON/OFF)
3.
Alert users about possible theft
36
4.
Provide remote control buttons for each load
Tools Used:
1) Android Studio
2) Python
3) MQTT client library (org.eclipse.paho.client.mqttv3)
4.2.2.6. System Integration and Testing
Once all modules were individually working, the complete system was integrated:
1.
Wi-Fi credentials were configured on each NodeMCU.
2.
MQTT broker was connected to all devices and the Android app.
3.
Data from CT sensors was continuously monitored.
4.
Theft detection logic was validated by simulating illegal load connections.
5.
Load control was tested using both hardware switches and the mobile app.
Testing Parameters:
1) Voltage/current accuracy
2) Communication delay (latency)
3) Relay response time
4) Theft detection accuracy
37
START
Select Hardware Components
Simulate Circuit in Proteus
Develop Firmware in Arduino IDE
Implement MQTT + Theft Logic
Design Android App
Integrate & Test All Modules
Deploy & Monitor
End
Figure 4.2.2 Workflow Flowchart
4.3. Theft Detection Algorithm:
Electricity theft remains a significant challenge in power distribution systems, causing
substantial revenue losses. Traditional methods of theft detection rely heavily on
manual inspection and are often ineffective. Modern approaches using IoT and smart
metering have shown promising results in automated theft detection
Theft Detection pseudocode:
If |ITRANSFORMER − ΣIMETER | > Threshold
where Threshold = Line_Loss_Factor × ITRANSFORMER
Alert("Potential Theft Detected")
Identify_Location()
38
Theft detection mechanisms include:
IT = IC + IM
Eq. 4.1
Where IT is theft current , IC is current at transformer and IM is the sum of meter
currents.As smart grids rely on IoT, securing data transmission and system integrity
becomes essential. This project incorporates encryption, authentication protocols, and
an Intrusion Detection System (IDS) to safeguard data integrity and confidentiality .
Encryption protects information from unauthorized access, while IDS monitors
network traffic for potential security threats.
Data
Collection
(Smart Meters,
CTs)
Data Encryption &
Secure Transmission
Central
Monitoring
Dashboard with
IDS
Figure 4.2.3 Cybersecurity Framework in IoT-Based Smart Grid
4.4. Communication and Software Framework
This section describes the communication model, software architecture, and tools
used for integrating real-time monitoring, control, and theft detection in the IoT-based
smart grid system.
4.4.1. Communication Architecture
The system uses a publish-subscribe messaging model via the MQTT protocol over
Wi-Fi. Each NodeMCU connects to a cloud-based MQTT broker to transmit sensor
data and receive control instructions. This model supports efficient and scalable
communication between multiple nodes and interfaces like the Android app or cloud
dashboards.
39
Key Features:
1.
Real-time bidirectional communication
2.
Lightweight and low-latency messaging
3.
Secure and structured topic-based data exchange
4.4.2. MQTT Protocol
MQTT (Message Queuing Telemetry Transport) is a lightweight IoT protocol
optimized for embedded devices.
Broker: HiveMQ Cloud serves as the central communication hub.
Topics Used:
1.
grid/house1/current – Publishes current readings
2.
grid/house1/status – Publishes relay state
3.
grid/house1/theft – Publishes theft alerts
4.
grid/house1/control – Subscribes to app commands (ON/OFF)
Each NodeMCU:
1) Publishes live sensor data to the broker.
2) Subscribes to command topics to listen for control instructions.
3) Sends alert messages if theft is detected (i.e., current flows when relay is off).
40
NodeMCU (Publisher/Subscriber)
MQTT Broker (HiveMQ/Mosquitto)
Android App (Publisher/Subscriber)
Figure 4.4.2 MQTT Communication Block Diagram
4.4.3. NodeMCU Firmware and Communication Logic
The firmware was developed using Arduino IDE and includes:
1.
Initialization of Wi-Fi and MQTT libraries
2.
Periodic current readings from CT sensors
3.
Relay control logic
4.
Theft detection by comparing CT current with relay state
5.
MQTT publish/subscribe handlers
Libraries Used:
1) ESP8266WiFi.h
2) PubSubClient.h
4.4.4. Android Application Framework
The Android app, developed in Android Studio, serves as a user interface for grid
monitoring and remote control.
41
Front-End: Python with MQTT client integration
Back-End: Real-time communication with broker
Functions:
1.
View live energy data
2.
Switch loads ON/OFF remotely
3.
Get alerts for abnormal conditions (theft)
4.
Show relay and sensor status
4.4.5. Software Tools and Platforms
Table 2 Softwares Tools
Tools
Purpose
Arduino IDE
Programming NodeMCU
Android Studio
App development
HiveMQ
MQTT communication
Proteus
Circuit simulation
4.5. Power Conversion Stage
The power supply unit is responsible for delivering regulated and isolated DC
voltages suitable for each component in the system. The design includes two stages of
voltage conversion to ensure stable operation.
4.5.1. AC to DC Conversion
42
A 220V AC mains supply is used as the input. A standard adapter module or stepdown transformer with rectification circuitry converts this into a 12V DC output. This
conversion is essential to power the intermediate-level devices like relay modules and
linear voltage regulators.
4.5.2. DC to DC Regulation
To power the NodeMCU (which operates at 3.3V but accepts 5V input via the Vin
pin), the 12V DC is stepped down to 5V DC using Buck Converter (preferred for
efficiency)
220V AC
AC/DC
converter
22V DC
NodeMCU &
Relay
5V DC
Figure 4.5.2 Power Flow Block Diagram
This regulated 5V powers:
1.
NodeMCU microcontroller
2.
Relay switching circuits
3.
LED indicators or other support components
4.5.3. Safety Considerations
1.
Fuses and overcurrent protection are added in the AC input.
2.
Flyback diodes across relays protect against voltage spikes.
43
Buck
Converter
3.
Isolation is maintained between AC mains and low-voltage circuit.
4.6. Android Application Integration
An Android application was developed to provide a real-time interface between the
user and the smart grid system. The app communicates wirelessly using MQTT
protocol and reflects live updates from the IoT nodes.
4.6.1. User Interface and Features
The app provides:
1.
Real-time load status (ON/OFF)
2.
Power consumption display (from CT readings)
3.
Theft alerts and warnings
4.
Remote control buttons to toggle relays
4.6.2. MQTT Communication in App
1.
Using the Eclipse Paho MQTT client library, the app:
2.
Subscribes to sensor and theft alert topics
3.
Publishes ON/OFF commands to specific relay topics
4.
Parses incoming data and updates the UI accordingly
4.6.3. Tools Used in App Development
1) Android Studio: Primary development environment
2) Python: Programming languages
3) MQTT Client : For real-time communication
44
The app acts as the interactive front-end of the entire system, making the grid smart,
user-friendly, and remotely operable.
4.7. Software implementation
The software implementation of the smart grid system was first initiated by designing
and simulating the complete circuit in Proteus. This included all the key modules: the
current transformer sensors, relay drivers, microcontrollers (NodeMCU ESP8266),
and their interconnections. Each component was simulated for real-time behavior to
validate the logic of current sensing and relay control. Sensor outputs were monitored
through virtual terminals, and digital logic control was verified by observing
switching actions of relays within the simulation. The Proteus environment provided a
controlled space to troubleshoot and confirm that the system would perform as
intended before proceeding to physical construction.[13]
Parallel to circuit simulation, the Arduino IDE was used to write and test the firmware
for each IoT node. The NodeMCU was programmed to collect real-time current
values, compare relay states for theft detection, and transmit data wirelessly using
MQTT. Each software module—data acquisition, decision-making logic, and
communication handling—was tested independently, and then integrated into a single
firmware loop. The interaction between simulated hardware and this software layer
ensured smooth functioning, accurate current measurements, and reliable relay control.
Once verified in simulation, the same logic and firmware were uploaded to the real
hardware for deployment and iterative testing.
45
Figure 4.7. Circuit Diagram of IoT based Smart Grid
4.7.1. Simulation Code
#include <ESP8266WiFi.h>
#include <PubSubClient.h>
#include <WiFiClientSecure.h>
// Wi-Fi credentials
const char* ssid = "fahadali_000";
const char* password = "Alee1122";
// MQTT Broker details
const char* mqtt_server = "75a4c4e53ce640c2b22e1cd51efacff4.s1.eu.hivemq.cloud";
const int mqtt_port = 8883; // Secure TLS port
const char* mqtt_user = "Iot_smart_grid";
const char* mqtt_password = "Iot11223344";
// Topics
const char* publishTopic =
"smartgrid/user1/current"; //user2//user1//grid//house1//house2
const char* onOffTopic
=
"smartgrid/user1/on_off"; //user2//user1//grid//house1//house2
const char* ackTopic
=
"smartgrid/user1/ack";
//user2//user1//grid//house1//house2
WiFiClientSecure espClient;
46
PubSubClient client(espClient);
#define LED_PIN D4
#define RELAY_PIN D0
int deviceState = 1;
void callback(char* topic, byte* payload, unsigned int length) {
String message;
for (unsigned int i = 0; i < length; i++) {
message += (char)payload[i];
}
Serial.print(" Message arrived [");
Serial.print(topic);
Serial.print("]: ");
Serial.println(message);
}
if (String(topic) == onOffTopic) {
if (message == "0") {
deviceState = 0;
digitalWrite(RELAY_PIN, LOW);
Serial.println(" Device turned OFF");
client.publish(ackTopic, "0");
} else if (message == "1") {
deviceState = 1;
digitalWrite(RELAY_PIN, HIGH);
Serial.println(" Device turned ON");
client.publish(ackTopic, "1");
}
}
void reconnect() {
while (!client.connected()) {
Serial.println(" Reconnecting to MQTT...");
if (client.connect("user1Node", mqtt_user, mqtt_password))
{ //user2//user1//grid//house1//house2
Serial.println("✅ MQTT Connected");
client.subscribe(onOffTopic);
} else {
Serial.print("❌ Failed, rc=");
Serial.print(client.state());
Serial.println(" → retrying in 5 seconds...");
delay(5000);
}
}
}
void printMQTTError(int state) {
switch (state) {
47
}
}
case -4: Serial.println("❌ Timeout."); break;
case -3: Serial.println("❌ Lost."); break;
case -2: Serial.println("❌ Connect failed."); break;
case -1: Serial.println("❌ Disconnected."); break;
case 0: Serial.println("✅ OK."); break;
default: Serial.println("❌ Unknown error."); break;
void setup_wifi() {
delay(10);
Serial.println("\n Connecting to Wi-Fi...");
Serial.print("SSID: ");
Serial.println(ssid);
WiFi.begin(ssid, password);
int retry = 0;
while (WiFi.status() != WL_CONNECTED && retry < 20) {
delay(500);
Serial.print(".");
retry++;
}
}
if (WiFi.status() == WL_CONNECTED) {
Serial.println("\n✅ Connected to Wi-Fi");
Serial.print("IP: ");
Serial.println(WiFi.localIP());
} else {
Serial.println("❌ Wi-Fi failed");
}
void setup() {
Serial.begin(115200);
pinMode(LED_PIN, OUTPUT);
pinMode(RELAY_PIN, OUTPUT);
digitalWrite(LED_PIN, LOW);
digitalWrite(RELAY_PIN, HIGH);
setup_wifi();
}
espClient.setInsecure(); // TLS w/o cert
client.setServer(mqtt_server, mqtt_port);
client.setCallback(callback);
// Sampling variables
unsigned long lastSendTime = 0;
const unsigned long sampleWindow = 1000; // 1 second
48
void loop() {
if (!client.connected()) {
reconnect();
}
client.loop();
int peakADC = 0;
unsigned long startTime = millis();
// Sample as fast as possible for 1 second
while (millis() - startTime < sampleWindow) {
int reading = analogRead(A0);
if (reading > peakADC) {
peakADC = reading;
}
delayMicroseconds(200); // Sampling delay (adjust for performance/noise tradeoff)
}
// Create message
char message[50];
sprintf(message, "grid current: %d", peakADC);
if (client.publish(publishTopic, message)) {
Serial.print(" Sent: ");
Serial.println(message);
}
digitalWrite(LED_PIN, HIGH); delay(100); digitalWrite(LED_PIN, LOW);
} else {
Serial.println("❌ Publish failed");
digitalWrite(LED_PIN, LOW);
}
4.7.2. Observations
The Arduino code enables Wi-Fi and MQTT communication between the NodeMCU
and the cloud-based broker. During simulation and testing, successful connection to
the broker was confirmed using MQTT authentication and secure TLS port 8883.
When ON/OFF commands were published from the Android application, the
NodeMCU correctly parsed the payloads, changed the relay state, and acknowledged
the action via a return message. Additionally, the current sensing part was triggered
49
through analog sampling on pin A0, providing peak ADC values which were
packaged and published every second.[14]
From these observations, it was verified that the LED blinked as an indicator during
message transmission and relay activation. The use of TLS ensured secure data
handling, while the defined MQTT topics maintained structured communication.
Overall, the simulation code demonstrated effective relay control, theft detection logic
integration, and real-time data exchange with stable performance, validating the
design for hardware implementation.
4.8. Hardware Implementation
Figure 4.8 Hardware Implementation Of IoT based Smart Grid
The hardware implementation of the IoT-based smart grid system was carried out by
assembling various electronic modules that work in coordination to provide real-time
monitoring, theft detection, and secure control. At the core of each sensing and
control unit is the NodeMCU ESP8266, which serves as the primary controller. This
microcontroller is interfaced with a Current Transformer (CT) sensor to measure the
current flowing through the consumer line. The analog output of the CT sensor is
50
connected to the A0 pin of the NodeMCU, which digitizes the signal and estimates
the power usage in real time. In parallel, a 5V relay module is used to control the
supply to the load. The relay is connected to a digital pin on the NodeMCU and can
be triggered remotely based on MQTT commands or internal logic.
To power the hardware safely and reliably, an AC to DC conversion module is used to
step down the 220V AC mains to 12V DC. This is then regulated to 5V using either a
buck converter or 7805 linear voltage regulator. The final 5V output is used to drive
both the NodeMCU and the relay module. Additional components such as LED
indicators are included to visually display the system’s status—such as power ON,
relay state, and message transmission. All components were first connected on a
breadboard and tested individually. Once verified, the final hardware was soldered
onto a PCB for compactness and reliability. The whole system was tested under load
conditions, and its behavior was validated with both normal and abnormal operating
scenarios, including power theft.[15,16]
4.9. Results
The implementation of the proposed hardware successfully addresses the key
challenges outlined in the problem statement. One of the primary issues—the lack of
real-time monitoring in traditional power systems—was resolved by integrating the
CT sensors with the NodeMCU, allowing continuous measurement and wireless
reporting of energy consumption. The hardware reliably transmitted this data to the
MQTT broker at regular intervals, making it accessible to both the control center and
the user via the mobile application.[17] This provides a significant improvement over
manual metering systems, as it allows power providers to observe grid status in real
time.
51
Additionally, the theft detection mechanism embedded in the hardware proved
effective during testing. When the relay was turned OFF and unauthorized current
flow was detected, the NodeMCU instantly identified the mismatch and published a
theft alert. This functionality directly responds to the problem of undetected power
theft in legacy systems. Moreover, the ability to remotely control relays through
MQTT and the Android app highlights the system's responsiveness and user
interactivity, aligning well with the proposed solution. Overall, the hardware
prototype confirmed that the IoT-based smart grid system is a viable, scalable, and
efficient approach to modernizing electrical power distribution.[18]
Figure 4.8.1 Power Distribution before and after Anti-Theft System
Figure 4.8.2 Theft Detection
52
Figure 4.8.3 Grid Efficiency Graph
Figure 4.8.4 Reduction in Theft Events
Figure 4.8.5 Current Distribution
Figure 4.8.6 Number of Thefts
53
Chapter 5
5. Conclusion
This thesis presents an Internet of Things (IoT)-based intelligent smart grid system
with real-time monitoring and control capabilities. Designed to function without
relying on complex infrastructure, the system is structured as a layered architecture
composed of modular components that can be rapidly deployed. This modularity
allows for flexibility in both system configuration and scalability, enabling seamless
integration and dynamic management of various devices within the smart grid
network.
Although the implementation in this study was limited to a prototype setup using
simulation protocols, the system successfully met its objectives in performance
evaluation scenarios. It demonstrates the foundational functionality necessary for
managing interconnected IoT devices across a smart energy network, including
features like secure communication, energy usage monitoring, and system
interoperability.[19,20]
The decision to utilize Wi-Fi as the primary communication medium proved effective
in reducing hardware requirements and maintaining system simplicity. Furthermore,
enabling IoT-enabled smart grid components to connect securely with external
networks via the Internet enhances accessibility while maintaining a degree of
isolation for improved cybersecurity. Overall, this work lays the groundwork for
future development and deployment of more advanced, scalable, and resilient IoTbased smart grid infrastructures.
54
Chapter 6
6. Scope for future work
The findings of this research can serve as a foundation for future advancements in
developing more intelligent, scalable, and efficient IoT-based smart grid systems.
Several improvements and extensions can be considered to enhance the overall
functionality and robustness of the system:
1. Integrate machine learning algorithms to predict energy consumption patterns,
optimize load distribution, and improve demand-response strategies within the
smart grid.
2. Develop IoT gateways to support the inclusion of legacy electrical devices or
components that lack native Wi-Fi connectivity, allowing broader integration
within the smart grid ecosystem.[21]
3. Implement hierarchical energy management layers, such as neighborhoodlevel or city-level control systems, to create a multi-tiered, decentralized energy
management structure.
4. Enable
flexible
and
adaptive
communication
protocols,
allowing
interoperability with different standards and supporting integration with other
emerging technologies in the energy domain.
Design a responsive and adaptive user interface that provides real-time insights and
control across various platforms and devices, improving accessibility and user
interaction for both residential and industrial users
55
PROJECT
AND
ITS
MAPPING
TO
SUSTAINABLE
DEVELOPEMNT GOALS
Goal
Sustainable development goals
7
Affordable & clean energy
9
Industry
,innovation
SDGs implemented
on the project
&
infrastructure
11
Sustainable cities & communities
12
Responsible
consumption
production
56
&
References:
[1] Swastika, A. C., Pramudita, R., & Hakimi, R. (2017a). IOT-based smart grid
system design for Smart Home. 2017 3rd International Conference on
Wireless
and
Telematics
(ICWT),
978
1
4673
1436
7,
49–53.
https://doi.org/10.1109/icwt.2017.8284137
[2] Navya, J. M., Sanjay, H. A., & Deepika, K. (2018). Securing Smart Grid data
under key exposure and revocation in cloud computing. 2018 3rd International
Conference on Circuits, Control, Communication and Computing (I4C), 1–4.
https://doi.org/10.1109/cimca.2018.8739496
[3] Hajjafari, A. et al. (2023) ‘Design and implementation of an IOT-based smart
home with the ability to communicate with the smart grid’, 2023 International
Conference on Protection and Automation of Power Systems (IPAPS), pp. 1–5.
doi:10.1109/ipaps58344.2023.10123324.
[4]
Sartika, N., Sukmana, Y., Effendi, M. R., Rusliana, I., Khomisah, K., &
Yuningsih, Y. (2021). A systematic literature review on IOT-based Smart Grid.
2021 7th International Conference on Wireless and Telematics (ICWT), 2017
july, 1–5. https://doi.org/10.1109/icwt52862.2021.9678415
[5] Kuroptev, K., & Steinke, F. (2023). Coordinated cyber attacks on smart grids
considering software supply chains. 2023 IEEE PES Innovative Smart Grid
Technologies
Europe
(ISGT
EUROPE),
1–5.
https://doi.org/10.1109/isgteurope56780.2023.10407630
[6] Gadasin, D. V., Shvedov, A. V., & Klygina, O. G. (2022). Organization of
interaction between the concept of Fog Computing and segment routing for the
provision of IOT services in Smart Grid Networks. 2022 Wave Electronics and
Its Application in Information and Telecommunication Systems (WECONF).
https://doi.org/10.1109/weconf55058.2022.9803696
[7] Pradyumna, A., Kuthadi, S. M., Kumar, A. A., & Karuppiah, N. (2022). IOT
based smart grid communication with Transmission Line Fault Identification.
57
2022 International Conference on Intelligent Controller and Computing for Smart Power
(ICICCSP), 7, 1–5. https://doi.org/10.1109/iciccsp53532.2022.9862383
[8] Adel Nazemi Babadi, Sanaz Nouri, Siamak Khalaj. Challenges and opportunities
of the integration of IOT and smart grid in Iran Transmission Power System. 2017
Smart Grid Conference (SGC).1-6.
https://doi.org/10.1109/sgc.2017.8308847
[9] Deepak kumar Aagri. Altanai bisht. Export and import of renewable energy by
Hybrid Microgrid via IOT. 2018 3rd International Conference On Internet of
Things: Smart Innovation and Usages (IoT-SIU).
https://doi.org/10.1109/iot-siu.2018.8519873
[10] Neeraj singh, Priyanka Paliwal. Planning and monitoring of smart grid
architecture using internet of things. 2022 IEEE 6th International Conference
on Condition Assessment Techniques in Electrical Systems (CATCON).12-16.
https://doi.org/10.1109/catcon56237.2022.10077659
[11] Pradeep, S., Krishna, S., Reddy, M. S., Sri, D. D., & Sri, M. S. (2023). Analysis
and functioning of smart grid for enhancing energy efficiency using
OptimizationTechniques with IOT. 2023 IEEE 5th International Conference on
Cybernetics, Cognition and Machine Learning Applications (ICCCMLA), 316–
321. https://doi.org/10.1109/icccmla58983.2023.10346767
[12] Lu, J., Zhao, R., Li, S., Yu, Z., & Li, H. (2022). Technical framework and
architecture of beidou-3 smart grid converged networking. 2022 4th International
Academic Exchange Conference on Science and Technology Innovation (IAECST),
660–663.
https://doi.org/10.1109/iaecst57965.2022.10062239
[13] Balasubramanian, C., & Raja Singh, R. L. (2023). IOT based energy
management system in Smart Grid. 2023 Innovations in Power and
Advanced Computing Technologies (i-PACT). https://doi.org/10.1109/ipact58649.2023.10434561
58
[14] Sartika, N., Sukmana, Y., Effendi, M. R., Rusliana, I., Khomisah, K., &
Yuningsih, Y. (2021). A systematic literature review on IOT-based Smart Grid.
2021 7th International Conference on Wireless and Telematics (ICWT), 1–5.
https://doi.org/10.1109/icwt52862.2021.9678415
[15] nick farid, Roghoyeh salmeh. Network configurations for IOT services in Smart
Grid. 2021 9th International Conference on Smart Grid and Clean Energy
Technologies (ICSGCE).
https://doi.org/10.1109/icsgce52779.2021.9621636
[16] Yasin baloorchi, Sadoon azizi, An IOT-fog-cloud framework for demand side
management in Smart Grid.( 2021) 5th International Conference on Internet of
Things
and
Applications
(IoT).1-6.
https://doi.org/10.1109/iot52625.2021.9469712
[17] Hameed, Z., Ahmad, F., Rehman, S. ur, & Ghafoor, Z. (2020). IOT based
communication technologies to integrate and maximize the efficiency of
renewable energy resources with smart grid. 2020 International Conference on
Computing
and
Information
Technology
(ICCIT-1441),
1–5.
https://doi.org/10.1109/iccit-144147971.2020.9213730
[18] Mais nijim, Divya Ballampalli. The design of a novel Smart Home Control
System using a smart grid based on edge and cloud computing.(2022)
International Journal of Smart Grid and Clean Energy.57-71.
https://doi.org/10.12720/sgce.11.2.57-71
[19] syed Naqvi shah. IOT enabled Smart Grid Integration with Edge Computing
Method. 2023 International Conference on Communication, Computing and
Digital Systems (C-CODE).1-6.
https://doi.org/10.1109/c-code58145.2023.10139871
[20] Seyed Ehsan ahmadi ,sina Delpasand. IOT‐based Energy Management Strategies
in smart grid.(2023) Smart Grids and Internet of Things.91-126.
https://doi.org/10.1002/9781119812524.ch4
59
[21] Sudhir.k.routray,
Devarajan
Gopal,
Abhishek
javali,
Anindita Sahoo.
Narrowband IOT (NBIoT) assisted Smart Grids. ( 2021) International Conference on
Artificial
Intelligence
and
Smart
Systems
(ICAIS).
1454-1458.
https://doi.org/10.1109/icais50930.2021.9395891
[22] Figure 3.1: ElectroPeak, “NodeMCU ESP8266 Wi-Fi Module,” [Online].
Available: https://electropeak.com/. [Accessed: Jul. 21, 2025].
[23] Figure 3.2: Current Transformer. Note. Image retrieved from Talema Group.
(n.d.). Current transformer product image. https://www.talema.com/
60
SIMILARITY REPORT:
61
62
63
64
65
66
67
68
Download