New Ready File
New Ready File
PAGE NO.
TITLE
List of Figures vi
List of Abbreviations vii
Abstract viii
Chapter –1 Introduction 1
Chapter –2 Literature survey 4
Chapter – 3 Aim and Scope of the present Investigation 5
3.1 Aim 5
3.2 Scope of the present Investigation 5
Chapter –4 Materials and methods 6
4.1 Components used 6
4.1.1 Arduino UNO 6
4.1.2 ESP 12 node MCU module 7
4.1.3 16*2 LCD 8
4.1.4Optocoupler 9
4.1.5 Single channel relay driver 10
4.1.6 Analogue Energy meter 10
4.2 Software used 10
4.2.1 Arduino IDE 10
4.2.2 MQTT Mobile application 11
4.3 Methodology 11
4.3.1 Working principle 11
4.3.2 Block diagram with explanation 12
4.3.3Work flow 13
Chapter –5 Results 14
Chapter –6 Summary and Conclusions 17
References 18
v
Appendix 20
vi
LIST OF FIGURES
SI. No Name Of Figure Page
Number
4.4 Optocoupler 9
vii
LIST OF ABBREVIATIONS
ABBREVIATIONS FULL FORM
EB Electricity Board
viii
ABSTRACT
An important research issue in smart metering is to correctly transfer the smart meter
readings from consumers to the operator within the given time period by consuming
minimum energy. The smart meter is recharged with the help of Esp12E
nodemcumodule. The EB station receives the amount and it enables the smart meter
to provide the electricity to the house. The recharge can be done on the daily basis
and it sends the alert message whenever the consumer exceeds the recharged
days. This method helps to reduce the wastage of electricity. This paper presents a
smart energy meter for an automatic metering and billing system. In this meter,
energy utilized and the corresponding amount will be displayed on the LCD
continuously and communicated to the controlling base station. The feedback from
the user helps in identifying the usages between authorized and unauthorized users
which helps in controlling the power wastage. Esp module is used for sending
messages to the local authorities regarding user power consumptions. This meter
can work as either prepaid meter. The proposed system replaces traditional meter
reading methods and enables remote access of existing energy meter by the energy
provider. Also they can monitor the meter readings regularly without the person
visiting each house. The prototype will be able to introduce the billing system to the
customers, get the power consumption data from smart meter, keep the data in
centralized database and generate the report.
ix
CHAPTER 1
INTRODUCTION
Electricity is one of the vital requirements for sustainment of contents of life. It should
be used very judiciously for its proper utilization. But in our country, we have lot of
locality where we have surplus supply for the electricity while many areas do not
even have access to it. Our policies of its distribution are also partially responsible
for this because we are still not able to correctly estimate our exact requirement and
still power theft is prevailing. On the other hand, consumers are also not satisfied
with the services of power companies. Most of the time they have complaints
regarding statistical errors in the monthly bills. With this we can monitor meter and
track if any fault is there or not. In previous meter a circular metal strip rotates and
according to that rotation we calculate the consumption. But our meter works on
pulse which is obtained with the help of LDR sensor according to consumption and
we previously connected Arduino board which monitor the pulse and according to
pulse the bill is generated. With the help of this project we are aiming to receive the
monthly energy consumption from a remote location directly to centralized office. In
this way we can reduce human efforts needed to record the meter readings which
are till now recorded by visiting every home individually. Smart energy meter is an
electronic device that measures the most accurate amount of electricity consumed
by a residence, business or any electrically-powered device. A smart meter is reliable
source for most accurate information of consumed energy that reduces the chance
of error in the existing billing system to minimal.
The work system adopts a totally new concept of "Prepaid Energy Meter". The WIFI
MODULE is used so that the consumer would receive messages about the
consumption of power (in watts) and if it reaches the minimum amount, it would
automatically alert the consumer to recharge. This technology holds good for all
electricity distribution companies, private communities, IT parks and self-containing
housing projects. The implementation of this project will help in better energy
management, conservation of energy and also in doing away with the unnecessary
hassles over incorrect billing. The automated billing system will keep track of the real
time consumption and will leave little scope for disagreement on consumption and
billing. It is observed that one of the faulty subsystems contributing to the huge
1
revenue loss in Nigerian Power Sector is the metering and billing system. Errors get
introduced at every stage of energy billing, like: errors with electro-mechanical
meters, human errors while noting down the meter reading; and error while
processing the paid bills and the due bills. The remedy for this drawback is a prepaid
energy billing. There are clear results from many countries, where prepaid
system has reduced the revenue loss by a large amount. A WIFImodule based
Energy Recharge Interface which contains a prepaid card equivalent to a mobile SIM
card. The prepaid setup communicates with the power utility using communication
network. Once the prepaid setup is out of balance, the consumer load is
disconnected from the utility supply by the latching Relay (contactor). The power
utility can recharge the prepaid setup remotely through messages base on customer
requests. The results obtained shows good system performance. A prior billing is
bound to do away with the problems of unpaid bills and human error in meter
readings, thereby ensuring justified revenue for the utility.
Smart card is a credit card sized plastic card embedded with an integrated circuit
(IC) and usually it consists of a ROM, EEPROM and a CPU.A smart card provides
both the memory capacity and the computational capability. Access to data stored on
the card is under the control of the smart card operating system. In this method
consumer have to have the smart card recharged for the amount he chooses and
enter the card into the card reader of the energy meter. Then the meter store the
number of units recharged and start to measures the energy consumption. When
purchased units are used up the meter disconnect the power supply until the next
recharge.
2
incorporated into a product, animal, or person for the purpose of identification and
tracking using radio waves. Some tags can be read from several meters away and
beyond the line of sight of the reader. In this method RFID cards which are issued by
the electricity suppliers to individual consumers are used. This RFID card is unique
with a code in it and consumers are free to make flexible recharge. When the
consumer wants to use the system, he needs to show the card to the reader, then
the unique code inside the card is recognized by the reader, and starts deducing the
amount of the RFID card as per the quantized unit charge. When the usage
completes the consumer has to recharge the RFID card again.
• Analog Energy Meter, which is used to measure the flow of electric power from
input to the output terminal.
• LCD Display, which is used for displaying readings of the parameters that are being
measured.
•Esp12E nodemcumoduleis used for communication with the end user and it is
responsible for updating the data on the distribution side.
Problem Statement
• Meter reading and other related tasks like bill payment are performed by a large
number of staff i.e., large number of employees are required.
• An expensive number of staff is utilized for meter reading and other related
assignments like bill payment.
• Billing errors due to carelessness of meter readers during meter reading and
sometime billing estimation.
3
CHAPTER - 2
LITERATURE SURVEY
Ashna, et.al., (2013) has proposed the design of a simple low-cost wireless GSM
energy meter and its associated wave interface, for automating billing and managing
the collected data globally.
Vivek Kumar Sehgal et.al.,(2020) has introduced the concept of Post paid Energy
Meter which automatically sense the energy used in the home and when it reaches
value which is initially fed in the hardware it will disconnect the power line. A user
interface given in the hardware for user which will interact with the hardware, through
user interface user can set a value.
Prajakta et al., (2020) proposed the design and implementation of a GSM based
remote operation of an energy meter which gives the solution to power theft,
consumption control, auto billing and payment, data logging and Manpower
reduction in power distribution and management.
The major disadvantage of the present systems is these systems are post paid base
service, Electricity board gives the service before collecting the payment from the
customers and it is difficult for Electricity board to collect the payable amount from
the customers and at the same Electricity board cannot stop to providing the service.
So there is need of a system service after payment.
4
CHAPTER 3
5
CHAPTER 4
6
• Flash Memory is 32 KB
• SRAM is 2 KB
• EEPROM is 1 KB
7
Fig:4.2- Esp12E nodemcu MODULE
8
Fig:4.3- LCD Output
4.1.4 OPTOCOUPLER
• The 4N35 is an optocoupler for general purpose application. It consists of
gallium arsenide infrared LED and a silicon NPN phototransistor.
• What an optocoupler does is to break the connection between signal source
and signal receiver, so as to stop electrical interference.
• An opto-isolator (also called an optocoupler, photocoupler, or optical isolator)
is an electronic component that transfers electrical signals between two
isolated circuits by using light.
• Opto-isolators prevent high voltages from affecting the system receiving the
signal.
Fig:4.4- Optocoupler
10
buttons for common functions and a series of menus. The open-source Arduino
Software (IDE) makes it easy to write code and upload it to the board. This software
can be used with any Arduino board.
4.3 Methodology
Esp12E
nodemcu
Fig:4.8-Block diagram
The AC source is the mainline which is connected directly to the Analogue energy
meter. From the Energy meter the load line is connected to the load which is nothing
but any electrical appliance which we use. The energy pulse is generated which is
obtained with the help of LDR sensor is given to the Arduino UNO which is
connected to the relay and LCD which has 16*2 Display. The Arduino is also
connected to the ESP12E nodemcu module. This module is responsible for the
wireless transmission between the setup and mobile.
12
4.3.3 Work flow
Fig:4.9Methodology Diagram
Methodology Explanation
When the module is started with the initialization of the Wifi module (Esp12E
nodemcu) and the LCD takes place first. Then it will read the amount of balance
available in the module and check for the balance. A threshold value is set in the
module here for example we have taken a balance greater than 10. If balance is not
greater than 10 it will check another condition if balance is less than 5 or not. If the
balance is less than 5 then the power will shut automatically. If the balance is less
than 10 and greater than 5 the setup will send an alert message to the user via the
Esp12E nodemcu module. If balance is greater than 10 the relay will turn ON and
units of electricity consumed so far and the balance will be shown on the LCD
screen. If want the user can send a new message to the setup and add the amount
recharged to the balance, if not the process will continue.
13
CHAPTER –5
RESULTS
Initialization of the setup –The LCD displays the Monitoring setup has
started.
Initially the Energy units consumed is zero is displayed on the LCD and
the initial balance is taken as 20. Here we have considered one unit is
equal to one blink on energy meter and one unit costs 2 which is
displayed.
14
Fig : 5.3 Low Balance displayed in LCD Fig : 5.4 Low balance alert in
mobile
When the Balance is below 5 it will send an alert message to the user
through a cloud based application called MQTT. This will let the user to
decide whether to recharge or not.
If the user decides not to recharge the power will automatically shut
down here leaving the bulb OFF and showing the user the so far
consumed power.
15
Fig : 5.6 Recharged amount is added
16
CHAPTER 6
17
REFERENCES
[1] Bharathy D, DhivyaC, Monisha A, Rathipriya S, Sikkandhar Batcha J- Smart
Energy Meter Monitoring over IOT- International Journal for Modern
Trends in Science and Technology (IJMTST)- Vol.06, Issue 06 -June 2020
- page no.[520-523]
[2] Manisha Tejwani, Prachi Rane, Moin Syed, Oyesh Patel, Pragyan Pandey -
Iot Based Smart Energy Meter Monitoring and Billing System- International
Journal of Innovative Technology and Exploring Engineering (IJITEE)-
Vol.9 ,Issue 06 - April 2020 -page no.[1480-1483]
[4] Nitesh D.Bhavsar, Mansi D.Mahajan, Omkar V.Joshi, D.Y. Thorat- IoT Based
Prepaid Energy Meter-International journal of research and
technology(IJRT)- Vol.4 ,Issue 3, 2019- page no.[16-18]
[6] Rishabh Jain ,Sharvi Gupta , Chirag Mahajan , Ashish Chauhan- IOT based
Smart Energy Meter Monitoring and Controlling System- International
Journal of Research in Electronics and Computer Engineering (IJRECE)
- Vol. 7 ,Issue 2 , 2019- page no.[1600-1604]
[11] https://github.com
[12] https://randomnerdtutorials.com/guide-for-relay-module-with-arduino/
[13] https://www.ieee.org
[14] https://www.instructables.com/id/GSM-SIM900A-With-Arduino/
[15] https://circuitdigest.com
[16] https://www.arduino.cc/en/guide/environment
[17] https://iot-analytics.com/10-internet-of-things-applications/
19
APPENDIX
Code for Arduino
/*
Reads an analog input pin, maps the result to a range from 0 to 255 and uses
the result to set the pulse width modulation (PWM) of an output pin.
The circuit:
by Tom Igoe
http://www.arduino.cc/en/Tutorial/AnalogInOutSerial
*/
// These constants won't change. They're used to give names to the pins used:
#include <LiquidCrystal.h>
const int analogInPin = A0; // Analog input pin that the potentiometer is attached to
char input[5];
20
void setup() {
Serial.begin(9600);
pinMode(5, OUTPUT);
digitalWrite(5, HIGH);
lcd.begin(16, 2);
delay(1000);
lcd.setCursor(0, 0);
lcd.setCursor(0, 1);
delay(5000);
lcd.setCursor(0, 0);
lcd.print(" ");
lcd.setCursor(0, 1);
lcd.print(" ");
lcd.setCursor(0, 0);
lcd.print("USED POWER:");
lcd.setCursor(0, 1);
lcd.print("BALANCE :");
delay(5000);
21
TCCR1B |= (1 << CS12) | (1 << CS10);
sei();//allow interrupts
void loop() {
sensorValue = analogRead(analogInPin);
// Serial.print("sensor = ");
// Serial.println(sensorValue);
timer++;
if(timer >= 2)
timer = 2;
flag = 1;
if(flag == 1)
used_power++;
remaining_balance = remaining_balance - 2;
// Serial.println("*");
sensorValue_previous = sensorValue;
delay(100);
22
ISR(TIMER1_COMPA_vect)
if(Serial.available() > 0 )
// Serial.println("success");
char a = Serial.read();
if(a == '*')
balance_flag = 1;
send_flag = 0;
if(balance_flag == 1)
// Serial.println("success");
balance_flag = 0;
send_flag = 1;
if(send_flag == 1)
Serial.println('1');
// Serial.println('#');
if(remaining_balance<= 1)
digitalWrite(5, LOW);
else if(remaining_balance> 1)
digitalWrite(5, HIGH);
23
lcd.setCursor(12, 0);
lcd.print(" ");
lcd.setCursor(12, 0);
lcd.print(used_power);
lcd.setCursor(12, 1);
lcd.print(" ");
lcd.setCursor(12, 1);
lcd.print(remaining_balance);
#include <PubSubClient.h> // Allows us to connect to, and publish to the MQTT broker
const int ledPin = 2; // This code uses the built-in led for visual feedback that the button has been pressed
// WiFi
// MQTT
// The client id identifies the ESP8266 device. Think of it a bit like a hostname (Or just a name, like Greg).
String no_of_sensor, data, sensor, sensor1, sensor2, sensor3, sensor4, sensor5, sensor6;
24
char char_data[50], string[50], lpm1[10], con1[10], alert[10], Date[10], live_usage[10];
char automation;
char time_value[50];
String time_data;
WiFiClientwifiClient;
PubSubClientclient(mqtt_server, 1883, wifiClient); // 1883 is the listener port for the Broker
Serial.print((char)payload[0]);
// flag = 0;
bool Connect() {
if (client.connect(clientID)) {
client.subscribe(mqtt_topic);
return true;
else {
return false;
void setup() {
pinMode(ledPin, OUTPUT);
// pinMode(buttonPin, INPUT);
digitalWrite(ledPin, HIGH);
delay(1000);
digitalWrite(ledPin, LOW);
delay(1000);
25
digitalWrite(ledPin, HIGH);
// bouncer.attach(buttonPin);
// bouncer.interval(5);
Serial.begin(9600);
Serial.print("Connecting to ");
Serial.println(ssid);
WiFi.begin(ssid, wifi_password);
delay(500);
Serial.print(".");
Serial.println("WiFi connected");
Serial.println(WiFi.localIP());
// client.connect returns a boolean value to let us know if the connection was successful.
// If the connection is failing, make sure you are using the correct MQTT Username and Password (Setup Earlier
in the Instructable)
client.setCallback(ReceivedMessage);
if (client.connect(clientID)) {
else {
if (Connect()) {
26
else {
Serial.println("Connection Failed!");
int found = 0;
found++;
strIndex[0] = strIndex[1] + 1;
strIndex[1] = (i == maxIndex) ? i + 1 : i;
void loop()
if (!client.connected()) {
Connect();
// client.loop() just tells the MQTT client code to do what it needs to do itself (i.e. check for messages, etc.)
client.loop();
if (Serial.available() > 0)
char a = Serial.read();
if(a == '1')
27
// flag = 1;
client.connect(clientID);
delay(100); // This delay ensures that client.publish doesn't clash with the client.connect call
// Serial.println("published data");
// flag = 2;
delay(100);
28