Professional Documents
Culture Documents
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
SUBMITTED TO
CBTP and project coordinator
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.
Date: ____________________
Page I
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.
Page II
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
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.
Page III
INTRODUCTION ................................................................................................................... 1
1.2.
1.3.
1.4.
1.5.
1.6.
1.7.
1.8.
Methodology .......................................................................................................................... 10
2.1.1.
2.1.1.
2.1.2.
2.1.3.
2.1.4.
RS232 ............................................................................................................................ 18
2.1.1.
3.2.
3.3.
3.3.1.
3.3.2.
Page IV
4.2.
4.3.
4.4.
Conclusion ............................................................................................................................. 42
5.2.
Recommendation ................................................................................................................... 43
Appendix ............................................................................................................................................... IX
Page V
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
Page VI
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
Page VII
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
Page VIII
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.
Page 1
Page 2
[3]
by any
abnormal activity, then the PIC circuit also automatically activate the computer to send SMS to
the owner using mobile phone modem.
Page 3
[11]
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
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.
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
cannot interact
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].
Page 5
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
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
Page 6
Develop an automatic water meter reading and billing system that will utilize
wireless technology using GSM module system for data transmission.
Determine the reliability of the automatic water meter reading using GSM data
transmission technology.
increased performance in the data collection, less manpower and resources are
needed in meter reading and data gathering
Page 7
Improves revenue collection and avoiding unpleasant bill surprises for customers.
Page 8
Page 9
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
Hardware
assembling using
proteus
Simulation
testing
Correct
values
Calibration
the system
Result and
analysis
Conclusion and
recommendati
on
End
Page 10
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]:
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
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
Page 11
Page 12
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].
Page 13
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.
Page 14
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.
5 input/output ports
3 timers
2 CCP modules
serial
communication
ports
(MSSP, USART)
Page 16
Special features:
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
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).
Signal
Pin
Signal
Receiving data
Request to send
Transmitted data
Clear to send
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
Page 19
[5].
memory, which uses normal PC voltages for erasure and reprogramming [6].
Page 20
CHAPTER THREE
3. SYSTEM DESIGN
3.1. Block diagram
Sending side (customer side)
LCD
POWER
SUPPLY
FLOW
SENSOR
PIC16F877
GSM
MICROCONTROLLER
EEPROM
Page 21
GSM
Station
personal
computer
GSM network
Customer phone
LCD
GSM
OUTPUT
The receiving or controller side has one input and one output. Those are:
Page 22
Sending end
Receiving end
Page 23
Page 24
Falling
edge
Rising
Edge
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.
Page 25
Meter reading
Is it sending
time?
Write data to
USART
Send to station
Stop
Page 26
Initialize
ports
Connect port
to C#
Read (access)
ports
Is message
incoming?
Display text on
message box
Store incoming
message on the
database
Stop
Page 27
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
Rent in month
inch
inch
1 inch
15
1 inch
20
2 inch
30
Page 28
Are Entered
values=text?
Cu=C-P
6<=Cu<
=16
Go to block
A
Cu<=5
c
Go to block
B
17<=Cu<
=30
Go to block
C
Cu>=30
Go to block
D
Page 29
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
Ye
s
Ye
s
B1=Cu*3.80
Bill=b1+ 20
Page 30
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+
Page 31
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
Page 32
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
Page 33
Sr.no
Equipment
Pic
Device
LCY(per
quantity
quantity)
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
1.04
20.8
41.6
0.2
1097.6
2043.8
232
7
Crystal
Crystal
oscillator
16MHz
oscillator 2
Total
price
Page 34
CHAPTER FOUR
4. SIMULATION RESULT AND DISCUSSION
4.1. Customer side message sending
Cus_nam:ABEBE CHALLA
Customer_no:1236/4
Meter reading:5
Page 35
Page 36
Page 37
Page 38
Page 39
Page 40
Page 41
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.
Page 42
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.
Page 43
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.
Page 44
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:
ABEBE CHALLA";
char
customerno[]="customer
no:
00534/07";
char metercode[]="metercode: 23434534";
char text1[]="meter reading=";
//**********************Meter
reading8********//
Page IX
while(*s)
void dataConvertion(void)
UART1_Write(*s++);
inttostr(count,txt);
UART1_Write(0x0D);
void display(void)
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);
}
Page X
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);
Page XI
Page XII
Page XIII