0% found this document useful (0 votes)
35 views79 pages

Fsssss 1

project

Uploaded by

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

Fsssss 1

project

Uploaded by

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

VISVESVARAYA TECHNOLOGICAL UNIVERSITY

“Jnana Sangama”, Belgaum 590014, KARNATAKA, INDIA

Project Report
On

“Design and Implementation of IoT based Energy Efficient Smart


Metering System for Domestic Applications”
Submitted in partial fulfillment of the requirements for the award of the degree
of
Bachelor of Engineering
in
Computer Science and Engineering
of Visvesvaraya Technological University, Belgaum.

Submitted by:

CH VARSHIT VARMA (1AM20CS045)


ABHISHEK C (1AM20CS005)
SUJAN SAMUEL S (1AM21CS401)
CHANDRASHEKAR R (1AM20CS046)

Under the Guidance of:

Mrs. Jaya Karuna B


Assistant Professor, Department of CSE

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


AMC ENGINEERING COLLEGE,
18th K.M, Bannerghatta Main Road, Bangalore-560 083
2023-2024
AMC Engineering College
18th K.M, Bannerghatta Main Road, Bangalore-560 083

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

CERTIFICATE

Certified that the Project Work entitled “Design and Implementation of IoT based Energy
Efficient Smart Metering System for Domestic Applications” has been successfully carried out
by CH VARSHIT VARMA (1AM20CS045), ABHISHEK C (1AM20CS005), SUJAN
SAMUEL S (1AM21CS401) and CHANDRASHEKAR R (1AM20CS046), bonafide
students of AMC Engineering College in partial fulfillment of the requirements for the award of degree in
Bachelor of Engineering in Computer Science and Engineering of Visvesvaraya Technological University,
Belgaum during academic year 2023- 2024. It is certified that all corrections/suggestions indicated for
Internal Assessment have been incorporated in the report. The project report has been approved as it satisfies
the academic requirements in respect of project work for the said degree.

_ _
Project Guide HOD Principal
Prof. Jaya Karuna B Dr. V Mareeswari Dr. Nagaraja R
Assistant Professor Professor & Head Principal
Department of CSE Department of CSE AMCEC

External Examiners: Signature with Date:

1 1

2 2

(i)
DECLARATION

We, the undersigned students of 7th semester Department of Computer Science & Engineering,
AMC Engineering College, declare that our project work entitled “Design and Implementation
of IoT based Energy Efficient Smart Metering System for Domestic Applications” is a
bonafide work of ours. Our project is neither a copy nor by means a modification of any other
engineering project. We also declare that this project was not entitledfor submission to any other
university in the past and shall remain the only submission made and will not be submitted by us
to any other university in the future.

Name USN Signature

CH VARSHIT VARMA 1AM20CS045 _

ABHISHEK C 1AM20CS005 _

SUJAN SAMUEL 1AM21CS401 _


CHANDRASHEKAR R 1AM20CS046 _

i
ACKNOWLEDGEMENT

First and fore most we would like to thank GOD, the Almighty for being so merciful on us.

We have a great pleasure in expressing our deep sense of gratitude to founder Chairman Dr. K.R.
Paramahamsa and Executive Vice President Mr. Rahul Kalluri for having provided us with a great
infrastructure and well-furnished labs for successful completion of our Project.

We express our special thanks and gratitude to our Academic Advisor Dr. Nagaraja R for providing us
all the necessary advice for successful completion of our project.

We express our sincere thanks and gratitude to our Principal Dr. K Kumar for providing us all the
necessary support successful completion of our project.

We would like to extend our special thanks to Dr. V Mareeswari Professor and HOD, Department of
CSE, for her support and encouragement and suggestions given to us in the course of our project work.

We would also like to extend our special thanks to Mrs. Snigdha Kesh, Assistant Professor and project
coordinator, Department of CSE for her constant support in completion of the project.

We are grateful to our guide Mrs. Jaya Karuna B Assistant Professor, Department of CSE, AMC
Engineering College, Bengaluru for her constant motivation & timely help, encouragement and
suggestion.

Last but not the least, we wish to thank all the teaching & non-teaching staffs of department of Computer
Science and Engineering, for their support, patience and endurance shown during the preparation of this
project report.

CH VARSHIT VARMA 1AM20CS045


ABHISHEK C 1AM20CS005
SUJAN SAMUEL S 1AM21CS401
CHANDRASHEKAR R 1AM20CS046

ii
ABSTRACT
The system being proposed consists of two primary sections: the Home Meter Section and the
Server Controlled Section. The communication between these two sections is established via a wireless
network. The purpose of this system is to monitor the load, which involves accurately calculating the
amount of resources consumed by the user at any given time. The utilization of these resources is
recorded in the server and continuously communicated to the controlling base station through an
application provided for consumers. This allows consumers to conveniently track their daily usage of
all three sources and the corresponding consumptions.
The implementation of an IoT-based energy-efficient smart metering system for domestic use involves
integrating IoT sensors with traditional energy meters to monitor, analyze, and optimize electricity
consumption. This system aims to provide real-time data on energy usage, enabling users to make
informed decisions to reduce waste and improve efficiency. Through wireless communication, these
smart meters send data to a central server or cloud platform, where it's processed for insights and
presented to users through user-friendly interfaces or mobile apps. The system may incorporate
machine learning algorithms for predictive analysis, enabling proactive energy management strategies,
ultimately leading to reduced costs and a more sustainable approach to energy consumption in
households.

iii
CONTENTS
Chapters Title Page no.

1 INTRODUCTION 1

1.1 Overview 1
1.2 Objectives 2
1.3 Purpose, Scope and Applicability 3
1.3.1 Purpose 3
1.3.2 Scope 3
1.3.3 Applicability 4

2 LITERATURE SURVEY 5

2.1 Introduction 5
2.2 Summary of Literature Survey 5
2.3 Drawbacks of Existing System 8
2.4 Problem Statement 8
2.5 Proposed Solution 9

3 REQUIREMENT ENGINEERING 10

3.1 Hardware Requirements 10


3.2 Software Requirements 11

4 METHODOLOGY 12

4.1 Functional Diagram 12


4.2 Architecture Diagram 13

5 REFERENCES 15

iv
LIST OF FIGURES

Figure no. Title Page no.

1.1 Smart metering system 01

4.1 Functional Diagram 12

4.2 Architecture Diagram 13

v
LIST OF TABLES
Table no. Title Page no.

3.1 Hardware Requirements 10

3.2 Software Requirements 11

vi
Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

Chapter 1

INTRODUCTION
1.1 Overview

In order to efficiently reduce the amount of the electricity usage in the residential area, the
demand response (DR) of the consumers is of importance. The in-home display (IHD) system provides
energymonitoring information for the consumer Demand Response. Recently, we have a in home
Display systems, which are based on 2.4GHz ZigBee.The Wi-Fi/GPRS issued in this project, different
types of IHDs are introduced and their technologies including network architectures are compared.

Figure 1.1 Smart metering system

A wide range of power line communication technologies are needed for different applications,
ranging from home automation to Internet access.The above figure 1.1 illustrates smart metering
system mostPLC technologies limit themselves to one type of wires (such as premises wiring within a
single building), but some can cross between two levels (for example, both the distribution network
and premises wiring). Typically transformers prevent propagating the signal, which requires multiple
technologies to form very large networks. Various data rates and frequencies are used in different
situationTs

In our day-to-day life, the electricity billing needs one KEB person to visit each and every home
to check how much unit they have consumed, then he will give electricity bill to them. If any
homeownerdidn’t pay the bill, then again one KEB person has to visit that home to cut the electric
supply and again to do the connection when he pays the bill, But by using our project there is no
necessity to visiteach and every home, instead KEB authorized person can send monthly electricity bill
automatically

Department of CSE, AMCEC 2023-24 1


Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

to every homeowner by sitting at his office. KEB authorized person can also cut off/on the electric
supply of every home and he can also achieve the load shedding by sitting at one place.There are situations like,
we are going outside and power is not there. So we will forget to switch off all fans andlights. If the power
comes, before we come back to our home leads to power wastage. By using our project we can reduce power
wastage, by the same time homeowner can send the appropriate message to trip off those power, we can switch
off all equipments and thereby reduce the power consumption, Using this project farmer can trip OFF & trip ON
his pump set and also known current information about the remote place, by doing little modifications, it can be
used as home appliances controller. Data transmission between Energy,water and gas meter and KEB
Station is achieved through IOT.
Today Internet has become one of the important part of our daily life. It has changed how people
live, work, play and learn. Internet serves for many purpose educations, finance, Business, Industries,
Entertainment, Social Networking, Shopping, E-Commerce etc. The next new mega trend of Internet
is Internet of Things (IOT).
Visualizing a world where several objects can sense, communicate and share information over
a Private Internet Protocol (IP) or Public Networks. The interconnected objects collect the data at
regular intervals, analyse and used to initiate required action, providing an intelligent network for
analyzing, planning and decision making. This is the world of the Internet of Things (IOT).
The IOT is generally considered as connecting objects to the Internet and using that connection
for control of those objects or remote monitoring. But this definition was referred only to part of IOT
evolution considering the machine to machine market today. But actual definition of IOT is creating a
brilliant, invisible network which can be sensed, controlled and programmed. The products developed
based on IOT include embedded technology which allows them to exchange information, with each
other or the Internet and it is assessed that about 8 to 50 billion devices will be connected by 2020.
Since these devices come online, they provide better life style, create safer and more engaged
communities and revolutionized healthcare.
The entire concept of IOT stands on sensors, gateway and wireless network which enable users
to communicate and access the application/information. Be that as it may, among all the regions no
place does the IOT offer more prominent guarantee than in the field of health awareness. As a saying
goes "Health is wealth" it is exceptionally crucial to make utilization of the innovation for better
wellbeing. Consequently it is obliged to add to an IOT framework which gives secure health awareness
checking. So outlining a savvy medicinal services framework where client information is gotten by the
sensor and sent to the cloud through Wi-Fi and permitting just approved clients to get to the
information.

Department of CSE, AMCEC 2023-24 2


Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

1.2 Objectives
The objectives of design and implementation of IOT based energy efficient smart metering
system for domestic applications enable users to track their energy consumption in real time to make
informed decisions about usage patterns and optimize energy consumption.

➢ Data Analytics: Utilize collected data to perform analytics, identify trends, and offer insights
into energy usage behaviors, allowing for tailored recommendations for more efficient
consumption

➢ Remote Control: Provide users with the ability to remotely control their appliances/devices
tomanage energy consumption effectively, such as scheduling usage during off-peak hours.

➢ Integration and Interoperability: Ensure seamless integration of the smart metering system
withexisting infrastructure and devices, promoting interoperability among various appliances
and systems.

➢ Energy Efficiency Promotion: Educate users about energy-efficient practices through


feedback mechanisms or recommendations generated from the system,encouraging
sustainable behavior.

➢ Security and Privacy: Ensure robust security measures to protect the system from cyber
threats and unauthorized access. Implement encryption protocols, authentication
mechanisms, and access controls to safeguard user data and privacy.

➢ Cost-effectiveness: Strive to design a cost-effective solution that balances functionality,


performance, and affordability. This may involve leveraging open-source technologies,
optimizing hardware and software components, and minimizing deployment and maintenance
costs.

By addressing these objectives, an IoT-based energy-efficient smart metering system can


effectively monitor, manage, and optimize energy usage in domestic applications, leading to
reduced costs, increased sustainability, and improved overall energy efficiency.

Department of CSE, AMCEC 2023-24 3


Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

1.3 Purpose, Scope, and Applicability


1.3.1 Purpose
The concept of merging the meter reading functions of different utilities into one single service
contracthas long been considered an alternative to the traditional method of reading water, electricity
and gasmeters independently of each other. The development of a combined meter reading service,
albeit a logical and seemingly simple cost saving and efficient strategy, raised many issues and
challenges forboth ActewAGL and Fieldforce Services that needed to be addressed before the overall
implementationof the service could be rolled out. The outcomes, however, both present and future, far
outweigh the challenges faced and speak volumes in terms of the benefits to both the organisations
involved and ultimately the customers. These systems generate valuable data that can be analyzed to
understand usage patterns, predict trends, and develop strategies for more effective energy
management.

1.3.2 Scope
The scope of a project focused on implementing an IoT-based, energy-efficient smart metering
system for domestic applications encompasses various facts. It involves designing and deploying smart
sensors and meters capable of accurately monitoring energy consumption within households. The
project encompasses developing robust communication protocols to relay this data securely to a
centralized system or cloud platform for analysis. Additionally, it includes creating user-friendly
interfaces or mobile applications for homeowners to access real-time energy consumption data, receive
insights, and remotely control devices for optimal energy usage. Integration with existing home
automation systems or appliances might also fall within the project's scope. Furthermore, incorporating
machine learning or AI algorithms to provide personalized recommendations for energy optimization
adds depth to the project. Finally, considering scalability and compatibility with diverse household
setups ensures the project's adaptability and potential for widespread adoption. The concept of merging
the meter reading functions of different utilities into one single service contract has long been
considered an alternative to the traditional method of reading water, electricity and gas meters
independently of each other. The development of a combined meter reading service, albeit a logical
and seemingly simple cost saving and efficient strategy, raised many issues and challenges for both
Actew AGL and Field force Services that needed to be addressed before the overall implementation of
the service could be rolled out. The outcomes, however, both present and future, far outweigh the
challenges faced and speak volumes in terms of the benefits to both the organisations involved and
ultimately the customers.

Department of CSE, AMCEC 2023-24 4


Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

1.3.3 Applicability
The applicability of an IoT-driven energy-efficient smart metering system for domestic use is
far- reaching and impactful. This project's relevance lies in its ability to revolutionize how households
monitor, manage, and optimize energy consumption. It caters to the fundamental need for efficient
energy use in homes, spanning across diverse residential setups, including apartments, houses, and
varying family sizes. Its applicability extends beyond geographical boundaries, addressing energy
concerns in urban, suburban, and rural areas alike. This technology benefits homeowners by providing
real-time insights into energy usage, fostering better decision-making for cost savings, environmental
conservation, and enhanced control over energy-intensive appliances. Furthermore, its scalability and
adaptability make it applicable not only for current household needs but also for future advancements
in smart home technologies. Ultimately, the applicability of this project lies in its potential to empower
households worldwide with tools for sustainable, efficient, and informed energy management. Its
relevance spans households of varying sizes and types, from single-person apartments to large family
homes, catering to diverse energy consumption patterns. This project finds practical use across
different geographical locations, addressing energy management needs in urban, suburban, and rural
environments. Its impact resonates with homeowners seeking to reduce energy costs, enhance
environmental sustainability, and gain greater control over their energy usage. Additionally,
itsadaptability allows seamless integration with existing infrastructure, ensuring relevance not just for
current households but also for evolving smart home technologies. By offering real-time monitoring
and insights, these systems empower users to make informed decisions about their energy usage.
Remote control and automation features allow for convenient management of connected devices, while
integration with renewable energy sources promotes sustainability. Participating in demand response
programs becomes seamless, facilitating grid stability and cost savings. Data-driven insights enable
homeowners to optimize energy efficiency and reduce environmental impact. For utility providers,
smart metering systems offer benefits such as improved grid management and regulatory compliance.
Overall, the adoption of IoT-driven smart metering systems in domestic settings promises significant
cost savings, enhanced convenience, and a greener, more sustainable future.

Department of CSE, AMCEC 2023-24 5


Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

Chapter 2

LITERATURE SURVEY
2.1 Introduction

A literature survey in general involves an extensive exploration and analysis of existing scholarly
works, academic papers, publications, and relevant sources on a specific topic. It aims to identify,
summarize, and synthesize the knowledge, findings, and trends within a particular field or subject area.
This survey serves to establish a comprehensive understanding of the existing research landscape,
highlighting gaps, trends, methodologies, and critical insights. A well-conducted literature survey
provides a foundation for new research by contextualizing current understanding, identifying areas
forfurther investigation, and offering a synthesized overview of the subject matter.

2.2 Summary of Literature Survey


A literature survey on an IoT-based energy-efficient smart metering system for domestic
applications would likely encompass a broad range of topics. It could include studies on IoT
technologies in the energy sector, focusing on smart meters, sensors, and communication protocols
used for residential energy monitoring.After conducting through research,here are some of the papers
we have surveyed
Analysis of Smart Meter Data for Electricity Consumers[1] Grzegorz Dudek, Anna Gawlak, Mirosáaw
Kornatka, Jerzy Szkutnik they discussed about Smart meter systems are being deployed to improve grid
reliability and promote energy,water and gas efficiency while providing improved services to their
customers. Smart metering which is installed in millions of households worldwide provides utility
companies with real-time meaningful and timely data about electricity consumption and allow
customers to make informed choices about energy,water and gas usage. Smart meter data analytics has
become an active area in research and industry. It aims to help utilities and consumers understand
electricity consumption patterns. This paper provides analysis methods for load data including: analysis
of daily load profiles and similarity between them, analysis of load density, and analysis of seasonal
and irregular components in the load time series. We evaluate our approach by analyzing smart meter
data collected from 1000 households in Poland at 15-minute granularity over a period of one year.

Department of CSE, AMCEC 2023-24 6


Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

Smart Meter for the IoT [2] F. Abate, M. Carratù, C. Liguori, M. Ferro, V. Paciello
In recent years, smart devices are increasingly. These devices allow making cities smart, enabling
communication not only among people but also among things, creating a new system nowadays known by
the term IoT (Internet of Things). A smart city is based on a smart grid that allows to intelligently manage the
power grid. In order to do this, the network must have intelligent meters that can communicate
bidirectionally with the network. This market has led to a proliferation of smart meters that give the
opportunity to measure the consumption of each single device in homes. The most part of smart meters are
based on a chip that calculates the parameters needed to estimate energy,water and gas consumption. In this
paper, the authors consider a smart meter based on a common chip that calculate the power consumption
and the meter characterization is reported.

Smart Energy,water and gas Metering and Power Theft Control using Raspberry Pi & GSM [3] Visalatchi
S, Kamal Sandeep K Energy,water and gas theft is a very common problem in countries like India where
consumers of energy,water and gas are increasing consistently as the population increases. Utilities in
electricity system are destroying the amounts of revenue each year due to energy,water and gas theft. The
newly designed AMR used for energy,water and gas measurements reveal the concept and working of new
automated power metering system but this increased the Electricity theft forms administrative losses because
of not regular interval checkout at the consumer's residence. It is quite impossible to check and solve out theft
by going every customer’s door to door. In this paper, a new procedure is followed based on
MICROCONTROLLER Atmega328P to detect and control the energy,water and gas meter from power theft
and solve it by remotely disconnect and reconnecting the service (line) of a particular consumer. An SMS will
be sent automatically to the utility central server through GSM module whenever unauthorized activities
detected and a separate message will send back to the microcontroller in order to disconnect the unauthorized
supply

An anti-power theft method for secondary circuit of energy,water and gas meter current
transformer Aut Sitao Li,Jinquan Zhao, Jianzhi Liu, Zhibin Zheng, Jing Zhang, Lixuan JiaAt present,
power theft ways become increasingly subtle and intelligent. Power theft not only has caused a great
loss to the nation and the power sector, but also has brought serious security risks to the equipment
and personal health. Although the power theft behavior of the energy,water and gas meter voltage
transformer secondary circuit has been well recognized and effectively suppressed,the anti power
theft method for the secondary circuit of the energy,water and gas meter current transformer is still
a weak link. Therefore, this paper proposes a transient method based anti power theft method for the

Department of CSE, AMCEC 2023-24 7


Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

secondary circuit of the energy,water and gas meter current transformer. This method applied the
pulse signal to the secondary circuit of the energy,water and gas meter current transformer first, then
obtained the equivalent resistance and inductance parameter of the circuit by measuring the transient
value of the circuit response current. Comparing these parameters with the original parameters of
the circuit, we can judge the circuit state and power theft way. The simulation results verify the
accuracy and reliability of the proposed method, which is a new anti power theft method of the
energy, water and gas meter.

Energy,water and gas Theft and Defective Meters Detection in AMI Using Linear Regression Author: Sook-
Chin Yip, Chia-Kwang Tan, Wooi-Nee Tan, Ming-Tao Gan and Ab-Halim Abu Bakar Electricity theft is
always a ticklish problem faced by utilities around the world. To mitigate and detect energy,water and gas
theft, utilities are leveraging on the consumers’ energy,water and gas consumption dataset obtained from
advanced metering infrastructure to identify anomalous consumption patterns. However, real energy,water and
gas theft sample as well as the distribution station smart meter readings do not exist in Malaysia because smart
grid is not fully implemented. Therefore, we design and construct a small-scaled advanced metering
infrastructure test rig in the laboratory to evaluate the performance and reliability of our previously proposed
linear regression- based detection schemes for energy,water and gas theft and defective meters in small grid
environment. Simulations and electrical tests are conducted and the results show that the proposed algorithms
can successfully detect all the fraudulent consumers and discover faulty smart meters in smart grids.

2.3 Drawbacks of Existing System


i. IoT devices are vulnerable to cybersecurity threats, risking unauthorized access to personal
data and control over energy systems.
ii. Connectivity problems or system failures may disrupt the continuous monitoring and control
of energy usage, impacting the system's reliability.
iii. Collecting a vast amount of data from smart meters may lead to information overload, making
it challenging for users to derive meaningful insights without proper analysis tools or services.
iv Highly depends on meter reader.
v Human error cannot be avoided for the manual meter reading.
vi Always there is no cross checking or recheck of human readers for energy utilization.
vii High chance of stealing and bribery always high to misuse it especially during events.
viii Possibility to change the reading when taking photos of energy meter by using software tools.

Department of CSE, AMCEC 2023-24 8


Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

ix More number of meter reading employees is extra expenses to the company for hiring them and
their expense on traveling too expensive one
x Wherever energy meter installed inside the house, which may lead to non-checking of reading due
to lock.

2.4 Problem Statement


The project aims to implement IoT-enabled energy efficiency solutions leveraging smart metering
systems in domestic settings. However, this initiative encounters several challenges that demand careful
consideration and strategic resolution. The primary issue lies in ensuring a seamless integration of
diverse smart devices and meters into a coherent ecosystem, thereby guaranteeing interoperability and
compatibility. At present, Electricity is the necessary thing in the world for human life. Today every
home, offices, companies, industries have electricity connection. The present system of energy,water
and gas billing, Water and gas is error prone and also time consuming and labor consuming. Errors get
introduced at every stage of billing like errors with electro-mechanical meters, human errors while
noting down the meter reading. The remedy for this drawback is smart meter. The main objective of the
project is to develop a smart meter. The Arduino takes the pulse from the Smart meter, calculate units
and displays the reading on the LCD. The reading is store in built in EEPROM so at the power failure it
continues the calculating reading. The reading of the meter is also sent to the cell phone of the user by
a message through GSM modem and parallel readings are uploaded to cloud. This project is powered
by external power supply that takes the ac power and converts it into dc power and is fed to Arduino and
GSM modem.Due to rapid increase in human population and the human’s dependency towards electrical
energy,water and gas,water and gas, the demand of electricity has increased, causing deficit of electrical
energy,water and gas,water and gas during peak hours. Accurate metering, detection of illegal activities
by and implementation of proper tariff and billing system would manage the consumption of electrical
energy,water and gas,water and gas.

Department of CSE, AMCEC 2023-24 9


Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

2.5 Proposed Solution

i. The project's success lies in selecting efficient smart meters and strategically integrating
sensors to capture comprehensive data without overburdening the electrical system.
ii. In this proposed system, the electricity bill would be generated and provided by a representative
from the Karnataka Electricity Board (KEB) on a monthly basis.
iii. The smart metering technology would facilitate automatic data collection, making the billing
process more accurate and efficient.

A Energy,Water and gas Meter works by communicating directly with wireless data
protocol with the energy,Water and Gas supplier, so the company will always have an accurate
meter reading and there's no need to take a meter reading our self. Energy,water and Gas Meters
can work in a variety of different ways, including using wireless mobile phone type technology to
send data. There are many benefits of smart meter such as:

Department of CSE, AMCEC 2023-24 10


Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

CHAPTER 3

REQUIREMENT ENGINEERING

3.1 Hardware and Software Tools Used

3.1.1 Hardware Requirments

Table 3.1.1 Hardware Requirements

MICROCONTROLLER Arduino is a popular open-source microcontroller platform used for


building various electronic projects. It consists of a simple hardware
ARDUINO board along with an integrated development environment (IDE) that
makes it easy to write, upload, and execute code on the board.

WIFI Wi-Fi, short for "Wireless Fidelity," is a technology that allows devices
to connect to the internet and communicate wirelessly within a local
area network (LAN). It works through radio waves, enabling devices
like smartphones, computers, tablets, and other gadgets to connect to a
wireless router or access point.
RELAYS Relay is an electronic switch that is controlled by an electrical signal.
It's commonly used to control high-power devices with low-power
signals. Relays essentially act as remote switches, allowing a small
electrical current to control a larger one, enabling automation and
remote control in IoT applications.
LCD A Liquid Crystal Display (LCD) is a type of flat-panel display
technology that uses liquid crystals sandwiched between two layers of
glass or plastic. The liquid crystals are manipulated to control the
passage of light, allowing for the display of images and information.
SOLAR PANEL Solar panels are devices that convert sunlight into electricity through
the photovoltaic effect. They are made up of many smaller units called
photovoltaic cells, usually made from silicon. When sunlight hits these
cells, it excites electrons, creating an electric current. This electricity
can be used directly or stored in batteries for later use.
BATTERY A battery is a device that stores and releases electrical energy through a
chemical reaction. It typically consists of one or more electrochemical
cells, each containing positive and negative terminals.

This above table 3.1 includes a list of hardware requirements essentials for the energy smart metering
system that combines different hardware components to transform the way energy consumption is
monitored and managed.

Department of CSE, AMCEC 2023-24 11


Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

3.1.2 Software Requirements

Table 3.2 software Requirements

EMBEDDED C Embedded C is a programming language specifically designed for


programming embedded systems, which are computers dedicated to
performing specific tasks within larger systems or devices.
ARDUINO IDE The Arduino IDE (Integrated Development Environment) is software
used to write, compile, and upload code to Arduino boards. It provides
a user-friendly interface for programming Arduino microcontrollers
using a simplified version of the C++ programming language.

This above table 3.2 includes a list of software requirements of energy efficient smart metering system
depends on a sophisticated interplay of software components to effectively manage the flow,
communication, and analysis of data.

Department of CSE, AMCEC 2023-24 12


Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

CHAPTER 4

PROJECT PLANNING

4.1 Project Planning and Scheduling

1. Domain Selection: This is the phase where we explored all possible domains and tried to figure out
what are the different type of links and its problems for which we could come up with good solutions.
This system involves considering factors like scalability, reliability, security, and interoperability. It's
essential to assess the specific requirements of the smart metering system, such as the type of data to
be collected, communication protocols, integration with existing infrastructure, and regulatory
compliance. Additionally, evaluating the availability of sensor technology, network connectivity
options, and data analytics capabilities is crucial for ensuring the effectiveness and
sustainability of the system.

2. Requirements Assessment: This involves understanding stakeholders' needs, defining functional and
technical specifications, ensuring security and privacy measures, considering environmental factors,
complying with regulations, assessing costs and resources, and anticipating future scalability. By
evaluating these aspects, stakeholders can ensure the system meets expectations, operates reliably, and
provides valuable insights for efficient energy management.

3. Execution Plan Preparation: This plan encompass various stages, including research and analysis to
understand the existing infrastructure, stakeholder requirements, and regulatory considerations and it's
crucial to define clear objectives and performance metrics for the smart metering system. Then,
selecting appropriate IoT hardware and software components tailored to the specific requirements is
essential. The plan will also address data management, security protocols, and scalability to ensure
seamless operation and future expansion.

4. Research Papers Compilation: Firstly we had gather relevant literature on the topic from reputable
sources such as academic journals, conference proceedings, and books and we have collected papers
based on themes, methodologies and key findings.

Department of CSE, AMCEC 2023-24 13


Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

5. Architecture Design: Designing its architecture involves several key considerations to ensure its
effectiveness and scalability it defines the system's requirements, including functionality, performance,
and security and select appropriate architectural styles such as client-server, microservices, or event-
driven based on the project's needs it has a high-level architectural diagram depicting the components
of the system and their interactions.

6. Determine Model Architecture: Determining the model architecture involves selecting the
appropriate structure and components for a specific machine learning or deep learning task. This
typically includes choosing the type of model (e.g., convolutional neural network for image
classification, recurrent neural network for sequential data), determining the number and types of
layers.

7. Results: Based on the previous phases we use the model which we get and deduce the results.

Department of CSE, AMCEC 2023-24 14


Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

CHAPTER 5
SYSTEM DESIGN

In this system we are connecting energy,Water and Gas meters to the internet i.e., IoT concept. This
system eliminates the human involvement in electricity maintenance.

The major components used in the system are Arduino micro controller, energy meter,Water meter and Gas
meter interfacing circuit, relay and relay driver circuit, LCD display. The main meters are connected to the
Arduino microcontroller.

Hardware Requirement:
• Microcontroller ARDUINO
• WIFI.
• Relays
• LCD.
• Flow Sensors

Software Requirement:
• Embedded C
• ARDUINO IDE

Department of CSE, AMCEC 2023-24 15


Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

5.1 System Architecture

Fig 5.1: Architecture Diagram For Energy Efficient Smart Metering System

The above figure 5.1 represents the architecture diagram for an Energy Efficient Smart Metering
System provides a comprehensive visualization of the interconnected components and their
functionalities aimed at optimizing energy consumption and enhancing efficiency.The system
typically comprises smart meters deployed across various locations to accurately measure energy
usage. These meters are equipped with advanced sensors and communication modules enabling real-
time data collection and transmission.

Department of CSE, AMCEC 2023-24 16


Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

5.2 Hardware Components Design


5.2.1 Arduino

Arduino/Genuino Uno is a microcontroller board based on the ATmega328P. It has 14


digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz
quartz crystal, a USB connection, a power jack, an ICSP header and a reset button. It contains
everything needed to support the microcontroller; simply connect it to a computer with a USB
cable or power it with an AC-to-DC adapter or battery to get started. You can tinker with
your UNO without worrying too much about doing something wrong, worst case scenario you
can replace the chip for a few dollars and start over again. "Uno" means one in Italian and was
chosen to mark the release of Arduino Software (IDE) 1.0. The Uno board and version 1.0 of
Arduino Software (IDE) were the reference versions of Arduino, now evolved to newer releases.
The Uno board is the first in a series of USB Arduino boards, and the reference model for the
Arduino platform; for an extensive list of current, past or outdated boards see the Arduino index of
boards. [1]

Fig 5.2: Arduino Microcontroller

The above figure 5.2 represents that Arduino is a popular open-source microcontroller platform used
for building various electronic projects. It consists of a simple hardware board along with an integrated
development environment (IDE) that makes it easy to write, upload, and execute code on the board.

Department of CSE, AMCEC 2023-24 17


Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

Arduino specification:

Table 5.1 Arduino specification


Microcontroller ATmega328P
Operating Voltage 5v
Input voltage 7-12v
Input voltage limit 6-20v
Digital I/O Pins 6
Analogue input Pins 6
DC current perI/O pins 20 mA
DC current for 3.3v Pin 50 mA
Flash Memory Of which o.5KB is used
SRAM 2 KB
EEPROM 1KB
Clock Speed 16MHz
Length 68.6mm
Width 53.4nm
Weight 25g

The above table 5.1 represents the specifications of Arduino boards are versatile
microcontroller platforms renowned for their ease of use and flexibility in prototyping electronics
projects. At their core, Arduino boards feature a microcontroller, typically from the AVR family like
the AT mega series, with varying clock speeds ranging from 8 MHz to 16 MHz.

Arduino programming:

The Arduino/Genuino Uno can be programmed with the (Arduino Software (IDE)).Select
"Arduino/Genuino Uno from the Tools > Board menu (according to the microcontroller on your
board). The ATmega328 on the Arduino/Genuino Uno comes preprogrammed with a boot loader
that allows us to upload new code to it without the use of an external hardware programmer. It
communicates using the original STK500 protocol (reference, C header files).
We can also bypass the boot loader and program the microcontroller through the ICSP (In-Circuit Serial
Programming) header using Arduino ISP or similar. The ATmega16U2/8U2 is loaded with a DFU boot
loader, which can be activated by:
• On Rev1 boards: connecting the solder jumper on the back of the board (near the map of Italy)
and then rese ing the 8U2.
• On Rev2 or later boards: there is a resistor that pulling the 8U2/16U2 HWB line to ground,
making it easier to put into DFU mode. [1]
Department of CSE, AMCEC 2023-24 18
Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

Warnings
The Arduino/Genuino Uno has a resettable polyfuse that protects your computer's USB ports from
shorts and overcurrent. Although most computers provide their own internal protection, the fuse
provides an extra layer of protection. If more than 500 mA is applied to the USB port, the fuse will
automatically break the connection until the short or overload is removed.

Power
The Arduino/Genuino Uno board can be powered via the USB connection or with an external power
supply. The power source is selected automatically.
External (non-USB) power can come either from an AC-to-DC adapter (wall-wart) or battery. The
adapter can be connected by plugging a 2.1mm center-positive plug into the board's power jack. Leads
from a battery can be inserted in the GND and VIN pin headers of the POWER connector.
The board can operate on an external supply from 6 to 20 volts. If supplied with less than 7V, however,
the 5V pin may supply less than five volts and the board may become unstable. If using more than
12V, the voltage regulator may overheat and damage the board. The recommended range is 7 to 12
volts.
The power pins are as follows:

• VIN. The input voltage to the Arduino/Genuino board when it's using an external power source
(as opposed to 5 volts from the USB connection or other regulated power source). One can
supply voltage through this pin, or, if supplying voltage via the power jack, access it through
this pin.
• 5V.This pin outputs a regulated 5V from the regulator on the board. The board can be
supplied with power either from the DC power jack (7 - 12V), the USB connector (5V), or the
VIN pin of the board (7-12V). Supplying voltage via the 5V or 3.3V pins bypasses the
regulator, and can damage your board. We don't advise it.

Memory: The ATmega328 has 32 KB (with 0.5 KB occupied by the boot loader). It also has
2 KB of SRAM and 1 KB of EEPROM (which can be read and written with the EEPROM
library). [1]

Department of CSE, AMCEC 2023-24 19


Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

Input & Output

Each of the 14 digital pins on the Uno can be used as an input or output, using pin mode
(), digital write (), and digital read () functions. They operate at 5 volts. Each pin can provide or
receive 20 mA as recommended operating condition and has an internal pull- up resistor
(disconnected by default) of 20-50k ohm. A maximum of 40mA is the value that must not be
exceeded on any I/O pin to avoid permanent damage to the microcontroller.

Communication:
Arduino/Genuino Uno has a number of facilities for communicating with a computer,
another Arduino/Genuino board, or other microcontrollers. The ATmega328 provides UART TTL
(5V) serial communication, which is available on digital pins 0 (RX) and 1 (TX). An ATmega16U2
on the board channels this serial communication over USB and appears as a virtual com port to
software on the computer. The 16U2 firmware uses the standard USB COM drivers, and no external
driver is needed. However, on Windows, an
.inf file is required. The Arduino Software (IDE) includes a serial monitor which allows simple textual
data to be sent to and from the board. The RX and TX LEDs on the board will flash when data is
being transmitted via the USB-to-serial chip and USB connection to the computer (but not for
serial communication on pins 0 and 1).
A Software serial library allows serial communication on any of the Uno's digital pins. The
ATmega328 also supports I2C (TWI) and SPI communication. The Arduino Software (IDE)
includes a Wire library to simplify use of the I2C bus; see the documentation for details. For SPI
communicatio n, use the SPI library.

Automatic (Software) Reset:


Rather than requiring a physical press of the reset button before an upload, the
Arduino/Genuino Uno board is designed in a way that allows it to be reset by software running
on a connected computer. One of the hardware flow control lines (DTR) of the ATmega8U2/16U2
is connected to the reset line of the ATmega328 via a 100 nano farad capacitor. When this line is
asserted (taken low), the reset line drops long enough to reset the chip. The Arduino Software
(IDE) uses this capability to allow you to upload code by simply pressing the upload button in the
interface toolbar. This means that the boot loader can have a shorter timeout, as the lowering
of DTR can be well-coordinated with the start of the upload. This setup has other implications.

Department of CSE, AMCEC 2023-24 20


Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

5.2.2 Regulated Power Supply

Fig 5.3 Regulated Power Supply

The above figure 5.3 represents the regulated power supply is an essential component in
electronics that provides a stable and consistent output voltage regardless of changes in input voltage
or load conditions. Its primary function is to convert an input voltage, which may fluctuate or be
unregulated, into a precise and steady output voltage suitable for powering electronic circuits or
devices.

Transformer:
A transformer is a device that transfers electrical energy from one circuit to another through inductively
coupled conductors without changing its frequency. A varying current in the first or primary winding creates
a varying magnetic flux in the transformer's core, and thus a varying magnetic field through the secondary
winding. This varying magnetic field induces a varying electromotive force (EMF) or "voltage" in the
secondary winding. This effect is called mutual induction. If a load is connected to the secondary, an electric
current will flow in the secondary winding and electrical energy will be transferred from the primary circuit
through the transformer to the load. This field is made up from lines of force and has the same shape as a bar
magnet. If the current is increased, the lines of force move outwards from the coil. If the current is reduced,
the lines of force move inwards. If another coil is placed adjacent to the first coil then, as the field moves out
or in, the moving lines of force will "cut" the turns of the second coil. As it does this, a voltage is induced in
the second coil. With the 50 Hz AC mains supply, this will happen 50 times a second. This is called MUTUAL
INDUCTION and forms the basis of the transformer.

Department of CSE, AMCEC 2023-24 21


Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

Rectifier:
A rectifier is an electrical device that converts alternating current (AC) to direct current (DC), a process
known as rectification. Rectifiers have many uses including as components of power supplies and as detectors
of radio signals. Rectifiers may be made of solid-state diodes, vacuum tube diodes, mercury arc valves, and
other components. A device that it can perform the opposite function (converting DC to AC) is known as an
inverter. When only one diode is used to rectify AC (by blocking the negative or positive portion of the
waveform), the difference between the term diode and the term rectifier is merely one of usage, i.e., the term
rectifier describes a diode that is being used to convert AC to DC. Almost all rectifiers comprise a number of
diodes in a specific arrangement for more efficiently converting AC to DC than is possible with only one
diode. Before the development of silicon semiconductor rectifiers, vacuum tube diodes and copper (I) oxide
or selenium rectifier stacks were used.
Filter:
The process of converting a pulsating direct current to a pure direct current using filters is called as
filtration. Electronic filters are electronic circuits, which perform signal-processing functions, specifically to
remove unwanted frequency components from the signal, to enhance wanted ones.
Regulator:
A voltage regulator (also called a ‗regulator‘) with only three terminals appears to be a simple device,
but it is in fact a very complex integrated circuit. It converts a varying input voltage into a constant ‗regulated
‘output voltage. Voltage Regulators are available in a variety of outputs like 5V, 6V, 9V, 12V and 15V. The
LM78XX series of voltage regulators are designed for positive input. For applications requiring negative input,
the LM79XX series is used. Using a pair of ‗voltage-divider‘ resistors can increase the output voltage of a
regulator circuit. It is not possible to obtain a voltage lower than the stated rating. You cannot use a 12V
regulator to make a 5V power supply. Voltage regulators are very robust. These can withstand over-current
draw due to short circuits and also over-heating. In both cases, the regulator will cut off before any damage
occurs. The only way to destroy a regulator is to apply reverse voltage to its input.

5.2.3 LCD Display


A 16*2 LCD demonstrates contains two lines likewise; there are 16 characters for each line. Each
character is appeared by 5x7 pixel lattice. This LCD includes two registers, specifically, Order and Data. The
charges select extras the charge bearings that are given to the LCD. A charge is a rule given to LCD to do a
predefined errand like presenting it, clears its screen, sets the cursor position, controls show et cetera. The data
enroll saves the data to be appeared on the LCD.

Department of CSE, AMCEC 2023-24 22


Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

Fig 5.4 LCD Display


The above figure 5.4 represents the LCD display .An LCD (Liquid Crystal Display) is a flat-panel
display technology used in a wide range of electronic devices, from digital watches and calculators to computer
monitors and television screens.

Table 5.2 LCD terminals

Terminal 1 GND
Terminal 2 +5V
Terminal 3 Mid terminal of potentiometer (for brightness control)
Terminal 4 Register Select (RS)
Terminal 5 Read/Write (RW)
Terminal 6 Enable (EN)
Terminal 7 DB0
Terminal 8 DB1
Terminal 9 DB2
Terminal 10 DB3
Terminal 11 DB4
Terminal 12 DB5
Terminal 13 DB6
Terminal 14 DB7
Terminal 15 +4.2-5V
Terminal 16 GND

Department of CSE, AMCEC 2023-24 23


Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

The above table 5.2 represents the LCD Terminals refer to small display screens integrated into IoT
devices. These displays serve various purposes, such as providing real-time status updates, presenting sensor
data, or offering user interaction interfaces.

5.2.4 Energy meter

Watt hour meter or energy meter is an instrument which measures amount of electrical energy used
by the consumers. Utilities install these instruments at every place like homes, industries,
organizations to charge the electricity consumption by loads such as lights, fans and other appliances.
Most interesting type are used as prepaid electricity meters. Basic unit of power is watts. One thousand
watts is one kilowatt. If we use one kilowatt in one hour, it is considered as one unit of energy
consumed. These meters measure the instantaneous voltage and currents, calculate its product and
gives instantaneous power. This power is integrated over a period which gives the energy utilized
over that time period be directly connected between line and load. But for larger loads, step down
current transformers must be placed to isolate energy meters from higher currents.

Three Basic types of Energy meters

Energy meter or watt hour meter is classified in accordance with several factors such as:

• Type of display like analog or digital electric meter.

• Type of metering point like grid, secondary transmission, primary and local distribution.
• End applications like domestic, commercial and industrial.

• Technical like three phases, single phase, HT, LT and accuracy class meters.

➢ Electromechanical induction type Energy meter

Department of CSE, AMCEC 2023-24 24


Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

Fig 5.5 Electromechanical Energy meter

The above figure 5.5 represents the Electromechanical induction type Energy meter It is the popularly
known and most common type of age old watt hour meter. It consists of rotating aluminum disc mounted
on a spindle between two electro magnets. Speed of rotation of disc is proportional to the power and this
power is integrated by the use of counter mechanism and gear trains.

➢ Electronic Energy meters

These are of accurate, high procession and reliable types of measuring instruments as compared to
conventional mechanical meters. It consumes less power and starts measuring instantaneously when
connected to load. These meters might be analog or digital. In analog meters, power is converted to
proportional frequency or pulse rate and it is integrated by counters placed inside it. In digital electric
meter power is directly measured by high end processor. The power is integrated by logic circuits to
get the energy and also for testing and calibration purpose. It is then converted to frequency or pulse
rate.

Analog Electronic Energy Meters :In analog type meters, voltage and current values of each phase
are obtained by voltage divider and current transformers respectively which are directly connected to
the load as shown in figure.

Department of CSE, AMCEC 2023-24 25


Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

Fig 5.6 Analog Electronic Meters

The above figure 5.6 represents the analog electronic meters Analog to digital converter converts
these analog values to digitized samples and it is then converted to corresponding frequency
signals by frequency converter.

Digital Electronic Energy Meters : Digital signal processor or high performance


microprocessors are used in digital electric meters. Similar to the analog meters, voltage and current
transducers are connected to a high resolution ADC. Once it converts analog signals to digital
samples, voltage and current samples are multiplied and integrated by digita l circuits to measure the
energy consumed.

Fig 5.7 Digital Electronic Energy Meter


The above figure 5.7 represents the digital electronic energy meter it is a sophisticated device
used to measure and monitor electrical energy consumption accurately. Unlike traditional
electromechanical meters, digital electronic energy meters utilize advanced electronic components
and digital processing techniques to provide precise readings and additional features for energy

Department of CSE, AMCEC 2023-24 26


Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

5.2.5 ESP8266 Block Diagram

Fig 5.8 ESP8266 Block Diagram


The above figure 5.8 represets the ESP8266 Block Diagram ESP8266 offers a complete and self-
contained Wi-Fi networking solution, allowing it to either host the application or to offload all Wi-Fi
networking functions from another application processor.
When ESP8266 hosts the application, and when it is the only application processor in the device, it is able
to boot up directly from an external flash. It has integrated cache to improve the performance of the system
in such applications, and to minimize the memory requirements.
Alternately, serving as a Wi-Fi adapter, wireless internet access can be added to any microcontroller-
based design with simple connectivity through UART interface or the CPU AHB bridge interface.
ESP8266 on-board processing and storage capabilities allow it to be integrated with the sensors and other
application specific devices through its GPIOs with minimal development up-front and minimal loading
during runtime. With its high degree of on-chip integration, which includes the antenna switch balun, power
management converters, it requires minimal external circuitry, and the entire solution, including front-end
module, is designed to occupy minimal PCB area.
Sophisticated system-level features include fast sleep/wake context switching for energy- efficient VoIP,
adaptive radio biasing for low-power operation, advance signal processing, and spur cancellation and radio
co-existence features for common cellular, Bluetooth, DDR, LVDS, LCD interference mitigation.
ESP8266 has been designed for mobile, wearable electronics and Internet of Things applications with the
aim of achieving the lowest power consumption with a combination of several proprietary techniques. The
power saving architecture operates in 3 modes: active mode, sleep mode and deep sleep mode.
Department of CSE, AMCEC 2023-24 27
Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

By using advance power management techniques and logic to power-down functions not required and to
control switching between sleep and active modes, ESP8266 consumes less than 12uA in sleep mode and
less than 1.0mW (DTIM=3) or less than 0.5mW (DTIM=10) to stay connected to the access point.
When in sleep mode, only the calibrated real-time clock and watchdog remains active. The real- time clock
can be programmed to wake up the ESP8266 at any required interval.
The ESP8266 can be programmed to wake up when a specified condition is detected. This minimal wake-
up time feature of the ESP8266 can be utilized by mobile device SOCs, allowing them to remain in the
low-power standby mode until Wi-Fi is needed.
In order to satisfy the power demand of mobile and wearable electronics, ESP8266 can be programmed
to reduce the output power of the PA to fit various application profiles, by trading off range for power
consumption.

5.2.6 Water flow sensor

Fig 5.9 Water Flow Sensor


The above figure 5.9 represents water flow sensor is a device designed to monitor and measure the flow
rate of water in a system. These sensors are typically integrated into IoT networks to enable remote
monitoring and management of water usage, whether in industrial processes, agriculture, or smart home
applications.
Water flow sensor consists of a plastic valve body, a water rotor, and a hall-effect sensor. When water flows
through the rotor, rotor rolls. Its speed changes with different rate of flow. The hall-effect sensor outputs the
corresponding pulse signal. This one is suitable to detect flow in water dispenser or coffee machine. We have
a comprehensive line of water flow sensors in different diameters. Check them out to find the one that meets
your need most.

Department of CSE, AMCEC 2023-24 28


Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

Features

1. Compact, Easy to Install


2. High Sealing Performance
3. High Quality Hall Effect Sensor
4. RoHS Compliant

Specifications

• Mini. Working Voltage: DC 4.5V


• Max. Working Current: 15mA (DC 5V)
• Working Voltage: DC 5V~24V
• Flow Rate Range: 1~30L/min
• Load Capacity: ?10mA (DC 5V)
• Operating Temperature: ?80?
• Liquid Temperature: ?120?
• Operating Humidity: 35%~90%RH
• Water Pressure: ?1.75MPa
• Storage Temperature: -25~+ 80?
• Storage Humidity: 25%~95%RH

5.2.8 LDR Sensor


A Light Dependent Resistor (LDR) or a photo resistor is a device whose resistivity is a function of
the incident electromagnetic radiation. Hence, they are light sensitive devices. They are also called as photo
conductors, photo conductive cells or simply photo cells. They are made up of semiconductor materials having
high resistance. There are many different symbols used to indicate a LDR, one of the most commonly used
symbol is shown in the figure below. The arrow indicates light falling on it.

• Working Principle of LDR

A light dependent resistor works on the principle of photo conductivity. Photo conductivity is an optical
phenomenon in which the materials conductivity is increased when light is absorbed by the material.

When light falls i.e. when the photons fall on the device, the electrons in the valence band of the
semiconductor material are excited to the conduction band. These photons in the incident light should

Department of CSE, AMCEC 2023-24 29


Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

have energy greater than the band gap of the semiconductor material to make the electrons jump from
the valence band to the conduction band. Hence when light having enough energy strikes on the device,
more and more electrons are excited to the conduction band which results in large number of charge
carriers. The result of this process is more and more current starts flowing through the device when the
circuit is closed and hence it is said that the resistance of the device has been decreased. This is the
most common working principle of LDR.

Fig 5.11 LDR(Light Dependent Resistor)

The above figure 5.11 represents Light Dependent Resistor works on the principle of photo conductivity.
Photo conductivity is an optical phenomenon in which the materials conductivity is increased when light
is absorbed by the material. when the photons fall on the device, the electrons in the valence band of the
semiconductor.

5.2.9 Esp 8266 Node MCU


The Internet of Things (IoT) has been a trending field in the world of technology. It has changed
the way we work. Physical objects and the digital world are connected now more than ever. Keeping
this in mind, Espressif Systems (A Shanghai-based Semiconductor Company) has released an
adorable, bite-sized WiFi enabled microcontroller – ESP8266, at an unbelievable price! For less than
$3, it can monitor and control things from anywhere in the world – perfect for just about any IoT
project.

ESP-12E Module

Department of CSE, AMCEC 2023-24 30


Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

The development board equips the ESP-12E module containing ESP8266 chip having Tensilica
Xtensa® 32-bit LX106 RISC microprocessor which operates at 80 to 160 MHz adjustable clock
frequency and supports RTOS.

• ESP-12E Chi

• Tensilica Xtensa® 32-bit LX106

• 80 to 160 MHz Clock Freq

• 128 KB internal Ram

• 4MB external flash

• 802.11b/g/n WiFi transceiver

Fig 5.12 ESP-12E Chip

The above figure 5.12 represents the ESP-12E Chip is a module commonly used in IoT (Internet of
Things) projects, developed by Espressif Systems. It's based on the ESP8266 microcontroller chip, which
gained popularity due to its low cost, low power consumption, and built-in Wi-Fi capabilities.

There’s also 128 KB RAM and 4MB of Flash memory (for program and data storage) just enough to
cope with the large strings that make up web pages, JSON/XML data, and everything we throw at IoT devices
nowadays.

Department of CSE, AMCEC 2023-24 31


Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

The ESP8266 Integrates 802.11b/g/n HT40 Wi-Fi transceiver, so it can not only connect to a WiFi
network and interact with the Internet, but it can also set up a network of its own, allowing other devices to
connect directly to it. This makes the ESP8266 Node MCU even more versatile Power Requirement.

➢ Power Requiremet

• Operating Voltage 2.5V to 6.3V

• On-board 3.3V 600mA regulator

• 80mA Operating Current

• 20 µA during Sleep Mode

Fig 5.13 power requirement of ESP-12E Chip

The above figure 5.13 represents the power requirement of ESP-12E Chip NodeMCU is
supplied via the on-board Micro B USB connector. Alternatively, if you have a regulated 5V voltage
source, the VIN pin can be used to directly supply the ESP8266 and its peripherals.

Department of CSE, AMCEC 2023-24 32


Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

5.2.10 Solenoid Valve

Fig 5.14 Solenoid Valve

The above figure 5.14 represents the Solenoid is an electromechanically operated valve.Solenoid
valves differ in the characteristics of the electric current they use, the strength of the magnetic field
they generate, the mechanism they use to regulate the fluid, and the type and characteristics of fluid
they control.

The mechanism varies from linear action, plunger-type actuators to pivoted-armature actuators and
rocker actuators. The valve can use a two-port design to regulate a flow or use a three or more port
design to switch flows between ports. Multiple solenoid valves can be placed together on a manifold.

Solenoid valves are the most frequently used control elements in fluidics. Their tasks are to shut off,
release, dose, distribute or mix fluids. They are found in many application areas. Solenoids offer fast
and safe switching, high reliability, long service life, good medium compatibility of the materials used,
low control power and compact design.

5.3 software components Design

5.3.1 Arduino IDE


• A program for Arduino may be written in any programming language for a compiler that
produces binary machine code for the target processor. Atmel provides a development
environment for their microcontrollers, AVR Studio and the newer Atmel Studio.

• The Arduino project provides the Arduino integrated development environment (IDE), which is
a cross-platform application written in the programming language Java. It originated from the
IDE for the languages Processing and Wiring. It includes a code editor with features such as text
cutting and pasting, searching and replacing text, automatic indenting, brace matching, and
syntax highlighting, and provides simple one-click mechanisms to compile and upload programs
to an Arduino board. It also contains a message area, a text console, a toolbar with buttons for

Department of CSE, AMCEC 2023-24 33


Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

common functions and a hierarchy of operation menus.

• A program written with the IDE for Arduino is called a sketch. Sketches are saved on the
development computer as text files with the file extension .ino. Arduino Software (IDE) pre-1.0
saved sketches with the extension .pde.
• The Arduino IDE supports the languages C and C++ using special rules of code structuring.

• The Arduino IDE supplies a software library from the Wiring project, which provides many
common input and output procedures. User-written code only requires two basic functions, for
starting the sketch and the main program loop, that are compiled and linked with a program stub
main() into an executable cyclic executive program with the GNU toolchain, also included with
the IDE distribution.
➢ A minimal Arduino C/C++ sketch, as seen by the Arduino IDE programmer, consist of only
two functions:

➢ setup(): This function is called once when a sketch starts after power-up or reset. It is used to
initialize variables, input and output pin modes, and other libraries needed in the sketch.

➢ loop(): After setup() has been called, function loop() is executed repeatedly in the main program. It controls
the board until the board is powered off or is reset

Fig 5.15 Arduino Sketch

Department of CSE, AMCEC 2023-24 34


Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

The above figure 5.15 represents the Arduino sketch is a program written in the Arduino programming
language (based on Wiring) that runs on Arduino-compatible microcontroller boards. These sketches are
written in the C or C++ programming languages and are typically used to control and interact with various
hardware components connected to the Arduino board.

Embedded C

• When designing software for a smaller embedded system with the 8051, it is very common place to
develop the entire product using assembly code. With many projects, this is a feasible approach since
the amount of code that must be generated is typically less than 8 kilobytes and is relatively simple in
nature. If a hardware engineer is tasked with designing both the hardware and the software, he or she
will frequently be tempted to write the software in assembly language.

• The trouble with projects done with assembly code can is that they can be difficult to read and maintain,
especially if they are not well commented. Additionally, the amount of code reusable from a typical
assembly language project is usually very low. Use of a higher-level language like C can directly
address these issues. A program written in C is easier to read than an assembly program.

• Since a C program possesses greater structure, it is easier to understand and maintain. Because of its
modularity, a C program can better lend itself to reuse of code from project to project. The division of
code into functions will force better structure of the software and lead to functions that can be taken
from one project and used in another, thus reducing overall development time. A high order language
such as C allows a developer to write code, which resembles a human’s thought process more closely
than does the equivalent assembly code.

Department of CSE, AMCEC 2023-24 35


Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

CHAPTER 6

IMPLEMENTATION

➢ The proposed system introduces a new method of meter reading electronically and transmitting to
headquarters for further processing. This helps in reducing the manual errors that occur in the present
meter reading systems.
➢ Meter reading system can be used to take readings for different utilities such as Electricity, Water,
Gasoline (LPG ,CNG) etc.,
➢ Let us consider an example of Electricity; here we are connecting the Energy,water and gas Meter
between main supply and load, by which Microcontroller will be able to measure the energy,water and
gas units consumed by the consumer.
➢ When the various appliances of the household consume energy,water and gas the energy,water and gas
meter reads the reading continuously and this consumed load can be seen on meter.
➢ We can see that the LED on meter continuously blinks which counts the meter reading. Based on the
blinking, the units are counted. Normally, 3200 blinks is one unit.
➢ In our project we are trying to develop, a system in which Arduino Uno act as main controller, which
continuously monitor energy,water and gas meter.
➢ As per the blinking of LED on energy,water and gas meter the Arduino will measure the unit
consumption. The measured reading with the calculation of the cost will be continuously displayed on
web that we have designed.
➢ Threshold value can be set on webpage with the help of Wi-Fi, as per the consumer’s requirement.
When the consumers reading will be near about to the set threshold value it will send a notification
value to the consumer.
➢ This threshold value notification will increase the awareness amongst the consumer about the
energy,water and gas.
➢ The Microcontroller computes the amount of energy,water and gas consumed. Then the calculated
values are transmitted instantaneously via Wi-Fi to the MAIN STATION and the necessary updates
are performed in the DATA BASE of the consumer.
➢ The Gas Leakage Sensor senses the leakage of gas in house and turn off the mains in case of leakage.
➢ Fire sensor used to detect the fire and turn off the supply in case of fire.

Department of CSE, AMCEC 2023-24 36


Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

6.1 Code
#include <LiquidCrystal.h>
LiquidCrystal lcd(13,12, 8, 9, 10, 11);
char flag1=0;
byte statusLed = 13;
#define pulsein 2
const int Relay1 = 5;
const int Relay3 = 6;
const int Relay2 = 7;
unsigned int pusle_count=0;
int units=0;
unsigned int count=0;
volatile byte pulseCount;
volatile byte pulseCount1;
char buff[40],buff1[40],buff2[40],buff3[40],buff4[40],buff5[40],temp1[200];
int X;
int Y;
float TIME = 0;
float FREQUENCY = 0;
float WATER = 0;
float TOTAL = 0;
float LS = 0;
const int input = A1;
int X1;
int Y1;
float TIME1 = 0;
float FREQUENCY1 = 0;
float GAS = 0;
float TOTAL1 = 0;
float LS1 = 0;
const int input1 = A2;
int AUTO=3;
int MANUAL=4;

Department of CSE, AMCEC 2023-24 37


Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

int Fire=14;
//char buff[50];
char ch;
char Start_buff[70];
void setup()
{
Serial.begin(9600);
lcd.begin(16, 2);
lcd.clear();
lcd.setCursor(0,0);
pinMode(Fire,INPUT);
pinMode(input,INPUT);
pinMode(input1,INPUT);
pinMode(AUTO,INPUT_PULLUP);
pinMode(MANUAL,INPUT_PULLUP);
pinMode(statusLed, OUTPUT);
pinMode(Relay1, OUTPUT);
pinMode(Relay2, OUTPUT);
pinMode(Relay3,OUTPUT);
digitalWrite(statusLed, HIGH); // We have an active-low LED attached
digitalWrite(Relay1, LOW);
digitalWrite(Relay2, LOW);
digitalWrite(Relay3,LOW);
pinMode(pulsein, INPUT);
digitalWrite(pulsein, HIGH);
lcd.setCursor(0,0);
lcd.print("Automatic Energy");
lcd.setCursor(0,1);
lcd.print(" Meter ");
delay(3000);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("SELECT THE MODES");
lcd.setCursor(0, 1);
Department of CSE, AMCEC 2023-24 38
Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

lcd.print("1.AUTO 2.MANUAL");
delay(2000);
}
void loop()
{
if(digitalRead(AUTO)==LOW)
{
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("AUTO MODE");
lcd.setCursor(0, 1);
lcd.print("SELECTED...");
Serial.println("$AUTO MODE SELECTED#");
digitalWrite(Relay1,HIGH);
digitalWrite(Relay2,HIGH);
digitalWrite(Relay3,HIGH);
HARDWARE();
}
if(digitalRead(MANUAL)==LOW)
{
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("MANUAL MODE");
lcd.setCursor(0, 1);
lcd.print("SELECTED...");

WAITING_FOR_RESPONSE();
}
}
void HARDWARE()
{
while(1)
{

Department of CSE, AMCEC 2023-24 39


Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

read_pulse();
check_status();
Water1_read();
GAS_Reading();
Sensor_Check();
}
}
void Sensor_Check()
{
int Gas_val=analogRead(A3);
Serial.println("Gas:"+String( Gas_val));
lcd.clear();
lcd.print("Gas:");
lcd.print(Gas_val);
delay(1000);
if(Gas_val>500)
{
Serial.println("$LPG Leakage Detected..#");
lcd.clear();
lcd.print("LPG Leakage Detected..");
delay(1000);
digitalWrite(Relay1, LOW);
digitalWrite(Relay2, LOW);
digitalWrite(Relay3,LOW);
}
if(digitalRead(Fire)==LOW)
{
Serial.println("$Fire Detected..#");
lcd.clear();
lcd.print("Fire Detected..");
delay(1000);
digitalWrite(Relay1, LOW);
digitalWrite(Relay2, LOW);
digitalWrite(Relay3,LOW);
Department of CSE, AMCEC 2023-24 40
Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

}
}
void pulseCounter()
{
// Increment the pulse counter
pulseCount++;
}
void pulseCounter1()
{
// Increment the pulse counter
pulseCount1++;
}
void read_pulse()
{
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Units:");
//Serial.print("$UNITS#")
lcd.print(units);
lcd.print(" ");
lcd.setCursor(0,1);
lcd.print("count:");
lcd.print(count);
lcd.print(" count:");
if(!digitalRead(pulsein))
{
// digitalWrite(led, HIGH);
count++;
lcd.print("count:");
lcd.print(count);
Serial.println("Electricity consumed:");
Serial.println(units);
Serial.print("count:");
Department of CSE, AMCEC 2023-24 41
Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

Serial.println(count);
//units=watt_factor*count/1000;
delay(1000);
if(count==4)
{
units++;
count=0;
}
}
}
void Water1_read()
{
X = pulseIn(input, HIGH);
Y = pulseIn(input, LOW);
TIME = X + Y;
FREQUENCY = 1000000/TIME;
WATER = FREQUENCY/7.5;
LS = WATER/60;
if(FREQUENCY >= 0)
{
if(isinf(FREQUENCY))
{
lcd.clear();
lcd.setCursor(0,0);
lcd.print("VOL. :0.00");
lcd.setCursor(0,1);
lcd.print("TOTAL:");
lcd.print( TOTAL);
lcd.print(" L");
}
else
{
TOTAL = TOTAL + LS;
Serial.println(FREQUENCY);
Department of CSE, AMCEC 2023-24 42
Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

lcd.clear();
lcd.setCursor(0,0);
lcd.print("VOL.: ");
lcd.print(WATER);
lcd.print(" L/M");
lcd.setCursor(0,1);
lcd.print("TOTAL:");
lcd.print( TOTAL);
lcd.print(" L");
if(TOTAL>3)
{
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Water Bill Generated");
lcd.setCursor(0,1);
lcd.print("Amount is 30Rs.");
delay(2000);
TOTAL=0;
WAITING_FOR_RESPONSE_W();
HARDWARE();
}
}
}
}
void GAS_Reading()
{
X1 = pulseIn(input1, HIGH);
Y1 = pulseIn(input1, LOW);
TIME1 = X1 + Y1;
FREQUENCY1 = 1000000/TIME1;
GAS = FREQUENCY1/7.5;
LS1 = GAS/60;
if(FREQUENCY1 >= 0)
{
Department of CSE, AMCEC 2023-24 43
Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

if(isinf(FREQUENCY1))
{
lcd.clear();
lcd.setCursor(0,0);
lcd.print("VOL.1 :0.00");
lcd.setCursor(0,1);
lcd.print("TOTAL1:");
lcd.print( TOTAL1);
lcd.print(" L");
}
else
{
TOTAL1 = TOTAL1 + LS1;
Serial.println(FREQUENCY1);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("VOL.1: ");
lcd.print(GAS);
lcd.print(" L/M");
lcd.setCursor(0,1);
lcd.print("TOTAL1:");
lcd.print( TOTAL1);
lcd.print(" L");
if(TOTAL1>3)
{
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Gas Bill Generated");
lcd.setCursor(0,1);
lcd.print("Amount is 30Rs.");
Serial.println("$Gas Bill Generated is 30Rs..#");
delay(2000);
TOTAL1=0;
WAITING_FOR_RESPONSE_G();
Department of CSE, AMCEC 2023-24 44
Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

HARDWARE();
}
}
}
delay(1000);
}
void check_status()
{
if(units<1)
{
flag1=0;
}
if(units>=3 && flag1==0)
{
lcd.setCursor(0,0);
lcd.print("BILL GENERATED:");
Serial.print("$Electricity Bill Generated:");
lcd.print(units);
Serial.print(units);
// delay(3000);
lcd.setCursor(0,1);
lcd.print("AMOUNT IS:");
Serial.print("AMOUNT IS:");
Serial.print("30rs#");
lcd.print("30rs");
delay(3000); // upload();
flag1=1;
units=0;
Waiting_for_Bill_E();
HARDWARE();
}
// }
}
char Serial_read(void)
Department of CSE, AMCEC 2023-24 45
Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

{
char ch;
while(Serial.available() == 0);
ch = Serial.read();
return ch;
}
void Waiting_for_Bill_E()
{
// Serial.println("$MANUAL MODE SELECTED#");
//
while(1)
{
if (Serial.available() > 0)
{
while(Serial_read()!='*');
int i=0;
while((ch=Serial_read())!='#')
{
Start_buff[i] = ch;
i++;
}
Start_buff[i]='\0';
}
// Serial.println("halo");
Serial.println( Start_buff);
if(strcmp(Start_buff,"Yes")==0)
{
Serial.write("$Yes#");
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("LIGHT IS");
lcd.setCursor(0, 1);
lcd.print("ON....");

Department of CSE, AMCEC 2023-24 46


Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

digitalWrite(Relay1,HIGH);
// delay(2000);
HARDWARE();
}
else if(strcmp(Start_buff,"No")==0)
{
Serial.write("$LIGHT OFF#");
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("LIGHT IS");
lcd.setCursor(0, 1);
lcd.print("OFF....");
digitalWrite(Relay1,LOW);
// delay(2000);
HARDWARE();
}
}
}
//
void WAITING_FOR_RESPONSE()
{
Serial.println("$MANUAL MODE SELECTED#");
//
while(1)
{
if (Serial.available() > 0)
{
while(Serial_read()!='*');
int i=0;
while((ch=Serial_read())!='#')
{
Start_buff[i] = ch;
i++;
}
Department of CSE, AMCEC 2023-24 47
Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

Start_buff[i]='\0';
}
// Serial.println("halo");
Serial.println( Start_buff);
if(strcmp(Start_buff,"LIGHT ON")==0)
{
Serial.write("$LIGHT ON#");
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("LIGHT IS");
lcd.setCursor(0, 1);
lcd.print("ON....");
digitalWrite(Relay1,HIGH);
// delay(2000);
WAITING_FOR_RESPONSE();
}
else if(strcmp(Start_buff,"LIGHT OFF")==0)
{
Serial.write("$LIGHT OFF#");
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("LIGHT IS");
lcd.setCursor(0, 1);
lcd.print("OFF....");
digitalWrite(Relay1,LOW);
// delay(2000);
WAITING_FOR_RESPONSE();
}
if(strcmp(Start_buff,"LED ON")==0)
{
Serial.write("$LED ON#");
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("LED IS");
Department of CSE, AMCEC 2023-24 48
Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

lcd.setCursor(0, 1);
lcd.print("ON....");
digitalWrite(Relay2,HIGH);
// delay(2000);
WAITING_FOR_RESPONSE();
}
else if(strcmp(Start_buff,"LED OFF")==0)
{
Serial.write("$LED OFF#");
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("LED IS");
lcd.setCursor(0, 1);
lcd.print("OFF....");
digitalWrite(Relay2,LOW);
// delay(2000);
WAITING_FOR_RESPONSE();
}
if(strcmp(Start_buff,"FAN ON")==0)
{
Serial.write("$FAN ON#");
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("FAN IS");
lcd.setCursor(0, 1);
lcd.print("ON....");
digitalWrite(Relay3,HIGH);
// delay(2000);
WAITING_FOR_RESPONSE();
}
else if(strcmp(Start_buff,"FAN OFF")==0)
{
Serial.write("$FAN OFF#");
lcd.clear();
Department of CSE, AMCEC 2023-24 49
Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

lcd.setCursor(0, 0);
lcd.print("FAN IS");
lcd.setCursor(0, 1);
lcd.print("OFF....");
digitalWrite(Relay3,LOW);
// delay(2000);
WAITING_FOR_RESPONSE();
}
}
}
void WAITING_FOR_RESPONSE_G()
{
// Serial.println("$MANUAL MODE SELECTED#");
//
while(1)
{
if (Serial.available() > 0)
{
while(Serial_read()!='*');
int i=0;
while((ch=Serial_read())!='#')
{
Start_buff[i] = ch;
i++;
}
Start_buff[i]='\0';
}
// Serial.println("halo");
Serial.println( Start_buff);
if(strcmp(Start_buff,"Yes")==0)
{
Serial.write("$LIGHT ON#");
lcd.clear();
lcd.setCursor(0, 0);
Department of CSE, AMCEC 2023-24 50
Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

lcd.print("GAS Bill ");


lcd.setCursor(0, 1);
lcd.print("Paid....");
digitalWrite(Relay1,HIGH);
// delay(2000);
HARDWARE();
}
else if(strcmp(Start_buff,"No")==0)
{
Serial.write("$LIGHT OFF#");
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("LIGHT IS");
lcd.setCursor(0, 1);
lcd.print("OFF....");
digitalWrite(Relay1,LOW);
// delay(2000);
HARDWARE();
}
}
}
void WAITING_FOR_RESPONSE_W()
{
// Serial.println("$MANUAL MODE SELECTED#");
//
while(1)
{
if (Serial.available() > 0)
{
while(Serial_read()!='*');
int i=0;
while((ch=Serial_read())!='#')
{
Start_buff[i] = ch;
Department of CSE, AMCEC 2023-24 51
Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

i++;
}
Start_buff[i]='\0';
}
// Serial.println("halo");
Serial.println( Start_buff);
if(strcmp(Start_buff,"Yes")==0)
{
Serial.write("$LIGHT ON#");
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Water Bill ");
lcd.setCursor(0, 1);
lcd.print("Paid....");
digitalWrite(Relay1,HIGH);
// delay(2000);
HARDWARE();
}
else if(strcmp(Start_buff,"No")==0)
{
Serial.write("$LIGHT OFF#");
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("LIGHT IS");
lcd.setCursor(0, 1);
lcd.print("OFF....");
digitalWrite(Relay1,LOW);
// delay(2000);
HARDWARE();
}
}
}

Department of CSE, AMCEC 2023-24 52


Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

CHAPTER 7
TESTING

7.1 Software Testing


7.1.1 Blackbox testing

The technique of testing without having any knowledge of the interior workings of the
application is called black-box testing. The tester is oblivious to the system architecture and does
not have access to the source code. Typically, while performing a black-box test, a tester will
interact with the system's user interface by providing inputs and examining outputs without
knowing how and where the inputs are worked upon.

7.1.2 Whitebox testing


White-box testing is the detailed investigation of internal logic and structure of the code.
White-box testing is also called glass testing or open-box testing. In order to perform white-box
testing on an application, a tester needs to know the internal workings of the code. The tester
needs to have a look inside the source code and find out which unit/chunk of the code is behaving
inappropriately.

7.2 Levels of Testing

7.2.1 Functional Testing


This is a type of black-box testing that is based on the specifications of the software that
is to be tested. The application is tested by providing input and then the results are examined that
need to conform to the functionality it was intended for. Functional testing of software is
conducted on a complete, integrated system to evaluate the system's compliance with its specified
requirements. There are five steps that are involved while testing an application for functionality.

7.2.2 Non-functional Testing


This section is based upon testing an application from its non-functional attributes. Non-
functional testing involves testing software from the requirements which are non-functional
in nature but important such as performance, security, user interface, etc. Testing can be done
in different levels of SDLC.

Department of CSE, AMCEC 2023-24 53


Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

7.2.3 Unit testing


Unit testing is a software development process in which the smallest testable parts of an
application, called units, are individually and independently scrutinized for proper operation.
Unit testing is often automated but it can also be done manually. The goal of unit testing is to
isolate each part of the program and show that individual parts are correct in terms of
requirements and functionality.

Table 7.1: Unit test case-1


Sl # Test Case : - UTC-1
Name of Test: - Power on Test
Items being tested: - Arduino and Wireless Modules
Sample Input: - Turn on system using Power Supply
Expected output: - Module should turn on
Actual output: - System Turned on
Remarks: - Pass.

The above table 7.1 represents the first test case on power using arduino and sensors in
which the sytem should be turned on using power supply. In this test case the result is pass
which means the test case for power is passed successfully without any errors.

Table 7.2: Unit test case-2


Sl # Test Case : - UTC-2
Name of Test: - Flow Sensor Test
Items being tested: - Test for different ranges
Sample Input: - Power up the system
Expected output: - Should work for different ranges
Actual output: - Worked for different flow
Remarks: - Test Passed

The above table 7.2 represents the secound test case on turbidity using water and sensors in
which the sytem should be able to detect the moving particles in water . In this test case the result is
pass which means the test case for turbidity is passed successfully without any errors. In this test
case the result is pass which means the test case for power is passed successfully without any errors.

Department of CSE, AMCEC 2023-24 54


Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

Table 7.3: Unit test case-3


Sl # Test Case : - UTC-3
Name of Test: - Meter Test
Items being tested: - Meter Power LED
Sample Input: - AC Load
Expected output: - Meter LED Should Blink on applying Load
Actual output: - Meter LED turned on and off
Remarks: - Test Passed

The above table 7.3 represents the third test case of temperature using arduino and sensors in
which the sytem should be able to detect temperature level of water . In this test case the result is
pass which means the test case for temperature is passed successfully without any errors.

7.2.4 Integration Testing

Integration testing is a level of software testing where individual units are combined and tested
as a group. The purpose of this level of testing is to expose faults in the interaction between integrated
units. Test drivers and test stubs are used to assist in Integration Testing. Integration testing is defined
as the testing of combined parts of an application to determine if they function correctly. It occurs after
unit testing and before validation testing.

1. Bottom-up Integration
This testing begins with unit testing, followed by tests of progressively higher-level
combinations of units called modules or builds.

2. Top-down Integration
In this testing, the highest-level modules are tested first and progressively, lower-level modules
are tested thereafter.

Department of CSE, AMCEC 2023-24 55


Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

Table 7.4: Integration test case-1


Sl # Test Case : - ITC-1
Name of Test: - Energy meter , gas and Water Meter Values
Item being tested: - Energy meter , gas and water flow values
Sample Input: - Power On
Expected output: - System should energy , water and gas flow values
Actual output: - Functioned Properly
Remarks: - Pass.

The above table 7.5 represents integration test case for displaying all sensor value in which the
system should be able to functioned properly water. In this integration test case the result is pass
which means the test case for displaying sensor value is passed successfully without any errors.

Table 7.5: Integration test case-2


Sl # Test Case : - ITC-2
Name of Test: - Update to IOT Platform
Item being tested: - Updating
Sample Input: - Power on
Expected output: - Should Update Readings to user through telegram application
Actual output: - Received usage values on telegram application
Remarks: - Pass.

The above table 7.5 represents integration test case for updating the iot platform in which
sensors value should be showed and updated in cloud platform. In this integration test case the result
is pass which means the test case for updating the iot platform is passed successfully without any
errors.

7.3 Hardware Testing


7.3.1 Continuity test
In electronics, a continuity test is the checking of an electric circuit to see if current flows
(that it is in fact a complete circuit). A continuity test is performed by placing a small voltage
(wired in series with an LED or noise-producing component such as a piezoelectric speaker)
across the chosen path. If electron flow is inhibited by broken conductors, damaged components,
or excessive resistance, the circuit is "open". Devices that can be used to perform continuity tests
include multi meters which measure current and specialized continuity testers which are cheaper,

Department of CSE, AMCEC 2023-24 56


Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

more basic devices, generally with a simple light bulb that lights up when current flows. An
important application is the continuity test of a bundle of wires so as to find the two ends
belonging to a particular one of these wires; there will be a negligible resistance between the
"right" ends, and only between the "right" ends.

7.3.2 Power on test


This test is performed to check whether the voltage at different terminals is according to
the requirement or not. We take a multi meter and put it in voltage mode. Remember that this test
is performed without microcontroller. Firstly, we check the output of the transformer, whether
we get the required 12 v AC voltage. Then we apply this voltage to the power supply circuit. Note
that we do this test without microcontroller because if there is any excessive voltage, this may
lead to damaging the controller.Overall,the power-on test is a critical step in hardware testing that
ensures the integrity and reliability of the device's hardware component.

Department of CSE, AMCEC 2023-24 57


Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

CHAPTER 8

RESULT DISCUSSION AND PERFORMANCE ANALYSIS

8.1 Snapshots

Fig 8.1 energy efficient smart metering system

The above figure 8.1 represents the energy efficient smart metering system system introduces a new
method of meter reading electronically and transmitting to headquarters for further processing. This
helps in reducing the manual errors that occur in the present meter reading systems. Meter reading
system can be used to take readings for different utilities such as Electricity, Water, Gasoline.

Fig 8.2 Display on Lcd-1

The above figure 8.2 represents the initial message displayed when esp8266 is connected to any
hotspot. When selected manual mode in telegram same message will be displayed.

Department of CSE, AMCEC 2023-24 58


Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

Fig 8.3 Display on Lcd-2

The above figure 8.3 represents the two modes automatic and manual. This message appears
after the Automatic energy meter message in which the user can use switch to select automatic mode
or manual mode.

• There are two modes

a. Automatic mode

b. Manual mode

1. Automatic mode

In an energy-efficient smart metering system, the automatic mode typically refers to the meter's ability
to collect, transmit, and process energy usage data without manual intervention.

2. Data Collection: Smart meters automatically measure and record energy consumption data at regular
intervals, such as every hour or every 15 minutes, depending on the configuration.
3. Processing: In the automatic mode, the meter may perform basic processing tasks on the collected
data before transmission. This processing could involve tasks like data aggregation, error correction,
and data formatting.
4. Analysis and Reporting: The utility company's systems receive the transmitted data and analyze it
to generate insights into energy usage patterns, peak demand periods, and potential energy-saving
opportunities.
5. Billing: For residential consumers, the automatic mode ensures accurate billing based on actual usage,
eliminating the need for manual meter readings. This enhances billing accuracy and eliminates
estimated bills, leading to better transparency and customer satisfaction.

Department of CSE, AMCEC 2023-24 59


Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

Fig 8.4 Display on Lcd-3

The above figure 8.4 shows the electricity bill is generated the meter calculates the meter
readings and show it in the LCD screen how many units of current is used and how much the bill is
generated.

Fig 8.5 Display on Lcd-4

The above figure 8.5 shows the water bill is generated through its sensor it has two valves input
and output valves the water stores in input and flow through output.

Fig 8.6 Display on Lcd-5

The above figure 8.6 shows the gas bill generated through its sensor it has two valves input and
output valves the gas stores input valve and flow to output valve the sensor generates the bill and
display on LCD screen.

Department of CSE, AMCEC 2023-24 60


Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

➢ There is one more sensor which works in emergency cases that is fire sensor which controls the whole
home meter section in case of any fire accidents it will sense the smoke and shutdown whole power
supply of the house .

➢ Manual mode

In an energy-efficient smart metering system, the manual mode typically allows for more direct
user interaction and control over certain aspects of the meter's operation.

1. User Interaction: In manual mode, the smart meter can be configured to allow users to
manually initiate specific actions or adjustments. This interaction can occur through various
interfaces, such as physical buttons, touchscreens, or remotely through a web portal or mobile
app.
2. Data Viewing: Users may be able to manually request and view real-time or historical energy
usage data directly from the meter. This visibility into energy consumption patterns empowers
users to make informed decisions about their energy usage habits and identify opportunities
for optimization.
3. Settings Adjustment: Manual mode may allow users to adjust certain settings or preferences
directly on the meter itself or through a user interface. For example, users might be able to set
preferences for time-of-use pricing, configure energy-saving modes, or specify alerts for
abnormal usage patterns.
4. Meter Testing and Maintenance: Manual mode can facilitate meter testing, calibration, and
maintenance procedures. Utility technicians or authorized personnel may use manual mode to
perform diagnostic tests, verify meter accuracy, or troubleshoot any issues that arise.
5. Emergency Situations: In the event of emergencies or disruptions to communication
networks, manual mode can ensure continued functionality of the meter. Users may still be
able to access essential information and perform critical tasks even when automated
communication channels are unavailable.

Department of CSE, AMCEC 2023-24 61


Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

Fig 8.7 Manual mode-1

The above figure 8.7 represents to control given through telegram when manual mode is
selected by the user should give commands to control all three energy resources with their mobile by
using telegram or sms bot to control their energy resources.

➢ To control the electricity first the user will receive the bill as shown in the above figure if user
give the command ‘Light on’ in their telegram chatbot then the power supply continues and if
you give the command ‘Light off’ the power supply cuts off.
➢ To control the water the user gets the water bill after that the user should open their telegram
chatbot there they get their water bill if users give the command ‘Yes’ the water supply
continues if the user gives ‘No’ then it will stop the supply and the same process is repeated for
gas.

Department of CSE, AMCEC 2023-24 62


Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

CHAPTER 9
CONCLUSION, APPLICATIONS AND FUTURE WORK

9.1 Conclusion
The designed automated system is a smart automated process instead of manual work.hence, meter
accuracy is increased and meter maintenance expenses also reduced. This proposed automated system
consists of two sections. One at Electricity board office that includes office section which has a PC with
its back end connected to a database. The other section is the customer home section which is present at
the home this section is used to read the amount of power consumed by the customer and the data of
information is sent to the PC in the EB office. This EB office section calculates the bill and sends the
amount of bill to the consumers through the PLCC. Also, it allows the user to get updated regarding the
details of power used in his house. The proposed system uses the existing power line because, it seems to
be the most economical one and adaptable system, compared to the other methodologies. Thus this system
proves to be very advantageous as precise consumption information can be easily obtained clear and
accurate billing is done, without error.

9.2 Applications

1. Energy Usage Insights: The system can provide detailed insights into energy consumption patterns
over time, enabling residents to make informed decisions about energy-saving measures and appliance
upgrades to improve efficiency.

2. Preventive Maintenance: Smart meters can detect abnormal energy usage patterns that may indicate
malfunctioning or inefficient appliances. This proactive approach allows homeowners to schedule
maintenance or repairs before major issues occur, reducing downtime and repair costs.

3. Integration with Renewable Energy Sources: For households with solar panels or other renewable
energy sources, smart meters can facilitate the integration and optimization of these systems by
monitoring energy generation, consumption, and surplus energy feeding into the grid.

4. Demand Response: Utilities can use data collected from smart meters to implement demand response
programs, incentivizing residents to reduce energy usage during peak periods or when renewable
energy generation is low, thus helping to balance the grid and reduce strain on the energy infrastructure.

Department of CSE, AMCEC 2023-24 63


Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

5. Billing Transparency and Accuracy: Smart meters provide accurate and transparent data on energy
usage, eliminating estimated bills and ensuring that residents are billed based on actual consumption.
This fosters trust between consumers and utility providers.

6. Home Automation Integration: Smart meters can integrate with home automation systems to
automate energy-saving actions based on predefined rules or triggers. For example, turning off non-
essential appliances during peak hours or adjusting lighting levels based on occupancy.

9.3 Future scope of the Project

In the future, the envisioned system could undergo further expansion to revolutionize the concept of
energy management through prepaid energy meters. These meters would offer users greater control and
flexibility over their energy consumption while simultaneously optimizing cost efficiency.

1. Customizable Recharge Options: Users would have the ability to recharge their prepaid energy
meters according to their specific needs and budgetary constraints. This could be achieved through
various channels such as mobile apps, online portals, or even at designated physical locations.

2. Real-Time Monitoring and Alerts: The integration of advanced monitoring capabilities would allow
users to track their energy usage in real-time. They could receive alerts when their energy balance is
running low, enabling proactive management and avoidance of unexpected interruptions in power
supply.

3. Energy Usage Insights: By leveraging data analytics and machine learning algorithms, the system
could provide users with valuable insights into their energy consumption patterns. This could empower
them to make informed decisions regarding energy conservation and optimization.

4. Flexible Tariff Plans: Prepaid energy meters could offer users a range of flexible tariff plans tailored
to their specific requirements. This could include off-peak discounts, tiered pricing structures, or
incentives for adopting renewable energy sources.

5. Smart Metering Infrastructure: The prepaid energy meters could form part of a broader smart
metering infrastructure, enabling advanced features such as remote meter reading, automated billing,
and demand response capabilities.

Department of CSE, AMCEC 2023-24 64


Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

REFERENCES
[1] Park, B.S, Hyun, D.H, Cho, S.K. “Implementation of AMR system using power line
communication”. Conference and Exhibition 2002: Asia Pacific. IEEE/PES, Vol. 1, Oct. 2002,
pp. 18-21
[2] Raja, G.T. “Electricity consumption and automatic billing through power line”, Power
Engineering Conference, 2007, PP. 1411 – 1415, 2007.
[3] Bharath, P “Wireless automated digital energy meter”, Sustainable energy technologies,
International conference, 2008, PP. 564 – 567,2008.
[4] TasfinMohaimeenHaq “Application of Power Line Carrier (PLC) in Automated Meter Reading
(AMR)and Evaluating Non-Technical Loss (NTL)” International Journal of Research and
Technology ,Vol 2,Issue 8,August 2013.
[5] PoonamBorle, AnkitaSaswadkar, DeepaliHiwarkar, RupaliS.K ad “Automatic Metre Reading
For Electricity Using Powerline Communication” International Journal of Advanced Research
in Electrical and Instrumentation EngineeringVol2.,Issue 3,March2013.
[6] Mr.VishalKashinathOvhal, Dr.U.L.Bombale”Power Line Communication Based Automatic
Electrical Billing Meter and Power Supply Control Using Frequency Shift Keying
Modulation”International Journal of Modern Trends in Engineering and Research vol.2, Issue
4,April2015.
[7] G.Sujatha, D.Murali, R,Ram Kishore “Automated EB Billing and Supply Control using
PowerLineCommunication” vol.45- NO 7,May 2015.
[8] V.Manimala,S.K.M.Sangeetha,R.Subhashree,T.V.K.Surekha ”Design and Implementation of
Automatic Metre Reading using PLC Modem”South Asian Journal of Engineering and
Technology,Vol-3-NO 6,2017.

Department of CSE, AMCEC 2023-24 65


Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

ANNEXURE

[1] INTERNATIONAL RESEARCH PAPER PRESENTATION

Our team, CH. Varshit Varma, Sujan Samuel S, Abhishek C, Chandrashekar R, published a
research paper in International Research Journal Of Modernization in Engineering Technology and
Science(IRJMETS), dated 31 March 2024. The paper entitled “Design and Implementation of IoT
based Energy Efficient Smart Metering System for Domestic Applications” was assigned the paper
ID “e-ISSN:2582-5208”. The team was guided by Mrs. Jaya Karuna B throughout the project. The
paper presentation was successful, and the team was awarded certificates in recognition of their
achievement.

Department of CSE, AMCEC 2023-24 66


Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

CERTIFICATES

Department of CSE, AMCEC 2023-24 67


Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

Department of CSE, AMCEC 2023-24 68


Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

Department of CSE, AMCEC 2023-24 69


Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

Department of CSE, AMCEC 2023-24 70


Design and Implementation of IoT based Energy Efficient Smart Metering System for Domestic Applications

Department of CSE, AMCEC 2023-24 71

You might also like