[go: up one dir, main page]

0% found this document useful (0 votes)
32 views39 pages

Completed Mini Project

The document presents a mini project titled 'IoT Based Smart Energy Metering System' developed by students at Dr. Mahalingam College of Engineering and Technology. It outlines the use of IoT technology, specifically the ESP32 microcontroller and Blynk application, to create a smart energy metering system that provides real-time monitoring and control of energy consumption. The system aims to enhance energy efficiency by allowing users to analyze consumption patterns, receive alerts, and manage appliances remotely.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views39 pages

Completed Mini Project

The document presents a mini project titled 'IoT Based Smart Energy Metering System' developed by students at Dr. Mahalingam College of Engineering and Technology. It outlines the use of IoT technology, specifically the ESP32 microcontroller and Blynk application, to create a smart energy metering system that provides real-time monitoring and control of energy consumption. The system aims to enhance energy efficiency by allowing users to analyze consumption patterns, receive alerts, and manage appliances remotely.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 39

+

IoT Based Smart Energy Metering System

MINI PROJECT

Submitted by

ARUN BALAN B 22BCS024


SRINITHI M 22BCS052
JOTHILAKSHMI M 23BCS306

in partial fulfilment for the award of the degree of

BACHELOR OF ENGINEERING

in

COMPUTER SCIENCE AND ENGINEERING

Dr. MAHALINGAM COLLEGE OF ENGINEERING AND TECHNOLOGY


(An Autonomous Institution Affiliated to Anna University Chennai)

MAY 2024
Dr. MAHALINGAM COLLEGE OF ENGINEERING AND TECHNOLOGY
POLLACHI – 642 003

(An Autonomous Institution Affiliated to Anna University, Chennai - 600 025)

BONAFIDE CERTIFICATE

Certified that this Mini project report titled “IoT BASED SMART ENERGY
METERING SYSTEM” is the bonafide work of

ARUN BALAN B 22BCS024


SRINITHI M 22BCS052
JOTHILAKSHMI M 23BCS306

who carried out the mini project under my supervision.

Ms. A.Suganya Dr. G. Anupriya


Assistant Professor Professor
SUPERVISOR HEAD OF THE DEPARTMENT
Dept. of Computer Science and Engineering, Dept. of Computer Science and Engineering,
Dr. Mahalingam College of Engineering and Dr. Mahalingam College of Engineering and
Technology, Pollachi- 642003 Technology, Pollachi- 642003

Submitted for the Autonomous End Semester Mini Project


Examination held on _____________

INTERNAL EXAMINER EXTERNAL EXAMINER


Dr. Mahalingam College of Engineering and Technology
Pollachi -642003

Technology Readiness Level (TRL) Certificate

Project Title: IoT Based Smart Energy Metering System

Course Code: 19CSPN6401

Students Names and Roll Numbers:

1.ARUN BALAN B 727622BCS024


2.SRINITHI M 727622BCS052
3.JOTHILAKSHMI M 727623BCS306

Guide Name: Ms. A. Suganya

Technology Readiness Level* (TRL) of this Project: ___________________

Signature of the Guide HoD

Internal Examiner External Examiner

1
IoT BASED SMART ENERGY METERING SYSTEM

ABSTRACT

The Internet of Things (IoT) has revolutionized various sectors, including energy management. This
paper introduces an IoT-based Smart Energy Metering System enhanced with an LCD display,
leveraging the ESP32 microcontroller and the Blynk application for seamless monitoring and
control. As energy efficiency gains prominence, this system provides users with real-time insights
into energy consumption patterns to facilitate informed decision-making for optimized energy usage
and cost reduction. The system integrates hardware components such as the ESP32 microcontroller,
current and voltage sensors, a Wi-Fi module, and an LCD display. The ESP32 collects data from
sensors, processes it, and transmits it to the Blynk cloud server via Wi-Fi. Additionally, it displays
key metrics on an LCD display for local viewing. The Blynk mobile application serves as the
primary interface, enabling users to remotely monitor energy usage in real-time, receive alerts for
abnormal consumption, and analyze historical data through intuitive graphical representations. Users
can also set consumption thresholds and receive notifications upon their breach, fostering energy
conservation practices. The inclusion of an LCD display enhances user experience by providing
immediate access to energy metrics without relying solely on the mobile application. This feature
caters to scenarios where mobile access might be limited or inconvenient. The system's
implementation underscores its effectiveness in delivering a user-friendly and cost-efficient solution
for smart energy management. By harnessing IoT technologies, it empowers users to actively engage
in energy conservation initiatives, contributing to a sustainable future.

2
ACKNOWLEDGEMENT

First and foremost, we wish to express our deep unfathomable feeling, gratitude to our institution and
our department for providing us a chance to fulfill our long- cherished dreams of becoming Computer
Science Engineers.

We express our sincere thanks to our honorable Secretary Dr.C.Ramaswamy for providing us
with required amenities.

We wish to express our hearty thanks to Dr. P.Govindasamy, Principal of our college, for his
constant motivation and continual encouragement regarding our project work.

We are grateful to Dr. G.Anupriya, Head of the Department, Computer Science and
Engineering, for her direction delivered at all times required. We also thank her for her tireless and
meticulous efforts in bringing out this project to its logical conclusion.

Our hearty thanks to our guide Ms.A.Suganya, Assistant Professor for her constant support and
guidance offered to us during the course of our project by being one among us and all the noble hearts
that gave us immense encouragement towards the completion of our project.

We also thank our review panel members for their continuous support and guidance.

3
TABLE OF CONTENTS

CHAPTER NO TITLE PAGE NO

1 ABSTRACT 2

2 LIST OF FIGURES 6

3 LIST OF ABBREVIATIONS 7

4 INTRODUCTION 8

4.1 Internet of Things


4.2 Applications of IoT
4.3 Advantages of IoT
4.4 Disadvantage of IoT

5 LITERETURE SURVEY 12

6 PROBLEM STATEMENT 15

7 OBJECTIVE OF THE 16
PROJECT

8 PROPOSED SYSTEM 17

4
8.1 Implementations
8.2 Circuit Diagram
8.3 Block Diagram
8.4 Module Description

9 HARDWARE AND
SOFTWARE DETAILS 21

9.1 Hardware Details


9.2 Software Details

10 RESULTS AND 26
DISCUSSION

11 CONCLUSION AND 27
FUTURE WORK

12 REFERENCES 28

13 PUBLICATIONS/PROJECT 30
CONTEST PROOF

13.1 Source code


13.2 Snapshots

LIST OF FIGURES

5
FIG NO TITLE PAGE NO

8.2.1 Circuit diagram 18

8.3.1 Block diagram 19

9.1.1 ESP32 Microcontroller 21

9.1.2 Current sensor 22

9.1.3 Voltage sensor 23

9.1.4 LCD display 23

9.1.5 Bread board 24

9.1.6 Wires 24

9.2.1 Arduino IDE 25

9.2.2 BLYNK app 25

13.2.1 Implementation of the proposed system 31

LIST OF ABBREVIATIONS

6
IoT Internet of Things

IDE Integrated Development Environment

ESP32 Espressif System's Product 32

I2C Inter-Integrated Circuit

LCD Liquid-crystal display

4. INTRODUCTION

7
Managing energy consumption efficiently has become increasingly important due to rising
energy costs and the push for sustainable practices. To overcome these limitations, this project
proposes the development of an IoT-based smart energy metering system using the ESP32
microcontroller and the Blynk app.

Users can access this data through the Blynk app to analyze trends and patterns, helping them
identify periods of high energy use and potential areas for improvement. This historical analysis
capability is essential for users who aim to optimize their energy consumption over time.

Another significant feature of the system is remote control. Users will be able to remotely control
connected electrical appliances through the Blynk app. This feature allows users to turn devices on
or off and adjust settings to optimize energy use, even when they are not at home. This level of
control is crucial for managing energy consumption more effectively and reducing waste.

The system will also send alerts and notifications to users when abnormal energy consumption is
detected or when predefined thresholds are exceeded. These notifications can be customized and
delivered via email or push notifications through the Blynk app, providing timely information to
users.

The overall goal of the suggested ESP32 and Blynk app-based smart energy metering system is to
transform energy management by offering comprehensive insights, control, and 19 analytical
capabilities. Users can achieve significant energy savings and promote more sustainable
consumption behaviors by utilizing real-time data and remote access. The system is a great option
for both home and business applications because of its user-friendly, expandable, and affordable
architecture.

4.1 APPLICATIONS OF IOT

8
Healthcare
IoT has the potential to revolutionize the healthcare industry by enabling remote patient
monitoring, real-time tracking of vital signs and early detection of health issues. IoT devices such as
wearables, connected medical devices and telemedicine platforms can enable patients to receive
personalized care and improve patient outcomes.
Manufacturing
IoT can be used in manufacturing to improve efficiency, reduce downtime and optimize
production processes. IoT sensors and devices can collect data on machine performance, monitor
inventory levels and track the movement of products in real-time, enabling manufacturers to make data-
driven decisions and streamline their operations.
Smart Homes
Smart homes that are more convenient, energy-efficient, and secure can be made possible via IoT.
Homeowners may monitor and manage their properties from anywhere with the use of voice assistants
or smartphones and smart home appliances like security cameras, lighting controls, and thermostats.
Transportation
IoT can be used to improve transportation systems by enabling real-time tracking of vehicles,
optimizing traffic flow and improving driver safety. IoT devices such as connected cars, sensors and
traffic management systems can be used to collect data on traffic patterns, road conditions and driver
behaviour enabling transportation authorities to make data-driven decisions and improve the overall
transportation experience.
Agriculture
IoT can be used in agriculture to track soil conditions, cut down on water usage, and increase
crop yield. By gathering information on weather patterns, soil moisture, and plant growth, IoT devices
like sensors and drones may help farmers make data-driven decisions and maximize agricultural
productivity.

9
4.2 ADVANTAGES OF IOT

Increased Efficiency
IoT can improve efficiency by enabling real-time data collection and analysis, automation of
routine tasks and remote control of devices. It can reduce the need for manual labour and increase
productivity in various industries.
Cost Savings
IoT can help reduce costs by optimizing resource utilization, reducing waste and improving
maintenance procedures. It can lead to increased profitability and sustainability for businesses.
Improved Decision Making
IoT can provide businesses with valuable insights by collecting and analyzing large amounts of
data. It can help them make more informed decisions, identify new opportunities and optimize their
operations.
Enhanced Customer Experience
IoT can help businesses provide a better customer experience by enabling personalized
interactions, real-time feedback and remote support. It can improve customer satisfaction and loyalty.
Increased Safety and Security
IoT can enhance safety and security by enabling real-time monitoring of environments,
equipment and people. It can help prevent accidents, identify potential hazards and reduce the risk of
theft or other security threats.

10
4.3 DISADVANTAGES OF IOT

Security Concerns
One of the most significant disadvantages of IoT is security concerns. As IoT devices are
connected to the internet and communicate with other devices, they are vulnerable to cyberattacks.
Hackers can use IoT devices to gain access to sensitive information or even control critical systems,
such as industrial equipment, medical devices or transportation systems.
Privacy Issues
IoT devices collect a vast amount of personal data, which can be used for various purposes, such
as targeted advertising, profiling or surveillance. The raises concerns about privacy and the potential
misuse of personal data.
Interoperability Challenges
IoT devices from different manufacturers may use different communication protocols, making it
challenging to integrate them into a unified system. It can lead to compatibility issues and limit the
ability to create a cohesive IoT ecosystem.

11
5.LITERATURE SURVEY:

The following literature survey on smart energy metering reveals significant advancements and
varied applications in this field, particularly with the integration of IoT, data analytics, and
renewable energy sources.

1. Design and Implementation of an IoT-Based Smart Energy Metering System" by S. S. Thakur, A.


K. Verma, and S. K. Singh (International Journal of Engineering Research & Technology, 2020):

The authors present a detailed overview of the IoT-based smart energy metering system's
architecture, which comprises various components such as smart meters, communication modules,
data processing units, and user interfaces. They discuss the role of each component in collecting,
transmitting, and analyzing energy consumption data in real-time. Special emphasis is placed on the
interoperability and scalability of the system to accommodate diverse energy infrastructure
environments. Furthermore, the paper delves into the design considerations and technical
specifications of the smart meters used in the system. It elucidates the sensor technologies,
communication protocols, and data encryption mechanisms employed to ensure the accuracy,
reliability, and security of energy consumption data. The authors also address the challenges
associated with data integration, interoperability, and privacy protection in IoT-enabled energy
metering systems. In the implementation section, the authors provide a step-by-step guide on setting
up the IoT-based smart energy metering system. Moreover, the paper discusses the potential
applications and benefits of IoT-based smart energy metering beyond traditional utility billing, such
as demand response management, predictive maintenance, and energy conservation initiatives. The
authors emphasize the importance of data analytics and machine learning techniques in extracting
actionable insights from the vast amount of energy consumption data collected by the system.
In conclusion, "Design and Implementation of an IoT-Based Smart Energy Metering System" offers
a comprehensive framework for integrating IoT technology into energy management practices.
It provides valuable insights into the design, implementation, and potential applications of IoT-
enabled solutions in the field of smart energy metering, paving the way for more efficient and
sustainable energy utilization in the future.

12
2. Gao, Y., Wang, L., & Deng, D. (2017). Design of smart energy metering system based on IoT
technology. 2017 5th International Conference on Advanced Cloud and Big Data (CBD), 214-218.
DOI: 10.1109/CBD.2017.33
The authors begin by addressing the significance of smart energy management in the context of
increasing energy consumption and the need for efficient energy usage. They highlight the potential of
IoT technology in revolutionizing traditional energy metering systems by enabling real-time monitoring,
data analytics, and remote control capabilities.The paper provides a comprehensive overview of the
proposed smart energy metering system architecture, which consists of three main components: the
physical meters installed at consumer premises, a communication network for data transmission, and a
central data processing and management system. They emphasize the importance of security measures
to safeguard sensitive energy consumption data and ensure the integrity of the system against cyber
threats.The paper explores the potential benefits of the proposed smart energy metering
system,including improved accuracy in consumption monitoring, reduction of operational costs through
automated meter reading, and the facilitation of demand-side management initiatives.

3. Liu, H., Zhang, D., & Li, Y. (2019). Smart energy metering and monitoring system
based on IoT. 2019 IEEE 2nd International Conference on Information and Computer Technologies
(ICICT), 529-533. DOI: 10.1109/ICICT.2019.00099
The paper titled "Smart energy metering and monitoring system based on IoT" by Liu, Zhang,
and Li (2019) presents a comprehensive overview of a smart energy metering and monitoring
system leveraging Internet of Things (IoT) technology. The system aims to improve energy
efficiency and management by employing IoT devices for real-time data collection, analysis, and
control.The system's potential applications in various sectors including residential, commercial, and
industrial are also explored. The primary focus of the study is to address the challenges associated
with traditional energy metering and monitoring systems by leveraging IoT technologies. The paper
begins by discussing the motivation behind the development of smart energy metering systems,
highlighting the growing demand for efficient energy management solutions in both residential and
industrial sectors. It emphasizes the need for accurate and timely data collection to facilitate
informed decision-making regarding energy usage. The system comprises smart meters installed at
consumer premises.Overall, the paper contributes to the growing body of literature on IoT-enabled
energy management systems, offering insights into their design, implementation, and potential

13
impact on energy sustainability.

4."An IoT based smart energy metering system for effective load management in smart grids" by
Mehmood, A., Ahmad, T., & Amin, N. U. (2020)

The authors present a comprehensive overview of the current challenges faced by traditional
energy metering systems in managing loads efficiently within smart grid environments. They
highlight the importance of integrating IoT technology into energy metering systems to enhance
monitoring, control, and optimization capabilities. The paper begins by discussing the significance
of smart grids in modern energy distribution systems and the growing need for efficient load
management strategies to address the increasing demand for electricity. These components work
together to collect, transmit, and analyze energy consumption data, enabling utilities to gain insights
into load patterns, identify potential areas for optimization, and implement proactive management
strategies.The proposed system in improving load management efficiency, reducing energy wastage,
and enhancing grid reliability.

5. Ratnadurai, K., & Ramkumar, R. (2020). Smart energy metering system for rural electrification
using IoT and blockchain. 2020 IEEE International Conference on Power Electronics, Smart Grid
and Renewable Energy (PESGRE), 1-5. DOI: 10.1109/PESGRE48776.2020.9070429

The paper "Smart energy metering system for rural electrification using IoT and blockchain"
by Ratnadurai and Ramkumar (2020) explores an innovative approach to enhance rural
electrification through the integration of Internet of Things (IoT) and blockchain technologies. The
authors propose a smart energy metering system designed to address the challenges of energy
management and distribution in rural areas. This system leverages IoT devices to monitor and
control energy usage in real-time, providing accurate and transparent data on energy consumption.
The incorporation of blockchain technology ensures the security and immutability of the recorded
data, fostering trust and accountability among users and providers.The authors also discuss the
implementation challenges and future prospects of the technology. This research presents a
significant step towards modernizing rural energy infrastructure, promoting reliable access to
electricity, and fostering economic growth through technological innovation.

14
6. PROBLEM STATEMENT

Efficient energy management is crucial for reducing costs and promoting sustainability.
Traditional energy meters require manual readings and lack real-time monitoring capabilities. The
goal is to develop an IoT-based smart energy metering system using the ESP32 microcontroller and
the Blynk app to enable real-time monitoring, data logging, and remote control of energy
consumption.
This system will provide users with real-time data on their energy usage via the Blynk app, allowing
them to monitor and manage their consumption more effectively. Historical data logging will enable
users to analyze usage patterns and identify opportunities for energy savings. Additionally, the
system will send alerts for abnormal consumption and allow remote control of devices to optimize
energy usage.

15
7.OBJECTIVE OF THE PROJECT:

The smart energy metering project using an ESP32 and the Blynk app aims to revolutionize
how users monitor and manage their energy consumption. This system provides real-time energy
monitoring, allowing users to track the usage of their electrical appliances accurately. Data collected
from the ESP32 is transmitted to the Blynk app, where it is displayed in an intuitive, user-friendly
interface featuring charts and graphs for easy comprehension.The system also offers remote access,
enabling users to check their energy consumption from anywhere with an internet connection. Alerts
and notifications can be set up for unusual energy usage, ensuring timely awareness of potential
issues. Additionally, the system tracks the cost of energy consumption, helping users understand
their electricity bills better and potentially integrate tariff rates for more detailed analysis.One of the
standout features is the provision of energy efficiency recommendations based on usage patterns,
promoting energy conservation. The system is designed to be scalable and can integrate with other
smart home devices, creating a comprehensive smart home ecosystem. With robust security
measures in place, user data is kept secure and private, ensuring peace of mind. Ultimately, this
project aims to enhance energy efficiency awareness and contribute to more sustainable energy
usage practices.

16
8.PROPOSED SYSTEM:

8.1 IMPLEMENTATIONS

Using an ESP32 with the Blink app for an IoT-based smart energy metering system sounds like a
great idea! The ESP32 is a powerful microcontroller with built-in Wi-Fi and Bluetooth capabilities,
making it suitable for IoT applications. The Blink app provides an intuitive platform for monitoring
and controlling IoT devices remotely.

Hardware Setup

A smart energy meter using ESP32 requires several hardware components, including an
ESP32 board (such as ESP32 DevKitC or ESP32 WROVER), an energy metering IC (like
ADS7871), current sensors (like ACS712), a voltage sensor (like ADS7871), an LCD display
(optional), and connectors for USB, UART, SPI, and I2C. The hardware components are housed in a
plastic or metal enclosure and powered by a 5V DC power supply.

Software Implementation

The software implementation involves writing firmware in C/C++ using the ESP-IDF
framework, utilizing an energy metering library (such as OpenEnergyMonitor), and implementing
communication protocols like Wi-Fi, MQTT, and HTTP. The firmware measures voltage, current,
and power consumption, logs data, and displays real-time energy usage on the LCD or a mobile app.
It also sends notifications for high usage, low battery, or firmware updates, and enables remote
firmware updates and secure communication. The software integrates with the hardware components
to measure energy usage data, send it to the cloud or a server, and receive commands from the cloud
or server.

17
8.2 CIRCUIT DIAGRAM:

Fig 8.2.1 Circuit Diagram

18
8.3 BLOCK DIAGRAM:

Fig 8.3.1 Block Diagram

19
8.4 MODULE DESCRIPTION

a) Current Sensor :
A current sensor is an electronic device used to measure the flow of electric
current in a circuit. It detects the current passing through a conductor and provides an
output signal proportional to the current being measured.

b) Voltage Sensor :
A voltage sensor is an electronic device used to measure voltage levels in a
circuit or electrical system. It detects the presence of voltage and provides an output
signal proportional to the voltage being measured.

c) ESP32:
ESP32 is a series of low-cost,low-power system on a chip microcontrollers
with integrated Wi-Fi and dual-mode Bluetooth.

d) LCD Display:
Liquid Crystal Display(LCD) is a type of flat panel display which uses liquid
crystals in its primary form of operation.

e) I2C module :
Common serial communication protocol that enables numerous devices to
connect with one another using just two wires a serial data line (SDA) and a serial
clock line (SCL)is the Inter-Integrated Circuit (12C) module. It is frequently utilized
for communication between integrated circuits in embedded systems,
microcontrollers, sensors, and other electronic devices. circuits.

20
9.HARDWARE AND SOFTWARE DETAILS:
9.1 HARDWARE DETAILS:
ESP-32 Microcontroller

Current Sensor

Voltage Sensor

LCD Display

Bread Board

Wires

ESP 32 Microcontroller
The ESP32 is a powerful and versatile microcontroller developed by Espressif
Systems. It's widely used in IoT (Internet of Things) applications due to its robust
features and capabilities. Here are some key points about the ESP32:Dual-Core
Processor: The ESP32 features a dual-core Tensilica LX6 microprocessor, allowing it
to handle more complex tasks compared to its predecessor, the ESP8266.Wireless
Connectivity: It includes integrated Wi-Fi and Bluetooth capabilities, making it ideal
for a variety of wireless applications.

21
Fig 9.1.1 ESP 32 Microcontroller

Current Sensor

Current sensor detects and measures electric current flowing through a wire or circuit and
converts this measurement into a proportional output signal, which can be analog or digital. These
sensors are critical in various applications, including power monitoring, energy management, and
electrical safety systems, enabling precise monitoring and control of current flow.Current sensors
come in several types, each suited to specific applications and environments. They are widely used
due to their ability to measure both AC and DC currents and their non-intrusive nature, which allows
for isolated measurements.Shunt resistors measure current by detecting the voltage drop across a
known resistor value. They are simple and cost-effective but are generally used for low-current
applications due to power dissipation concerns.

Fig 9.1.2 Current Sensor


VOLTAGE SENSOR
A voltage sensor measures and monitors the electrical potential difference between two points
in a circuit, converting this measurement into a proportional output signal. These sensors are
essential in various applications, including power systems, industrial automation, consumer
electronics, and renewable energy systems, where accurate voltage monitoring is critical for
performance and safety.Voltage sensors come in different types, each tailored to specific needs.
Resistive voltage dividers are the simplest form, using a series of resistors to proportionally reduce
the measured voltage to a safe level for the sensor. These are commonly used in low-voltage
applications due to their simplicity and cost-effectiveness.Capacitive voltage sensors are used for
high-voltage measurements, leveraging the capacitive coupling effect to measure voltage without

22
direct electrical contact. This provides isolation and safety in high-voltage environments.

Fig 9.1.3 Voltage Sensor


LCD DISPLAY
An LCD (Liquid Crystal Display) is a flat-panel technology widely used in screens for
televisions, computers, smartphones, and other devices. It operates by manipulating liquid crystals
sandwiched between polarized glass layers. When an electric current passes through, these crystals
align to modulate light and create images. LCDs are energy-efficient, offer sharp image quality, and
are capable of producing vibrant colors. They come in various types, including TN (Twisted
Nematic), IPS (In-Plane Switching), and VA (Vertical Alignment), each with distinct viewing
angles, color accuracy, and response times. Their thin, lightweight design makes them ideal for
modern electronic displays.

Fig 9.1.4 LCD Display

23
BREAD BOARD
An application called the Arduino Integrated Development Environment (IDE)
gives users a platform to write, compile, and upload code to microcontroller boards
that are compatible with Arduino.It's an intuitive environment made to make writing
and uploading code for Arduino projects easier.

Fig 9.1.5 BREAD BOARD


WIRES

Male-to-female wires, commonly used in IoT projects and electronics prototyping, are
cables or jumper wires with connectors at each end. These connectors are designed to
facilitate easy connection and disconnection of electronic components, modules, or
devices without soldering.

24
Fig 9.1.6 WIRES

9.2 SOFTWARE DETAILS:


Arduino IDE
BLYNK app
Arduino IDE:
The Arduino Integrated Development Environment (IDE) is a software application that
provides a platform for writing, compiling, and uploading code to Arduino-compatible
microcontroller boards.It's a user-friendly environment designed to simplify the process of
creating and uploading code for Arduino projects.

Fig 9.2.1 Arduino IDE


BLYNK app :
Once the code is uploaded to your hardware device, it begins transmitting energy
consumption data to the Blynk app in real-time.Through the app, you can monitor your
energy usage from anywhere with an internet connection, gaining insights into your
consumption patterns and identifying opportunities for optimization.

25
Fig 9.2.2 BLYNK app

10.RESULTS AND DISCUSSION

The smart energy metering system developed using ESP32 microcontroller and
the Blynk app offers a comprehensive solution for monitoring and managing energy
consumption in real-time.One of the primary objectives of the system was to provide users
with real-time visibility into their energy consumption. Through the Blynk app interface,
users can monitor key metrics such as current power consumption, voltage levels, and
energy usage trends. This real-time monitoring capability empowers users to make
informed decisions regarding their energy usage habits and identify opportunities for
optimization.

By leveraging the Blynk app's remote access features, users can monitor and
control their energy metering system from anywhere with an internet connection. This
level of accessibility is particularly beneficial for homeowners and businesses that require
on-the-go access to their energy consumption data. Whether at home, in the office, or on
vacation, users can stay connected to their energy metering system and take proactive
measures to manage their energy usage effectively. The integration of data logging
functionality allows the system to store historical energy consumption data over time. This
data can be analyzed to identify usage patterns, detect anomalies, and predict future
consumption trends. By gaining insights into their energy consumption behavior, users can
implement targeted strategies to optimize energy usage, reduce costs, and minimize
environmental impact.

26
11.CONCLUSION & FUTURE WORK

In this project, we successfully developed a smart energy metering


system using ESP32 and Blynk, which enables users to monitor their energy
consumption in real-time via a mobile application. The system integrated the
capabilities of ESP32 for data acquisition and Blynk for remote monitoring and
control, providing a user-friendly interface for accessing energy consumption data
anytime, anywhere. Through rigorous testing and validation, we confirmed the
reliability and accuracy of the system in capturing energy consumption metrics. The
integration of Blynk allowed for seamless connectivity and remote access, enhancing
the accessibility and usability of the system for end-users.

Implementing robust security measures to protect the system from potential


cyber threats and ensure the confidentiality and integrity of energy consumption data.
Designing the system with scalability and interoperability in mind to support
integration with other IoT devices and platforms, facilitating broader adoption and
interoperability within smart home ecosystems.

27
12.REFERENCES

1. Ratnadurai, K., & Ramkumar, R. (2020). Smart energy metering system for rural
electrification using IoT and blockchain. 2020 IEEE International Conference on Power
Electronics, Smart Grid and Renewable Energy (PESGRE), 1-5. DOI:
10.1109/PESGRE48776.2020.9070429

2. Mehmood, A., Ahmad, T., & Amin, N. U. (2020). An IoT based smart energy metering
system for effective load management in smart grids. 2020 IEEE International Conference on
Power, Intelligent Computing and Systems (ICPICS), 1-5. DOI:
10.1109/ICPICS49022.2020.9196160

3. Liu, H., Zhang, D., & Li, Y. (2019). Smart energy metering and monitoring system based on
IoT. 2019 IEEE 2nd International Conference on Information and Computer Technologies
(ICICT), 529-533. DOI: 10.1109/ICICT.2019.00099

4. Mouna, M., Boulmalf, M., & Eleuldj, M. (2019). A smart energy metering system for green
buildings using IoT. 2019 2nd International Conference on Advanced Communication
Technologies and Networking (CommNet), 1-6. DOI: 10.1109/CommNet.2019.8731241

5. Salami, E., & Obe, O. (2019). Smart energy metering system using IoT and blockchain
technology. 2019 IEEE 9th Annual Computing and Communication Workshop and
Conference (CCWC), 0638-0642. DOI: 10.1109/CCWC.2019.8666649

6. Islam, M. S., & Jahan, N. (2019). Smart energy metering using IoT and big data analytics for

28
sustainable smart cities. 2019 22nd International Conference on Computer and Information
Technology (ICCIT), 1-6. DOI: 10.1109/ICCIT48875

7. Soomro, T. R., Ahmed, S., & Awais, M. M. (2018). Implementation of smart energy metering
system using IoT and MQTT protocol. 2018 IEEE International Symposium on Consumer
Electronics (ISCE), 1-4. DOI: 10.1109/ISCE.2018.8551593

8. Abdullah, S., & Aljoumaa, K. (2018). An IoT based smart energy metering system. 2018
IEEE Jordan Conference on Applied Electrical Engineering and Computing Technologies
(AEECT), 1-6. DOI: 10.1109/AEECT.2018.8616464

9. Gao, Y., Wang, L., & Deng, D. (2017). Design of smart energy metering system based on IoT
technology. 2017 5th International Conference on Advanced Cloud and Big Data (CBD), 214-
218. DOI: 10.1109/CBD.2017.33

10. Gómez-González, R., López, A., & Alcarria, R. (2017). Smart metering for home energy
management: Towards energy efficiency using IoT technologies. Sensors, 17(11), 2601. DOI:
10.3390/s17112601

29
13.
13.1 SOURCE CODE

#define BLYNK_TEMPLATE_ID "sri4srinithi2004@gmail.com"


#define BLYNK_TEMPLATE_NAME "smart energy meter"
#define BLYNK_PRINT Serial

#include "EmonLib.h"
#include <EEPROM.h>
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 20, 4);

const float vCalibration = 41.5;


const float currCalibration = 0.15;

const char auth[] = "pJ_NJHnJJMlm6cqtXnTbttMw9W-DgAhJ";


const char ssid[] = "Redmi 11 Prime 5G";
const char pass[] = "password";

30
EnergyMonitor emon;

BlynkTimer timer;

float kWh = 0.0;


unsigned long lastMillis = millis();

const int addrVrms = 0;


const int addrIrms = 4;
const int addrPower = 8;
const int addrKWh = 12;

void sendEnergyDataToBlynk();
void readEnergyDataFromEEPROM();
void saveEnergyDataToEEPROM();

void setup()
{
Serial.begin(9600);
Blynk.begin(auth, ssid, pass);

lcd.init();
lcd.backlight();

EEPROM.begin(32);
readEnergyDataFromEEPROM();

31
emon.voltage(35, vCalibration, 1.7);
emon.current(34, currCalibration);

timer.setInterval(5000L, sendEnergyDataToBlynk);

delay(1000);
}

void loop()
{
Blynk.run();
timer.run();
}

void sendEnergyDataToBlynk()
{
emon.calcVI(20, 2000);
unsigned long currentMillis = millis();
kWh += emon.apparentPower * (currentMillis - lastMillis) / 3600000000.0;
lastMillis = currentMillis;

Serial.printf("Vrms: %.2fV\tIrms: %.4fA\tPower: %.4fW\tkWh: %.5fkWh\n",


emon.Vrms, emon.Irms, emon.apparentPower, kWh);

saveEnergyDataToEEPROM();

32
Blynk.virtualWrite(V0, emon.Vrms);
Blynk.virtualWrite(V1, emon.Irms);
Blynk.virtualWrite(V2, emon.apparentPower);
Blynk.virtualWrite(V3, kWh);

lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Vrms: ");
lcd.print(emon.Vrms, 2);
lcd.print(" V");

lcd.setCursor(0, 1);
lcd.print("Irms: ");
lcd.print(emon.Irms, 4);
lcd.print(" A");

lcd.setCursor(0, 2);
lcd.print("Power: ");
lcd.print(emon.apparentPower, 4);
lcd.print(" W");

lcd.setCursor(0, 3);
lcd.print("kWh: ");
lcd.print(kWh, 5);
lcd.print(" kWh");
}

void readEnergyDataFromEEPROM()
{

33
EEPROM.get(addrKWh, kWh);

if (isnan(kWh))
{
kWh = 0.0;
saveEnergyDataToEEPROM();
}
}

void saveEnergyDataToEEPROM()
{

EEPROM.put(addrKWh, kWh);

EEPROM.commit();
}

34
13.2 SNAPSHOTS

Fig 13.2.1 Implementation of the proposed system

35
36

You might also like