Final Report - MOD
Final Report - MOD
Bachelor of Technology
In
Electrical Engineering
By
Sk Safin (EEN184006)
Pursued in
ALIAH UNIVERSITY
KOLKATA
_______________________
SIGNATURE OF THE SUPERVISOR
PALLAV DUTTA
ASSISTANT PROFESSOR
DEPARTMENT OF ELECTRICAL ENGINEERING
___________________________________
We declare that this project report titled SMART ELECTRICITY MONITORING AND
CONTROL SYSTEM BASED ON INTERNET OF THINGS AND USAGE DATA submitted
in partial fulfillment of the degree of Bachelor of Technology in (Electrical
Engineering) is a record of original work carried out by me under the supervision
of Prof. Pallav Dutta and has not formed the basis for the award of any other
degree or diploma, in this or any other Institution or University. In keeping with the
ethical practice in reporting scientific information, due acknowledgements have
been made wherever the findings of others have been cited.
SIGNATURE
SK SAFIN (EEN184006)
KOLKATA -700160
We express our sincere gratitude to Mr. Pallav Dutta, Assistant Professor, Department
of Electrical Engineering, Aliah University, as the mentor for our project. It is our
great fortune that we have got opportunity to carry out this project work under the
supervision. We express our sincere thanks for the encouragement, support and the
guidance. We would further like to thank the entire faculty for their cooperation and
extended support in undergoing the project work. We also would thank the
department of Electrical Engineering to provide the infrastructure and facility in
carrying the projects like these.
SK SAFIN (EEN184006)
i
ABSTRACT
ii
TABLE OF CONTENTS
Acknowledgment i
Abstract ii
List of figures v
List of tables vi
Abbreviations vii
Introduction 1
Chapters:
1) Chapter 1: Internet of Things 3
(a) Introduction 3
(b) Key Features
6
(c) Advantages
8
(d) Disadvantages
(e) Applications 10
(c) Conclusion 21
5) Hardware Configuration
(a) Hardware Component Description 22
(b) Hardware Setup
29
(c) Setting up the Dashboard
34
iii
6) Result and Data Analysis
(a) Industrial Revolution 37
(b) Test Results 37
(c) Data analysis from our Implemented system
39
(d) Conclusion
42
7) Applications and Limitations
(a) Applications
(b) Limitations 43
8) Challenges Faced and Future Scope 45
(a) Challenges Faced 46
(b) Future Scope
47
References 53
Appendices 56
iv
LIST OF FIGURES
v
LIST OF TABLES
vi
ABBREVIATIONS
AC Alternating Current
IP Internet Protocol
AI Artificial Intelligence
NB nota bene
vii
PCB Printed Circuit Board
CT Current Transformer
PT Potential Transformer
GND Ground
viii
IEEE Institute of Electrical and Electronics Engineers
ML Machine Learning
PF Power Factor
ix
INTRODUCTION
The Internet of Things (IoT) describes the network of physical objects or things that
are embedded with sensors, software, and other technologies for the purpose of
connecting and exchanging data with other devices and systems over the internet
exploits recent advances in software, falling hardware prices, and modern attitudes
towards technology. Its new and advanced elements bring major changes in the
delivery of products, goods, and services; and the social, economic, and political
impact of those changes. Deployment of IoT for energy management helps us with
energy quality control on the household appliances to lower costs, boost efficiencies
and reduce environmental impact.[1]
From the very beginning of power consumption throughout the day, it is realized
that power consumption is still now utmost. The power consumption is high due to
line losses in the peak hours. So, we had to implement a system which can facilitate
remote proctoring as well as remote control. Almost 33% of the demand is fulfilled
by the Peak-load Power Stations when required. It is convenient for our system if
we use the power in an efficient manner. Inhabitancies and companies are beginning
to research for best methods to assist decrease their rising electrical bills. One
method of decrease these expenses through real-time monitoring, how much power
is being consumed, and from this information make informed decisions about how
to control the electrical devices being operated. A system that can give consumers
an estimate of the amount of power consuming, will allow them to adjust their habits
in order to reduce costs.[2]
We were invoked for this kind of implementation of IoT in a system keeping some
viewpoints in mind such as some intelligent properties of IoT which can manage the
power through the relay system as well as the basic concepts of smart grid
technology thereby reducing
1
wastage of electrical energy by human negligence and automate the monitor and
control of home appliances. In recent years, WSNs has been used for environmental
monitoring, health monitoring and industrial monitoring as a means of reducing the
energy consumption. WSNs are also highly flexible and support power management
using Web services and middleware technologies. WSN technology has
demonstrated a great potential in management and collecting data such as humidity,
pressure, temperature, electrical parameter, etc. This data that collected through the
sensing node will be transferred wirelessly to the control system for operation and
management. So, by using WSN technology we would like to implement our idea
as well as continue to save energy in unique manner.[3]
2
CHAPTER 1
INTERNET OF THINGS
1.1 Introduction
The internet of things, or IoT, is a system of interrelated computing devices,
mechanical and digital machines, objects, animals or people that are provided with
unique identifiers (UIDs) and the ability to transfer data over a network without
requiring human-to-human or human-to-computer interaction. In a more technical
sense, IOT (Internet of Things) is an advanced automation and analytics system
which exploits networking, sensing, big data, and artificial intelligence technology
to deliver complete systems for a product or service. These systems allow greater
transparency, control, and performance when applied to any industry or system.[10]
A ‘thing’ in the internet of things can be a person with a heart monitor implant,
a farm animal with a biochip transponder, an automobile that has built-in sensors to
alert the driver when tire pressure is low or any other natural or man-made object
that can be assigned an Internet Protocol (IP) address and is able to transfer data
over a network.[10]
3
preferred grocer. Realizing the future and full potential of IoT devices will require
an investment in new technologies. The convergence of AI and IoT can redefine the
way industries, business, and economies functions. AI enabled IoT creates
intelligent machines that simulate smart behavior and supports in decision making
with little or no human interference.AI in IoT crunches the constant streams of data
and detects the patterns not deceptive on simple gauges.AI-powered IoT ecosystem
analyzes and summarizes the data from one device before transferring it to other
devices naming it as scalability. As such, it reduces large volumes of data to a handy
level and allows connecting a large number of IoT devices. The predictive
maintenance with AI enabled IoT allows you to predict the equipment failure in
advance and schedule orderly maintenance procedures. Hence, you can avoid the
side effects of downtime. Some examples are robots manufacturing, self-driving
cars, retail analytics and smart thermostat system.[4]
4
areas and requiring minimal power consumption. Seeing a huge potential of Low-
Power Wide Area technologies, major global network operators are busy developing
their proprietary solutions (Sigfox, NB-IoT, LTE Cat-M1, LoRa and others),
thereby benefitting other networks too.[5]
• Sensors − IoT loses its distinction without sensors. They act as defining instruments
which transform IoT from a standard passive network of devices into an active
system capable of real-world integration and play an important role in creating
solutions using IoT a wide range of IoT sensors used to detect and measure various
physical phenomena such as heat and pressure as well as the five human senses:
sight, hearing, touch, taste and smell. With respect to communication interference
the types of sensors include USB sensors, wireless and Bluetooth sensors and
embedded sensor modules.[6]
• Small Devices − Devices, as predicted, have become smaller, cheaper, and more
powerful over time. IoT exploits purpose-built small devices to deliver its precision,
scalability, and versatility devices are hardware devices, such as sensors, gadgets,
appliances and other machines that collect and exchange data over the Internet. They
are programmed for certain applications and can be embedded into other IoT
5
devices. Different IoT devices have different functions, but they all have similarities
in terms of how they work. Firstly, IoT devices are physical objects that sense things
going on in the physical world. They contain an integrated CPU, network adapter
and firmware, and are usually connected to a Dynamic Host Configuration Protocol
server. It also requires an IP address to function over the network. Most IoT devices
are configured and managed through a software application. Some devices also have
integrated web servers, which eliminates the need for external applications. For
example, the lights switch on immediately when you enter a room.[7]
The advantages of IoT span across every area of lifestyle and business. Here is a list
of some of the advantages that IoT has to offer −
• Improved Customer Engagement − Current analytics suffer from blind spots and
significant flaws in accuracy; and as noted, engagement remains passive. IoT
completely transforms this to achieve richer and more effective engagement with
audiences’ helps with asset utilization, improves safety and security, enhances
productivity, saving costs, and delivers the best customer experience. Thus,
businesses are taking advantage of this technology to not only improve profitability
but also enhance customers’ experience plays a vital role in creating a positive
customer experience. It can increase customer satisfaction by controlling equipment
for problems. In some circumstances, the IoT sensors may be able to foretell
problems before they occur. The IoT device can convey an alert to an engineer
warning them about the inherent problem; the equipment could be repaired before
the issue commences to any downtime is used to enrich communication, as well.
From operational management to understanding customers’ behavior, IoT can
generate important data for your business. With the insights, you can personalize
communication with your customers and increase
6
satisfaction. Also, you will be able to gauze the interest area of your customers,
which is essential to personalize their experience.[8]
• Technology Optimization − The same technologies and data which improve the
customer experience also improve device use, and aid in more potent improvements
to technology. IoT unlocks a world of critical functional and field data. In the current
time; engineering problems are associated with multiple objectives. Based on the
number of objectives optimization problem can be classified as single‐, multi‐, and
many‐objective optimization. In the case of a single‐objective optimization it is easy
to find a single solution, however it becomes very difficult to get a single solution
in the cases of multi‐ and many‐objective optimization as the objectives are quite
contradictory. Hence, evolutionary and swarm‐based algorithms are widely used to
address such problems where the search space is very large and the problem is
associated with multiple contradictory objectives. Today optimization is a powerful
tool of trade for the engineer in virtually every discipline. It provides them with a
rigorous, systematic method for rapidly zeroing in on the most innovative, cost‐
effective solutions to some of today's most challenging engineering design
problems. The IoT is the concept of connecting everyday devices to the Internet
allowing the devices to send and receive data. With the IoT, devices can constantly
report their status to a receiving computer that uses the information to optimize
decision making. The IoT network optimization offers a lot of benefits for
improving traffic management, operating efficiency, energy conservation, reduction
in latency, higher throughput and faster rate in scaling up or deploying IoT services
and devices in the network.
• Reduced Waste − IoT makes areas of improvement clear. Current analytics give
us superficial insight, but IoT provides real-world information leading to more
effective management of resources. Using IoT technology, smart waste bins
transmit their real-time fill level information to waste collectors. The IoT solution
then uses the data and
7
selects optimum routes for waste collection trucks. This leads to a pickup process
that passes over empty waste bins, saving on transportation costs and human power.
Smart waste management with IoT is crucial not just for food, but also in handling
special materials, like e – waste. These IoT- based efforts are important
contributions toward a systemic, long-term solution for waste reduction. The IoT
allows people to organize daily activities in a way that reduces excess. For example,
wasting energy often happens because of human neglect. But with computers
ensuring that no resource is wasted (e.g., smart thermostats); our carbon footprint
can also be reduced. When applied to a society-wide level, the effects may be
tremendous.
• Enhanced Data Collection − Modern data collection suffers from its limitations
and its design for passive use. IoT breaks it out of those spaces, and places it exactly
where humans really want to go to analyze our world. It allows an accurate picture
of everything data collection is the process of using sensors to track the conditions
of physical things. Devices and technology connected over the IoT can monitor and
measure data in real time. The data are transmitted, stored, and can be retrieved at
any timeout data collection is the foundation of preventative and predictive
maintenance, which can reduce the likelihood of unexpected equipment breakdown.
Though IoT delivers an impressive set of benefits, it also presents a significant set
of challenges. Here is a list of some its major issues −
8
problem when the device is connected to the Internet: everyone in the world can
now potentially access the functionality offered by the device. When a device
communicates in plain text, all information being exchanged with a client device or
backend service can be obtained by a ‘Man-in-the-Middle’ (MitM). Anyone who is
capable of obtaining a position on the network path between a device and its
endpoint can inspect the network traffic and potentially obtain sensitive data such
as login credentials. A typical problem in this category is using a plain-text version
of a protocol (e.g., HTTP) where an encrypted version is available (HTTPS). A
Man-in-the-Middle attack where the attacker secretly accesses, and then relays
communications, possibly altering this communication, without either party being
aware.
9
This complexity has a significant impact on performance and availability. We know
that the complexity for performance occurs in the IoT ecosystem because the IoT
devices are linked to multiple points, such as endpoint devices, mobile applications
and cloud platforms. Managing all these devices and keeping track of the failures,
configurations and performance of such a large number of devices can be a
challenge in IoT solutions.
• Flexibility − Many are concerned about the flexibility of an IoT system to integrate
easily with another. They worry about finding themselves with several conflicting
or locked systems.
• Compliance − IoT, like any other technology in the realm of business, must comply
with regulations. Its complexity makes the issue of compliance seem incredibly
challenging when many consider standard software compliance a battle.
IOT systems have applications across industries through their unique flexibility and
ability to be suitable in any environment. They enhance data collection, automation,
operations, and much more through smart devices and powerful enabling
technology. While other uses of IOT technology or the Internet of Things are
concerned, we are offering an innovative to the qualitative and quantitative
challenges such as intelligent energy supply, distribution and various wide service
oriented and maintenance. Such responsible applications of IOT are Smart home,
Smart Grid, Smart Energy Monitoring, Solar control and monitoring, Industrial
Internet, Smart Street Lighting, Energy usage &efficiency, Power Quality
Monitoring, Building Automation, Smart Solar Tracking.
10
CHAPTER 2
LITERATURE SURVEY
In 2011, Kim et.al. [7], they proposed a power management and control system
based on wireless sensor networks. Where wireless sensors were used to
continually sense and update electricity data and transmit it via Zigbee module,
in order to provide real-time electricity consumption information to users and
remote monitoring and control of home appliances were provided to users
through web service.
In 2013, Soliman et.al. [7], they explored the concept of Smart Home through
integrating IOT with Web services and Cloud computing. Their approach
consisted of embedding intelligence into sensors and actuators using Arduino
platform, networking smart things using Zigbee technology and facilitating
interactions with smart things using Cloud services for easy access in different
locations. The approach was successfully used for demonstrating services for
measuring home conditions, monitoring home appliances, and controlling home
access. The infrastructure can be adopted for or adapted to other applications.
In 2014, Suryadevara et.al. [7], they proposed the pattern of a smart monitoring
and controlling system for household electrical appliances in real time. This
system monitors electrical parameters of household appliances were done by
interfacing with fabricated sensing modules for transmitting wirelessly by
Zigbee protocol to central controller. In order to calculate the power consumed.
This system implemented the controlling mechanism of appliances in different
ways. The system was used for remote monitoring and control of appliances
effectively through a website. Local and remote user interfaces were easy to
handle by a consumer and are efficient in handling the operations.
In 2015, Sindhuja and Balamurugan [7], they designed the system to implement
smart power monitoring and control through IoT using cloud data storage.
Power consumed by various appliances is monitored
11
through an ARM based controller interfaced to Hall Effect current sensors and
stored in a cloud data base. Power control of home appliances is achieved through
actuators such as relays which can be controlled by client with the help of a web
server by establishing Remote Procedure Calls between client and server. The
designed system was enabled client to monitor and control the appliances at home
from anywhere availing the IoT features thereby reducing the wastage of energy.
In 2016, Kallur and Kulkarni [7], they created a smart power monitoring and control
system toward the usage of an intelligent building. This framework adequately
screens and controls the electrical machine utilizations at an elderly home. The
electrical parameters of home machines were monitored by interfacing with sensor
modules and the yield signals from it were incorporated and associated with Zigbee
module for transmitting electrical parameters data wirelessly to the host PC which
was stored the information into a database. This system intended to decide the zones
of daily peak hours of power use levels and accompany an answer by which the
system can bring down the utilization and improve better use of effectively restricted
assets during peak hours.
In 2017, Joshi and Khan, [7], they reported an effective implementation for Internet
of Things used for monitoring home appliances, they presented wireless sensor
networks based real time power management system to control and monitor the
power consumption of electrical appliances in a home. For calculating the power
consumption of electrical appliances was used current and voltage sensors. Then,
these measured data was transmitted wirelessly using Zigbee protocol to the
Ethernet shield for monitoring and controlling remotely through a secured internet
web connection. Thus, this system can reduce electricity cost of the consumers.
In 2018, Anas Ali[7], they used an embedded system where they utilized WSNs
technology integrated with a Zigbee module for monitoring and controlling power
via a smartphone application. Then the measured data
12
was transmitted wirelessly using Zigbee protocol to the Ethernet shield for
monitoring and controlling remotely through a secured internet web connection.
Thus, this system was intended to reduce the electricity cost of the consumers. The
visible shortcoming of this system was that it used the Zigbee which had a
foundation of range of communication as it incorporated Bluetooth connectivity
which requires line-of-sight communication.
13
CHAPTER 3
In this project, we will learn how to make our own IoT Based Electricity Energy
Meter using ESP32 & monitor data on the Blynk Application. With the current
technology, you need to go to the meter reading room and take down readings. Thus,
monitoring and keeping track records of your electricity consumption is a tedious
task. To automate this, we can use the Internet of Things. The Internet of Things
saves time and money by automating remote data collection. Smart Energy Meter
has received quite a lot of acclaim across the globe in recent years. So, why not to
build our own IoT Based Electricity Energy Meter?
We need to select the current sensor as well as the voltage sensor so that the current
& voltage can be measured and so we can know about the power consumption &
total power consumed. The best current sensor available in the market is SCT-013.
This is SCT-013 Non-Invasive AC Current Sensor Split Core Type Clamp Meter
Sensor which can be used to measure AC current up to 100 amperes. Similarly, the
best voltage sensor is the AC Voltage Sensor Module ZMPT101B. The ZMPT101B
AC Voltage Sensor is the best where we need to measure the accurate AC voltage
with a voltage transformer. Using the SCT-013 Current Sensor & ZMPT101B
Voltage Sensor, we can measure the all required parameters needed for Electricity
Energy Meter. We will interface the SCT-013 Current Sensor & ZMPT101B
Voltage Sensor with ESP32 Wi- Fi Module & Send the data to Blynk Application.
The Blynk Application Dashboard will display the Voltage, Current, Power & total
unit consumed in kWh.
14
In this work, the system designed by the integration of wireless technology with
Web Service communications for power management using IoT platform, to
monitor the power usage of AC devices in a home environment. Then, the consumed
power will be displayed through a user-visible interface in real time where the
consumers can readily realize the patterns of electricity consumption and adjust their
behavior to reduce power consuming and costs. The system permits for inexpensive
monitoring of power usage and demonstrates a practical method to control power
consumption through user interaction. Moreover, consumers can manually, control
the on/off appliances to effectively control power usage of appliances and able to
remotely control via smartphone application. The flexibility and configurability
characteristics of our system are two key points for users, as well as low power
consumption and system portability.
iii. Smart electrical devices like voltage sensors, current sensors etc.
Starting from the electrical system and sensing node, there’s use of Hall Effect AC
Current Sensor and a transformer-based AC Voltage Sensor to calculate the real
time power consumption of the connected electrical appliances. From the digital
reference value getting from the voltage and current sensor we can easily calculate
the power (apparent power), energy consumed (in W unit) per hour. We can also
calculate the power factor using the comparator. In our implemented system, the
GUI is designed based upon the latest value for same power consumption. We have
already designed the two-gauge meter which include Vrms and Irms, apart from those
two meters a bar graph is also designed for integrating the value of power. Lastly,
the amount of electricity consumed is also shown as per the consumed units. As per
different distribution boards, the
15
cost per unit differs accordingly and the power consumed will be displayed on the
dashboard.
The smart meter shows a digital meter reading and uses a secure smart data network
to automatically send the reading to your energy supplier. That means you get
accurate, not estimated bills, without needing to take a manual reading.
We can easily install smart energy meter in our home as well as industry
by setting an API whereas we ought to install it in a specific place only.
16
from anywhere in the world, receive important notifications, and much more. We
made sure that we are in developer mode before we can continue the further
dashboard setup.
The Arduino IoT Cloud is an online platform that makes it easy for you to create,
deploy and monitor IoT projects. We can learn how to set up the Arduino Cloud IoT
and get a quick overview of the compatible boards, the API, configuration, Things,
variables and dashboards from the blogs available on the platform itself.
In this project, we will learn about the application of Arduino IoT Cloud with
ESP32. Recently the Arduino Community launched their IoT platform called
Arduino IoT Cloud. We can connect multiple devices to each other and allow them
to exchange real-time data. We can also monitor data from anywhere using a simple
user interface.
As an example, we can control multiple home appliances from the Arduino IoT
Cloud Dashboard. We will interface a 4-channel relay with ESP32 Wi-Fi Module &
send the ON/OFF commands either from the mobile phone dashboard or from
Computer Dashboard and Control Relay, Light, or anything else. Now we will
discuss about the deployment of this entire system.
17
CHAPTER 4
SOFTWARE DESIGN
The purpose of the Proteus toolkit is to simulate the creation of a schematic circuits
and how to conduct an interactive simulation using Proteus VSM. User will
concentrate on the use of active components and the debugging facilities of the ISIS
editor, the basics of laying out a schematic and general circuit management is also
covered in the software. Proteus toolkit combines mixed mode SPICE circuit
simulation, animated components and microprocessor models to facilitate co-
simulation of complete microcontroller-based designs. It helps to develop and test
such designs before a physical prototype is constructed. The Proteus Design Suite
is unique in offering the ability to co- simulation both high and low-level
microcontroller code in the context of a mixed-mode SPICE circuit simulation. PCB
editing software that is included in the Proteus Design Suite. It is fully compatible
with ISIS Schematic Capture. [29]
18
4.1.3 Working Procedure of ISIS
STEP 1: Run the ISIS professional program by clicking the icon on the desktop,
then this splash screen will appear.
STEP 2: Next, a work space with interface buttons for designing circuit will appear.
Note that there is a blue rectangular line in the workspace; make sure that whole
circuit designed inside the rectangular space.
STEP 3: Select the components from library. In menu bar library → pick device /
symbol. Then one window will open that shown in below is another way to select
the components. In work space left side there is a tool bar. In that tool bar click the
component mode button or pick from library.
STEP 4: Select the all components from library, that components are added to
devices list. Click on the device and change the angle of the device by using rotate
button. Then click in the work space.
STEP 5: Place all the devices in work space and put the curser at the component pin
end then draw the connections with that pen symbol. Connect all the components
according to circuit then that designed circuit is show in below image.
STEP 6: If any modifications want to do the component place the mouse point and
click on right button then option window will open.
STEP 7: The components are connected with the wires or it can connect with the
wire label by giving common wire label.[29]
19
Figure 4 : Proteus Design
4.2 Description
But in case of our practical scenario, we have already implemented this system by a
microcontroller (ESP32) which is actually feasible in reality. In our Proteus software
these are beyond the scope as they have no hex
20
file to upload the code. Hence, we just draw and design the circuit only. Rather it is
possible to stimulate the same design instead of Node MCU with some cons as well
[21].
4.3 Conclusion
In this project, the proposed smart meter system using proteus software has been
proposed. This system which records the energy utilized by the consumers and
transmits that information to the utilities for monitoring, controlling, billing and
other purposes. The collected data and parameters such as voltage, current, power
factor, consumed power, frequency and billing amount are transmitted to the
monitor section as well as the home section. Hence smart meter will reduce the man
power and provides accuracy. Smart meter also reduces the difficulty faced by the
people when readings are taken manually. The proposed smart meter provides better
accuracy in meter reading, better control over distribution and management. [17]
21
CHAPTER 5
HARDWARE CONFIGURATION
ESP32
Development
1 ESP32 Board 1
Board (ESP-
WROOM-32)
ZMPT101B AC
2 Voltage Sensor Voltage Sensor 1
Module
SCT-013-030 Non-
3 Current Sensor invasive AC 1
Current Sensor
4 Resistor 10K 2
6 Capacitor 10uF 1
8 Breadboard - 1
22
5.1.1 SCT-013 Current Sensor
The SCT-013 is a Non-invasive AC Current Sensor Split Core Type Clamp Meter
Sensor that can be used to measure AC current up to 100 amperes. Current
transformers (CTs) are sensors are for measuring alternating current. They are
particularly useful for measuring whole building electricity consumption. The
SCT-013 current sensors can be clipped straight either to the live or neutral wire
without having to do any high voltage electrical work.[19]
Figure 5.2 : Simple construction and circuit symbol for the current sensor
23
5.1.2 ZMPT101B AC Single Phase Voltage Sensor
The Modules can measure voltage within 250V AC voltage & the
corresponding analog output can be adjusted. The module is simple to use
and comes with a multi-turn trim potentiometer for adjusting and
calibrating the ADC output.[20]
Specifications:
24
5.1.3 5V Four-Channel Relay Module
Specifications:
Current when the relay is active – ~70mA (single), ~300mA (all four)
The four-channel relay module contains four 5V relays and the associated
switching and isolating components, which makes interfacing with a
microcontroller or sensor easy with minimum components and
connections. There are two terminal blocks with six terminals each, and
25
each block is shared by two relays. The terminals are screw type, which makes
connections to mains wiring easy and changeable.[23]
The four relays on the module are rated for 5V, which means the relay is activated
when there is approximately 5V across the coil. The contacts on each relay are
specified for 250VAC and 30VDC and 10A in each case, as marked on the body of
the relays.[23]
The switching transistors act as a buffer between the relay coils that require high
currents, and the inputs which don’t draw much current. They amplify the input
signal so that they can drive the coils to activate the relays. The freewheeling diodes
prevent voltage spikes across the transistors when the relay is turned off since the
coils are an inductive load. The indicator LEDs glow when the coil of the respective
relay is energized, indicating that the relay is active. The optocouplers form an
additional layer of isolation between the load being switched and the inputs. The
isolation is optional and can be selected using the VCC selector jumper. The input
jumper contains the main V•CC, GND, and input pins for easy connection using
female jumper wires.[23]
26
5.1.4 ESP32 DEVKIT DOIT
We have used the ESP32 DEVKIT DOIT board as a reference. But the
information on this page is also compatible with other ESP32 development
boards besides the ESP-WROOM-32 chip that we’re using.
Specifications:
27
Sound), RMII (Reduced Media-Independent Interface), PWM (pulse
width modulation), and more.[18]
The ESP32 has more GPIOs with more functionality compared to the ESP8266.
With the ESP32 you can decide which pins are UART, I2C, or SPI – you just need
to set that on the code. This is possible due to the ESP32 chip’s multiplexing feature
that allows assigning multiple functions to the same pin. If you don’t set them on
the code, the pins will be used as default – as shown in the figure x (the pin location
can change depending on the manufacturer) [24].
Security:
28
∗ Cryptographic hardware acceleration: AES, SHA-2, RSA, elliptic curve
cryptography (ECC), random number generator (RNG)[24]
Power management:
Now let us see the circuit diagram of IoT Based Electricity Energy Meter
using ESP32. The circuit has been designed using Fritzing software.
The connection diagram is simple. Both the Sensor, i.e., SCT-013 Current Sensor
& ZMPT101B Voltage Sensor VCC is connected to Vin of ESP32 which is a 5V
Supply. The GND pin of both the modules is connected to the GND of ESP32. The
output analog pin of the ZMPT101B Voltage Sensor is connected to GPIO35 of
ESP32.
29
Similarly, the output analog pin of SCT-013 Current Sensor is connected to GPIO34
of ESP32. You need a two resistor of 10K & a single resistor of 100 Ohms connected
along with a 10uF Capacitor [22].
Apart from the circuit part, the AC wires where the current and voltage needs to be
measured are connected to the input AC Terminal of Voltage Sensor. Similarly, the
current sensor clip doesn’t have any connection and a single live wire or neutral wire
is inserted inside the clip part as shown in the above circuit [22].
As per the circuit diagram shown in fig. x1, we have set up the hardware part and
then connected it to the AC Mains. The modification we did here is that we have
connected three static loads and one variable load instead of just a single load [13].
The 4 – Channel relay module is connected to the ESP 32 board which is powered
up by a 5V DC Source. The voltage sensor and the current sensor is connected to
the GPIO Pins 34 and 35 respectively, and the triggering pulse of the relay module
is given by the GPIO Pins 2, 21, 22 and 23. Resistances and Capacitances are
connected so that we can limit the current value, to get a constant voltage and to
filter out the noise.[15]
Blynk is an application that runs over Android and IOS devices to control any IoT
based application using Smartphone. It allows you to create your Graphical user
interface for IoT application. Here we will display the IoT Energy Meter Data on
Blynk Application.
1. So, download and install the Blynk Application from Google Play Store. IOS users
can download from the App Store. Once the installation is completed, open the app
& sign-up using your Email id and Password.
2. From the dashboard create a new project and select ESP32 & Wi-Fi Connection.
30
3. Then drag & drop or add 4 widgets and assign the variable as per code and
then email the authentication code.
4. You will get the authentication code in the mail. Copy this authentication
code. This will be used in your code.[14]
i. EmonLib Library
The EmonLib Library is used for Electricity Energy Meter. EmonLib is a
Continuous Monitoring of Electricity Energy repeats, every 5 or 10sec, a sequence
of voltage and current measurements. EmonLib continuously measures in the
background the voltage and all the current input channels, calculates a true average
quantity for each and then informs the sketch that the measurements are available
and should be read and processed.[14]
ii. Blynk Library
Blynk is the most popular Internet of Things platform for connecting any hardware to
the cloud, designing apps to control them, and managing your deployed products at
scale. With Blynk Library you can connect over 400 hardware models including
Arduino, ESP8266 & ESP32 to the Blynk Cloud.[14]
31
5.2.4 Source Code/Program – IoT Electricity Energy Meter
After adding the above libraries to the Arduino IDE, you can upload the
IoT Electricity Energy Meter Code to ESP32 Board. But before that please
make changes to the Wi-Fi SSID, Password & Blynk Authentication
Token.
Code Explanation
#include "EmonLib.h"
//https://github.com/openenergymonitor/EmonLib
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
EnergyMonitor emon:
BlynkTimer timer:
32
char auth[] = "************";
Then we define the SSID & Password on our local Wi-Fi network & insert
the authentication code from the Blynk.
Serial.begin(9600);
timer.setInterval(5000L, myTimerEvent);
Under the setup function we initialized the Serial baud rate and set the
current and voltage sensor analog pin as GPIO34 & GPIO35. Then we set
the timer to 5000L for an update time of 5 seconds.
Blynk.run();
timer.run();
Inside the loop function we are running the timer and Blynk.
33
5.3 Setting up the Dashboard
After setting up the hardware, next we designed a dashboard so that we can perform
various tasks by our system, like controlling the switching of the loads and observe
the various instantaneous changes in the system via the data that is being collected.
For that, firstly create an account on the Blynk IoT platform to create a new template.
Then we create a data stream function, written in an IDE and link it to a profile.
According to the DataStream, create the variables, like voltage, current, power, etc.
Link the data stream to the variables. Metadata is a platform where we can see the
Developer’s Access details, location and time. Then, set up some switch value to
control all the appliances. Finally, we create a dashboard whose console looks like
the one shown below in figure 5.10 [16].
The mobile dashboard is also setup using the Blynk IoT application on the
smartphone. The similar kind of data is visible on this mobile dashboard too. It has
a separate set up procedure which can easily be found in the application itself. Our
Mobile Dashboard looks as shown in figure 5.11.[11]
34
Figure 5.11 : The Mobile Dashboard
The data coming from the voltage and the current sensors are retrieved in the cloud,
named Blynk Cloud. Generally, the active low pin of the relay module gets HIGH
when a triggering of 3.7V is given to it. Each ‘IN’ pin needs a minimum current
of 70mA to trigger the pulse. So, a total of 280mA current is required for
controlling the Active LOW signal. Normally, the relay GPIO pin is Active HIGH.
We have to write a program as the relay channel.[11]
35
Next, when the switch is switched ON from the dashboard, the signal goes
to the ESP 32 pins (Active LOW), they get HIGH and the corresponding
relay channels also get HIGH. A time delay is given in between for
synchronizing the start bit to the server and response to the http client. A
similar phenomenon occurs for all the other signals. Thus, we can control
the relay module connected to the AC appliances.[12]
The generated data is then fetched to the server and the signal goes to- and-
fro from server to client and vice-versa. On the other hand, the Access
Point sends the signal back to the system with the help of the Wi- Fi. For
that, we have to keep in mind some important points:
36
CHAPTER 6
In Industry 4.0, the revolutionary aspect is ‘Automation’. However, since the load
demand is ever so varying and is unpredictable, it becomes difficult to supply to
their demands properly. To account for that, the Smart Grid technology comes into
the picture. In this project, as we have generated the data and organized it structured
manner to get the knowledge of the voltage, current and power consumption at the
same place. This will bring about a wonderful change in the Industry 5.0.
The data we obtained from our system when no load is connected or when the load
is powered OFF, the current and voltage parameters should be almost ZERO. If it
shows some small value even in that OFF condition, then we need to define the
calibration factors in the code itself. It is a trial-&-error method.
37
When the load is now connected, the corresponding voltage and current values will
be shown alongside the power consumption. The energy meter data is uploaded to
the Blynk Application after every 5 seconds. The data can be observed on the serial
monitor as well as the Blynk App.
38
6.3 Data Analysis from our implemented system
By monitoring the power consumption of the appliances, the data is collected and
saved in the database of the system for processing and analysis. This data is also
saved in the cloud database for remote access. The parameters stored are the voltage
(Vrms), the current (Irms), the apparent power (S) and the status of the kWh with the
cumulative runtime of the system. This data will be displayed through the GUI and
the smartphone app. Suitable action as turning the devices ON and OFF are done
from the GUI of the smartphone as per the consumer requirement. In addition to
that, the system depends on the average of the drawn current that is identified in the
program, which means the appliances can be turned ON and OFF manually too. The
entire data from the system is now analyzed in a table format, as shown in Table 6.3.
From this table we have already seen that the voltage and current profiles are
changing accordingly based on the maximum load demand of the appliances.
Whenever a surge in current occurs, the apparent power curve is also distorted. In
a similar fashion, the energy consumption goes to utmost when time is increasing.
It is to be noted that as we have connected only resistive loads in our system, so the
power factor (PF) is assumed to be Unity. We practically run our system for last 30
minutes from which the data was extracted and the corresponding kWh is calculated.
The data charts are shown below.
200 2
VOLTAGE ,CURRENT
150 1.5
100 1
50 0.5
0 0
1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43
TIME INTERVAL
Voltage Current
39
Table 6.3 : Table for 30 minutes consumption of data
DataStream Name
Time
Voltage Current Apparent Power Energy
05/21/22 09:44:00 PM 244.0764839 0.1543797 37.5152584 0.223
05/21/22 09:43:00 PM 247.8721161 0.17551 42.8000153 0.223
05/21/22 09:42:00 PM 244.3640013 0.1608221 38.9026828 0.223
05/21/22 09:41:00 PM 244.6188175 0.1629833 39.5398686 0.222
05/21/22 09:40:00 PM 244.9125696 0.4879998 117.0334195 0.222
05/21/22 09:39:00 PM 239.2115211 0.5099337 120.5683946 0.222
05/21/22 09:38:00 PM 240.9730742 0.5241382 124.7233421 0.22
05/21/22 09:37:00 PM 240.897627 0.5464242 129.8558105 0.218
05/21/22 09:36:00 PM 239.2332178 0.5520243 131.2060568 0.216
05/21/22 09:35:00 PM 238.3499609 0.5607314 132.9844165 0.214
05/21/22 09:34:00 PM 241.9551444 0.5114902 122.5349454 0.212
05/21/22 09:33:00 PM 239.0324299 0.5251278 125.1032887 0.21
05/21/22 09:32:00 PM 241.2286893 0.5342254 127.3942492 0.208
05/21/22 09:31:00 PM 241.2170777 0.3226213 76.9423969 0.206
05/21/22 09:30:00 PM 244.017046 0.3148187 74.9463285 0.205
05/21/22 09:29:00 PM 245.0595458 0.3066412 73.0535647 0.203
05/21/22 09:28:00 PM 241.3962062 0.2938885 70.7659272 0.202
05/21/22 09:27:00 PM 241.1858832 0.3072941 73.5703682 0.201
05/21/22 09:26:00 PM 243.0451688 0.3090606 73.719407 0.2
05/21/22 09:25:00 PM 243.3174999 0.2873666 68.9842775 0.199
05/21/22 09:24:00 PM 242.6089948 0.2868235 68.2243357 0.198
05/21/22 09:22:00 PM 242.4085809 0.2775009 67.2685996 0.197
05/21/22 09:21:00 PM 243.703195 0.2723976 65.4706145 0.196
05/21/22 09:20:00 PM 245.7989356 0.3045515 72.9091063 0.195
05/21/22 09:19:00 PM 244.5374957 0.2479898 60.1335828 0.194
05/21/22 09:18:00 PM 243.716772 0.2470413 60.0280413 0.193
05/21/22 09:17:00 PM 243.7415389 0.2673314 64.889557 0.192
05/21/22 09:16:00 PM 244.6153898 0.315742 76.6554021 0.191
05/21/22 09:15:00 PM 245.691878 0.3394125 83.2994974 0.19
05/21/22 09:14:00 PM 245.3164917 0.2590007 63.2065603 0.189
05/21/22 09:13:00 PM 245.0997734 0.2723968 65.5157451 0.188
05/21/22 09:12:00 PM 244.8801171 0.2789656 67.4552611 0.187
05/21/22 09:11:00 PM 244.9761646 0.3020352 72.7942833 0.186
05/21/22 09:10:00 PM 246.0487324 0.3875388 93.174844 0.185
05/21/22 09:09:00 PM 243.3573841 2.5367852 603.5050988 0.18
05/21/22 09:08:00 PM 243.7402483 2.5095625 593.6062438 0.174
05/21/22 09:07:00 PM 242.4127213 0.3866388 93.7261679 0.173
05/21/22 09:06:00 PM 242.5378011 0.3777146 89.6080077 0.171
05/21/22 09:05:00 PM 242.5736383 0.5170243 125.4164651 0.17
40
05/21/22 09:04:00 PM 244.7781531 0.3456211 82.9284171 0.169
05/21/22 09:04:00 PM 247.8592686 0.1967703 48.57 0.169
05/21/22 09:02:00 PM 0.169 0.333937 0.0564 0.169
700 0.25
600
0.2
500
400 0.15
ENERGY
POWER
300 0.1
200
0.05
100
0 0
1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43
TIME STAMP
Energy
0.23
0.22
0.21
0.2
0.19
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
From the above data charts, we can say that the apparent power is
maintained in Unity PF because we have used all resistive loads for
domestic appliances.
41
6.4 Conclusion
42
CHAPTER 7
7.1 Applications
43
centric way and must not be purely technology-driven. It is a thin line between an
effective, user – supporting smart home system and an annoying, overly intrusive
one. Now, after having a running prototype we will shift focus to user evaluations,
to gain deeper knowledge on how to design energy efficient smart homes. We also
applied novel interaction techniques, which allow users to use their mobile phones
as magic lenses to view the energy consumption of their appliances just by pointing
gestures. When users require more details or when they like to compare energy
consumption between devices, they can easily transfer the information to a larger
display such as a TV. Users are also able to control the appliances such as turn on,
off, start washing, play movie etc. This seamless communication among devices
allows users to interact with the appliances using various kinds of device types [27].
We have presented the step-by-step procedure of smart energy meter. With the help
of the design control unit, home appliance can be converted into a smart and
intelligent device using IoT. The working of the proposed model was experimentally
shown with help of connecting the three bulbs. Proposed system has two advantages.
First, using the IoT connectivity, we can monitor and access our smart home easily
from anywhere, which will definitely prove to be energy efficient. Secondly, it acts
has a helping hand for the old age and differently-abled person. For future work we
would like to add up more controlling units that can make our smart home more
intelligent that can be practically deployed in the real time situation [28].
We can control our home appliances from anywhere through our voice commands
at a lower price using cost effective NodeMCU and Blynk app which is free of cost
also if we have not turned off the appliances before leaving, we can always turn
them off with our voice commands and this saves a lot of energy and money [29].
44
7.2 Limitations
Our implemented system has some constraints but they have some advantages
too. Such limitations are elaborated below:
∗ As we all know that the domestic home appliances maintain a Unity PF, hence
we consider the Unity PF and calculate the whole power consumption
accordingly.
∗ Here we can measure the current but have no provision to display the phase
shift between the current and the voltage waveforms.
∗ All the sensors we have used here are highly sensitive and hence prone to
noise. Thus, even the minimal changes of the load affect the sensor value
initially, but at steady state its value stabilizes.
∗ In the ESP module, we need to ‘Reset’ the board at first and then only upload
a new code again. Moreover, whenever the code is uploaded to the ESP
module, then the ‘Enabling’ (via the ‘Enable’ switch on the module) to the
server.
45
CHAPTER 8
At present, there have been many studies on control strategies, but the application
and promotion of the smart energy management system are still in the process of
exploration:
46
8.2 Future Scope
Smart Home and Energy Management is current trend with the development of IoT.
Lot of work has been reported in regards to controlling the appliances of home and
also on monitoring the electrical parameters towards hazard. Also work reporting in
controlling the appliance for energy consumption. So, with all these works reported,
we here have developed a better IoT system for Energy Management which takes
the Humidity, Temperature and light intensity into consideration and accordingly
interfaced with ESP32 for controlling the usage of appliance like speed of fan, light
intensity rather than just switches on or off. Also, the prototype system computes
the current drawn from each appliance based on appliance usage where total power
consumed of appliances computed against time. This information is computed all
through the day and same uploaded in cloud server too. This ultimately achieves in
energy consumption of every household resulting in Energy Management using IoT.
The system so developed is not fully complete as we have developed a prototype
only for controlling two appliances i.e., fan and light. In future, we propose to extend
the system for controlling appliances like Refrigerator, Air cooler, Television etc.
The presence of human only will switch on the appliances. More amount of power
can be saved based on the lesser usage of the appliances. There can be also a manual
control over the appliances. We can implement algorithm that learns the change in
the weather based on season and detect changes in season based on the temperature,
humidity and brightness [31].
47
The relay channel module may be improved to an 8 – channel or a 16 – channel
relay module, so that a greater number of loads can easily be connected and
controlled.
In the present time of 21st century we have no space for errors or faults either in any
technical system or in general applications. Prepaid Energy Meter is an advantages
concept for the further. It’s facilitating the exemption from electricity bills.
Electricity coupons will be available at nearby shops. The word prepaid means “pay
before use” one of the advantageous features of this concept prepaid Energy Meter
is used to prepaid the ongoing supply of electricity to homes, offices etc. Though
many have tried implementing a country wide AMRS, it is still an unreachable goal,
many factors like cost, feasibility and mainly the need to replace the existing system
have hindered its development. At least in near future, the cost involved in the
building of this system could be minimized by using more efficient technology and
commercializing it by production in a large scale thus reducing the production costs
tremendously and hence making it more feasible to be implemented worldwide. The
system could be made Smarter by allowing the user to check for the power
consumption and alert him on his power consumption and also allows him to turn
off the various devices from his mobile application itself hence conserving energy
and saving money. Moreover, if real time data feeds of the energy usage were
tracked and stored in a centralized data Centre it will enable the government or the
energy provider to predict the energy demand trends consequently ensuring
uninterrupted supply of electricity and reducing the unexpected load on the
electricity grid making it more tolerant to failures [32].
48
Energy monitoring through the internet is easy. It gives the real power consumption
as well as accurate reading. Also, it requires fewer labors and less time to monitor
the energy. It can transmit the data to the utilities and also can receive information
from utilities. After two months electricity bill will be paid otherwise supply line
will be disconnected through the internet. After two months validity for alert
purpose buzzer will be ON. It is easy to know the two months validity. By making
this thing the energy will be monitored. The future scope will be on PC side one
server software is required for automatic data collection. In this project, HTML
knowledge is taken for demonstration purpose [33].
Smart energy monitoring system includes Arduino, WI-FI, energy meter. The
system automatically reads the energy material links anything from anywhere in the
universe. It communicates with almost everything around the world. The
communication can be a control signal or identified data from this world. It is a
common internet data communication and is communicated in different way. IoT
collects the data of automated objects and helps the machine learn where it needs.
The data is stored in cloud and sends to the energy meter to switch on/off objects
and provides home automation through an app developed and power management
done through this application. The proposed system consumes less energy and it will
reduce manual work. We can receive monthly energy consumption from a remote
location directly to centralize office. In this way we reduce human effort needed to
record the meter reading which are till now recorded by visiting the home
individually [34].
49
REFERENCES
[24] https://randomnerdtutorials.com/getting-started-with-esp32/
[29] https://www.irjet.net/archives/V8/i4/IRJET-V8I4842.pdf
[30] https://www.frontiersin.org/articles/10.3389/fenrg.2021.772027/full
51
[31] https://www.ripublication.com/ijaer17/ijaerv12n16_05.pdf
[32] http://www.iraj.in/journal/journal_file/journal_pdf/11-566- 15640381031-5.pdf
[33] https://www.ijariit.com/manuscripts/v4i3/V4I3-1913.pdf
52
APPENDICES
53