PROJECT TITLE
Submitted By
Name
ID #
Name
ID #
Submitted in partial fulfillment of the requirement for the Certificate
IV in Electronics Engineering / Biomedical Engineering,
to
SCHOOL OF ELECTRICAL & ELECTRONIC ENGINEERING
FIJI NATIONAL UNIVERSITY
FIJI ISLAND
2020
DECLARATION
i
I hereby declare that this submission is my own work and that, to the best of my knowledge and
belief, it contains no material previously published or written by another person nor material
which to a substantial extent has been accepted for the award of any other degree or diploma of
the university or other institute of higher learning, except where due acknowledgment has been
made in the text.
Signature: ______________
Name:
ID No:
Date:
ACKNOWLEDGEMENT
ii
It gives me a great sense of pleasure to present the report of EEC405 Final Project I have
undertaken during Certificate IV in Electronics Engineering in the final stage of the programme.
I owe special debt of gratitude to Mr. XXX, School of Electrical & Electronics Engineering,
CEST, FNU for his constant support and guidance throughout the course of my work. His
sincerity, thoroughness and perseverance have been a constant source of inspiration for us. It is
only his cognizant efforts that my endeavors have seen light of the day.
I also do not like to miss the opportunity to acknowledge the Final Project Coordinator, Mr.
Nauneet Menon, and the contribution of all faculty members of the department for their kind
assistance and cooperation during the development of our project. Last but not the least, I
acknowledge my friends for their contribution in the completion of the project.
iii
ABSTRACT
iv
TABLE OF CONTENTS
CHAPTER 1 INTRODUCTION.................................................................................................1
1.1 Background Study.............................................................................................................2
1.1.1 Evolution of Electricity & Water Meters...................................................................2
1.1.2 Traditional Electricity Meters....................................................................................3
1.1.3 Traditional Water Meters...........................................................................................4
1.1.4 Smart Meters..............................................................................................................5
1.2 Problem Definition............................................................................................................6
CHAPTER 2 DESIGN AND IMPLEMENTATION...................................................................7
2.1 Aim and Objectives...........................................................................................................7
2.2 Methodology.....................................................................................................................8
2.3 Overview...........................................................................................................................8
2.3.1 Features....................................................................................................................10
2.4 Software..........................................................................................................................11
2.5 Hardware.........................................................................................................................14
2.5.1 Single Phase Two Wire Energy Meter....................................................................14
2.5.2 Water Meter.............................................................................................................15
2.5.3 Sensors.....................................................................................................................16
2.5.4 PIC Microcontroller (PIC16F877)...........................................................................17
2.5.5 Real Time Clock Module (DS1307)........................................................................18
2.5.6 GSM Module...........................................................................................................20
2.5.7 Keypad.....................................................................................................................21
2.5.8 Liquid Crystal Display.............................................................................................22
2.6 Circuit Design.................................................................................................................23
1
2.6.1 Interfacing Utility Meters with PIC.........................................................................23
2.6.2 Interfacing the GSM Module with the PIC16F877.................................................24
2.6.3 Interfacing the LCD and Keypad with PIC16F877.................................................24
2.6.4 Interfacing the RTC Module with PIC16F877........................................................25
CHAPTER 3 RESULTS AND DISCUSSION..........................................................................27
3.1 Electricity Tariffs and Rates................................................................................................27
3.2 Calculating Your Bill...........................................................................................................27
3.2.1 Tariff charged to Domestic Customers – No Government subsidy..............................27
3.2.2 Tariff charged to Domestic Customers – Government subsidy....................................28
3.3 Derived Formulas’..........................................................................................................29
Energy Usage Calculation.....................................................................................................29
Bill Calculation......................................................................................................................29
CHAPTER 4 CONCLUSION....................................................................................................31
2
CHAPTER 1 INTRODUCTION
1.1 Background Study
1.1.1
1.1.2 T
1
CHAPTER 2 DESIGN AND IMPLEMENTATION
2.1 Aim and Objectives
The purpose of this project is the monitoring and control of the domestic Water and Electricity
Meter. This system enables the consumer to know the billing of their water/electricity
consumption at any time and without the utility department personnel to visit households to read
the meter readings. The consumed water/electricity reading and the amount charged over it is
displayed on a LCD screen. The monthly cost of usage is sent to the consumer via SMS message
at the end of the month. This lets the user know about his exact water/electricity units consumed
and cost directly from his mobile phone. The related objectives are as follows:
Objectives:
To design a circuit to interface voltage and current sensor to the PIC microcontroller for
electricity measurement.
To interface a flow sensor for water usage measurement.
Interface the GSM Module to the PIC microcontroller for communication from the smart
meter to the customer and utility provider.
Interface Keypad, RTC Module and LCD to PIC16F877.
Program the PIC microcontroller as per the specification and features of the system.
Develop the hardware prototype of the project.
Calibrate and test the system to work as per the specifications of the project.
Present the design of the Smart Utility Meter.
2
2.2 Methodology
The methodology strategies involved in my project to its completion is as follows;
General research on the available Smart Utility Meters. Check out the traditional meters
currently installed and work on improving the current ones with user friendly features.
Design circuits of the project. The voltage and current sensor circuits for energy usage
measurement and the flow sensor circuit for water usage measurement will be tested
separately before connecting to the final circuit. The keypad and the lcd circuit will be
designed and tested. GSM circuit will also be tested. Finally, all these circuits will be
combined and connected as a final circuit and tested out.
Program and simulate the project. Each section was simulated separately before they
were all simulated together. Proteus software is used to write the C program and simulate
the microcontroller circuits.
Debug errors in the software part of the project.
Final testing of the Smart Utility Meter.
2.3 Overview
With a view to least affect the customers of Fiji with their existing utility meters during the
implementation of this smart meter, sensors are to be used with the existing meters. It is aimed at
not disturbing or removing the existing water and energy meters, but sensors to be installed and
consumption recorded in the smart meters. Thus, this project consists of three different sensors
interfaced with a PIC microcontroller for the measurement of energy and water consumed.
Voltage and current sensors are used to measure the energy usage to calculate the power
consumed. Water flow sensor is used to determine the flow rate and thus water volume
consumed. The system continuously monitors the water and energy consumption and calculates
the units consumed for each utility. The system then uses the cost of each unit consumed to
calculate the water and electricity cost.
3
At the end of each month, the total utility usage for both water and electricity together with the
cost of usage which is the total bill for the month, is sent to the respective utility providers. This
is done with the use of the GSM Module (SIM 900) which will be interfaced with the
microcontroller.
RTC Module and Keypad are interfaced with the system for viewing of real time previous
months’ billings. Keypad is used for entering of numerical data while setting the date and time,
setting the tariff rate and VAT, and to check previous month’s usage and bill. The utility usage
for the month and the cost is saved in the memory of the RTC Module. The system stores up to
12 months of data and the consumer will be able to monitor their electricity usage for the whole
year.
The system also has an in-home built-in display unit that would show the real time utility usage
and the cost of each on the screen. As the utilities are consumed, the display is updated with the
usage and the cost. This allows the consumer to monitor their daily usage.
A detailed diagram of the proposed system is shown below.
4
Figure 2.0 – Detailed proposed system operation
An overall block diagram of the proposed system is shown in Fig. 2.1.
OPTICAL ENCODER WATER METER
PULSES PULSES
PIC
4x4
MICROCONTROLLER LCD
KEYPAD
(PIC16F877)
RTC GSM
MODULE 5 MODULE
Figure 2.1 - Block diagram of the proposed system
2.3.1 Features
The Smart Utility Meter has the following user friendly features;
Gives real time utility usage for both water and electricity and their cost.
Autonomous meter reading. Sends monthly reading to customer and the service provider.
Consumer is able to keep track of the utility usage and bill.
Consumer is able to view past month’s usage and bill and monitor their usage.
It has an option for setting the date and time.
Set the VAT and the utility tariff rates as and when reviewed by the utility providers.
2.4 Software
START
Enter Date
& Time
Set Date
& Time
Read Pulses for
Water & Electricity
Calculate
Units &6 Bill
Display
Usage & Bill
No If End of
Month
Yes
(Continued next page)
Send SMS of Unit Usage
& Bill to Customer &
Utility Provider
Reset Units
& Bill
MODE No
Pressed?
Yes
7
Select
Option
“1”
No
is
Selected?
“2” Yes
No
is
Selected? Display Time
& Date
Yes
(Continued next page)
“3”
No Set Time
is
& Date
Selected?
Yes
Enter Time
Set Tariffs & Date
& VAT
Enter Tariff
& VAT
END
8
Figure 2.2 – System flow chart showing mechanism of operation for the Smart Utility
Meter
2.5 Hardware
Major components used in the design of the Smart Utility Meter are as follows:
Optical Encoder
Flow Sensor
PIC Microcontroller
GSM Module
Real Time Clock Module
Keypad
20x4 Liquid Crystal Display
2.5.1 Single Phase Two Wire Energy Meter
The most common type of energy meter used in the Fijian households is the electromechanical
induction watt-hour meter. The electromechanical meter operates by counting the revolutions of
a non-magnetic, but electrically conductive, metal disc which is made to rotate at a speed
9
proportional to the power passing through the meter. The number of revolutions is thus
proportional to the energy usage. Figure 2.3 shows the existing energy meter installed in most
Fiji households.
Figure 2.3 – Existing Energy Meter
2.5.2 Water Meter
A standard water meter installed by the Water Authority of Fiji normally has a dial similar to an
odometer, to indicate the measuring unit and the amount of water used. Gears in the meter
convert the motion of the measuring element to the proper usage increment for display on the
odometer-style wheels.
Water enters a precision-machined chamber containing a disc which rotates (wobbles). The
position of the disc divides the chamber into compartments containing an exact volume. Liquid
pressure drives the disc to wobble and a roller cam causes the rotating disc to make a complete
cycle. The movements of the disc are transmitted by gear train to an indicator/totalizer or pulse
transmitter. Close clearances between the disc and chamber ensure minimum leakage for
accurate and repeatable measurement of each volume cycle. The rotating disc rotates counter
clockwise as water passes through the meter. The disc is carried on a ball and socket that allows
10
it to freely rotate. The cycles are converted to rotary motion by the measuring spindle and
registers the usage on the dial display.
Figure 2.4 – Existing Water Meter
2.5.3 Sensors
Two different measurements are incorporated in the design of the project. The Optical Encoder is
used for the energy consumption measurement, and the Flow sensor to measure the water
consumption.
Phototransistor Optical Interrupter Switch (H21A1) is used for the energy measurement. YF-
S201 is used for the water flow measurement.
Figure 2.5 – (a). Optical Encoder (H21A1)
(b). Water Flow Sensor (YF-S201)
11
Figure 2.7 – Working detail of the Water Flow Sensor
The illustration above gives detailed working method of hall effect sensor based water flow
sensor, a turbine wheel embed with magnet is placed on a closed plastic envelope and a Hall
effect sensor placed, When the water flows through the pipeline, it makes the turbine wheel to
rotate and hence the magnet flux interferes the hall sensor, the rate of interference is depends on
the speed of water flow, so the hall effect sensor produce pulse signal output, this pulse output
can be calculated as water volume.
2.5.4 PIC Microcontroller (PIC16F877)
The PIC16F877 is the main component which does all the processing of the system. This
microcontroller is very convenient to use, the coding or programming of this controller is also
easier. One of the main advantages is that it can be write-erase as many times as possible because
it uses FLASH memory technology. It has a total number of 40 pins and there are 33 pins for
input and output. Figure 2.3 shows the DIP package of the PIC16F877 and its pin diagram.
The external interrupt pin B0 is used to count the pulses from the optical encoder circuit of the
energy meter and interrupt B4 is used to count the pulses from the flow sensor. The PIC
processes these two measurements and displays the energy and water usage and their cost of the
bill.
12
Figure 2.8 – PIC16F877 DIP Package and its Pin Details
2.5.5 Real Time Clock Module (DS1307)
This compact, easy to install mini-board uses the standard I2C bus for control and data transfer.
The time is maintained and updated within the DS1307 IC. Included on-board is also battery
back-up, enabling the time to be maintained even with power disconnected from the board. The
DS1307 IC stores time values in separate registers, for years, month, day, hour, minutes and
seconds. A scratchpad data bank is also available for storing of temporary or alarm values. The
DS1307 Real Time Clock Mini Board is a compact, easy to control Real Time Clock, ideal for
use when setting up a real-time control system or for use when date stamping is required for
various monitoring applications. Figure 2.9 shows a DS1307 Real Time Clock Mini Board.
The smart energy meter uses the DS1307 module to control the real date and time for reading
and recording the real time energy usage.
The DS1307 supports the I2C protocol. A device that sends data onto the bus is defined as a
transmitter and a device receiving data as a receiver. The device that controls the message is
called a master. The devices that are controlled by the master are referred to as slaves. The bus
must be controlled by a master device that generates the serial clock (SCL), controls the bus
access, and generates the START and STOP conditions. The DS1307 operates as a slave on the
I2C bus whereas the PIC is the master that processes the message.
13
The project uses the CCS DS1307 driver for PIC which is the library used to read and write data
using the I2C protocol on the DS1307 chip. The PIC16F877 has two pins available for I2C
communication. Pin C4 which is SDA or the serial data pin and pin C3 which is the SCL or
serial clock pin.
Figure 2.9 – DS1307 Real Time Clock Mini Board
The DS1307 has 56 bytes of battery-backed SRAM. The RAM registers are located in address
locations 08h to 3Fh. These registers will be used to store the monthly data (electricity usage &
bill). Each byte of memory will be used to store each month’s usage.
The time and calendar information is obtained by reading the appropriate register bytes. Table
2.1 shows the RTC registers. The time and calendar are set or initialized by writing the
appropriate register bytes. The contents of the time and calendar registers are in the BCD format.
The day-of-week register increments at midnight. Values that correspond to the day of week are
user-defined but must be sequential (i.e., if 1 equals Sunday, then 2 equals Monday, and so on.)
Illogical time and date entries result in undefined operation. Bit 7 of Register 0 is the clock halt
(CH) bit. When this bit is set to 1, the oscillator is disabled. When cleared to 0, the oscillator is
enabled. On first application of power to the device the time and date registers are typically reset
to 01/01/00 01 00:00:00 (MM/DD/YY DOW HH:MM:SS). The CH bit in the seconds register
14
will be set to a 1. The clock can be halted whenever the timekeeping functions are not required,
which minimizes current (IBATDR).
Table 2.1 – Timekeeper Registers
The interface of the RTC module is further explained in section 2.6.3 later in the chapter.
2.5.6 GSM Module
A GSM module is a wireless module that works with a GSM wireless network. SIM900 GSM
module can work with any GSM network operator SIM card just like a mobile phone with its
own unique phone number. SIM900 modem supports features like voice call, SMS, Data/Fax,
GPRS etc. A SIM card needs to be connected.
Figure 2.10 – GSM Module (SIM900)
15
2.5.7 Keypad
This 4x4 (16-button) keypad provides a useful human interface component for microcontroller
projects.
Figure 2.11 – 4x4 Matrix Keypad
Matrix keypads use a combination of four rows and four columns to provide button states to the
host device, typically a microcontroller. Underneath each key is a pushbutton, with one end
connected to one row, and the other end connected to one column. These connections are shown
in Figure 2.11.
In order for the microcontroller to determine which button is pressed, it first needs to pull each of
the four columns either low or high one at a time, and then poll the states of the four rows.
Depending on the states of the columns, the microcontroller can tell which button is pressed. For
example, say your program pulls all four columns low and then pulls the first row high. It then
reads the input states of each column, and reads pin 1 high. This means that a contact has been
made between column 4 and row 1, so button ‘A’ has been pressed.
2.5.8 Liquid Crystal Display
A liquid crystal display or LCD draws its definition from its name itself. It is combination of two
states of matter, the solid and the liquid. LCD uses a liquid crystal to produce a visible image.
16
Figure 2.7 shows LCD-20X4B display which is an industry standard HD44780 based controlled
4 lines x 20 characters LCD display with WHITE characters on BLUE background and
backlight.
Figure 2.12 – 20 x 4 Liquid Crystal Display
The LCD displays all necessary information to the user. The utility usage and its bill charged for
both water and electricity is always displayed on the LCD screen unless the user wishes to view
other information such as the time and date, previous months’ bill, set VAT and tariff rates, and
set date and time.
The interface of the keypad and LCD is further explained in section 2.6.3 later in the chapter.
2.6 Circuit Design
2.6.1 Interfacing Utility Meters with PIC
The utility meters are interfaced to the PIC16F877 microcontroller via sensors. Figure 2.13
shows the interface of the sensors with the microcontroller. The YF-S201 Water Flow Sensor
has 5V TTL output thus it can be interfaced directly to the interrupt input pin of the
microcontroller. The sensor gives a pulse output and it can be easily read by the microcontroller.
The energy is measured using the H21A1 Optical Encoder which is used to measure the
revolutions of the rotating disc of the energy meter. By counting the revolutions of the rotating
disc, the energy usage can be determined. The meter has the specification of 360 revolutions per
every kWh.
17
Figure 2.13 – Interface of the Utility Sensors with PIC16F877
2.6.2 Interfacing the GSM Module with the PIC16F877
Interfacing the PIC with the SIM900 GSM Module is simple. RX pin of microcontroller
connects with TX pin of GSM module and TX pin of microcontroller connect with RX pin of the
GSM module. This will establish a Serial connection between both. Also, ground connection
must be common for both the GSM module and the PIC.
18
Figure 2.14 – Interface of the GSM Module with PIC16F877
2.6.3 Interfacing the LCD and Keypad with PIC16F877
The 4x4 keypad is interfaced to Port B and Port D of the PIC microcontroller. The column pins
of the keypad are connected to pins D0 to D3 and the rows of the keypad to pins B4 to B7. 4 x
10kΩ resistors are used for the rows to pull them low until any of the row pins goes high.
The keypad is used to set the date and time on initial setup as well as to set the VAT and tariff
rates.
Port D and Port E is used to interface the 20 x 4 LCD. Pins 11 to pin 14 of the LCD are
connected to pins D4 to D7 of the microcontroller respectively. Pins E0 to E2 of the
microcontroller are connected to pins 4 to pin 6 of the LCD. A 20kΩ trimpot is used to set the
contrast of the LCD and is connected as shown in Figure 2.15.
19
Figure 2.15 – Interface of LCD and Keypad
2.6.4 Interfacing the RTC Module with PIC16F877
The Real Time Clock (RTC) Module is connected to Port C of the PIC microcontroller. The SCL
and SDA pins of the the module are connected to the corresponding pins (Pins 18 and 23) of the
microcontroller via 2 x 10k pull-up resistors. Figure 2.16 shows the interface. The RTC is used
to generate the real time date and time.
20
Figure 2.16 – RTC Module Interface
21
CHAPTER 3 RESULTS AND DISCUSSION
3.1 Electricity Tariffs and Rates
3.2 Calculating Your Bill
Tariff charged to Domestic Customers – No Government subsidy
Tariff charged to Domestic Customers – Government subsidy
3.3 Derived Formulas’
Energy Usage Calculation
The interrupt pin B0 of the PIC microcontroller counts the number of impulses. From the
specifications of the energy meter, 360 revs = 1kWh = 1 Unit, hence formula;
22
number of revolutions
Units=
360
23
CHAPTER 4 CONCLUSION
From this project, it can be concluded that
REFERENCES
[1] S.Gopinath1, R.Suresh2, T.Devika3, N.Divya4, [Link] Vanitha5," Embedded Based
Digital Energy Measurement for Improved Metering and Billing System," International
Journal of Innovative Research in Electrical, Electronics, Instrumetation & Control
Engineering, vol. 1, 2013.
[2] FEA, "Electricity Tariffs and Rates," [Online]. Available: [Link]
home/electricity-tariffs-and-rates/. [Accessed 15 March 2020].
[3] Md. Mejbaul Haque1 et al [3] ”Microcontroller Based Single Phase Digital Prepaid Energy
Meter for Improved Metering and Billing System” International Journal of Power
Electronics and Drive System (IJPEDS) Vol.1, No.2, December 2011, pp. 139~147ISSN:
2088-8694.
[4] Md. MejbaulHaquelet al“ Microcontroller Based Single Phase Digital Prepaid Energy meter
for Improved Metering and Billing system” International Journal of Power Electronics and
Drive System (IJPEDS) Vol.1, No.2, December 2011, pp.139-147 ISSN: 2088-8694.
[5] Mr. Darshit S. Patel, Mr. H.B. Patel “GSM Based Energy Meter Monitoring and Load
Control” International Research Journal of Engineering and Technology (IRJET) Volume:
04 Issue: 03, Mar -2017, ISSN: 2395 -0056.
[6] H. M. Zahid Iqbal1, M. Waseem2, Tahir Mahmood3, " Automatic Energy Meter Reading
using Smart Energy Meter," International Journal of Innovative Research in Electrical,
Electronics, Instrumetation & Control Engineering, vol. 1, 2013.
[7] Ashna.k , Sudhish N George. “GSM Based Automatic Energy Meter Reading System with
Instant Billing” 978-1-4673-5090-7©2013 IEEE
24
[8]. V. C. Sharath, S. Suhas, B. N. S. Jain, S. B. V. Kumar and C. P. Kumar, "Smart Aqua
Meter," 2014 International Conference on Advances in Electronics Computers and
Communications, Bangalore, 2014, pp. 1-5.
[9]. A. S. Metering, S. Visalatchi and K. K. Sandeep, "Smart energy metering and power theft
control using arduino & GSM," 2017 2nd International Conference for Convergence in
Technology (I2CT), Mumbai, 2017, pp. 858-961.
[10]. H. Das and L. C. Saikia, "GSM enabled smart energy meter and automation of home
appliances," 2015 International Conference on Energy, Power and Environment: Towards
Sustainable Growth (ICEPE), Shillong, 2015, pp. 1-5.
[11]. M. Kumar Jha, R. Kumari Sah, M. S. Rashmitha, R. Sinha, B. Sujatha and K. V. Suma,
"Smart Water Monitoring System for Real-Time Water Quality and Usage Monitoring," 2018
International Conference on Inventive Research in Computing Applications (ICIRCA),
Coimbatore, 2018, pp. 617-621.
[12]. G. Gosavi, G. Gawde and G. Gosavi, "Smart water flow monitoring and forecasting
system," 2017 2nd IEEE International Conference on Recent Trends in Electronics,
Information & Communication Technology (RTEICT), Bangalore, 2017, pp. 1218-1222.
APPENDIX A – Bill of Materials
Material List:
No
Description Qty Unit Cost Total Cost
.
1
2
3
4
5
6
7
8
9
10
25
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Total Cost:
APPENDIX B – Gantt Chart
APPENDIX C – Datasheets
26
--------- REPORT ENDS ---------
27