Iot Based Prepaid Smart Metering System
Iot Based Prepaid Smart Metering System
METERING SYSTEM
By
Soumyadeep Mukherjee(11701616024)
Debjyoti Dey(11701616059)
Disha Ghosh (11701617016)
Sourav Saha(11701617003)
1
Department of Electrical Engineering
RCC INSTITUTE OF INFORMATION TECHNOLOGY
GROUND FLOOR, NEW
BUILDING, CANAL SOUTH ROAD, BELIAGHATA,
KOLKATA – 700015, WEST BENGAL
PHONE: 033-2323-2463-154, FAX: 033-2323-4668
Email: [email protected], Website: http://www.rcciit.org/academic/ee.aspx
CERTIFICATE
To whom it may concern
This is to certify that the project work entitled IOT Based Prepaid Smart metering
system is the bona fide work carried out by Soumyadeep Mukherjee
(11701616024), Debjyoti Dey (11701616059), Disha Ghosh(11701617016) &
Sourav Saha (11701617003) , a student of B.Tech in the Dept. of Electrical Engi-
neering, RCC Institute of Information Technology (RCCIIT), Canal South Road,
Be- liaghata, Kolkata-700015, affiliated to Maulana Abul Kalam Azad University
of Technology (MAKAUT), West Bengal, India, during the academic year 2016-17,
in partial fulfilment of the requirements for the degree of Bachelor of Technology in
Electrical Engineering and that this project has not submitted previously for the
award of any other degree, diploma and fellowship.
__________________ ___________________
Signature of the Guide. Signature of the HOD
Name: Name:
Designation: Designation:
_____________________
Signature of the External Examiner
Name:
Designation:
2
ACKNOWLEDGEMENT
It is our great fortune that we have got opportunity to carry out this project work
under the supervision of Mr. Sarbojit Mukherjee in the Department of Electrical
Engineering, RCC Institute of Information Technology (RCCIIT), Canal South
Road, Beliaghata, Kolkata-700015, affiliated to Maulana Abul Kalam Azad
University of Technology (MAKAUT), West Bengal, India. We express our sincere
thanks and deepest sense of gratitude to our guide for his constant support,
unparalleled guidance and limitless encouragement.
We would also like to convey our gratitude to all the faculty members and
staffs of the Department of Electrical Engineering, RCCIIT for their whole hearted
cooperation to make this work turn into reality.
We are very thankful to our Department and to the authority of RCCIIT for
providing all kinds of infrastructural facility towards the research work.
3
To
The Head of the Department
Department of Electrical Engineering
RCC Institute of Information Technology
Canal South Rd.
Beliagahata, Kolkata-700015
Respected Sir,
We declare that the thesis submitted is our own, expected as acknowledge in the test
and reference and has not been previously submitted for a degree in any other
Institution.
Yours Sincerely,
4
TABLE OF CONTENTS
List of Figures 7
List of Acronyms 8
Abstract 9
1. Introduction 10-13
4. Theory 18-24
7. References 40-41
5
LIST OF TABLES
SL.NO TABLE NAME PAGE NUMBER
1 LIST OF COMPONENT 30
2 COST ESTIMATION 31
6
LIST OF FIGURES
1 BLOCK DIAGRAM 13
2 ARDUINO UNO 19
3 INTERFACING OF SIM900 WITH ARDUINO UNO 22
4 SAMPLE CODE FOR SIM900 INTERFACING 22
5 INTERFACING LCD WITH ARDUINO UNO 24
6 SAMPLE CODE FOR INTERFACING LCD WITH ARDUINO 24
7 WORKING OF PROTTYPE 26
8 PHOTOGRAPH OF PROTOTYPE 27
9 INITIALISATION OF LCD AND GSM 28
10 READING OF PULSE 28
11 FINDING MODULE 29
12 CHECKING STATUS 29
13 READING PULSE 30
14 FLOW DIAGRAM 33
15 CIRCUIT DIAGRAM 35
16 SYSTEM INITIALIZING 37
17 MODULE CONNECTION ESTABLISHED 37
18 NETWORK ESTABLISHED 37
19 READING OF ENERGY METER 37
20 LCD PIN OUT 49
21 ULN 2003 PIN CONFIGURATION 49
22 4N35 PIN CONFIGURATION 50
23 STATIC ENERGY METER 52
24 RESISTOR COLOUR CODE 53
25 RELAY 54
7
ABBREVIATIONS AND ACRONYMS
8
ABSTRACT
9
CHAPTER 1
(Introduction)
10
INTRODUCTION:
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 created according to
consumption and we previously connected an- droid 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.
EXISTING PREPAID METERING TECHNOLOGIES:
• SMART CARD based prepaid Energy Meters: 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 [5]. 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
11
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.
PROBLEM STATEMENT
As we mentioned above several advantages of digital energy meters, but always
there are chances of innovation or modification in different instruments for ease
of consumer and supplier. Following are some problems observed in those
energy meters which should be rectified:
12
• 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.
BLOCK DIAGRAM:
13
CHAPTER 2
(Literature Survey)
14
LITERATURE SURVEY:
15
CHAPTER 3
(Proposed System)
16
PROPOSED SYSTEM:
T his mechanism requires the consumers to pay for the electricity before its
consumption. On that way, users hold credit and then use the electricity until the
credit is ended. If the available credit is ended then the electricity supply is cut-
off by a relay. Readings made by operators are prone to errors. This project
shows the above mentioned problems. These system will first register the user.
For making recharge the consumer must have to login to the system. The
username and password must create to login then it will check for the user is
valid or not through server. It can able to recharge through user phone app only
if the user is authorized user. As recharge ends it will cut off the electricity.
17
CHAPTER 4
(Theory)
18
THEORY:
Power (Barrel Jack): Arduino boards can be powered directly from the AC
mains power supply by connecting it to the Barrel Jack (2).
4Crystal Oscillator: The crystal oscillator helps Arduino in dealing with time
issues. How does Arduino calculate time? The answer is, by using the crystal
oscillator. The number printed on top of the Arduino crystal is 16.000H9H. It
tells us that the frequency is 16,000,000 Hertz or 16 MHz
19
5,17Arduino Reset: You can reset your Arduino board, i.e., start your program
from the beginning. You can reset the UNO board in two ways. First, by using
the reset button (17) on the board. Second, you can connect an external reset
button to the Arduino pin labelled RESET (5).
Analog pins: The Arduino UNO board has six analog input pins A0 through
A5. These pins can read the signal from an analog sensor like the humidity
sensor or temperature sensor and convert it into a digital value that can be read
by the microprocessor.
Main microcontroller: Each Arduino board has its own microcontroller (11).
You can assume it as the brain of your board. The main IC (integrated circuit)
on the Arduino is slightly different from board to board. The microcontrollers
are usually of the ATMEL Company. You must know what IC your board has
before loading up a new program from the Arduino IDE. This information is
available on the top of the IC. For more details about the IC construction and
functions, you can refer to the data sheet.
ICSP pin: Mostly, ICSP (12) is an AVR, a tiny programming header for the
Arduino consisting of MOSI, MISO, SCK, RESET, VCC, and GND. It is often
referred to as an SPI (Serial Peripheral Interface), which could be considered
20
as an "expansion" of the output. Actually, you are slaving the output device to
the master of the SPI bus.
Power LED indicator: This LED should light up when you plug your Arduino
into a power source to indicate that your board is powered up correctly. If this
light does not turn on, then there is something wrong with the connection.
TX and RX LEDs: On your board, you will find two labels: TX (transmit) and
RX (receive). They appear in two places on the Arduino UNO board. First, at
the digital pins 0 and 1, to indicate the pins responsible for serial
communication. Second, the TX and RX led (13). The TX led flashes with
different speed while sending the serial data. The speed of flashing depends on
the baud rate used by the board. RX flashes during the receiving process.
Digital I/O: The Arduino UNO board has 14 digital I/O pins (15) (of which 6
provide PWM (Pulse Width Modulation) output. These pins can be configured
to work as input digital pins to read logic values (0 or 1) or as digital output
pins to drive different modules like LEDs, relays, etc. The pins labelled “~”
can be used to generate PWM.
21
FIG 3. INTERFACING OF SIM900 WITH ARDUINO UNO
22
Basic AT Command
1. To change sms sending mode : AT+CMGF=1
mySerial.println("AT+CMGF=1");
mySerial.println("AT+CNMI=2,2,0,0,0");
mySerial.println("ATD+91XXXXXXXXX;");
mySerial.println("ATH");
5. To redial : ATDL
mySerial.println("ATDL");
mySerial.println("ATA");
23
INTERFACING OF 16x2 LCD WITH ARDUINO:
At first we connect the LCD with Arduino according to the circuit diagram
given below:
24
CHAPTER5
(Hardware Modelling)
25
Main features of the prototype
The features of the developed prototype are:
• LCD display (showing the unit and balance)
• Communication between user and provider
• 5 Volt operation (both control board and ON & OFF relay)
• Prepaid recharge of energy meter.
• Intimation for low balance.
• Power cut occur if there is insufficient balance
• Cost effective (Rs 1110/- approx.)
RELAY
16 X 2 LCD
LOAD
MOBILE FOR
COMMUNICATION
FIG 7 . WORKING OF PROTTYPE
26
PROJECT LAYOUT:
PROJECT
MODULE
HARDWARE SOFTWARE
PHOTOGRAPH OF PROTOTYPE:
27
PROGRAMMING EXPLANATION:
First of all we include required library and Define pins & variables that are
required in our project. This can be seen in first few lines of our program code
below.
After it we initialize the LCD, serial communication, GSM and display some
message.
After this in loop function we read serial received data if any. And reads pulse
from energy meter and show units and balance on LCD.
Reads pulse from energy meter and show units and balance on LCD.
gsm_init() function is used for initializing the GSM module for get ready to
operate with the system. In this we first sends AT command to know whether
GSM module is connected or not. After it we turned off the echo and then check
the network.
29
send_confirmaiton_sms() function is used for sending confirmation message to
the user if recharge has been done and it also update the balance in the system.
decode_message() function is used for decoding the amount figure from the
SMS message, by using the # and * as starting and ending character.
read_pulse() function is used for reading pulse from the Energy meter through
optocoupler IC. And update the unit and balance.
COMPONENTS REQUIRED:
30
11. LED red 2
12. LCD 1
13. 6pin IC base 1
14. 16 pin IC base 1
15. Female header 1
31
Chapter 6
(Logic and operation)
32
FLOW DIAGRAM:
WORKING PRINCIPLE:
This model has the Arduino UNO as CPU. The entire system is interfaced with
Arduino UNO. The GSM modem is serially connected with the controller which
is used as communication module between User and provider. The GSM uses its
own network for the transfer of data. Special coding in Arduino is used for
programming AT89S51 microcontroller. The relay is used as switching device
to cut off and restore power supply. The LCD is interfaced to microcontroller
using parallel connection. In this project the Microcontroller based system
continuously measures the readings and the current meter reading can be sent to
the Electricity department on request. This system also can be used to cut off the
power supply to the house in case of non-payment of electricity bills. This GSM
modem with SIM card is essential for each energy meter.
33
FLOW CHART:
34
CIRCUIT DIAGRAM: Energy
Relay Driver Meter
Relay
16x2 LCD
Optocoupler
Arduino
UNO SIM GSM
900
35
CHAPTER 7
(OBSERVATION AND RESULTS)
36
OBSERVATIONS AND RESULTS:
37
CHAPTER 8
(CONCLUSION AND FUTURE SCOPE)
38
CONCLUSIONS:
1. By using this project, we can reduce the manual effort to take the reading
from the energy meter which is cost effective.
3. Encourage clients to opt for prepaid meters on a voluntary basis and offering
tariff or non-tariff incentives to those users who prepaid their power
changes would help the utilities to execute this system.
FUTURE SCOPE:
This is 21st century and there is no space for errors or faults either in any technical
system or in general applications. Prepaid energy meter is a beneficial concept
for the future. It’s facilitates the remission from electricity bills. Electricity
vouchers will be available at nearby shops. The word prepaid means “pay before
use” one of the beneficial feature of this concept prepaid energy meter is used to
prepaid the current supply of electricity to homes, offices etc.
39
CHAPTER 9
(REFERENCE)
40
REFERENCES:
• https://github.com
• https://randomnerdtutorials.com/guide-for-relay-module-with-arduino/
• https://www.ieee.org
• https://www.instructables.com/id/GSM-SIM900A-With-Arduino/
• International Journal of Advanced Computer Science and Applications:
Modelling of Arduino-based Prepaid Energy Meter using GSM
Technology
• https://circuitdigest.com
• https://www.arduino.cc/en/guide/environment
• https://iot-analytics.com/10-internet-of-things-applications/
• E. I. Abbas, M. E. Safi and M. A. Jaber, "Design and Implementation
Prepaid Energy Meter Supported by RFID and GSM Technologies," 2018
International Conference on Advanced Science and Engineering
(ICOASE), Duhok, 2018, pp. 216-220, doi:
10.1109/ICOASE.2018.8548870.
• Shanaka Lakmal, Isuru & Rodrigo, Asanka. (2016). A Prepaid Energy
Meter Using GPRS/GSM Technology For Improved Metering And
Billing.
• Surajudeen-Bakinde, Nazmat & AYODELE, Sunday & Oloruntoba,
Timilehin & Otuoze, Abdulrahaman & Faruk, Nasir. (2017). Development
of an Internet Based Prepaid Energy Meter.
10.1109/AFRCON.2017.8095681.
• N. Mohammad, A. Barua and M. A. Arafat, "A smart prepaid energy
metering system to control electricity theft," 2013 International Conference
on Power, Energy and Control (ICPEC), Sri Rangalatchum Dindigul, 2013,
pp. 562-565, doi: 10.1109/ICPEC.2013.6527721.
41
APPENDIX A
(HARDWARE DESCRIPTION)
42
APPENDIX A
Arduino UNO:
The Arduino Uno is an open-source microcontroller board based on
the Microchip ATmega328P microcontroller and developed by Arduino.cc. The
board is equipped with sets of digital and analog input/output (I/O) pins that may
be interfaced to various expansion boards (shields) and other circuits. The board
has 14 digital I/O pins (six capable of PWM output), 6 analog I/O pins, and is
programmable with the Arduino IDE (Integrated Development Environment),
via a type B USB cable. It can be powered by the USB cable or by an external 9-
volt battery, though it accepts voltages between 7 and 20 volts.
43
PIN DESCRIPTION:
Pin Pin name Description Secondary Function
No.
1 PC6 (RESET) Pin6 of PORTC Pin by default is used as RESET pin. PC6
can only be used as I/O pin when
RSTDISBL Fuse is programmed.
2 PD0 (RXD) Pin0 of PORTD RXD (Data Input Pin for USART)
USART Serial Communication Interface
[Can be used for programming]
3 PD1 (TXD) Pin1 of PORTD TXD (Data Output Pin for USART)
USART Serial Communication Interface
[Can be used for programming]
44
9 PB6 Pin6 of PORTB XTAL1 (Chip Clock Oscillator pin 1 or
(XTAL1/TOSC1)
External clock input)TOSC1
(Timer Oscillator pin 1)
16 PB2 (SS/OC1B) Pin2 of PORTB SS (SPI Slave Select Input). This pin is
Low when controller acts as slave.
[Serial Peripheral Interface (SPI) for
programming] OC1B (Timer/Counter1
45
Output Compare Match B Output)
19 PB5 (SCK) Pin5 of PORTB SCK (SPI Bus Serial Clock). This is the
Clock shared between this controller and
other system for accurate data transfer.
[Serial Peripheral Interface (SPI) for
programming]
22 GND GROUND
46
25 PC2 (ADC2) Pin2 of PORTC ADC2 (ADC Input Channel 2)
Features:
• SIM900 is designed with a very powerful single-
chip processor integrating AMR926EJ-S core
• Quad - band GSM/GPRS module with a size of 24mmx24mmx3mm
• SMT type suit for customer application
• An embedded Powerful TCP/IP protocol stack
• Based upon mature and field-proven platform, backed up by our
support service, from definition to design and production
47
16X2 LCD:
An LCD (Liquid Crystal Display) screen is an electronic display module and has
a wide range of applications. A 16x2 LCD display is very basic module and is
very commonly used in various devices and circuits. A 16x2 LCD means it can
display 16 characters per line and there are 2 such lines. In this LCD each
character is displayed in 5x7 pixel matrix. The 16 x 2 intelligent alphanumeric
dot matrix display is capable of displaying 224 different characters and symbols.
This LCD has two registers, namely, Command and Data.
Command register stores various commands given to the display. Data register
stores data to be displayed. 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. In your Arduino
project Liquid Crystal Library simplifies this for you so you don't need to know
the low-level instructions. Contrast of the display can be adjusted by adjusting
the potentiometer to be connected across VEE pin.
Features :
§ Operating Voltage is 4.7V to 5.3V
§ Current consumption is 1mA without backlight
§ Alphanumeric LCD display module, meaning can display
alphabets and numbers
§ Consists of two rows and each row can print 16 characters.
§ Each character is built by a 5×8 pixel box
§ Can work on both 8-bit and 4-bit mode
§ It can also display any custom generated characters
48
LCD PIN OUT:
ULN2003:
It is basically a relay driver IC and it is a Darlington array having high voltages
and high currents as well. It is made up of seven open collector Darlington pairs
having common emitter which shows ULN2003 has a capability of handling
seven different relays at a time. A single Darlington pair consists of two bipolar
transistors and operates in the range of 500mA to 600mA current.
PIN CONFIGURATION:
49
PIN DESCRIPTION:
4N35 OPTOCOUPLER:
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.
PIN CONFIGURATION:
50
PIN DESCRIPTION:
FEATURES:
• Reverse current & earth load tampering protection.
waveforms.
• Sealed electromagnetic impulse counter for additional security.
51
• Resistant to heat, fire and dust as per IP-51.
RESISTORS:
A resistor is a passive two-terminal electrical component that
implements electrical resistance as a circuit element. In electronic circuits,
resistors are used to reduce current flow, adjust signal levels, to divide
voltages, bias active elements, and terminate transmission lines, among other
uses. High-power resistors that can dissipate many watts of electrical power as
heat, may be used as part of motor controls, in power distribution systems, or as
test loads for generators. Fixed resistors have resistances that only change
slightly with temperature, time or operating voltage. Variable resistors can be
used to adjust circuit elements (such as a volume control or a lamp dimmer), or
as sensing devices for heat, light, humidity, force, or chemical activity.
52
COLOUR CODE OF RESISTORS:
53
RELAY:
Relays are the switches which aim at closing and opening the circuits
electronically as well as electromechanically. It controls the opening and closing
of the circuit contacts of an electronic circuit. When the relay contact is open
(NO), the relay isn't energize with the open contact.
The relay’s switch connections are usually labelled COM (POLE), NC and NO:
COM/POLE= Common,
NC and NO always connect to this, it is the moving part of the switch.
NC = Normally Closed,
COM/POLE is connected to this when the relay coil is not magnetized.
NO = Normally Open,
COM/POLE is connected to this when the relay coil is MAGNETIZED and vice
versa.
54
APPENDIX B
(DATASHEET)
55
DATASHEET OF ARDUINO UNO:
56
57
58
59
60
61
62
63
64
65
66
67
68
DATASHEET OF ULN2003:
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
DATASHEET OF 4N35:
91
92
93
94
95
96
97
98
DATASHEET OF SIM900:
99
ENERGY METER:
Specifications
A. Electrical
I. Supply Voltage
II. Current
III. Power
B. Other
Accuracy Class 2
Creep Nil
100