Professional Documents
Culture Documents
Design and Construction of A GSM Based e
Design and Construction of A GSM Based e
ENERGY METER
BY
OLANREWAJU-GEORGE BABATUNDE
(EE/08/0160)
YOLA
MAY, 2014
1
DESIGN AND CONSTRUCTION OF A GSM BASED
ENERGY METER
BY
OLANREWAJU-GEORGE BABATUNDE
(EE/08/0160)
MAY, 2014
2
DECLARATION
I hereby declare that this project report was written by me and it is a record of my own
research work. It has not been presented before in any previous application for a bachelor’s
(STUDENT)
ENGR. I. M. VISA
(SUPERVISOR)
3
CERTIFICATION
This project entitled “Design and Construction of a GSM Based Energy Meter” by
the bachelor’s degree of the Modibbo Adama University of Technology, Yola and is approved
ENGR. I. M VISA
(SUPERVISOR)
ENGR. I. M VISA
(HOD)
PROF. E .E OMIZEGBA
(EXTERNAL EXAMINER)
4
DEDICATION
This project report is dedicated to the glory of Almighty God, who in His infinite mercies and
5
ACKNOWLEDGEMENTS
In my sincere acknowledgement, I would say I am most grateful to God Almighty for his
I appreciate my parents Mr& Mrs Aderemi Olanrewaju George whose unending care and
support, prayers has been my refuge, my siblings (Adebayo and Adedapo, my elder sister and
her family the Akpede’s and my adorable niece Fiyinfoluwa and nephew Feyigbola) for their
Also I acknowledge with deep appreciation my friend who like a brother has been there for
me all the way, Tony Ekeyi. I express sincerely my gratitude to you Oluwakemi whose
support, love and inspirations were never ending, I say a big thank you.
I acknowledge the efforts of my lecturers and duly appreciate each and every one, from my
HOD who also is my supervisor Engr. I.M Visa., Engr. A.S. Kadalla, Engr. Luka Mattew,
Engr. I.A Usman, Dr. S.Y. Musa, Abel Ajibesin, Engr. Zara N. Oriolowo and Engr. A.
Yahaya, Idris I Idris, Mallam Aminu, Dr. A. H Zummo, Pallam S. W. For the knowledge they
Finally, I also appreciate my course mates for their support, Monica, Lord Miracle, Silas,
Joel, Chiroma, Ankiri, Elijah, Samuel, Ifunaya, Munir, Daniel, Williams, Seid, Lanre,
Dennis, Oyeyemi, Sadiq, Isa, Vitalis, Umar. For their care support and encouragement while i
was the classrep. To everyone who has contributed in one way or the other, i want to say
6
ABSTRACT
billing has come of age. Traditional metering methods for retrieving the energy data of
consumers is not convenient. The present system of energy billing is error prone, time,
resource and labour consuming. The problem worsens when consumers try to bypass meter
units, thereby pay less than what is actually consumed or the case of overbilling by the
This paper presents the design and implementation of a GSM based remote operation of
an energy meter which proffers the solution to power theft, consumption control, auto billing
and payment, data logging and labour reduction in power distribution and management
The objective of this project is to facilitate energy consumption measurement and its
The materials and method deployed herein is the use of a microcontroller unit that
continually monitors the meter interfaced with a GSM MODEM with a dedicated SIM for
remote operations. The method used to carry out this project is the principle of serial
7
TABLE OF CONTENTS
CERTIFICATION ………………………………………………………………… iv
DEDICATION ……………………………………………………………………. v
ACKNOWLEDGEMENT …………………………………………..................... vi
CHAPTER ONE
INTRODUCTION ………………………………………………….………… 1
i. BACKGROUND ……...……………………………………………….. 1
v. SCOPE …………………………………………………………………. 3
CHAPTER TWO
8
2.11 DIRECT CURRENT (DC) ………………………………………………….. 5
CHAPTER THREE
9
3.3.1 CIRCIUT ANALYSIS …………………………………………………………….19
10
3.5.1 CIRCIUT DESIGN USING PRINTED CIRCIUT BOARD (PCB) ………………49
CHAPTER FOUR
CHAPTER FIVE
CONCLUSIONS………………………………………………………………….....63
REFERNCES …………………………………………………………………………65
APPENDICE ............................................................................................................68
11
LIST OF TABLES
LIST OF FIGURES
12
FIG. 3.6 LM 317T IN CIRCUIT REGULATION ………………………………..……26
FIG.3.20 THE MAX 232 INTERFACED WITH DB9 CONNECTOR TO MODEM ……44
13
FIG. 3.24 PCB LAYOUT …………………………………………………………………..50
LIST OF PLATES
PLATE 3.3 CASING OF METER UNIT SHOWING THE COMPONENTS AND GSM
MODEM …………………………………………………………………………………….54
PLATE 4.4 LCD SCREEN INDICATING THE METER CHECKING FOR SMS ………..56
PLATE 4.5 SCREEN SHOT OF SMS RECEIVED FROM THE METER UNIT ………….57
14
CHAPTER ONE
INTRODUCTION
1.0 BACKGROUND
tools are predominantly at different levels, interfacing in the day–to-day activity of man.
These livelihood activities constitute and deliver economic, social and political benefits and
potential risks to the survivability of nations –especially developing nations like ours.
Electricity has become one of the basic requirements of human civilization, being widely
deployed for domestic, industrial and agricultural purposes. In spite of the very well developed
sources of electricity, there are a number of problems with distribution, metering, billing and
control of consumption. Electricity is one of the vital requirements for sustainment of comforts
of life and so it should be used very judiciously for its proper utilization [1]. But in our country
we have lot of localities where we have surplus supply for the electricity while many areas do
not even have access to it. Our policies of its distribution are also partially responsible for this
because we are still not able to correctly estimate our exact requirements and still power theft
is prevailing [1].
On the other hand consumers are also not satisfied with the services of power companies,
most of the time they have complaints regarding statistical errors in their monthly bills.
Thus this project presents an innovation towards the minimization of technical errors and
reduction in human dependency at the same time. With the help of this project the monthly
energy consumption of a consumer will be received from a remote location directly. In this
way human effort needed to record the meter readings which are till now recorded by visiting
15
every home individually is reduced. This results in considerable loss of human hours and also
provides considerable details regarding the average consumption of a locality so that power
supply can be made according to these data. This will help the officials in deciding the
distribution.
This idea is economically efficient as well because the meter reading can be gotten at a
very low cost. The implementation is done in such a way that a SMS is delivered to the GSM
MODEM whose reading is to be noted and then that meter replies to the server in the SMS
The GSM AMR takes the advantage of available GSM infrastructure nationwide
coverage and the Short Messaging System (SMS) cell broadcasting feature to request and
retrieve individual houses and building power consumption reading back to the energy
provider wirelessly.
company hire persons to visit each house and record meter reading manually which is used for
billing, the bill then sent to consumer by post or hand delivery, this is not only sluggish but
laborious, with the company having no control over these meters. There is a stark amount of
revenue loss being incurred by our country due to energy theft which is a serious problem,
people try to manipulate meter reading by adopting various corrupt practices such as current
reversal, partial earth fault condition, bypass meter, magnetic interference etc. [2]. With the aid
of this project a definite solution is proffered which allows power companies to have total
control over energy meters and have real time information of same from a remote location with
16
1.2 OBJECTIVE
The purpose of this project is the remote monitoring and control of the domestic energy
meter; its aims includes: to design a circuit which continuously monitors the meter reading and
sends message to electricity company, programming of the GSM MODEM with AT (Attention)
command sequence, interfacing the programmable chip with the personal computer, interfacing
the programmable chip with the energy meter, interfacing of GSM MODEM with the
programmable chip, sending messages from the remote phone to control device.
1.3 SIGNIFICANCE
The significance of these project benefits the Consumers of electric service and the
electric services company as it provides precise consumption information, clear and accurate
billing, automatic outage information and faster recovery, better and faster customer service,
smart automated processes instead of manual work, accurate information from the network
load to optimise maintenance and investments, detection of tampering of meters, demand and
eliminates cost and inadequacies of manual reading, observation and control of energy
consumption and production, this is useful for planning and power allocation purposes.
1.4 SCOPE
The scope of this project is to design and construct GSM based a one phase two wire
energy meter with voltage rating of 220V, current of 25 -100A operating at 50Hz and interfaced
17
with a microcontroller unit and GSM module with a LCD with the wireless communication
features over SMS. Within the scope of this project, the prototype model is equipped with a
18
CHAPTER TWO
LITERATURE REVIEW
An electricity meter or energy meter is a device that measures the amount of electric
are typically calibrated in billing units, the most common one being the kilowatt hour (kWh).
The electric power company which supplies the electricity installs the electric meters to
Reading (AMR). One as discussed in this report is the GSM based Automatic Meter Reading
System which uses the GSM network for communicating with the meter.
important that an electric energy meter was required to properly bill customers for the cost of
energy. Edison at first worked on a DC electromechanical meter with a direct reading register,
but instead developed an electrochemical metering system, which used an electrolytic cell to
totalize current consumption. At periodic intervals the plates were removed, weighed, and the
An early type of electrochemical meter used in the United Kingdom was the 'Reason'
meter. This consisted of a vertically mounted glass structure with a mercury reservoir at the
top of the meter. As current was drawn from the supply, electrochemical action transferred the
mercury to the bottom of the column. Like all other DC meters, it recorded ampere-hours. Once
19
the mercury pool was exhausted, the meter became an open circuit. It was therefore necessary
The first specimen of the AC kilowatt-hour meter produced on the basis of Hungarian
Ottó Bláthy's patent and named after him. These were the first alternating-current watt-hour
meters, known by the name of Bláthy-meters. Also around 1889, Elihu Thomson of the
American General Electric company developed a recording watt meter (watt-hour meter) based
electrochemical type and could operate on either alternating or direct current. [3]
meter of the modern electromechanical form, using an induction disk whose rotational speed
was made proportional to the power in the circuit. Although the induction meter would only
work on alternating current, it eliminated the delicate and troublesome commutator of the
The most common unit of measurement on the electricity meter is the kilowatt hour
(kWh), which is equal to the amount of energy used by a load of one kilowatt over a period of
one hour, or 3,600,000 joules. Demand is normally measured in watts, but averaged over a
period, most often a quarter or half hour. Reactive power is measured in "thousands of volt-
20
ampere reactive-hours", (kvarh). By convention, a "lagging" or inductive load, such as a motor,
and current (amperes) to give energy used (in joules, kilowatt-hours etc.). The meters fall into
magnetic, metal disc which rotates at a speed proportional to the power passing through the
meter. The number of revolutions is thus proportional to the energy usage. The voltage coil
consumes a small and relatively constant amount of power, typically around 2 watts which is
not registered on the meter. The current coil similarly consumes a small amount of power in
proportion to the square of the current flowing through it, typically up to a couple of watts at
The disc is acted upon by two coils. One coil is connected in such a way that it produces
a magnetic flux in proportion to the voltage and the other produces a magnetic flux in
proportion to the current. The field of the voltage coil is delayed by 90 degrees, due to the coil's
inductive nature, and calibrated using a lag coil. A permanent magnet exerts an opposing force
proportional to the speed of rotation of the disc. The equilibrium between these two opposing
forces results in the disc rotating at a speed proportional to the power or rate of energy usage.
The disc drives a register mechanism which counts revolutions. The type of meter described
21
FIG 2.1 A 3Ø ELECTROMECHANICAL INDUCTION METER, METERING 100 A
240/415 V SUPPLY
The amount of energy represented by one revolution of the disc is denoted by the symbol
Kh which is given in units of watt-hours per revolution. The value 7.2 is commonly seen. Using
the value of Kh one can determine their power consumption at any given time by timing the
3600. ℎ
= − − − − − − − − − −1
Where:
P = power in watts.
22
For example, if Kh = 7.2 as above, and one revolution took place in 14.4 seconds, the power is
1800 watts. This method can be used to determine the power consumption of household devices
Electronic meters display the energy used on an LCD or LED display, and some can also
transmit readings to remote places. In addition to measuring energy used, electronic meters can
also record other parameters of the load and supply such as instantaneous and maximum rate
of usage demands, voltages, power factor and reactive power used etc. They can also support
time-of-day billing, for example, recording the amount of energy used during on-peak and off-
peak hours.
23
As in the block diagram, the meter has a power supply, a metering engine, a processing
and communication engine (i.e. a microcontroller), and other add-on modules such as real time
24
PHCN (Power Holding Company of Nigeria), the operating electric power utility
Electronic meters are intended to replace the old post-payment meters. This document looks at
some benefits of this new prepayment meters first to PHCN and then to average electric power
consumers in Nigeria. The new energy prepayment meters if well handled by PHCN will
increase her revenue. First, since new meters are prepayment meters it will reduce the overhead
that usually characterize house-to-house recovery of revenue as was almost the case in the past.
This new energy metering system has some anti-tamper facilities that will largely discourage
PHCN will also reduce its administrative overhead when this new energy prepayment
meters are fully deployed in most parts of Nigeria. Because this new metering system is
Electronic, most of the steps required in administering it can be automated. This will reduce
staff requirement and as a result reduce staff overhead. As a result, PHCN will free more cash
for investment in deployment of new power plants that will answer the current problems of
Another benefit of these new energy prepayment meters to PHCN is that it will enable her
to determine the actual energy demand in Nigeria. This is because most of her consumers will
now be conscious of the amount of energy consumed. The new prepayment meters will reduce
According to [6], Automatic Meter Reading (AMR) technology, Electrical Utilities (EUs)
has been exploiting their own infrastructure to bill their customers in an efficient and
economical way. Since the amount of data that has to be sent is quite low related to the available
time to perform this task, AMR applications have been demanding low bit rates. At this
moment, EUs are exploring and demanding other services as load and alarm management,
25
remote monitoring and disconnections, etc. In this context, the Low Voltage modems should
provide more throughout while keeping the cost of the hardware low. The results of this low
complexity AMR technology are that in order to deploy an AMR network, the cost of the
equipment on the customer premises and the added value services that the system provides are
According to [7], it describes the different methods by which distribution transformer loads
can be allocated for power-flow studies. Individual distribution loads are calculated using four
different methods of allocation. The results of the power-flow studies are compared to those
• Daily kWh
• Monthly kWh
• Transformer kVA
• REA
The electromechanical based energy meters are rapidly being replaced by digital energy
meters which offer high accuracy and precision. Now the generation of electric energy meters
1) Higher speed
26
6) Remote power switches ON/OFF
7) Load balancing
provides a cost-effective, reliable, and interference free data transfer between remote meter
reading units and the utility control centre. The meter reading and management processes are
free from human involvement. Based on the existing telephone networks, it is very flexible for
the utility companies to access, service and maintain this meter reading system. A user friendly
and window based user interface is designed which fully utilizes the personal computer's
terminal and programming technique to achieve communications between the remote meter
reading units and the personal computers in the utility control centre.
In [9], a novel Automatic Meter Reading (AMR) system was proposed using the IEEE
802.15.4-compliant wireless networks to communicate with energy meter. The mesh network
based Automatic Utility Data Collection System (AUDCS) provides a cost-efficient solution
by exploring the self-organization, self-healing capabilities of the mesh networks and utilizing
semiconductor chips and the radio transceivers compliant with IEEE 802.15.4 standard. The
peer-to-peer mode is chosen for the AUDCS system, as it is more flexible and robust than the
centralized implementation based on the star topology. The application data characteristics are
exploited in the data gathering and dissemination to achieve better energy efficiency.
In the paper ‘Design and implementation of Web services Based GPRS Automatic Meter
Reading System’[10], for the purpose of enhancing the management level of the meter reading
of power enterprises, web services based automatic meter reading system is put forward. The
27
It describes the characteristics of GPRS technology and Web Services technology and
introduced how to build the Automatic Meter Reading System with merits such as: real time,
wide coverage, open and easy to maintenance and extension. At present, this GPRS Automatic
Meter Reading System has gained good application in practical work and been proven to be
correct.
From the reviews described above, which implements the Automatic Meter Reading
System, using web based technologies and GSM communications systems which tend to all
cost of implementation and power theft. It will be noted the essence of further development of
systems that will meet the growing demand of electricity generation and distribution.
Tampering in electric meter and energy theft has become quite common. Electric meters
can be manipulated, thus causing them to stop, under-register or even bypassing the meter.
Consumers, who tamper with electric meter, effectively use power without paying for it.
Electric meter security is looked upon as major issue in many countries today. A large portion
of a country’s revenue is lost due to the high density of tampering and security in electric
meters. Hence it becomes very important to detect tampering in electric meters to ensure proper
billing. One of the methods adopted to ensure the efficient supply is to reduce tampering with
Modern detection tools that help in power theft identification include the following;
28
2.5 POWER LINE RELATED INTELLIGENT METERING (PRIME)
Power utility companies can use the smart grid power line communication technology
to effect internal communication between control centres and different devices to realise
remote control functions. PRIME was developed for energy related services in the narrow
This technology enables utility providers to read meters without the need to go to each
physical location. Furthermore, customers and utility providers can monitor and manage
resource usage more easily. AMR is implemented using these technologies, usually; a
transceiver sends a wake up signal to the particular transmitter and asks it to send its data.
Advanced Metering Infrastructure (AMI) collects all the data from smart meters and the
Distribution Automation System (DAS) and sends it to the control centres. AMI deployment
provides the opportunity for utility companies to control end user devices, send real time
29
GSM has been the backbone of the phenomenal success of mobile communication in
the previous decade. Now at the dawn of true broadband services, GSM continues to evolve
to meet new demands. GSM is an open, non-proprietary system with international roaming
capability.
GSM was originally known as Group Special Mobile but nowadays it is commonly
described a digital circuit switched network optimized for full duplex voice communications.
The standard was expanded over time to include first circuit switched data transfer, then
packet data transport via GPRS (General Packet Radio Service). Packet data transmission
speed was later increased with the help of EDGE (Enhanced Data Rate for GSM evolution)
technology.
Global System for Mobile Communication (GSM) is the world’s most popular standard
for mobile telephony systems. GSM is used by over 1.5 billion people all over the world.
GSM also pioneered the low cost implementation of the Short Message Service (SMS) which
allows parties to exchange delay tolerant short text messages. The popularity and coverage of
According to the analysis of real data taken from a real GSM network in India, SMS
delivery success rate is found to be 94.3%. Of these successfully delivered messages, 73.3
arrived to their destination within 10 seconds. About 5% of them required more than 1 hour
30
Using SMS for AMR will certainly increase the flow of messages tremendously. GSM
uses several cryptographic algorithms for security. The development of UMTS introduces an
optional Universal Subscriber Identity Module (USIM), which uses a longer authentication
key to give greater security, as well as mutually authenticating the network and the user.
31
CHAPTER THREE
3.0 INTRODUCTION:
This chapter entails the design and construction procedure of the GSM Energy Meter
detailing step by step the theoretical analysis, choice of components and values and
construction and packaging materials. Indicating calculations, schematics and drawings. The
design procedure is divided into hardware and software design as discussed below.
The GSM Based Energy Meter is an electronic unit design to take real time energy
usage using a current sensing method which is then communicated to a microcontroller, who
takes the appropriate calculations and displays on an LCD. A GSM MODEM is incorporated
with the unit so as to make remote control of the meter unit by doing either of the following:
32
3.2 SYSTEM BLOCK DIAGRAM
This section describes the methods used in designing each component part of the system.
Analysing the choice of components and values as used in the circuit. The circuit was
The circuit is divided into 6 segments: the regulated power, current sensing, relay
33
3.3.2 REGULATED POWER SUPPLLY
In this circuit there are two voltage levels of 5V and 12V DC respectively, using the
Zener power regulation method, consisting of a current limiting capacitor, bridge rectifier,
filtering capacitors, Zener diode, a buffer transistor and a three terminal adjustable voltage
regulator. With the 5V powering the LCD and the Microcontroller, the 12V for the Relay.
The 2W005G bridge rectifier has a diffused junction with a low forward voltage drop of
1V and a high current capability of 50A and an Average Rectified Output Current of 2A.[13]
= √2 × × − 2 × − − − − − − − − − − − −2
= 0.7
= 0.05
34
= √2 × 220 × 0.05 − 2 × 0.7
= 14.16
The filtering capacitors C4 and C5 in this circuit are used to smooth the ripple of the
rectifier output. When selecting a capacitor the important parameters are; the capacitance,
≥ 2 − − − − − − − − − − − − − −2
= √2 × − − − − − − − − − − − − − −3
= √2 × 220
VP = 311.13V
∴ = 2 × 311.13
= 622.25
The capacitance value can be obtained from the current formula of the capacitor given as;
$%
"# = − − − − − − − − − − − − − − − − − −4
$
q = charge in coulomb
% = &
35
$)
'( = & − − − − − − − − − − − − − − − − − 5
$
1
*+
, =
$
, = frequency ripple
"# = &, $
& = . 0- − − − − − − − − − − − − − − − − − −6
/ 1
∴ , "2
3"45 ,67 ,+88 39)5 754
","57.
∴ /:; = 0.482 × 12
= 5.784V
So the capacitor value can also be determined by the given equation below
"0#
&= − − − − − − − − − − − − − −8
4√3,<
f =50Hz
< = 0.482
36
= 14.16
"0# = 1E
Equation 8 becomes
1
&=
4√3 × 50 × 0.482 × 14.16
& = 423 F,
It can be deduced that the least capacitor value needed is 423µf, to get a high value of
voltage; we require a large value of capacitance in the circuit. Thus, a capacitor with a value
1000µf was chosen. Which is more than twice the value of the needed capacitor value. This is
used to provide safety in the circuit. Therefore C4 and C5 are rated 1000µf.
The Zener diode is like a general-purpose signal diode. When biased in the forward
direction it behaves just like a normal signal diode, but when a reverse voltage is applied to it,
The purpose of the Zener voltage regulator is to maintain a constant voltage across a
load regardless of variations in the applied input voltage and variations in the load current.
The 1N5242B Zener diode is used in the design of this project as it meets the desired design
[14]
A typical Zener diode shunt regulator is shown in the figure below. The resistor is
selected so that when the input voltage is at Vin(min) and the load current is at IL(max) that the
current through the Zener diode is at least Iz(min). Then for all other combinations of input
37
voltage and load current the Zener diode conducts the excess current thus maintaining a
constant voltage across the load. The Zener conducts the least current when the load current
is the highest and it conducts the most current when the load current is the lowest. [15]
Calculating current
The total current drawn from the source is the same as that through the series resistor.
' = − − − − − − − − − − − − − − − − − −9
G
14.16
'I = = 3JE
470
20 − 3 = 17JE
38
3.3.6 TRANSISTOR TIP 41
The TIP 41 NPN transistors serves as a Buffer for Voltage Regulator. The impedance
matching and current amplifying characteristics of the emitter follower provide buffering for
the Zener and draw less current from it. It is a useful adjunct to a Zener regulator. In order to
used to amplify current to the load, so that the Zener diode circuit only has to handle the
The choice of voltage regulator depends on the load current of the circuit. The voltage
regulator must have a capacity to carry a current twice the load current. The LM317T, a
supply more than 1.5 A of load current with an output voltage adjustable over a 1.2 V to 37 V
range. It employs internal current limiting, thermal shutdown, and safe area compensation.
[16]
39
FIG. 3.5 BLOCK DIAGRAM OF LM317T
Since the LM317T is an adjustable regulator, the choice of output voltage is determined
by the resistance which is a potential divider across the terminal 1, where we have R1 to be
2.2KΩ and R2 to be 1KΩ, as a 4V output is needed to power the microcontroller and the
The LM 317T has electrical characteristics as gotten from the datasheet [16].
40
VI-VO = 5 V, IO = 0.5 A, 0°C ≤ TJ ≤ +125°C, IMAX = 1.5 A, PDMAX = 20 W
The expression below is used to derive the desired output voltage of 4V.
OTU
LMN =
OPQ R1 + W − − − − − − − − − − − − − 11
OTV
2.2
LMN = 1.25 X1 + Y
1
∴ LMN = 5
C1 is not needed for stability; however, it does improve transient response. Since IADJ is
controlled to less than 100μA, the error associated with this term is negligible.
The rated DC output across the Zener regulator is 12V, this is used to power the 12V
relay used in the isolation of the consumer load from the power source and the voltage across
the LM317T is derived to be 4V which is used to power the microcontroller and the LCD.
power supplies, digital watt meters, programmable current sources, etc. In this design the
41
ACS755-100 CB current sensor is used as it provides economical and precise solutions for
The output of the device has positive slope when an increasing current flows through
the copper conduction path. At zero current, the output voltage is half of the supply voltage
(Vcc/2). It should be noted that the ACS755 provides ratiometric output, which means the
zero current output and the device sensitivity are both proportional to the supply voltage,
VCC.
42
The microcontroller ADC uses Vcc = 5.0V as a reference for A/D conversion and the
same supply voltage powers the ACS755 sensor chip. The analog output of the ACS755 is
digitized through the ADC chip. When there is zero current through the current sensor, the
The curve below shows the nominal sensitivity and transfer characteristics of the
The output of the sensor module goes to RA0/AN0 (pin 2) ADC channel of the
PIC18F2550 microcontroller. The microcontroller uses the supply voltage (+5V) as reference
for A/D conversion. The digitized sensor output is processed through software to convert it to
the actual current value. The mathematics involved in the process is described below.
43
Sensitivity =40mV/A
1024
46+Z
= ×
[ − − − − − − − − − − − − − −12
((
But
((
[ = × 0.04 + ' − − − − − − − − − − − − − −13
2
1024
((
46+Z
= × \ × 0.04 + ']
(( 2
' = 0.026446+Z
− 512
The string of the program that controls the calculation for charging consumer load in KW/hr
is as seen in the source code in Appendices A.
applied to it. Normally a relay is used in a circuit as a type of switch. The relay in this circuit
44
is used to isolate the consumer load from the power grid when either the loaded units are
Since the relay is transistor driven, the relay is used on the collector side. The voltage
impressed on the relay is always full rated coil voltage, and in the OFF time, the voltage is
completely zero for avoidance of trouble in use. The NPN transistor is used for the switching
of the relay. The BC 547 NPN transistor is selected based on current, voltage and power
The transistor is driven into saturation (turned ON) when a LOGIC 1 is written on the
PORT PIN thus turning ON the relay. The relay is turned OFF by writing LOGIC 0 on the
port pin. A diode 1N4007 is connected across the relay coil; this is done so as to protect the
transistor from damage due to the ‘BACK EMF’ generated in the relay's inductive coil when
the transistor is turned OFF. When the transistor is switched OFF the energy stored in the
inductor is dissipated through the diode & the internal resistance of the relay coil. This diode
is also called as free-wheeling diode. Resistor R10 is used as a Series Base Resistor to set the
45
(( −
(P
'(;^_ = − − − − − − − − − − − − − 14
GOP=`a
12 − 0.2
'(;^_b = 0.0295E
400
'(;^_
'c;^_ =
10
0.0295
'cd^_ = = 2.95JE
10
[ − )cP
GTe = − − − − − − − − − − − − − − − 15
'c;^_
4 − f. 7
GTe = = 1118.64Ω ≈ 1Ω
2.95 × 10gh
The microcontroller is the heart of the project; it controls all the activities of the entire
system.
• Meet the computation needs of task at hand efficiently and cost effectively.
For these reason the PIC18F2550 microcontroller is chosen. It is further discussed below.
46
FIG. 3.11 THE PIC18F2550 PIN CONFIGURATION
The PIC18F2550 microcontroller offers the following features which makes it very
with the addition of high endurance, Enhanced Flash program memory. In addition to these
features, the PIC18F2550 introduces design enhancements that make these microcontrollers a
Features PIC18F2550
47
Program Memory (Instructions) 16384
Interrupt Sources 19
Capture/Compare/PWM Modules 2
Comparators 2
48
FIG.3.12 BLOCK DIAGRAM OF PIC18F2550
49
3.3.12 CRYSTAL OSCILLATOR DESIGN
Configuration registers and two control registers. Configuration registers, CONFIG1L and
CONFIG1H.
The choice of capacitor used in the resonance of the crystal oscillator is dependent on
1: Higher capacitance increases the stability of oscillator but also increases the start-up time.
2: When operating below 3V VDD, or when using certain ceramic resonators at any voltage,
3: Since each resonator/crystal has its own characteristics, the user should consult the
4: Rs may be required to avoid overdriving crystals with low drive level specification.
5: Always verify oscillator performance over the VDD and temperature range that is expected
50
From the table it can be seen that for a 16MHz crystal a 22pf capacitor is used across
the crystal as also used in this design connected to PIN 9 and PIN 10 of the microcontroller.
specialised type of PN junction diode, made from a very thin layer of fairly heavily doped
semiconductor material. When the diode is forward biased, electrons from the
semiconductors conduction band recombine with holes from the valence band releasing
sufficient energy to produce photons which emit a monochromatic (single colour) of light.
Three LED’S are visible in the design as indicators. The yellow LED indicates power on of
the whole unit when it is powered on, the green LED indicates connection with the GSM
MODEM and the red LED indicates communication between the GSM MODEM and the
microcontroller. The red LED connected to PIN 4, the green LED to PIN 5 and yellow LED
to PIN 7.
51
FIG. 3.14 LED SCHEMATIC SYMBOL AND I-V CHARACTERISTICS CURVES
LED-YELLOW D3
R12
1k
LED-YELLOW
D4
LED-GREEN R13
1k
LED-GREEN
D5
LED-RED R14
1k
LED-RED
I −
Q
GI = − − − − − − − − − − − − − − − − − − − −16
'Q
I −
Q
'Q = − − − − − − − − − − − − − − − − − − − −17
GI
5−2
'Q = = 3JE
1000
52
The current flowing through the LED derived to 3mA for a 1kὨ series resistor
Buzzer is an electrical device, which is similar to a bell that makes a buzzing noise and
is used for signalling. The buzzer is integrated into this design as it will buzz when the units
on the ENERGY METER is below 100 units to server as a form of notification to the
consumer to recharge before disconnected from the power grid. The buzzer is connected to
A Liquid Crystal Display (LCD) is an electronic device that can be used to show
numbers or text. There are two main types of LCD display, numeric displays (used in
watches, calculators etc.) and alphanumeric text displays. LCD screen is an electronic display
module and find a wide range of applications. A LCD display modules is preferred over
seven segments and other multi segment LEDs. The reasons being: LCDs are economical;
easily programmable; have no limitation of displaying special & even custom characters
A 20x4 LCD displays 20 characters per line and there are 4 such lines. In this LCD each
character is displayed in 5x7 pixel matrix. This LCD has two registers: Command and Data.
The command register stores the command instructions given to the LCD. A command is an
instruction given to LCD to do a predefined task like initializing it, clearing its screen, setting
the cursor position, controlling display etc. The data register stores the data to be displayed
on the LCD. The data is the ASCII value of the character to be displayed on the LCD.
53
TABLE 3.3 LCD PIN FUNCTIONS
The LCD has 6 lines that can be connected directly to the PIC microcontroller pins.
However it is a good design practice to add a low value resistor on the lines to protect against
static discharges. The 10k potentiometer connected to pin 3 is used to adjust the contrast of
the display. All unused lines are tied to ground as shown below.
54
FIG 3.16 LCD
MICROCONTROLLER
Modems are devices that let computers transmit information over ordinary telephone
information into a series of tones (modulation) at one end of the telephone line, and translate
the tones back into the serial stream at the other end of the connection (demodulation). Most
modems are bidirectional, so a data transfer can take place in both directions simultaneously.
Because modems work with standard telephone lines, and use the public telephone network
to route their conversations, any computer that is equipped with a modem and a telephone
line can communicate with any other computer that has a modem and a telephone line,
A GSM modem could also be a standard GSM mobile phone with the appropriate cable
and software driver to connect to a serial port on your computer. Phones such as the Nokia
7110 with a DLR-3 cable, or various Ericsson phones, are often used for this purpose.
55
The GSM modem is configured via COM PORTS of a computer using the RS232
cable. The GSM modem understands a set of instructions called the AT (Attention)
commands. This is used to send queries and receive response from the GSM modem. The
READ COMMAND AT+<X>? The command returns the currently set value of
the parameters
WRITE COMMAND AT+<X>=<…> This command sets the user defined parameter
values
56
FIG.3.18 INSERTING/REMOVING THE SIM CARD INTO THE MODEM
The MAX232 is an integrated circuit, first created by Maxim Integrated Products, that
converts signals from an RS-232 serial port to signals suitable for use in TTL compatible
digital logic circuits. The MAX232 is a dual driver/receiver and typically converts the RX,
In interfacing GSM modem with microcontroller, the MAX 232 is used. The MAX
232 device is a dual driver/receiver that includes a capacitive voltage generator to supply
EIA-232 voltage levels from a single 5-V supply. Each receiver converts EIA-232 inputs to
5-V TTL/CMOS levels. Each driver converts TTL/CMOS input levels into EIA-232 levels.
The MAX 232 chip is used to do the level shifting and this chip is required to send data
Association (EIA). The 9-pin (DB9) connector, with specific pin assignments, is commonly
accepted as "the RS232 connector or the serial connector. This standard interface provides
connection for only modest transmission rates & is often used with modems. [22]
57
The transmitters take input from the microcontroller’s pin and send the output to RS
232’s receiver. The receivers, on the other hand, take input from transmission pin of RS 232
serial port and give serial output to microcontroller’s receiver pin. MAX 232 needs four
58
FIG.3.20 THE MAX 232 INTERFACED WITH DB9 CONNECTOR TO MODEM
59
FIG. 3.21 CIRCUIT DIAGRAM OF GSM BASED ENERGY METER.
60
3.4 SOFTWARE DESIGN
Been an embedded system, the programme was written in C# using the Microsoft Visual
Studio Integrated Development Environment (IDE). The program was compiled to the
memory of the PIC18F2550 microcontroller using the HiTech software. For any software
According to the hardware circuit design features, meter reading terminal program
flowchart was introduced as shown in figure 3.23. First the system initializes each module,
and then reads the meter reading regularly and stores them. When the receiving the
command, meter send the current status along with the energy consumption.
In doing this, the algorithm for the source code is written as seen in Appendices’ A.
following the instruction set of the PIC microcontroller, the flow chart for the design is seen
61
FIG. 3.22 SCREEN SHOT OF PROGRAMME IDE
62
FIG. 3.23 FLOWCHART OF PROGRAM
63
SECTION B: CONSTRUCTION PROCEDURE
PCB (Printed Circuit Board) is used to mechanically support and electrically connect
electronic components using conductive pathways, tracks or signal traces etched from copper
sheets laminated onto a non-conductive board. Components are connected through the
conductive material below a non-conductive board, the common conductive material used in
packaged PCBs are usually copper, since copper is cheap and common.
First, because the board will be more compact because design as well is made to be
compact. Second, it's more convenient to use, since one can decide where to put space on the
board. And last, the board will be stronger unlike those ready-made project boards which are
In making the PCB, the design is printed on a photo paper then the design is transferred
to the copper side of the board using heat transfer method, the ink from the paper is
transferred to the board. The ink serves as the protective layer to cover the copper part that
shouldn't be etched. Then after transferring the ink to the PCB board, the PCB board dipped
in an etching solution (Ferric Chloride) for 15 minutes. After etching the PCB board is rinsed
with water to remove the etching solution. After rinsing the remaining ink is removed with a
brush, to uncover the unetched copper part. After removing the ink, holes were drilled for the
64
FIG. 3.24 PCB LAYOUT
65
3.5.2 CASING AND PACKAGING
After the components were soldered to the PCB, continuity tests were carried out to
ensure proper connections of the components. The packaging materials include a base for
mounting the constructed which is placed in a plastic casing which houses the PCB and GSM
modem. Below is the description of the base material. A plywood is used as the base so as to
mount the casing and other external connections for the construction.
The edges of the plywood were taped with masking tape for neatness. Then an emboss
cardboard used as covering for the plywood. This is used to add beauty to the packaging. The
casing used to house the PCB and GSM modem is a white ready-made PVC material. This
was used as it fits the desired purpose and neatness. Holes were drilled on the cover to allow
for the LCD screen. The side of the case was drilled also to allow the GSM modems antenna
out and the external wirings. Below is a figure showing the dimensions of the PVC casing.
66
FIG. 3.26 TOP VIEW OF CASING
67
PLATE 3.2 SET UP OF GSM BASED ENERGY METER
68
PLATE 3.3 CASING OF METER UNIT SHOWING THE COMPONENTS AND GSM
MODEM
69
CHAPTER FOUR
This chapter describes the evaluations carried out of the system from simulation way
through to final construction. Detailing the results obtained and the cost evaluation for each
Prior to the construction of the project, the circuit was first designed using Proteus design
suite 8. The program was written in C# and then embedded on the microcontroller. The
program was compiled using Hitech software. This was done in order to see how the circuit
would work under real conditions. The GSM modem was also connected via COM ports on
the computer so as to send commands to the working circuit and see real time simulation of the
ENERGY METER. With the whole setup a simulation was established and the circuit was seen
to perform the required tasks and then real construction of the project began.
After the components were soldered to the PCB, continuity tests were carried out. The set
up was found to be properly working. The board was further packaged placed in the casing and
packaged. A registered MTN SIM card was inserted into the GSM modem. The meter unit was
connected to power source and then the SMS command to ‘Connect’ the meter was sent. A
report was replied back from the meter unit with details of the energy consumption. Further
commands were sent to ‘load’ the meter, ‘Disconnect’ the meter and also to get status ‘Report’
of the meter unit. The following plates shows the meter unit with the display.
70
PLATE 4.1 THE METER UNIT INDICATING MODEM IS CONNECTED
71
PLATE 4.3 LCD SCREEN INDICATING THE ENERGY CONSUMPTION DETAILS
PLATE 4.4 LCD SCREEN INDICATING THE METER CHECKING FOR SMS
72
PLATE 4.5 SCREEN SHOT OF SMS RECEIVED FROM THE METER UNIT
In order to perform the remote operations for the metering unit the format for the SMS
73
TABLE 4.1 SMS COMMAND AND FUNCTIONS
The project is seen to be cost effective as most components are readily available
locally. The packaging as seen is a plastic casing. From the cost evaluation table below it can
be deduced that the cost of producing a unit is quite expensive due to the procedures and
methods of carrying out the project in a local setting. It should therefore be noted that for a
mass production on a commercial scale the cost will reduce as much as 50% of the cost of
producing a unit as components will be purchased in bulk. The use of an analog meter would
The table below shows the list of all components used and the corresponding unit cost.
74
TABLE 4.1 COST EVALUATION
5 1N4007 DIODE 1 20 20
7 BC 547 TRANSISTOR 1 50 50
8 TIP41C TRANSISTOR 1 60 60
9 LM317T VOLTAGE 1 50 50
REGULATOR
12 BUZZER BUZZER 1 50 50
14 R1-R15 RESISTORS 15 5 75
75
15 C1, C2, C3, C8, CERAMIC 7 30 210
C10, C13.
CAPACITORS
CAPACITORS
24 POTENTIOMETE POTENTIOMETER 1 50 50
27 LAMP LAMP 1 50 50
HOLDERS HOLDERS
76
29 CASING PACKAGING - 800 800
30 CARDBOARD - 50 50
32 MISCELENOUS 12,000
TOTAL 37,200
77
CHAPTER FIVE
CONCLUSIONS
5.1 SUMMARY
The GSM Based Energy Meter project as stated proffers solution to the deficiencies of
traditional metering system. With the implementation of the GSM network system which is
readily available. Man is on the way to ultimately derive the benefits in remote automation
and control of electrical system. With this design fully implemented the cost associated with
metering is reduced. Power theft at minimum, proper documentation and even distribution of
Therefore it avoids human intervention, provides efficient meter reading, avoid the billing
error and reduce the maintenance cost. It displays the corresponding information on LCD for
user notification.
5.2 CONCLUSION
Modern civilization would be brought to its knees, if a crisis of electricity scarcity ever
looms. The cusp of society would collapse. Therefore, the undeniable need for uninterruptible
electricity is the prelude to development of any nation in the world today. From the design of
the system and development, it is realised that the implementation of the GSM BASED
ENERGY METER meets the objectives of its design as it was able to fully remote control the
activities of the meter unit by doing the following making it beneficial to both utility
78
Take meter reading.
time. Providing the power utility company to proper plan and design sufficient
5.3 RECOMMENDATIONS
Further development work can be done in the area of tampering in meters as this seem to
be major setback, though as known no system is 100% safe. The use of tamper proof seals
and labels, tamper resistant screws and locks and providing non-magnetic enclosure. Also the
incorporation of consumer load control with the metering system would also be developed.
The implementation of other control methods such as the wireless communication over the
With this development primary focus of research should be on the degree to which IT
can accomplish large scale, permanent change for a better and sustainable Nigeria, and by
extension the future of nations throughout the African continent especially in the area of
79
REFERENCES
http://www.nairaland.com/electronicenergyprepaymentoverview6486487/hrfh
[2] http://en.wikipedia.org/wiki/electricenergymeter
Design and Development of GSM based Energy Meter, International Journal of Computer
[4] H.G.Rodney, Tan IEEE, C.H.Lee and V.H.Mok, (2007), Automatic Power Meter
Reading system using GSM Network. The 8th International Power Engineering
http://www.naijatechguide.com/2012/11/phcn-benefits-of-new-prepayment
Oct. 2007.pdf
[7] Md. Ashiquzzaman, Nadia Afroze, Taufiq Md. Abdullah, Design and Implementation
80
[8] Mr.Rahul Ganesh Sarangle, Prof.Dr.Uday Pandit Khot, Prof. Jayen Modi, GSM Based
Power Meter Reading And Control System, International Journal of Engineering Research
and Applications (IJERA) ISSN: 2248-9622 www.ijera.com Vol. 2, Issue 4, June-July 2012,
pp.664-671
[9] O.Homa Kesav , B. Abdul Rahim, Automated Wireless Meter Reading System for
Technology and Engineering (IJRTE) ISSN: 2277-3878, Volume-1, Issue-2, June 2012
[10] Design and implementation of web based GPRS Automated Meter Reading System
[11] Xiaolin Lu Manager of Smart Grid R&D Il Han Kim System Engineer, Ram
VedanthamSystem Engineer Smart Grid Solutions team Texas Instruments Incorporated (TI),
Implementing PRIME for Robust and Reliable Power Line Communication (PLC)
[12] Printed circuit Processes & Instructions, Comprehensive Datak Instructions for Printed
Circuit Prototyping
www.fairchildsemi.com
Corporation www.fairchildsemi.com
www.datasheetcatalog.com
81
[20] Microcontroller interfacing circuits, Revolution Education Ltd. Business Innovation
Centre.
82
APPENDICE A
//08120899379
//#include <htc.h>
#include <p18cxxx.h>
#include "S@configs.h"
#include "S@types.h"
#include "S@EEPROM.h"
#include "S@LCD.h"
#include "S@Modem.h"
#include "S@Port.h"
#include "S@PIC16EEPROM.h"
#include "S@Queue.h"
#include "S@mTime.h"
#include "S@AC.h"
#include "System.h"
LCD lcd;
//uint8_t ModemTxBuf[1];
uint8_t ModemRxBuf[100];
//QUEUE ModemTxQueue;
QUEUE ModemRxQueue;
PORT mdPort;
MODEM modem;
TIME ConnTime, SMSTime, buzzTime;
TIME SenseTime;
uint8_t dSTime;
uint8_t txt[150];
uint8_t txtMatch[10];
uint8_t contact[17];
sBinType VBin[40];
sBinType IBin[40];
float V, I, W, J, M, IOffset;
bool connected;
bool memSet, smsSet;
uint8_t newLine[3] = "\r\n\0";
void Acquire(void){
uint8_t i;
for (i = 0; i < sizeof(VBin)/sizeof(sBinType); i++){
VBin[i] = (int16_t)SystemReadADC(1) - 511;
SystemDelayUs(1000/2);
IBin[i] = (int16_t)SystemReadADC(0) - 511;
SystemDelayUs(1000/2);
}
}
bool SendReport(void){
uint8_t i = 0;
83
SystemDelayMs(2000);
LCDLine(&lcd, 4, TRUE);
printf("Sending report...");
sprintf(txt, "Energy Report for SAKE Company, Apr 2014.\r\nGrid: %s.\r\nCurrent
Voltage: %uV.\r\nCurrent Load: %uW.\r\nEnergy Consumed: %uKWh.\r\nBalance:
N%u.%2.2uk", connected ? "Connected" : "Disconnected", (uint16_t)V, (uint16_t)W,
(uint16_t)(J/1000.0), (uint16_t)M, (uint16_t)(M*100)%100);
while(i++ < 5){
if (ModemSendSMSTextMode(&modem, txt, contact)){
return TRUE;
}
}
return FALSE;
}
uint8_t jValid;
float j;
static bool oldConnected, buzzing;
uint8_t unt;
void main(void){
SystemBeginInit();
BUSInit();
LCDInit(&lcd);
ModemCreate(&modem, &mdPort, NULL, NULL, 0, &ModemRxQueue, ModemRxBuf,
sizeof(ModemRxBuf), SystemPutC, SystemGetC);
mdPort.NewLine = newLine;
ReadEEPROM(0, &jValid);
ReadEEPROMS(sizeof(jValid), (uint8_t*)&J, sizeof(J));
ReadEEPROMS(sizeof(jValid) + sizeof(J), (uint8_t*)&M, sizeof(M));
ReadEEPROM(sizeof(jValid) + sizeof(J)+ sizeof(M), &connected);
oldConnected = connected;
if (jValid != 0){
J = 0;
M = 0;
}
SystemFinishInit();
while(1){
if (TimeSpan(ConnTime) > TimeToTick(2) || ConnTime == 0){
ConnTime = GetTime();
SystemSetWhiteLED(TRUE);
SystemSetGreenLED(ModemConnect(&modem));
SystemSetWhiteLED(FALSE);
SystemPower(connected);
if (!modem.ModemConnected){
memSet = FALSE;
smsSet = FALSE;
}
if (!memSet)
memSet = ModemSetSMSMemory(&modem, SIM);
if (!smsSet)
smsSet = ModemSetSMSMode(&modem, TextMode);
Acquire();
V = 2.3414 * ACGetRms(VBin, sizeof(VBin)/sizeof(sBinType));
//I = (60.0/1000.0) * (5.0/1023.0) * (3.142/(2.0*1.414)) *
ACGetAverage(IBin, sizeof(IBin)/sizeof(sBinType));
I = (1000.0/60.0) * (5.0/1023.0) * ACGetRms(IBin,
sizeof(IBin)/sizeof(sBinType));
//I = 0.0346 * ACGetRms(IBin, sizeof(IBin)/sizeof(sBinType));
84
W = V * I;
//integrate this power over time
J = J + W * (2.0 / (60.0 * 60.0)); //2s to hour
if (M > 0.009)
M -= W * (2.0 / (60.0 * 60.0)) * 12.48;
//12.488 = Charge per Watt hour
else{
connected = FALSE;
}
WriteEEPROMS(sizeof(jValid), (uint8_t*)&J, sizeof(J));
WriteEEPROMS(sizeof(jValid) + sizeof(J), (uint8_t*)&M,
sizeof(M));
WriteEEPROM(0, 0); //set valid flag
if (I > 10.0){
connected = FALSE;
//unt=0;
//sprintf(txt, "Current %.2fA Surge detected in SAKE. SAKE
has been disconnected", W);
//strcpy(contact, "08064311877");
//while(unt < 5){
// if (ModemSendSMSPduMode(&modem, txt, contact))
// break;
//}
}
LCDLine(&lcd, 1, TRUE);
printf(" Energy meter");
LCDLine(&lcd, 2, TRUE);
printf("%3uV %2u.%2.2uA %3uW", (uint16_t)V, (uint16_t)I,
(uint16_t)(I*1000)%1000, (uint16_t)W);
//printf("%5.2fV %4.2fA", V, I);
LCDLine(&lcd, 3, TRUE);
if (J > 999.999){
j = J / 1000;
unt = 'K';
}
else {
j = J;
unt = '0';
}
// printf("%6.2fW %6.2f%cWh", W, j, unt);
printf("%3u.%1.1u%cWh N%u.%2.2uk",
(uint16_t)j,(uint16_t)(j*10)%10 , unt, (uint16_t)M, (uint16_t)(M*100)%100);
LCDLine(&lcd, 4, TRUE);
if (modem.ModemConnected){
if (memSet && smsSet)
printf(" Net Connected");
else
printf(" Modem Connected");
}
else
printf(" No Connection");
if (connected != oldConnected){
WriteEEPROM(sizeof(jValid) + sizeof(J) + sizeof(M),
connected);
}
oldConnected = connected;
}
if (connected && M < 100){
if (!buzzing && TimeSpan(buzzTime) > TimeToTick(M/3)){
SystemBuzzer(TRUE);
85
buzzing = TRUE;
buzzTime = GetTime();
}
else if (buzzing && TimeSpan(buzzTime) > TimeToTick(1)){
SystemBuzzer(FALSE);
buzzing = FALSE;
buzzTime = GetTime();
}
}
else
SystemBuzzer(FALSE);
}
else if (strcpy(txtMatch, "Disconnect"),
strcmp(txt, txtMatch) == 0){
connected = FALSE;
sent = SendReport();
}
else if (strcpy(txtMatch, "Connect"), strcmp(txt,
txtMatch) == 0){
connected = TRUE;
sent = SendReport();
}
else if (strcpy(txtMatch, "Reset"), strcmp(txt,
txtMatch) == 0){
J = 0;
sent = SendReport();
86
}
else{
LCDLine(&lcd, 4, TRUE);
printf("Unknown request!!!");
SystemDelayMs(2000);
sent = TRUE;
}
if (!sent){
LCDLine(&lcd, 4, TRUE);
printf("Error sending SMS!!!");
SystemDelayMs(2000);
}
LCDLine(&lcd, 4, TRUE);
printf("Deleting SMS...");
ModemDeleteSMS(&modem, in);
SystemDelayMs(2000);
}
}
if (!found){
LCDLine(&lcd, 4, TRUE);
printf("No request found...");
SystemDelayMs(2000);
}
SMSTime = GetTime();
SystemSetRedLED(FALSE);
}
}
SystemPutC(0);
SystemGetC(&jValid);
}
87