Smart Energy Meter Project Report
Smart Energy Meter Project Report
Declaration
1
We, the undersigned, hereby declare that this project report titled "Smart Energy Meter with
IoT and AI-Driven Consumption Prediction" is our original work and has not been submitted to
any other institution for academic or professional purposes.
We confirm that all sources of information used in this work have been appropriately
acknowledged, and any borrowed ideas, figures, or research findings have been cited
accordingly. This project is developed for academic purposes, and any implementation beyond
this scope will adhere to relevant ethical and regulatory guidelines.
ACKNOWLEDGEMENTS
2
Special thanks to our supervisor, Dr. Sylvester McOyowo for his expert idea and encouragement
throughout this innovative course.
My appreciation also goes to all lecturers in the department of Computer Science. Your help
has really been beneficial to us all may continue inspiring those that will also pursue this field of
study.
We say a big thank you to our parents for their support, both financially and otherwise
throughout this study. We appreciate all your efforts.
ABSTRACT
3
An energy meter is a device used to monitor the electricity utilization/consumption. Meters
usually involve real-time or near real-time sensors data to calculate current, voltage and power.
The main objective of this work was to design a single-phase smart energy meter using
instantaneous power calculation. The device can be utilized to measure the amount of electric
power consumed by electrical appliances. One of the goal is to monitor the consumption of
electric energy using both current and voltage signal from power system. Voltage and current
signal are sampled and analyzed by using Arduino. The device is embedded with WiFi control
switching operation, i.e- to turn on/off the appliances at any time remotely via a software
developed in Android Platform named with PMU. An Arduino code is developed to measure the
various circuit parameters including current voltage, power factor (PF), real power consumption
and reactive power. The system is also embedded with sensitivity measurement module and
the values are displayed regularly. To control the various appliances, a mobile application is
developed and integrated with the system. WiFi enabled energy metering system can be
utilized to control the appliances remotely.
4
TABLE OF CONTENTS
DECLARATION………………………………………………………………………………………………………………………….
ACKNOWLEDGEMENTS ………………………………………………………………………………………………………….. ii
ABSTRACT……………………………………………………………………………………………………………………………….. iii
LIST OF FIGURES……………………………………………………………………………………………………………………… iv
CHAPTER ONE: INTRODUCTION……………………………………………………………………………………………….. 1
1.1 Background of Research……………………………………………………………………………………………………… 2
1.2 Problem Statement………………………………………………………………………………………………………………
1.3 Research Objectives…………………………………………………………………………………………………………..
1.4 Research Questions……………………………………………………………………………………………………………..
1.5 Significance of the study………………………………………………………………………………………………………
1.6 Scope of Work……………………………………………………………………………………………………………………..
CHAPTER TWO: LITERATURE REVIEW…………………………………………………………………………………………
2.1 Background Overview…………………………………………………………………………………………………………
2.2 Automatic Meter Reading……………………………………………………………………………………………………
2.3 Current Measurement………………………………………………………………………………………………………….
2.3.1: Analog to Digital Conversion…………………………………………………………………….
2.3.2: Sampling and Holding……………………………………..
2.3.3: Quantizing and Encoding……………………………………………….
2.4 Node Mcu…………………………….
CHAPTER THREE: METHODOLOGY………………………………………………………………
3.1: Materials
3.2: Block Diagram:
3.3: Detailed Design
3.3.1: Proteus Circuit Simulation
3.4: The Mobile Application:
3.4.1: Overview Of The Mobile Application
3.5. Application Programming Interface
3.6: Database
5
Appendixes
References
CHAPTER ONE
INTRODUCTION
6
1.1 Background of Research
In recent years, domestic and industrial users have shifted from traditional meters to smart
meters. As global energy demand increases, efficient energy usage has become a critical
concern for both consumers and governments. In developing countries like Kenya, households
and small businesses often struggle to monitor and manage their electricity consumption
effectively, leading to high energy bills and wastage. Electromechanical meters were a
dominant part of electricity measurement before 1970 . However, it had been identified that
the requirement of a meter which could communicate and measure the electrical energy along
with other electrical parameters was essential. Therefore, solid state electronic meters were
introduced to measure the overall electrical parameters. Between 1970 and 2000, automatic
meter reading was added to electronic meters and it was a great achievement since it could
send the data in near time. However, it could only provide one-way communication. This
limitation was overcome by the introduction of smart meters which can provide two-way
communication. Smart meters can measure all the electrical parameters like electronic meters
and communicate data in a meaningful way. The consumer is updated with details such as
energy consumption, the number of electricity units remaining and other required information.
Before the invention of smart meters, we had the electromechanical meters. Electromechanical
energy meter is the most traditional and widely used energy meter for over a century. It can
measure only the active energy which is typically displayed on a mechanical counter.
Traditional energy meters only provide a cumulative reading, making it difficult for consumers
to track real-time usage and identify energy-heavy appliances. With rising electricity costs and
increasing awareness of environmental sustainability, a smart energy meter system that
provides real-time data can help users monitor their energy consumption patterns, reduce
waste, and cut down on costs.
The use of microcontrollers in electricity metering is gaining ground when it comes to electricity
distribution.
8
This project proposes the development of a Smart Energy Meter that integrates Internet of
Things, prepaid metering, and AI-driven consumption prediction to:
1. Provide real-time energy tracking via a mobile/web app.
2. Use AI to analyze consumption patterns and alert users about high usage.
3. Detect and report electricity theft through automated tamper detection.
4. Allow remote control of appliances to optimize energy efficiency.
By implementing this solution, the project aims to enhance energy accountability, empower
consumers with real-time usage insights, and support Kenya’s efforts in smart energy
management.
9
What is the cost-effectiveness of implementing smart energy meters in Kenyan homes
compared to traditional metering systems?
How can the cost of implementing a Smart Energy Meter solution be minimized for wide-scale
adoption, especially for low-income households?
6. Sustainability and Scalability:
How scalable is the Smart Energy Meter solution in different regions of Kenya, including rural
areas with limited access to the internet or mobile networks?
What are the environmental and economic benefits of using smart energy meters in the
context of Kenya’s push towards sustainable energy management?
7. Policy and Regulatory Impact:
What are the challenges and opportunities for integrating smart energy meters into Kenya’s
current electricity grid and regulatory framework?
How can the government and utility companies encourage the adoption of smart energy meters
among consumers and service providers?
10
ii) Smart meters also help enable better management of energy use, save money, and reduce
emissions.
iii) Bring an end to estimated billing-consumers are only billed for their actual energy use,
helping them to better manage their budget.
iv) Smart meters help with energy consumption measurement and enables us to monitor our
billings.
This project is designed to measure changes in electricity consumption readings over time, this
helps with the calculation of energy usage (KWh). However, voltage is kept at a constant 220v.
This is because the NodeMCU has only one analog pin and as such cannot easily be connected
to both a current and voltage sensor.
This project also allows users to monitor their energy consumption via the accompanying
mobile application. Users can set reminders which include but is not limited to "reminders
notifying users to switch off the light before going to bed". Users are also sent E-mail messages
which notifies them when their average power consumption exceeds the limit that has been set
by them in the mobile application to help ensure power conservation and budgeting of
electricity billing. The load connected to the smart meter is also put off once excess power
consumption is sensed. This is however limited as users do not have the flexibility to remotely
switch on or put off their appliances remotely.
11
CHAPTER TWO
LITERATURE REVIEW
13
some facility, whose function is to set off in case of fire or overheating. Our whole alarm system
will be electronic but the temperature sensor will give analog values at the output after sensing
the temperature. Therefore, convert the varying values of temperature in digital or discrete
values, we have to use an analog to digital converter.
A/D Conversion Process and How ADC works?
Mainly there are two steps for the analog to digital conversion:
1. SH: Sampling and holding.
2. Q/E: Quantizing and Encoding
14
We keep the switch normally open, and when we want to find a measurement, we close the
switch momentarily.
15
This project however improves on this by not only alerting consumers when their available
number of unit is about to finish but also helping them to automatically top-up their credit unit
In another paper by Win Adiyansyah Indra et al titled "GSM-Based Smart Energy Meter with
Arduino Uno" [11]. Users were able to monitor their current power consumption with the help
of SMS alerts. This was made possible by the use if an Arduino Microcontroller and a GSM
module. However, this is not efficient and makes it difficult for users to still be able to monitor
their power consumption should they leave the country or visit an area where their local
service operator does not operate
Here, the smart meter being designed comes along with a mobile application that allows the
user to monitor her power consumption real time from anywhere in the world. This is also cost
effective and updates in real time when compared against an SMS based system.
16
CHAPTER THREE
METHODOLOGY
3.1 MATERIALS
17
7. Software:
Arduino IDE
Flutter
Golang
AI Tools (e.g., Scikit-learn): With Python, you can integrate machine learning models to predict
energy consumption patterns.
8. Additional Accessories:
Smartphone (mobile application)
Jumper Wires, Switches, Breadboard, Resistors, and Capacitors: Basic prototyping materials for
building circuits.
Relay Module: For remotely controlling home appliances based on energy consumption
thresholds.
LCD Display:
The Liquid Crystal library allows you to control LCD displays that are compatible with the Hitachi
HD-4-4780 driver. There are many of them out there, and you can usually tell them by the 16-
pin interface
18
The LCDs have a parallel interface, meaning that the microcontroller has to manipulate several
interface pins at once to control the display. The interface consists of the following
A register select (RS) pin that controls where in the LCD's memory you're writing data to You
can select either the data register, which holds what goes on the screen, or an instruction
register, which is where the LCD's controller looks for instructions on what to do next.
A Read/Write (R/W) pin that selects reading mode or writing mode
An Enable pin that enables writing to the registers
8 data pins (00-07). The states of these pins (high or low) are the bits that you're writing t a
register when you write, or the values you're reading when you read.
There's also a display contrast pin (Vo), power supply pins (+5V and Gnd) and LED Backlight
(Bklt+ and BKlt-) pins that you can use to power the LCD, control the display contrast, and turn
on and off the LED backlight, respectively.
The process of controlling the display involves putting the data that form the image of what you
want to display into the data registers, then putting instructions in the instruction register. The
Liquid Crystal Library simplifies this for you so you don't need to know the low-level instructions
Signal flow:
Once the system is powered on, the ESP8266 NodeMCU creates a connection with the router
(here, my mobile device serves as the router).
The current sensor receives current signal from the load and sends this to the NodeMCU for
sampling.
19
NodeMCU is an open-source Lua based firmware and development board specially targeted for
IoT based Applications. It includes firmware that runs on the ESP8266 Wi-Fi SoC from Espressif
Systems, and hardware which is based on the ESP-12 module
NodeMCU(ESP8266) Development Board Pinout Configuration
20
The ACS712 in a fully integrated, hall effect-based linear current sensor with 2.1kVRMS voltage
isolation and an integrated low-resistance current conductor. Technical terms aside, it is simply
put forth as a current sensor that uses its conductor to calculate and measure the amount of
current applied
The features of ACS712 include:
80kHz bandwith
66 to 185 mV/A output sensitivity
Low-noise analog signal path
Device bandwith is set via the new FILTER pin
Stable output offset voltage.
Near zero magnetic hysteresis
Here's how the ACN712 works:
Current flows through the onboard hall sensor count in its IC
The hall effect sensor detects the incoming current through its magnetic field generation
Once detected, the hall effect sensor generates a voltage proportional to its magnetic field
that's then used to measure the amount of current
ACS712 Current Sensor Applications
The ACS712 IC being able to detect both AC/DC current, it can be used in a wider range of
applications apart from electrical appliances. Be it Arduino other microcontroller usages, or
industrial, commercial, and communications applications
They include:
Motor speed control in motor control circuits
Electrical load detection and management
Switched-mode power supplies (SMPS)
Protection for over-current
21
Buzzer:
A buzzer is a small yet efficient component to add sound features to our project/system. It is
very small and compact 2-pin structure hence can be easily used on breadboard, Perf Board and
even on PCBs which makes this a widely used component in most electronic applications.
There are two types are buzzers that are commonly available. The one shown here is a simple
buzzer which when powered will make a Continuous Beep...sound, the other type is called a
readymade buzzer which will look bulkier than this and will produce a Beeр. Веер. Beep. Sound
due to the internal oscillating circuit present inside it. But, the one shown here is most widely
used because it can be customised with help of other circuits to fit easily in our application.
This buzzer can be used by simply powering it using a DC power supply ranging from 4V to 9V. A
simple 9V battery can also be used, but it is recommended to use a regulated +5V or +6V DC
supply. The buzzer is normally associated with a switching circuit to turn ON or turn OFF the
buzzer at required time and require interval.
Applications of Buzzer
Alarming Circuits, where the user has to be alarmed about something
Communication equipments
Automobile electronics
Portable equipment's, due to its compact size
22
3.3.1: Proteus Circuit Simulation
To validate the Smart Energy Meter design, a Proteus simulation was conducted. The simulation
tested the circuit's behavior, including current and voltage measurement, microcontroller
response, and data transmission via Wi-Fi/GSM.
23
Below is the Proteus simulation of the proposed design:
The simulation successfully demonstrated real-time measurement and IoT data transmission,
confirming that the hardware design functions as expected.
Software is now an integral part of the world. Almost everything runs on software and the
world is becoming more interconnected than ever with the popularization of loT(Internet of
Things) and increased capability for these devices to connect to the Internet. We have
leveraged some of these technologies to build our project.
The Smartvac project is split into two parts. One part is the Arduino hardware that collects
information on the energy used by the appliance. But most of the processing and data.
aggregation happens at the software end. This offloads most of the complex processing burden
from Arduino so that it doesn't require a larger, more expensive processor or memory. The
software consists of an application, an application programming interface and a database. All of
them are hosted and available on the internet.
24
3.4.1: OVERVIEW OF THE MOBILE APPLICATION
The three different parts can operate independently but are connected to create a good
experience. The app, written in the Flutter language, is the part that the user interfaces with. It
is designed to be visually appealing and easy to use. It displays the energy usage and payment
information in a simple format for the user to see. It serves as the front-end of the product.
The Application Programming Interface(API) is the part that the Arduino sends its data to. The
API is the bridge of communication between the front-end, the Arduino hardware and the
database. It is written in Golang
The database stores all the data-users, energy and payment information. It is secured and
access to it is limited as most of the data it holds is sensitive. Long term storage of the data.
enables users to view their usage over various periods of time.
25
Figure7 : Hone Application Programming Interface works
The software that needs to access information (i.e., X hotel room rates for certain dates) or
functionality (i.e., a route from point A to point B on a map based on a user's location) from
another software, calls its Application Programing Interface while specifying the requirements
of how data/functionality must be provided. The other software returns data functionality
requested by the former application.
And the interface by which these two applications communicate is what the Application
Programming Interface specifies. The Red Hat specialists note that Application Programming
Interfaces are sometimes considered contracts, where documentation is an agreement
between the parties: "If a party first sends a remote request structured a particular way, this is
how the second party's software will respond." The Application Programming Interface (APT)
documentation is a manual for developers that includes all necessary information on how to
work with the Application Programming Interface and use the services it provides.
When used in the context of web development, an API is typically defined as a set of
specifications, such as Hypertext Transfer Protocol (HTTP) request messages, along with a
definition of the structure of response messages, usually in an Extensible Markup Language
(XML) or JavaScript Object Notation (JSON) format. An example might be a shipping company
API that can be added to an eCommerce-focused website to facilitate ordering shipping services
and automatically include current shipping rates, without the site developer having to enter the
shipper's rate table into a web database. While "web API" historically has been virtually
synonymous with web service, the recent trend (so-called Web 2.0) has been moving away
26
from Simple Object Access Protocol (SOAP) based web services and service oriented
architecture (SOA) towards more direct representational state transfer (REST) style web
resources and resource-oriented architecture (ROA)
The Smartvac API collects data from various current sensors in JSON format and stores it in a
database. It can do calculations to convert the current/voltage data into a format more
understandable by users. Ideally, the data being received should have an identification number
to associate the data with different users. It also exposes endpoints so that the data can be
pulled by various dashboards to enable users to view usage data over time in the form of
graphs.
Stack/Languages used:
Language: Golang
Golang was the language of choice because Go is a great language for creating simple yet
efficient web servers and web services. It provides a built-in HTTP package that contains utilities
for quickly creating a web or file server.
The API is to be consumed by an app and possibly other platforms.
Endpoints
-[POST]/signup Onboard users into the app
-[POST]-sign in-Login users
-[POST] data-Receive data from various endpoints
-[GET]/data? Query Dashboards hit this endpoint for data
-[POST]/user-Store user data
-[GET]/user/id-Get user data
-[PUT]/user/id-Update user data
-[POST]/pay/:id-Make payment for a particular user
27
-[GET]/history/id-get history of payment for a particular user
3.6: DATABASE
Formally, a "database" refers to a set of related data and the way it is organized. Access to this
data is usually provided by a "database management system" (DBMS) consisting of an
integrated set of computer software that allows users to interact with one or more databases
and provides access to all of the data contained in the database (although restrictions may exist
that limit access to particular data). The DBMS provides various functions that allow entry,
storage and retrieval of large quantities of information and provides ways to manage how that
information is organized.
28
Because of the close relationship between them, the term "database" is often used casually to
refer to both a database and the DBMS used to manipulate it.
Outside the world of professional information technology, the term database is often used to
refer to any collection of related data (such as a spreadsheet or a card index) as size and usage
requirements typically necessitate the use of a database management system.
Existing DBMSs provide various functions that allow management which can be classified into
four main functional groups:
Data definition-Creation, modification and removal of definitions that define the organization
of the data.
Update-Insertion, modification, and deletion of the actual data.
Retrieval-Providing information in a form directly usable or for further processing by other
applications. The retrieved data may be made available in a form basically the same as it is
stored in the database or in a new form obtained by altering or combining existing data from
the database.
Administration- Registering and monitoring users, enforcing data security, monitoring
performance, maintaining data integrity, dealing with concurrency control, and recovering
information that has been corrupted by some event such as an unexpected system failure.
Both a database and its DBMS conform to the principles of a particular database model.
"Database system" refers collectively to the database model, database management system,
and database.
Appendix
29
Appendix A: List of Components
The table below outlines the key components required for the development of the Smart
Energy Meter, along with their specifications and purpose.
The table below lists the software tools used for developing the Smart Energy Meter system.
30
Appendix C: System Architecture
System Architecture
1. Data Collection: Sensors measure voltage and current.
2. Processing: Microcontroller calculates energy usage and detects anomalies.
3. Data Transmission: Wi-Fi/GSM module sends data to a cloud database.
4. User Interface: Mobile app or web dashboard displays real-time usage and allows appliance
control.
5. AI Analysis: Predicts future consumption patterns based on historical data.
31
A timeline for completing the Smart Energy Meter project.
REFERENCES
Below are references that were used to guide the development of the Smart Energy Meter
project, including sources for hardware components, IoT integration, and AI-driven energy
analysis.
32
6. IEEE Xplore (2024). Smart Metering and Energy Management Systems. Retrieved from
https://ieeexplore.ieee.org/
Datasheets and Manufacturer Documentation
7. Espressif Systems (2023). ESP32 Technical Reference Manual. Available at
https://www.espressif.com/en/products/socs/esp32
8. Microchip (2023). ACS712 Current Sensor Datasheet. Retrieved from
https://www.microchip.com/
9. HLW8012 Energy Meter IC Datasheet. Retrieved from https://www.hi-link.com.cn/
Online Learning Platforms
10. Coursera. (2024). IoT and Smart Grid Technologies. Available at https://www.coursera.org/
11. Udemy. (2024). Building IoT Applications with ESP8266/ESP32. Available at
https://www.udemy.com/
33