Sunteți pe pagina 1din 58

Group member

Name

ID

1.

ABAS

MUSA...00302/03

2.

BILISUMA GELANA...01673/03

3.

DEJENIE

FIKIR....00742/03

4.

FEYISA

KENENISA...00866/03

5.

FISIHA

TIGABU....03841/03

6.

GIRMA

TOLI.00983/03

Advisor name: Ashenafi Abadi co with Mulugeta Hadis


SUBMISSION DATE
June 15, 2015

SUBMITTED TO
CBTP and project coordinator

Automatic Water meter Reading and Billing system (June 2015)

DECLARATION
This declaration is made on the ..day of..2015.

Students Declaration:
We

signature
1.

Abas Musa

2. Bilisuma Galena.
3. Dejenie Fikir ..
4. Feyisa kenenisa
5. Fisiha Tigabu ..
6. Girma Toli .
hereby declare that the work entitled Automatic Water meter reading and billing system is
our original work. We have not copied from any other students work or from any other sources
except where due reference or acknowledgement is made explicitly in the text, nor has any part
been written for us by another person.
Supervisors Declaration:
We
Signature
Mulugeta Hadis
Ashenafi Abadi ..
hereby certifies that the work entitled Automatic Water meter reading and billing system was
prepared by the above named student, and was submitted to the institute as a * partial/full
fulfillment for the conferment of BSC and the aforementioned work, to the best of our
knowledge, is the said students work.

Received for examination by: _____________________

Date: ____________________

(Name of the supervisor)

JIT 5TH YEAR ECE PROJECT

Page I

Automatic Water meter Reading and Billing system (June 2015)

Acknowledgment
We have immense pleasure in expressing our thanks and deep sense of gratitude to our advisors
Mr. Ashenafi and Mr. Mulugeta Hadis for their guidance throughout this project. We also
express our sincere thanks to instructor Mr. Solomon W/Sadik (MSC in ECE) for extending his
help. Finally we express our great thank to all members of the faculty and school staff for their
valuable advice and help to complete the project successfully.

JIT 5TH YEAR ECE PROJECT

Page II

Automatic Water meter Reading and Billing system (June 2015)

Abstract
A water meter is a device used to measure the volume of water consumed by either a residential
or a commercial establishment. An analog meter is usually installed within the area of the
consumer and readings from the odometer are read on a monthly basis by hired personnel
from the water company. Manual reading of the water meter is a tedious job and throughout the
years this method tends to show noticeable disadvantages. This study aims to develop an
automatic water meter reading system that will enhance the Analog water meter data
collection

by

utilizing

wireless

technology using

GSM

module

system

for

data

transmission to increase the range of data transmission. This automatic reading system,
encountered with flow sensor which is available with low cost, reliable, quick water meter
system accompanying with existing GSM networks. Paddle wheel flow sensor measures the
water flow accurately with the help of rotating paddles. Monthly water

usage can be sent to

municipal corporation office within fraction of seconds in the form of text message by
using existing GSM network. And the municipal corporations resend the amount of water
usage with birr to the customer mobile phone. Such metering system reduces manpower, with
higher accuracy and less power consumption. It gives better results than any other
metering systems such as mechanical, ultrasonic, electro-magnetic systems. By using this
system water consumption can be observed in real time with controlled use of precious water
resources. Water resources are managed for future planning. Non-revenue water will be detected
and loss can be avoided in distribution system.

JIT 5TH YEAR ECE PROJECT

Page III

Automatic Water meter Reading and Billing system (June 2015)


Contents
Acknowledgment .................................................................................................................................... II
Abstract.................................................................................................................................................. III
List of Figure.......................................................................................................................................... VI
List of Table .......................................................................................................................................... VII
CHAPTER ONE ..................................................................................................................................... 1
1.

INTRODUCTION AND LITERATURE REVIEW ......................................................................... 1


1.1

INTRODUCTION ................................................................................................................... 1

1.2.

LITERATURE REVIEW ......................................................................................................... 3

1.3.

Problem statement .................................................................................................................... 6

1.4.

General Objective .................................................................................................................... 7

1.5.

Specific objective ..................................................................................................................... 7

1.6.

Significance of the study .......................................................................................................... 8

1.7.

Project scope ............................................................................................................................ 9

1.8.

Methodology .......................................................................................................................... 10

CHAPTER TWO .................................................................................................................................. 11


2.

COMPONENT DESCRIPTION .................................................................................................... 11


2.1.

Components used in this project ............................................................................................. 11

2.1.1.

Flow sensor .................................................................................................................... 11

2.1.1.

GSM modem .................................................................................................................. 13

2.1.2.

LCD Display .................................................................................................................. 14

2.1.3.

PIC16f877 microcontroller ............................................................................................. 15

2.1.4.

RS232 ............................................................................................................................ 18

2.1.1.

EEPROM (memory) ....................................................................................................... 20

CHAPTER THREE ............................................................................................................................... 21


3.

SYSTEM DESIGN ........................................................................................................................ 21


3.1.

Block diagram ........................................................................................................................ 21

3.2.

System Circuit Diagram ......................................................................................................... 23

3.3.

Software designed .................................................................................................................. 25

3.3.1.

Message sending and receiving software design flow chart ............................................. 26

3.3.2.

Billing software .............................................................................................................. 28

JIT 5TH YEAR ECE PROJECT

Page IV

Automatic Water meter Reading and Billing system (June 2015)


3.4.

Cost analysis .......................................................................................................................... 34

CHAPTER FOUR ................................................................................................................................. 35


4.

SIMULATION RESULT AND DISCUSSION .............................................................................. 35


4.1.

Customer side message sending .............................................................................................. 35

4.2.

Receiving end (station of supply) ........................................................................................... 36

4.3.

Message sending next month .................................................................................................. 38

4.4.

Message sending customer 2 .................................................................................................. 39

CHAPTER FIVE ............................................................................................................................... 42


5.

CONCLUSION AND RECOMMENDATION .............................................................................. 42


5.1.

Conclusion ............................................................................................................................. 42

5.2.

Recommendation ................................................................................................................... 43

Appendix ............................................................................................................................................... IX

JIT 5TH YEAR ECE PROJECT

Page V

Automatic Water meter Reading and Billing system (June 2015)

List of Figure
Figure 1-1 methodology ........................................................................................................... 10
Figure 2-1 Transfer function of Hall Effect sensor (hysteresis) ................................................. 13
Figure 2-2 LCD diagram .......................................................................................................... 14
Figure 2-3 PIC16F877 chip ....................................................................................................... 15
Figure 2-4 RS232 diagram ........................................................................................................ 19
Figure 3-1 customer side block diagram .................................................................................... 21
Figure 3-2 controller side block diagram ................................................................................... 22
Figure 3-3 Sending end circuit diagram ..................................................................................... 23
Figure 3-4 Receiving end circuit diagram .................................................................................. 24
Figure 3-5 output pulse of flow sensor...................................................................................... 25
Figure 3-6 flow chart in the customer side algorithm ................................................................. 26
Figure 3-7 flow chart for receiving side (controller or office) ................................................... 27
Figure 3-8 billing flow chart ..................................................................................................... 32
Figure 3-9 login window .......................................................................................................... 33
Figure 3-10 Billing window ...................................................................................................... 33
Figure 4-1 Customer side message sending 1 ............................................................................ 35
Figure 4-2 Login window .......................................................................................................... 36
Figure 4-3 welcome window ..................................................................................................... 37
Figure 4-4 incoming message 1 ................................................................................................ 37
Figure 4-5 registration for incoming message 1 ......................................................................... 37
Figure 4-6 message sending next month 2 ................................................................................. 38
Figure 4-7 message incoming next month 2 ............................................................................... 39
Figure 4-8 message sending 2.................................................................................................... 40
Figure 4-9 message incoming 2 ................................................................................................. 40
Figure 4-10 registration for incoming message 2 ....................................................................... 41
Figure 4-11 view of registered customers .................................................................................. 41

JIT 5TH YEAR ECE PROJECT

Page VI

Automatic Water meter Reading and Billing system (June 2015)

List of Table
Table 2-1 Specification of flow sensor ................................................................................................... 11
Table 2-2 ports of pic16f877 ................................................................................................................. 18
Table 2-3 Pin description ...................................................................................................................... 19
Table 3-1 Billing calculation.................................................................................................................. 28
Table 3-2 rent of water meter ................................................................................................................. 28
Table 3-3 cost analysis ......................................................................................................................... 34

JIT 5TH YEAR ECE PROJECT

Page VII

Automatic Water meter Reading and Billing system (June 2015)

Acronyms
GSM: Global System for Mobile Communications
LCD: Liquid Crystal Oscillator
EEPROM: Electrically Erasable Programmable Read Only Memory
PIC: Peripheral Interface Control
AC: Analog current
AT: Attention
DC: Direct Current
SMS: Short Messaging System
GUI: Graphical User Interface
RTC: Real Time Clock
RF: Radio Frequency
PC: Personal Computer

JIT 5TH YEAR ECE PROJECT

Page VIII

Automatic Water meter Reading and Billing system (June 2015)

CHAPTER ONE
1. INTRODUCTION AND LITERATURE REVIEW
1.1 INTRODUCTION
Water resources around the world are getting scarcer day after day. Climate, global warming,
and irresponsible usage are major factors make the situation even harder. In the absence of
any real solution for global warming, governments are putting large efforts to compensate
for the shortage of water either through awareness campaigns to reduce consumption or
through more taxes on usage of water. While raising awareness is usually a long process that
requires a lot of resources, increasing usage fees is highly dependent on the availability of human
resources to make measurements and collect appropriate fees. An alternative, more practical,
solution consists of reusing existing technologies that are already deployed in other fields,
where the results are promising. The main idea is to customize existing solutions to the
context of water billing and usage management. The proposed approach in this paper
relies on two main technologies that have made significant contributions to wellbeing of
individuals and societies: Application specific embedded systems and the Global System
for Mobile Communications (GSM). The latter has been increasingly used in different
applications ranging from phone calls to Internet browsing and remote control of
electronic, electrical, and mechanical devices. Meanwhile, applications based on embedded
systems are also being introduced almost in every domain, especially for purposes of cost
reduction and portability. In additions, networks of embedded wireless sensors are being
used in many domains like weather forecasting and smart home development. In this paper,
we propose a system to automate the billing of the consumption of water and the control of the
water meters using a blend of both technologies: GSM networks and embedded systems. The
proposed system consists of three main components:
1. Embedded water meter (E-WATER) system for measurement and control of water
consumption.

JIT 5TH YEAR ECE PROJECT

Page 1

Automatic Water meter Reading and Billing system (June 2015)


2. Server application to manage the measurements and prepare invoices and bills. In addition to
that, the application performs some predefined control operations that can be transmitted to
the embedded water meter.
3. Communication medium that is based on the existing GSM networks. The water billing and
control operations will be performed simply using the Short Messaging System service that
is available over GSM. For this, no modification or even customization is needed in the
networks themselves.
Automating the billing process remains an appealing objective especially with tendency of
governments in many countries to go electronic (paperless). Some proposals already exist
to automate the billing of some basic services like water, gas, phone, and electricity. In, a
proposal is presented to combine in one meter the measurements of all the services needed for a
house. The proposed system relies on a microcontroller for the readings.

JIT 5TH YEAR ECE PROJECT

Page 2

Automatic Water meter Reading and Billing system (June 2015)

1.2. LITERATURE REVIEW


Out of the earths surface almost 71% surface is covered with water. Only 3% of water can be
used as drinking water or fresh water and 97% water is sea water which cannot be used by
human out of 71% available water on earth. Tremendous population growth causes insufficient
and uneven distribution of drinking water. So measuring the water usage and providing it with
proper amount will limit the wastage of water in society. Previously some traditional methods
were used such as mechanical meters in which water flow drives mechanical gears which
drives moving arrow pointer on the water meter scale, such meter need to be read in
customer premises which is time consuming process. Such mechanical meters overtaken by
electronics meters this works on RF frequencies. RF transmitter is mounted on meter which
will transmit water usage on monthly basis within a limited range which then collected by RF
receiver based hand held device. Then by using computer interfacing billing can be done. Such
system needs manpower and it takes some time in collecting and distributing bills.
This section provides a previous study of related work regarding the application of SMS services
in a various fields. Some previous researches have been studied to gain more information about
current existing GSM control system that was previously implemented. It is necessary to know
and understand how the software and hardware were used in the SMS controlled system
development. This is to ensure that the study that currently being conducted contribute at certain
level of application thus it become more efficient and practical.
Several smart home projects such as Home Security with Messaging System , Security &
Control System , and Remote and Security Control via SMS were the three alarm system that
were designed using GSM Based Electrical Control System for Smart Home Application SMS
application to securely monitor the home condition when the owner is away or at night. A
system as suggested by triggered by SMS to the home owner to notify the owner of any
incident happened around the house such as robbery or fire. The security system uses mobile
phone with a combination of microcontroller circuit PIC16F877A which interfaced with the
computer

[3]

. The system work accordingly

when the sensor actively triggered

by any

abnormal activity, then the PIC circuit also automatically activate the computer to send SMS to
the owner using mobile phone modem.

JIT 5TH YEAR ECE PROJECT

Page 3

Automatic Water meter Reading and Billing system (June 2015)


Meanwhile, the system developed by is automating the power reading meter to send the energy
consumed to e-billing system at authorized office. The system works by integrating the GSM
modem that was embedded with digital kWh power meter. It utilizes the GSM network to send
power usage reading using SMS to the authorized office [5]. The authorized office collect and
manage the received SMS message contains the meter reading to generate the billing cost and
send back the cost to the respective consumer through SMS. The work presented by is about the
development of Integrated Water Billing System with SMS capability. The system is designed to
facilitate the Water authorized to manage the monthly billing system without the use of human
services. The system receives SMS from the meter to central databases. Then the information
received is processed to generate current billing. The system again sends a SMS notification to
the user regarding the total amount that has been billed. The system was implemented using
Visual Basic and database in order to perform the prototype and the system works successfully in
sending SMS to user for notification

[11]

. Furthermore, the system developed by is to control the

switch for lamp, door and alarm system using Visual Basic 6.0 software. Visual Basic was
chosen because it can easily communicate between computer and mobile phone. The system
used computer and mobile phone to send and receive the text messages. Vehicle Speed Detection
using SMS, presented the design of the black box for warning system to control the exceeding
speed of express bus via SMS. The system consists of three main parts which is microcontroller
circuit, relay driving circuit and also mobile phone. This project used PIC 16F873A, Nokia 3310
mobile phone and using JAL (Just another Language) software for the programming. The
purpose of this project is to prevent the express bus driver from driving over the permitted speed
limit as well as to educate the drive to obey the regulation; therefore the accident can be
prevented as well. The system is activated when the speedometer in the black box exceeds the
speed limit permitted by Department of Transportation (JPJ), thus, SMS text notification is sent
to JPJ for record.
Moreover, the projects for Acquiring Water Level and Temperature Status via SMS also have
similarity with this project. This project utilized PIC 16F877 and MPLAB IDE software for
programming. The project was designed to detect level and temperature of the water in a pool[4].
The system functions when the level of water and the temperature in pool exceed the desired
limits. At the same time the PIC circuit will automatically interface to the mobile phone and send
the alert message to the user.
JIT 5TH YEAR ECE PROJECT

Page 4

Automatic Water meter Reading and Billing system (June 2015)


H.G Rodney Tan, of IEEE

(2007) uses GSM Network to his study Automatic Power

Meter Reading System Using GSM Network presented the advantage of the available
GSM infrastructure nationwide coverage in the country and the Short Messaging System
cell broadcasting feature to request and retrieve individuals houses and building power
consumption meter reading back to the energy provider wirelessly.

The Store and

forwarding features of SMS allow reliable meter reading delivery when GSM signal is
affected by poor weather condition. The stored SMS is an archive in the mobile operator and
can be retrieved for billing verification purpose [5].
In addition, one of the applications of GSM is the Vehicle Tracking Using a reliable
Embedded Data Acquisition System with GPS and GSM by Kishore, Vardhan and
Narayana Assistant Professors of St. Anns College of Engineering and Technology and Nirmra
College of Engineering and Technology in India last February 2010. On the data collection
for post processing on a vehicles position for an advanced traffic survey was also discussed.
Some applications adding remote accessibility are detailed, which are built to collect and send
data through a modem to a server. Although these are well-built systems that serve the
purpose for

a specific task, the user

cannot interact

with the system.

Another

unidirectional data transfer is presented which uses the Global System for Mobile
Communications (GSM), a popular wireless choice for connectivity between the dataacquisition units and clients[3].
According to Automatic Ambulance Rescue System by Athavan, Balasubramanian,
Jagadeeshwaran, and Dinesh of Sri Venkatashwara College of Engineering (2012), the
traffic junctions are referred to as nodes and each node will have a GSM modem connected to
the controller. The GPS SYSTEM finds out the current position of the vehicle (latitude
and longitude) which is the location of the accident spot and gives that data to the GSM
MODULE. The GSM MODULE sends this data to the MAIN SERVER whose GSM number is
already in the module as an emergency number[9].

JIT 5TH YEAR ECE PROJECT

Page 5

Automatic Water meter Reading and Billing system (June 2015)

1.3. Problem statement


Water meter is a cash register of a water supply authority. Water meters are read on a monthly
basis by authorized water reader hired by the water companies. The main drawbacks of the
current systems are:

Reading meter from house to house is tedious

It is difficult to collect monthly bill on time

Data storage system for billing is poorly secured and easily lost

There is no mechanism to control peoples that are not pay on the time required

The process consumes more man power, time and money

There is guessing of reading and missing of house due to over burden the author

The authorized person from water supply station cannot access meter reading if the house is
closed

JIT 5TH YEAR ECE PROJECT

Page 6

Automatic Water meter Reading and Billing system (June 2015)

1.4. General Objective

Develop an automatic water meter reading and billing system that will utilize
wireless technology using GSM module system for data transmission.

1.5. Specific objective

Reduce faults during manual meter reading

Determine the reliability of the automatic water meter reading using GSM data
transmission technology.

eliminate estimated meter reading

increased performance in the data collection, less manpower and resources are
needed in meter reading and data gathering

save utilization of water consumption

JIT 5TH YEAR ECE PROJECT

Page 7

Automatic Water meter Reading and Billing system (June 2015)

1.6. Significance of the study

Faster and more efficient meter reading

improving data management

prevent corrupt practices relating to meter reading and illegal connections

Greater billing accuracy

Enabling a flexible tariff structure

Increased read frequency, resulting in improved debt collection

Ability to remotely monitor resource use

Improves revenue collection and avoiding unpleasant bill surprises for customers.

JIT 5TH YEAR ECE PROJECT

Page 8

Automatic Water meter Reading and Billing system (June 2015)

1.7. Project scope


This project mainly concerned with sending the water usage to the water supply agency using
GSM, calculating the water usage in terms of birr using billing software and sending the amount
of birr to be paid to the customer phone. After we assembling the hardware and loading
software program to the system designed we simulate the system using proteus, micro c pro and
C# in connection with Sql server.

JIT 5TH YEAR ECE PROJECT

Page 9

Automatic Water meter Reading and Billing system (June 2015)

1.8. Methodology
This section presents the steps to follow to complete and to attain the objectives of
the study as, illustrated on the figure system flow:

Star
t

Gathering
information, data,
document and
research necessary
(relevant) for the
Developing
mechanisms of
sending and receiving
of the meter reading
data and billing

Loading
SMS to
GUI

Reading and
analyzing
informations and
interpreting to our
goal
Developing
billing software
using C# and
SQL server

List out hardware


and software
components we
use

Hardware
assembling using
proteus

Simulation
testing

Correct
values

Calibration
the system

Result and
analysis

Conclusion and
recommendati
on

End

Figure 1-1 methodology

JIT 5TH YEAR ECE PROJECT

Page 10

Automatic Water meter Reading and Billing system (June 2015)

CHAPTER TWO
2. COMPONENT DESCRIPTION
2.1. Components used in this project
2.1.1. Flow sensor
Flow sensor is the device that detect and measure water flowing. It is a robust & compact flow
sensor, which generates frequency and signal proportional to the flow. The sensor has the
following main components [7]:

Hall effect sensor, Magnet, Turbine

In this system in order to calculate the flow the rotor surrounded by a magnet along with the Hall
Effect sensor is used. As the water flows through the rotor, its blade rotates. As the turbine
rotates magnetic field is produced and accordingly an AC pulse is generated which then
converted to digital output with the help of hall effect sensor placed just after the turbine. Also
measuring flow rate through rotating rotor provides high accuracy, excellent repeatability,
simple structure and low pressure loss.
Table 2-1 Specification of flow sensor
Parameters of sensor

Value or range

Working voltage(volts)

5-24

Maximum current(mA)

15

Flow rate range(L/min)

1-30

Operating temperature(0c)

0-80

Liquid temperature(0c)

<120

Operating humidity(RH)

35-90%

Operating pressure(Mpa)

Under 1.2

Store temperature(0c)

-25 to +80

JIT 5TH YEAR ECE PROJECT

Page 11

Automatic Water meter Reading and Billing system (June 2015)


Working theory of Hall Effect sensor
It is a transducer which examines the rotations of rotor and passes the pulse train which is in the
form of electrical signal as a frequency input. They are temperature resistant and stress resistant
sensor especially suited for electronic computation. Hall Effect sensor has a Hall element which
is a magneto-electric transducer and is made of a thin semiconductor layer as shown in figure 4
with two input voltage terminals and two output voltage terminals. The magnetic flux
perpendicular to the semiconductor layer generates a voltage by the Lorentz force. The Hall
voltage produced in the Hall element is directly proportional to the current produced (I) and the
magnetic flux density (B) as shown in equation 1.
VH = RH
Where, VH is Hall voltage, RH is Hall Effect coefficient, I is current flowing through sensor
in amperes, T is thickness of sensor in mm and B is magnetic flux density in Tesla, Ic is
drive current. Hall voltage is of the order of 7 V/Vs/gauss in silicon and thus requires
signal conditioning for practical applications. Signal conditioning circuit consists of a voltage
regulator, a signal amplifier that is differential amplifier and a Schmitt trigger in order to convert
the analog output to digital output on a single silicon chip. A voltage regulator is used to
automatically maintain a constant voltage level with the amplifier to amplify the Hall voltage
according to the application.

Figure 2-1 Hall Effect sensor output


The transfer function for a digital output Hall Effect sensor incorporates hysteresis as
shown in

JIT 5TH YEAR ECE PROJECT

Page 12

Automatic Water meter Reading and Billing system (June 2015)

Figure 2-1 Transfer function of Hall Effect sensor (hysteresis)

2.1.1.GSM modem
A GSM modem is a specialized type of modem which accepts a SIM card, and operates over a
subscription to a mobile operator, just like a mobile phone. From the mobile operator
perspective, a GSM modem looks just like a mobile phone [9]. When a GSM modem is connected
to a computer, this allows the computer to use the GSM modem to communicate over the mobile
network. While these GSM modems are most frequently used to provide mobile internet
connectivity, many of them can also be used for sending and receiving SMS and MMS
messages. The working of GSM modem is based on commands, the commands always start with
AT and finish with a <CR> character. For example, the dialing command is ATD<number>;
ATD3314629080; here the dialing command ends with semicolon. The AT commands are
given to the GSM modem with the help of PC or controller. The GSM modem is serially
interfaced with the controller with the help of MAX 232. GSM modems can be a quick and
efficient way to get started with SMS, because a special subscription to an SMS service provider
is not required. In most parts of the world, GSM modems are a cost effective solution for
receiving SMS messages, because the sender is paying for the message delivery [10].
The specifications and characteristics for GSM

Frequency bandThe frequency range specified for GSM is 1,850 to 1,990 MHz
(mobile station to base station).

Duplex distancethe duplex distance is 80 MHz Duplex distance is the distance between
the uplink and downlink frequencies. A channel has two frequencies, 80 MHz a part [1].

JIT 5TH YEAR ECE PROJECT

Page 13

Automatic Water meter Reading and Billing system (June 2015)

Channel separationthe separation between adjacent carrier frequencies, In GSM, is 200


kHz.

ModulationModulation is the process of sending a signal by changing the


characteristics of a carrier frequency. This is done in GSM via Gaussian minimum shift
keying (GMSK).

Transmission rateGSM is a digital system with an over-the-air bit rate of 270 kbp[3].

2.1.2.LCD Display
LCD-Liquid Crystal Display is an electronic device for displaying text or Characters

[2]

. We are

using 14 pin LCD. 16*2 represents 16 characters and 2 line display. LCDs are economical and
easily programmable and can easily display special and custom characters.

Figure 2-2 LCD diagram

JIT 5TH YEAR ECE PROJECT

Page 14

Pin description is as follows

4. Pin 6-This is E i.e., enable pin.

1. Pin 7 to pin 14-All 8 pins are responsible

5. Pin 2-This is VDD i.e., power supply pin.

for the transfer of data.

6. Pin 1-This is VSS i.e., ground pin.

2. Pin 4-This is RS i.e., register select pin.

7. Pin 3-This is short pin

3. Pin 5-This is R/W i.e., Read/Write pin.

2.1.3.PIC16f877 microcontroller
Pic16f877 is one of the most advanced microcontrollers from microchip

[3]

. This controller is

widely used for experimental and modern applications because of its low price, wide range of
applications, high quality, and ease of availability. It is ideal for applications such as machine
control applications, measurement devices, study purpose, and so on. The PIC 16F877 features
all the components which modern microcontrollers normally have. The figure of chip is shown
below.

Figure 2-3 PIC16F877 chip

Automatic Water meter Reading and Billing system (June 2015)


Features of PIC16f877

Maximum operating frequency is


20MHz

Flash program memory (14 bit


words), 8KB

Data memory (bytes) is 368

EEPROM data memory (bytes) is


256

5 input/output ports

3 timers

2 CCP modules

serial

communication

ports

(MSSP, USART)

PSP parallel communication port

10bit A/D module (8 channels)[8]

JIT 5TH YEAR ECE PROJECT

Page 16

Special features:

Hundred thousand times erase/write cycle enhanced memory

Self-programmable under software control

In-circuit serial programming and in-circuit debugging capability

Single 5v, DC supply for circuit serial programming

Programmable code protection

Power saving sleep modes

Selectable oscillator option

PIC 16F877 has 5 basic input/output ports. They are usually denoted by PORT A, PORT B,
PORT C, PORT D, and PORT E. these ports are used for input/output interfacing.
Table 2-2 ports of pic16f877
PORT

Pin number

Bit wide (bit)

PORT A

RA-0 to RA-5

PORT B

RB-0 to RB-7

PORT C

RC-0 to RC-7

PORT D

RD-0 to RD-7

PORT E

RE-0 to RE-2

2.1.4.RS232
The default standard for serial port on computers is RS-232. It uses 3-wires consisting of a
transmit signal TD (pin 3 of the DB9 connector from the computer perspective), a receive
signal RD (pin 2 of the DB9 connector), and a signal ground SG (pin 5 of the DB9
connector).

Automatic Water meter Reading and Billing system (June 2015)

Figure 2-4 RS232 diagram


Table 2-3 Pin description
Pin

Signal

Pin

Signal

Data carrier detect

Data set ready

Receiving data

Request to send

Transmitted data

Clear to send

Data terminal ready

Ring indicator

Signal ground

Transmitted Data (TD): One of two separate data signals. This signal is generated by the DTE
and received by the DCE.
Received Data (RD):The second of two separate data signals. This signal is generated by the
DCE and received by the DTE.
Request to Send (RTS): When the host system (DTE) is ready to transmit data to the peripheral
system (DCE), RTS is turned ON. In simplex and duplex systems, this condition maintains the
DCE in receive mode. In half duplex systems, this condition maintains the DCE in receive

JIT 5TH YEAR ECE PROJECT

Page 19

Automatic Water meter Reading and Billing system (June 2015)


mode and disables transmit mode. The OFF condition maintains the DCE in transmit mode.
After RTS is asserted, the DCE must assert CTS before communication can commence.
Clear to Send (CTS): CTS is used along with RTS to provide handshaking between the DTE
and the DCE. After the DCE sees an asserted RTS, it turns CTS ON when it is ready to begin
communication.
Data Set Ready (DSR): This signal is turned on by the DCE to indicate that it is connected to
the telecommunications line.
Data Carrier Detect (DCD ): This signal is turned ON when the DCE is receiving a signal from
a remote DCE which meets its suitable signal criteria. This signal remains ON as long as the
suitable carrier signal can be detected.
Data Terminal Ready (DTR): DTR indicates the readiness of the DTE. This signal is turned
ON by the DTE when it is ready to transmit or receive data from the DCE. DTR must be ON
before the DCE can assert DSR.
Ring Indicator (RI): RI, when asserted, indicates that a ringing signal is being received on the
communications channel.

2.1.1. EEPROM (memory)


EEPROM (electrically erasable programmable read-only memory) is user-modifiable read-only
memory (ROM) that can be erased and reprogrammed (written to) repeatedly through the
application of higher than normal electrical voltage. Unlike EPROM chips, EEPROMs do not
need to be removed from the computer to be modified. However, an EEPROM chip has to be
erased and reprogrammed in its entirety, not selectively. It also has a limited life - that is, the
number of times it can be reprogrammed is limited to tens or hundreds of thousands of times. In
an EEPROM that is frequently reprogrammed while the computer is in use, the life of the
EEPROM can be an important design consideration

[5].

A special form of EEPROM is flash

memory, which uses normal PC voltages for erasure and reprogramming [6].

JIT 5TH YEAR ECE PROJECT

Page 20

Automatic Water meter Reading and Billing system (June 2015)

CHAPTER THREE
3. SYSTEM DESIGN
3.1. Block diagram
Sending side (customer side)

LCD

POWER
SUPPLY
FLOW
SENSOR

PIC16F877

GSM

MICROCONTROLLER

EEPROM

Figure 3-1 customer side block diagram

JIT 5TH YEAR ECE PROJECT

Page 21

Automatic Water meter Reading and Billing system (June 2015)


Controller side or office station

GSM in the station


Pic16f877
microcontroller

GSM

Desk top with


billing
software and
data storage

Station
personal
computer

GSM network

Customer phone

Figure 3-2 controller side block diagram


The above block diagram contains sending (customer side) and receiving (controller side or
office station) sections. The sending side block diagram has one input and two outputs. Those
are:

Flow meter as input

LCD

GSM

OUTPUT

The receiving or controller side has one input and one output. Those are:

GSM via PIC16F877 microcontroller interfaced with PC

GSM that transmit message to customer phone wirelessly

JIT 5TH YEAR ECE PROJECT

Page 22

Automatic Water meter Reading and Billing system (June 2015)

3.2. System Circuit Diagram


The system has two components:

Sending end

Receiving end

Sending end circuit diagram

Figure 3-3 Sending end circuit diagram


Receiving end circuit diagram

JIT 5TH YEAR ECE PROJECT

Page 23

Automatic Water meter Reading and Billing system (June 2015)

Figure 3-4 Receiving end circuit diagram


As you see in the above circuit diagram the design system consists of two major components:
hardware and software. The hardware components are flow sensor, microcontroller, GSM and
personal computer in the station. The flow of system starts with reading of water flow using flow
sensor. The operation of this sensor is: as the water flows through the rotor its blades rotates. As
the turbine rotates magnetic field is produced and accordingly an AC pulse is generated. This
signal is converted to digital output with the help of Hall Effect sensor placed with in flow sensor
after turbine. The number of pulses generated per liter can be counted by the software
programming. Thus pulses produce an output frequency which is directly proportional to the
volumetric flow rate/ total flow rate through the meter. Then the sensor passes the square pulse
train which is in the form of electrical signal as frequency input the microcontroller that is
programmed to convert it to flow rate. This value is stored in the microcontroller EEPROM
memory. Here at the falling edge of the wave controllers counter will be set till the wave ends.
Meanwhile counter value will be incremented as per duration of the wave. At the end the value
present in the timer will be given at output port by converting to decimal digits. We can make
use of RTC for monthly billing (approximately 30 days).

JIT 5TH YEAR ECE PROJECT

Page 24

Automatic Water meter Reading and Billing system (June 2015)

Falling
edge

Rising
Edge

Figure 3-5 output pulse of flow sensor


And this sensor is interface with the microcontroller to give water usage in terms of pulse
count to GSM Modem. GSM modem receives water usage as a number string of numbers. It
then transmitted to another GSM modem through existing GSM network. GSM modem is
connected to computer through serial port and microcontroller, to give water usage. Then this
GSM sends the counting value (meter reading) to personal computer serially. The data received
from the customer side (meter reading) calculated by billing software to convert in to cash (birr).
Calculated bill can be sent through SMS to the customer phone. Whole mechanism of collection
of water usage and providing bill take few minutes, which will be fastest and low cost process
over the existing water distribution and billing system.

Power supply
The power supply of the E-WATER system is a combination of long term battery and a
solar panel based supply. The solar power supply is the default source of power with the
battery acting as backup for when the sun light is reduced or at night.

3.3. Software designed


In this software design there are two components those are:

Message sending and receiving software design

Billing software design using c# and sql server

JIT 5TH YEAR ECE PROJECT

Page 25

Automatic Water meter Reading and Billing system (June 2015)

3.3.1.Message sending and receiving software design flow chart


Start

Initialized all peripherals


(Ports, UART and Variables) ,
and AT command
initialization

Meter reading

Is it sending
time?

Make USART ready

Write data to
USART

Send to station
Stop

Figure 3-6 flow chart in the customer side algorithm

JIT 5TH YEAR ECE PROJECT

Page 26

Automatic Water meter Reading and Billing system (June 2015)


Start

Initialize
ports

Connect port
to C#

Read (access)
ports

Is message
incoming?

Read text in the


port

Display text on
message box

Store incoming
message on the
database

Stop

Figure 3-7 flow chart for receiving side (controller or office)

JIT 5TH YEAR ECE PROJECT

Page 27

Automatic Water meter Reading and Billing system (June 2015)

3.3.2.Billing software
Billing calculation
Table 3-1 Billing calculation
Consumption

Multiplier constant

0-5m3

3.80

6-16m3

5.60

17-30m3

6.60

>30m3

7.60

Sample example
For consumption of 35m3 for half inch water meter
0-5m3

5*3.80=19birr

6-16m3

11*5.60=61.6birr

17-30m3

14*6.60=92.4birr

>30m3

5*7.60=38birr

Total

211 birr

Total with rent 211+5=216birr


Table 3-2 rent of water meter
Type of water meter

Rent in month

inch

inch

1 inch

15

1 inch

20

2 inch

30

JIT 5TH YEAR ECE PROJECT

Page 28

Automatic Water meter Reading and Billing system (June 2015)


Billing flow chart
Start

Initialize values P (previous


reading), C (current
reading), b1, b2, b3, b4, Cu
(current usage) and bill

Are Entered
values=text?

Reenter float type values

Cu=C-P

6<=Cu<
=16

Go to block
A

JIT 5TH YEAR ECE PROJECT

Cu<=5
c

Go to block
B

17<=Cu<
=30

Go to block
C

Cu>=30

Go to block
D

Page 29

Automatic Water meter Reading and Billing system (June 2015)


Block A

No

No

No

MT=2
inch

MT=3/
4 inch

Ye
s

MT=1
/2

No
MT=1
inch

Ye
s

Ye
s

MT=4
/3

Ye
s

B1=5*3.80

B1=5*3.80

B1=5*3.80

B1=5*3.80

B2= (Cu-5)*5.60

B2= (Cu-5)*5.60

Bill=b1+b2+30

B2= (Cu5)*5.60

B2= (Cu5)*5.60

Bill=b1+b2+8

Ye
s
B1=5*3.80
B2= (Cu5)*5.60
Bill=b1+b2+20

Block B

No
MT=2
inch

MT=3/
4 inch

Ye
s

No

No
MT=1
/2

No
MT=1
inch

MT=4
/3

Ye
s

Ye
s

B1=Cu*3.80

B1=Cu*3.80

B1=Cu*3.80

B1=Cu*3.80

Bill=b1+ 30

Bill=b1+8

Bill=b1+ 5

Bill=b1+ 15

JIT 5TH YEAR ECE PROJECT

Ye
s

Ye
s
B1=Cu*3.80
Bill=b1+ 20

Page 30

Automatic Water meter Reading and Billing system (June 2015)


Block C

No

No

No

MT=2
inch

MT=3
/4

Ye

MT=1
/2

Ye

No
MT=1
inch

Ye

MT=4
/3

Ye

Ye

B1=5*3.80

B1=5*3.80

B1=5*3.80

B1=5*3.80

B1=5*3.80

B2=11*5.60

B2=11*5.60

B2=11*5.60

B2=11*5.60

B2=11*5.60

B3= (Cu16)*6.60

B3= (Cu-16)*6.60

B3= (Cu-16)*6.60
Bill=b1+B1+b2+b
3+5

B3= (Cu16)*6.60

Bill=b1+B1+b2+

Bill=b1+B1+b2+b3
+8

B3= (Cu16)*6.60
Bill=b1+B1+b2+b

Bill=b1+B1+b2+

JIT 5TH YEAR ECE PROJECT

Page 31

Automatic Water meter Reading and Billing system (June 2015)


Block D

No

No

No

No
MT=2
inch

MT=3/
4 inch

Ye
s

MT=1
inch

MT=1
/2
inch

Ye
s

Ye
s

MT=4
/3
inch

Ye
s

Ye
s

B1=5*3.80

B1=5*3.80

B1=5*3.80

B1=5*3.80

B1=5*3.80

B2=11*5.60

B2=11*5.60

B2=11*5.60

B2=11*5.60

B2=11*5.60

B3= 14*6.60

B3= 14*6.60

B3= 14*6.60

B3= 14*6.60

B3= 14*6.60

B4= (Cu-30)*7.60

B4= (Cu-30)*7.60

B4= (Cu-30)*7.60

Bill=b1+B1+b2+b
3+b4+30

B4= (Cu30)*7.60

Bill=b1+B1+b2+b3+
b4+8

B4= (Cu30)*7.60
Bill=b1+B1+b2+
b3+b4+5

Bill=b1+B1+b2+b
3+b4+15

Bill=b1+B1+b2+b
3+b4+20

Figure 3-8 billing flow chart

JIT 5TH YEAR ECE PROJECT

Page 32

Automatic Water meter Reading and Billing system (June 2015)

3.3.2.1. Billing window design


On the software component is composed of Graphical User Interface that outputs the
signal graphically from the database.

The system flow starts from the data retrieve from the

GSM and it will be saved to the database. After the data was retrieved, it would output
graphically using volume over time. And, if the user monitoring the device wish to continue
it will go back to the process of retrieving data else the software will stop. Data of reading
will be given to PC for billing purpose by GSM modem through DB9 connector. For billing we
will be using GUI based on VB. In it total bill based on tariff, taxes, discount will be displayed.
Login window

Figure 3-9 login window

Figure 3-10 Billing window


JIT 5TH YEAR ECE PROJECT

Page 33

Automatic Water meter Reading and Billing system (June 2015)

3.4. Cost analysis


Table 3-3 cost analysis

Sr.no

Equipment

Pic

Device

quantity Price($) per Price


unit

LCY(per

quantity

quantity)

in Price per given


one quantity(birr)

PIC16F877

8.9

178

356

microcontr
oller
2

GSM

SIM300

37.16

743.2

1486.4

Flow

VATS JT-121

3.5

70

70

sensor
4

LCD

LCD 16X2

4.09

81.8

81.8

MAX232

MAX232 series RS- 2

1.04

20.8

41.6

0.2

1097.6

2043.8

232
7

Crystal

Crystal

oscillator

16MHz

oscillator 2

Total
price

JIT 5TH YEAR ECE PROJECT

Page 34

Automatic Water meter Reading and Billing system (June 2015)

CHAPTER FOUR
4. SIMULATION RESULT AND DISCUSSION
4.1. Customer side message sending

Figure 4-1 Customer side message sending 1


As shown in the above diagram in let us assume the customer is ABEBE CHALLA. In the
required time with in the month the above information display on LCD send to water supply
agency. See the information i.e.

Cus_nam:ABEBE CHALLA

Customer_no:1236/4

Mty:1/2 inch meter

Meter reading:5

JIT 5TH YEAR ECE PROJECT

Page 35

Automatic Water meter Reading and Billing system (June 2015)

4.2. Receiving end (station of supply)


The operator in the station login the window using user name and password to register the
customers bill amount to the registration form. This login window is required in order to secured
the file and for keeping files from immediate updating.

Figure 4-2 Login window


After the operator login the login widow, the following window is displayed. This window is
used to:

Remember the operator to see the incoming message

To check whether the message is coming in the dedicated date or not

JIT 5TH YEAR ECE PROJECT

Page 36

Automatic Water meter Reading and Billing system (June 2015)


Figure 4-3 welcome window

Figure 4-4 incoming message 1


By pressing the view message button we can accesses the incoming message but the operator
must take care to see the message incoming date. After accessing the incoming message, we
need to register that information to the registration form. Then press calculate button: the
following dialobox will be displayed.

Figure 4-5 registration for incoming message 1

JIT 5TH YEAR ECE PROJECT

Page 37

Automatic Water meter Reading and Billing system (June 2015)

4.3. Message sending next month


The following diagram is about message sending of abebe challa for the 2 nd month. The reading
is increased by 10. This new reading is sent to the station.

Figure 4-6 message sending next month 2

JIT 5TH YEAR ECE PROJECT

Page 38

Automatic Water meter Reading and Billing system (June 2015)


The message sent from the customer side is displayed in the station dialobox like as follows.

Figure 4-7 message incoming next month 2

4.4. Message sending customer 2


Information in the customer 2:

Cus_nam: kebede worku


Customer_no: 239/9
Mty: 4/3 inch meter
Meter reading: 7

This information sent to station.

JIT 5TH YEAR ECE PROJECT

Page 39

Automatic Water meter Reading and Billing system (June 2015)

Figure 4-8 message sending 2

Figure 4-9 message incoming 2


The sent message from the customer is displayed like above dialog.

JIT 5TH YEAR ECE PROJECT

Page 40

Automatic Water meter Reading and Billing system (June 2015)

Figure 4-10 registration for incoming message 2

Figure 4-11 view of registered customers


By writing the primary key in the textbox we can delete and search the registered customer files

JIT 5TH YEAR ECE PROJECT

Page 41

Automatic Water meter Reading and Billing system (June 2015)

CHAPTER FIVE
5. CONCLUSION AND RECOMMENDATION
5.1. Conclusion
Proposed system will provide accurate and real time water billing system. This
overcomes existing systems in terms of cost and manpower required. Minimized cost of
the whole system will support to use as economical and logical metering system. Monthly
billing cycle can be maintained to limit the use of precious natural resource water.

JIT 5TH YEAR ECE PROJECT

Page 42

Automatic Water meter Reading and Billing system (June 2015)

5.2. Recommendation
The current water reading and billing system is very tedious and manual. This increases labor
cost and complexity in the system for water supply agency. So we would like to advice water
supply agencies to choice this new technology in order to avoid error, corruption in reading,
extra labor spent and overloading in data storing and managing. This design can be extended to
further controlling system like: opening and closing of water valve using SMS from the station,
paying (billing) with mobile and making the system web based. It is better to add these features
when someone do research regarding with water meter.

JIT 5TH YEAR ECE PROJECT

Page 43

Automatic Water meter Reading and Billing system (June 2015)

Reference
[1] Hussain, A., & Kwak, K. S. (2009), Positioning in Wireless Body Area Network using GSM.
International Journal of Digital Content Technology and its Applications.
[2]. Kishore, Vardhan, & Narayana. (2010, February). Vehicle Tracking Using a reliable
Embedded Data Acquisition System with GPS and GSM. IEEE.
[3] Mohd Helmy Abd Wahab, GSM Based Electrical Control System for Smart Home
Application, Universiti Tun Hussein Onn Malaysia, Johor Malaysia, February 2010.
[4]. Macedonio, L. E. (2011, January). Automatic Water Meter Reading using IEEE 802.15.4
Standard for Wireless Networking and Magnetic Hall Sensor. Process Leak Detection Diagnostic
with Intelligent Differential Pressure Transmitter. (2008).
[5]. Saqquaf S. M., Zigbee Based Energy Monitoring System with E-Billing
through GSM Network ,Sai Vidya Institute of Technology, Bangalore, August 2014.

[6]. L. Shiwei, etc, "Design of an automatic meter reading system," Proceedings of the
1996 IEEE IECON 22nd International Conference on Industrial Electronics,
pp.631-636, Aug. 1996.
[7]. Peter Marwedel, Embedded System Design. Kluwer Academic Publishers, Nov. 2003,
ISBN 1-4020-7690-8
[8]. Martin Bates, Interfacing PIC Microcontrollers Embedded Design by Interactive Simulation, San
Francisco, Copyright 2006.

[9]. Rainer N. Dita, Introduction to GSM modem, Mapa Institute of Technology, March 2013.
[10]. Joerg Eberspaecher, Hans-Joerg Voegel, Christian Bettstetter. GSM Switching, Services,
and Protocols,John Wiley & Sons, 2001.
[11]. Mrs. M.S.Vanjale, GSM based water billing machine, India, University of Pune, April2014.

JIT 5TH YEAR ECE PROJECT

Page 44

Automatic Water meter Reading and Billing system (June 2015)

Appendix
Message sending code
To the station
// LCD module connections
sbit LCD_RS at RB0_bit;
sbit LCD_EN at RB1_bit;
sbit LCD_D4 at RB2_bit;
sbit LCD_D5 at RB3_bit;
sbit LCD_D6 at RB4_bit;
sbit LCD_D7 at RB5_bit;

//

*******************AT

Commands

initialization***********//
char AT[]="AT";
char noecho[]="ATE0";
char modetext[]="AT+CMGF=1";
char
mobileno[]="AT+CMGS=+251932823704";
char terminator=0x1A;
char customername[]=" Customer name:

sbit LCD_RS_Direction at TRISB0_bit;

ABEBE CHALLA";

sbit LCD_EN_Direction at TRISB1_bit;

char

sbit LCD_D4_Direction at TRISB2_bit;


sbit LCD_D5_Direction at TRISB3_bit;
sbit LCD_D6_Direction at TRISB4_bit;
sbit LCD_D7_Direction at TRISB5_bit;

customerno[]="customer

no:

00534/07";
char metercode[]="metercode: 23434534";
char text1[]="meter reading=";
//**********************Meter
reading8********//

// End LCD module connections


void meterread(void)
int count;
{
char txt[20];
count=ADC_Read(0);
JIT 5TH YEAR ECE PROJECT

Page IX

Automatic Water meter Reading and Billing system (June 2015)


count=count*0.4887;

while(*s)

void dataConvertion(void)

UART1_Write(*s++);

inttostr(count,txt);

UART1_Write(0x0D);

void display(void)

void sendtomodem1(char *s)

Lcd_Out(1,1,"meter reading=");

while(*s)

Lcd_Out(1,15,Ltrim(txt));

UART1_Write(*s++);

Lcd_Chr_Cp(0xdf);

Lcd_Chr_Cp("m3");

void sendsms()

Lcd_Out(1,17,count);

Lcd_Out(2,1,customername);

sendtomodem1(text1);

Lcd_Out(3,1,customerno);

delay_ms(1000);

Lcd_Out(1,17,count);

sendtomodem1(txt);

delay_ms(2000);

//****************************string

UART1_Write(terminator);

transmit function****//
void sendtomodem(char *s)

delay_ms(2000);
}

JIT 5TH YEAR ECE PROJECT

Page X

Automatic Water meter Reading and Billing system (June 2015)


sendtomodem(modetext);
delay_ms(2000);
void main() {

sendtomodem(mobileno);

Lcd_Init();

delay_ms(2000);

UART1_Init(96000);

sendtomodem(customername);

while(1)

delay_ms(2000);

sendtomodem(customerno);

meterread();

delay_ms(2000);

delay_ms(2000);

sendtomodem(metercode);

display();

delay_ms(2000);

delay_ms(2000);

sendsms();

sendtomodem(AT);

delay_ms(2000);

delay_ms(2000);
sendtomodem(noecho);

delay_ms(2000);

JIT 5TH YEAR ECE PROJECT

Page XI

Automatic Water meter Reading and Billing system (June 2015)

AT Commands for sending SMS


1. Define message format by typing AT+CMGF=1 (Text mode).
2. Set message center number by typing AT+CSCA=XXXXX(Center number of service
provider)
3. Enter recipient number by AT+CMGS=YYYYYY.
4. Write message and press Ctrl-z.
AT Commands for receiving SMS
1. Define message format by typing AT+CMGF=1(Text mode).
2. Type AT+CNMI=1,, 2,0,0,0 In order to see all received messages.
ATEO Echo off
ATE1- Echo on
ATD Call a dial no.
Syntax: ATD 9479555640
ATDL- Redial last telephone no.
ATA- Answer an incoming call
ATH-Disconnect existing connection
AT+CMGS-To send SMS
Syntax: AT+CMGS=9479555640 Press enter

AT+CMGR To read SMS

Syntax: AT+ CMGR=1; reads first SMS in sim card

AT+CMGD To delete SMS

Syntax: AT+CMGD = 1; deletes first SMS in sim card


JIT 5TH YEAR ECE PROJECT

Page XII

Automatic Water meter Reading and Billing system (June 2015)

JIT 5TH YEAR ECE PROJECT

Page XIII