Download as pdf or txt
Download as pdf or txt
You are on page 1of 87

DESIGN AND CONSTRUCTION OF A GSM BASED

ENERGY METER

BY

OLANREWAJU-GEORGE BABATUNDE

(EE/08/0160)

DEPARTMENT OF ELECTRICAL AND

ELECTRONICS ENGINEERING, SCHOOL OF

ENGINEERING AND ENGINEERING TECHNOLOGY,

MODIBBO ADAMA UNIVERSITY OF TECHNOLOGY

YOLA

MAY, 2014

1
DESIGN AND CONSTRUCTION OF A GSM BASED

ENERGY METER

BY

OLANREWAJU-GEORGE BABATUNDE

(EE/08/0160)

A PROJECT REPORT SUBMITTED TO THE

DEPARTMENT OF ELECTRICAL AND

ELECTRONICS ENGINEERING, SCHOOL OF

ENGINEERING AND ENGINEERING TECHNOLOGY,

MODIBBO ADAMA UNIVERSITY OF TECHNOLOGY

YOLA, IN PARTIAL FULFILMENT OF THE

REQUIREMENTS FOR THE AWARD OF THE

DEGREE OF BACHELOR OF ENGINEERING.

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

degree. References made to published literature have been duly acknowledge

…………………………………….. DATE: ………………..……

OLANREWAJU- GEORGE BABATUNDE

(STUDENT)

The above declaration is confirmed

..……………………………….......... DATE: …………………....

ENGR. I. M. VISA

(SUPERVISOR)

3
CERTIFICATION

This project entitled “Design and Construction of a GSM Based Energy Meter” by

Olanrewaju-George Babatunde (EE/08/0160) meets the regulations governing the award of

the bachelor’s degree of the Modibbo Adama University of Technology, Yola and is approved

for its contribution to knowledge and literary presentations.

.……………………………….. DATE: ……………………..

ENGR. I. M VISA

(SUPERVISOR)

.............................................. DATE: ……………………….

ENGR. I. M VISA

(HOD)

............................................... ….. DATE: ……………………..…

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

grace began with me and brought me thus far.

5
ACKNOWLEDGEMENTS

In my sincere acknowledgement, I would say I am most grateful to God Almighty for his

unending grace, love, favour, kindness towards me through my years of study.

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

love, prayers, care and support all the way.

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

all impacted on me through my years in this great department.

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

thank you to you all and God bless. Amen.

6
ABSTRACT

Wireless automation in the generation, transmission and distribution of electricity and

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

Electricity Company as the case in many Nigerian houses.

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

corresponding billing scheme.

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

communication in collaboration with embedded systems. The meter provides corresponding

billing Information on a LCD screen.

7
TABLE OF CONTENTS

COVER PAGE …………………………………………………………………….. i

TITLE PAGE ………………………………………………………...................... ii

DECLARATION ………………………………………………………………….. iii

CERTIFICATION ………………………………………………………………… iv

DEDICATION ……………………………………………………………………. v

ACKNOWLEDGEMENT …………………………………………..................... vi

ABSTRACT ………………………………………………………………………. vii

LIST OF FIGURES ………………………………………………………………. viii

CHAPTER ONE

INTRODUCTION ………………………………………………….………… 1

i. BACKGROUND ……...……………………………………………….. 1

ii. PROBLEM STATEMENT ……...…………………………………….. 2

iii. OBJECTIVES ………………………………………………………….. 2

iv. SIGNIFICANCE ……………………….………………………………. 3

v. SCOPE …………………………………………………………………. 3

CHAPTER TWO

LITERATURE REVIEW ……………………………………….........................5

2.1 HISTORY OF ELECTRIC ENERGY METERS …………………………….. 5

8
2.11 DIRECT CURRENT (DC) ………………………………………………….. 5

2.12 ALTERNATING CURRENT (AC) …………………………………………...6

2.2 UNITS OF MEASUREMENT ……………………………………………….. 6

2.3 TYPES OF METERS …………………………………………………………...7

2.31 ELECTROMECHANICAL METERS ………………………………………..7

2.32 ELECTRONIC METERS ……………………………………………………. 9

2.33 SOLID STATE DESIGN ……………………………………………………...9

2.4 TAMPERING AND SECURITY IN ENERGY METERS …………………. .14

2.5 POWER LINE RELATED INTELLIGENT METERING (PRIME) ………….15

2.6 INTRODUCTION TO GSM NETWORK………………………………….….15

2.61 MESSAGING OVER GSM NETWORK…………………………………….16

2.62 GSM NETWORK STRUCTURE ……………………………………………17

CHAPTER THREE

DESIGN AND CONSTRUCTION PROCEDURE …………………….………..18

3.0 INTRODUCTION ………………………………………………………………18

3.1 SYSTEM DESCRIPTION ………………………………………………………18

3.2 SYSTEM BLOCK DIAGRAM …………………………………………………19

SECTION A. DESIGN PROCEDURE……………………………………………...19

3.3 HARDWARE DESIGN………………………………………………………....19

9
3.3.1 CIRCIUT ANALYSIS …………………………………………………………….19

3.3.2 REGULATED POWER SUPPLLY…………………………………………........20

3.3.3 BRIDGE RECTIFIER……………………………………………………………..20

3.3.4 FILTERING CAPACITORS………………………………………………………21

3.3.5 ZENER REGULATOR DESIGN ………………………………………….……..23

3.3.6 TRANSISTOR TIP 41……………………………………………………….…...25

3.3.7 LM317T VOLTAGE REGULATOR…………………………………………….25

3.3.8 RATED DC OUTPUT…………………………………………………………….27

3.3.9 CURRENT SENSING DESIGN……….…………………………..…..…………27

3.3.10 RELAY SWITCHING………………………………………………….……….32

3.3.11 THE MICROCONTROLLER UNIT…………………………………………....32

3.3.12 CRYSTAL OSCILLATOR DESIGN……………………………………..……..36

3.3.13 LED INDICATORS………………………………………………………………37

3.3.14 THE BUZZER…………………………………………………………………….39

3.3.15 INTERFACING THE LCD WITH THE MICROCONTROLLER. ……………...39

3.3.16 INTERFACING THE GSM MODEM WITH MICROCONTROLLER…………41

3.3.17 THE MAX 232 IC…………………………………………………………………43

3.4 SOFTWARE DESIGN ………………………………………………………………46

SECTION B: CONSTRUCTION PROCEDURE…………………………………….…49

10
3.5.1 CIRCIUT DESIGN USING PRINTED CIRCIUT BOARD (PCB) ………………49

3.5.2 CASING AND PACKAGING …………………………………………………….51

CHAPTER FOUR

PERFORMANCE AND COST EVALUATION …………………………………….55

4.0 PERFORMANCE EVALUATION………………………………………………….55

4.1 DESIGN SIMULATION………………………………………………..……….......55

4.2 PERFORMANCE TEST…………………………………………………………….55

4.3 COST EVALUATION ……………………………………………………………...59

CHAPTER FIVE

CONCLUSIONS………………………………………………………………….....63

5.1 SUMMARY ………………………………………………………………………..63

5.2 CONCLUSION …………………………………………………………………….63

5.3 RECOMMENDATIONS …………………………………………………………..64

REFERNCES …………………………………………………………………………65

APPENDICE ............................................................................................................68

11
LIST OF TABLES

TABLE 3.1 PIC18F2550 FEATURES …………………………………………………33

TABLE 3.2 VALUE OF CAPACITOR USED ………………………………………...36

TABLE 3.3 LCD PIN FUNCTIONS ……………………………………………………40

TABLE 3.4 AT COMMAND AND RESPONSE ……………………………………….42

TABLE 4.1 SMS COMMAND AND FUNCTIONS ……………………………………59

TABLE 4.1 COST EVALUATION ……………………………………………………..60

LIST OF FIGURES

FIG 2.1 A 3Ø electromechanical induction meter, metering 100 A 240/415 V supply…… 7

FIG 2.2 A digital meter……………………………………………………………………. 8

FIG 2.3 A solid state energy meter design …………………………………………..……. 9

FIG 2.4 PRIME core structure…………………………………………………………..…15

FIG 2.5 GSM network structure ……………………………………………………………17

FIG 3.1 SYSTEM BLOCK DIAGRAM…………………………………………………...19

FIG. 3.2 POWER RECTIFICATION CIRCUIT..…………………………………………20

FIG.3.3 ZENER REGULATOR CIRCUIT …………………………………………..........24

FIG. 3.4 TIP 41 BUFFER TRANSISTOR …………………………………………….......25

FIG. 3.5 BLOCK DIAGRAM OF LM317T ……………………………………………….26

12
FIG. 3.6 LM 317T IN CIRCUIT REGULATION ………………………………..……26

FIG. 3.7 FUNCTIONAL BLOCK DIAGRAM OF ACS755-100CB ………………….28

FIG. 3.8 OUTPUT VOLTAGE VS SENSED CURRENT OF ACS755 AT 5.0 V POWER

SUPPLY AND VARYING TEMPERATURE………………………………………….29

FIG. 3.9 CURRENT SENSOR CIRCUITRY …………………………………………..30

FIG. 3.10 THE RELAY CIRCUIT …………………..………………………………….31

FIG. 3.11 THE PIC18F2550 PIN CONFIGURATION …………………………………33

FIG.3.12 BLOCK DIAGRAM OF PIC18F2550…………………………………………35

FIG.3.13 CRYSTAL OSCILLATOR CIRCUIT ………………………………………...37

FIG. 3.14 LED SCHEMATIC SYMBOL AND I-V CHARACTERISTICS CURVES

SHOWING THE DIFFERENT COLOURS AVAILABLE………………...……………38

FIG. 3.15 SERIES LED CONNECTION …………………..……………………………38

FIG.3.16 LCD ……………………………………………………………………………40

FIG. 3.17 SMART GSM MODEM ……………………………………………………...41

FIG.3.18 INSERTING/REMOVING THE SIM CARD INTO THE MODEM …………42

FIG.3.19 TYPICAL OPERATING CIRCUIT OF THE MAX 232 IC …………………..44

FIG.3.20 THE MAX 232 INTERFACED WITH DB9 CONNECTOR TO MODEM ……44

FIG.3.21 CIRCUIT DIAGRAM OF GSM BASED ENERGY METER …………………45

FIG. 3.23 FLOWCHART OF PROGRAMME …………………………………………….48

13
FIG. 3.24 PCB LAYOUT …………………………………………………………………..50

FIG. 3.25 PLY WOOD SURFACE MOUNTING ………………………………………….51

FIG. 3.26 TOP VIEW OF CASING ………………………………………………………...52

FIG. 3.27 INSIDE VIEW OF PVC CASING ………………………………………………52

LIST OF PLATES

PLATE 3.1 SOLDERED COMPONENTS MOUNTED ON PCB ………………………...50

PLATE 3.2 SET UP OF GSM BASED ENERGY METER ……………………………..…53

PLATE 3.3 CASING OF METER UNIT SHOWING THE COMPONENTS AND GSM

MODEM …………………………………………………………………………………….54

PLATE 4.1 THE METER UNIT INDICATING MODEM IS CONNECTED……………...55

PLATE 4.2 THE METER UNIT WITH LOAD CONNECTED ……………………………55

PLATE 4.3 LCD SCREEN INDICATING ENERGY CONSUMPTION DETAILS ………56

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

Today, humanity can be classified as living in a “machine society” where technological

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

specifications of transformers and other instruments required in power transmission and

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

format and it is known that SMS costs are very low.

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.

1.1 PROBLEM STATEMENT

In Conventional metering system to measure electricity consumption the energy provider

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

little human effort and at reduced cost as compared to conventional methods.

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

distribution management, better company credibility, consumer meter reading which

eliminates cost and inadequacies of manual reading, observation and control of energy

consumption and production, this is useful for planning and power allocation purposes.

The project provides learning’s on the following advancements in terms of theory

practice: GSM modem interfacing to Microcontroller, PC interfacing with GSM modem,

energy meter interfacing to Microcontroller, embedded C programming, PCB (printed circuit

board) design, LCD interfacing to Microcontroller.

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

dedicated SIM (Subscriber Identification Module).

18
CHAPTER TWO

LITERATURE REVIEW

An electricity meter or energy meter is a device that measures the amount of electric

energy consumed by a residence, business, or an electrically powered device. Electricity meters

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

measure the amount of electricity consumed by each of its customers. [3]

Researchers have proposed different implementation techniques for Automatic Meter

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.

2.1 HISTORY OF ELECTRIC ENERGY METERS

2.11 DIRECT CURRENT (DC)

As commercial use of electric energy spread in the 1880s, it became increasingly

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

customer billed. [3]

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

for the consumer to pay for a further supply of electricity.

The first accurate, recording electricity consumption meter was a DC meter by Dr

Hermann Aron, who patented it in 1883. [3]

2.12 ALTERNATING CURRENT (AC)

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

on an ironless commutator motor. This meter overcame the disadvantages of the

electrochemical type and could operate on either alternating or direct current. [3]

In 1894 Oliver Shallenberger of the Westinghouse Electric Corporation applied the

induction principle previously used only in AC ampere-hour meters to produce a watt-hour

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

Thomson design. [3]

2.2 UNIT OF MEASUREMENT

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,

will have positive reactive power. [4]

2.3 TYPES OF METERS

Electricity meters operate by continuously measuring the instantaneous voltage (volts)

and current (amperes) to give energy used (in joules, kilowatt-hours etc.). The meters fall into

two basic categories, electromechanical and electronic.

2.31 ELECTROMECHANICAL METERS

The electromechanical induction meter operates by counting the revolutions of a non-

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

full load, which is registered on the meter.

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

above is used on a single-phase AC supply. [3]

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

disc with a stopwatch.

3600. ℎ
 = − − − − − − − − − −1

Where:

t = time in seconds taken by the disc to complete one revolution,

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

by switching them on one by one. [3]

2.32 ELECTRONIC METERS

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.

FIG. 2.2 A digital meter

2.33 SOLID-STATE DESIGN

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

clock (RTC), LCD display, communication ports/modules and so on.

FIG. 2.3 A SOLID STATE ENERGY METER DESIGN

24
PHCN (Power Holding Company of Nigeria), the operating electric power utility

company in Nigeria is currently deploying energy prepayment meters in Nigeria. These

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

meter tampering by Nigerian consumers. [5].

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

load shedding in Nigeria. [5]

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

corruption within PHCN ranks [5].

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

two key factors in its business case.

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

determined using the actual customer meter readings.

• 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

is that of AMRs. Various features offered by AMR are given below:

1) Higher speed

2) Improved load profile

3) Automatic billing invoice

4) Real time energy cost

5) Tampering Alarm warning

26
6) Remote power switches ON/OFF

7) Load balancing

In [8], a microprocessor-based automatic meter reading system is implemented, which

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

architecture of web services based automatic meter reading system is designed.

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

have limitations in areas of management and design of infrastructure, available technology ,

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.

2.4 TAMPERING AND SECURITY IN ENERGY METERS

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

the electric meters as also proposed in this report.

Modern detection tools that help in power theft identification include the following;

• Tamper proof seals and labels

• Tamper resistant screws and locks

• Tamper alarms and sensors

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

band power line communication technology.

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

commands, and control the distribution grid devices. [11]

FIG. 2.4 PRIME CORE STRUCTURE

2.6 INTRODUCTION TO GSM NETWORK

GSM (Global System for Mobile Communication)

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

referred as Global System for Mobile Communication. It is a set of standards developed by

the European Telecommunications Standards Institute (ETSI) to describe technologies used

for second generation digital communications, commonly referred as 2G technologies. It was

developed as a replacement to the first generation analog communications. It originally

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.

Messaging Over GSM Network

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

cellular networks allows the use of SMS service.

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

to reach the destination.

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.

GSM Network structure

FIG 2.5 GSM NETWORK STRUCTURE

31
CHAPTER THREE

DESIGN AND CONSTRUCTION PROCEDURE

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.

3.1 SYSTEM DESCRIPTION

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:

 Connect the unit to power Grid.

 Disconnect the unit from power Grid.

 Take meter reading.

 Recharge the meter unit.

 Reset the meter unit.

32
3.2 SYSTEM BLOCK DIAGRAM

FIG. 3.1 SYSTEM BLOCK DIAGRAM

SECTION A. DESIGN PROCEDURE

3.3 HARDWARE DESIGN

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

designed using Proteus 8. Design suite.

3.3.1 CIRCIUT ANALYSIS

The circuit is divided into 6 segments: the regulated power, current sensing, relay

switching, microcontroller unit, LCD and communication units.

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.

FIG. 3.2 POWER RECTIFICATION CIRCUIT

3.3.3 BRIDGE RECTIFIER

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]

The output of rectifier voltage is given as

 = √2 ×  ×  − 2 ×   − − − − − − − − − − − −2

Knowing that:  = 220

 = 0.7

 = 0.05

34
= √2 × 220 × 0.05 − 2 × 0.7

= 14.16

3.3.4 FILTERING CAPACITORS

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,

working voltage and percentage ripple.

The working voltage is always given as

 ≥ 2 − − − − − − − − − − − − − −2

Where Vp = peak voltage given as

= √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.

R.M.S value of ripple voltage is given as

//:; = < =>? − − − − − − − − − − − − − −7

Where < = 7"@@85 ,94


67

A>? = B. & )68


9C5 6,
ℎ5 869$.

The voltage chosen for this project is 12V.

∴ /:; = 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.

3.3.5 ZENER REGULATOR DESIGN

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 voltage remains constant for a wide range of currents.

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

regulations.it has the following electrical characteristics: VZ = 12V at IZ 2 tolerance of 5%.

[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]

FIG.3.3 ZENER REGULATOR CIRCUIT

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

The Zener diode current is 'K = 20JE

The current through the load resistor is

'= = 'K − 'I − − − − − − − − − − − − − 10

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

increase the current-handling ability of the regulator circuit, a common-collector transistor is

used to amplify current to the load, so that the Zener diode circuit only has to handle the

amount of current necessary to drive the base of the transistor.

FIG. 3.4 TIP 41 BUFFER TRANSISTOR

3.3.7 LM317T VOLTAGE REGULATOR

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

monolithic integrated circuit is an adjustable 3-terminal positive-voltage regulator designed to

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

FIG. 3.6 LM 317T IN CIRCUIT REGULATION

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

LCD. This is calculated as follows:

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

IADJ (Adjustable Pin Current) = 46µA

I∆ADJ (Adjustable Pin Current Change) = 2.0A

VREF (Reference Voltage) = 1.25V

IL (MIN) (Minimum Load Current to Maintain Regulation) = 3.5A

IO (MAX) (Maximum Output Current) = 2.2A

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.

3.3.8 RATED DC OUTPUT

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.

3.3.9 CURRENT SENSING DESIGN

Sensing and controlling current flow is a fundamental requirement in a wide variety of

applications including, over-current protection circuits, battery chargers, switching mode

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

current sensing in industrial, automotive, commercial, and communications systems.

FIG. 3.7 FUNCTIONAL BLOCK DIAGRAM OF ACS755-100CB

Sensitivity and output of ACS755

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

output is Vcc/2 = 2.5V.

The curve below shows the nominal sensitivity and transfer characteristics of the

ACS755 sensor powered with a 5.0V supply.

FIG. 3.8 OUTPUT VOLTAGE VS SENSED CURRENT OF ACS755 AT 5.0 V POWER

SUPPLY AND VARYING TEMPERATURE

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.

ACS755-100CB 100A current sensor

43
Sensitivity =40mV/A

For VCC = 5.0V and ADC Vref = VCC

The relationship between input voltage of ADC count is:

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.

FIG. 3.9 CURRENT SENSOR CIRCUITRY

3.3.10 RELAY SWITCHING

A relay is an electromagnetic switch. In other words it is activated when a current is

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

exhausted or the meter is been tampered with.

FIG. 3.10 THE RELAY CIRCUIT

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

handling capabilities. [17]

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

base current. This is calculated thus: [18]

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

3.3.11 THE MICROCONTROLLER UNIT

The microcontroller is the heart of the project; it controls all the activities of the entire

system.

The criteria for choosing the microcontroller are:-

• Meet the computation needs of task at hand efficiently and cost effectively.

• Availability of software development tools such as compiler, assemblers and debuggers

and widely availability and reliable source of the microcontroller.

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

beneficial to this design, namely, high computational performance at an economical price –

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

logical choice for many high-performance, power sensitive applications. [19]

TABLE 3.1 PIC18F2550 FEATURES

Features PIC18F2550

Operating Frequency DC – 48 MHz

Program Memory (Bytes) 32768

47
Program Memory (Instructions) 16384

Data Memory (Bytes) 2048

Data EEPROM Memory (Bytes) 256

Interrupt Sources 19

I/O Ports Ports A, B, C, (E)

Capture/Compare/PWM Modules 2

Comparators 2

Serial Communications MSSP, Enhanced USART

Universal Serial Bus (USB) Module 1

10-Bit Analog-to-Digital Module 10 Input Channels

Instruction Set 75 Instructions;83 with Extended


Instruction Set Enabled

48
FIG.3.12 BLOCK DIAGRAM OF PIC18F2550

49
3.3.12 CRYSTAL OSCILLATOR DESIGN

The operation of the oscillator in PIC18F2550 device is controlled through two

Configuration registers and two control registers. Configuration registers, CONFIG1L and

CONFIG1H.

CAPACITOR SELECTION FOR CERAMIC RESONATORS

The choice of capacitor used in the resonance of the crystal oscillator is dependent on

the following factors:

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,

it may be necessary to use the HS mode or switch to a crystal oscillator.

3: Since each resonator/crystal has its own characteristics, the user should consult the

resonator/crystal manufacturer for appropriate values of external components.

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

for the application. [19]

TABLE 3.2 VALUE OF CAPACITOR USED

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.

FIG.3.13 CRYSTAL OSCILLATOR CIRCUIT

3.3.13 LED INDICATORS

A “Light Emitting Diode” or LED as it is more commonly called, is basically a

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

SHOWING THE DIFFERENT COLOURS AVAILABLE

LED-YELLOW D3
R12
1k
LED-YELLOW

D4
LED-GREEN R13
1k
LED-GREEN

D5
LED-RED R14
1k
LED-RED

FIG. 3.15 SERIES LED CONNECTION

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

3.3.14 THE BUZZER

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

PIN 12 of the microcontroller.

3.3.15 INTERFACING THE LCD WITH THE MICROCONTROLLER

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

(unlike in seven segments), animations and so on. [20]

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

3.3.16 INTERFACING THE GSM MODEM WITH

MICROCONTROLLER

Modems are devices that let computers transmit information over ordinary telephone

lines. Modem is an acronym for "modulator/demodulator." Modems translate a stream of

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.

Modems have a flexibility that is unparalleled by other communications technologies.

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,

anywhere in the world. [21]

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.

FIG. 3.17 SMART GSM MODEM

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

table below describes the basic AT commands. [21]

TABLE 3.4 AT COMMAND AND RESPONSE

QUERY AT COMMAND RESPONSE

The mobile equipment returns list of

parameters and values ranges set with the


TEST COMMAND AT+<X>=?
corresponding write command.

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

The execution command reads non-variable

parameters affected by internal processes in the


EXECUTION AT+<X>
GSM modem
COMMAND

56
FIG.3.18 INSERTING/REMOVING THE SIM CARD INTO THE MODEM

3.3.17 THE MAX 232 IC

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,

TX, CTS and RTS signals.

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

serially to a PC which requires voltage levels as per RS 232 standard. [22]

RS 232 is an electrical signalling specification published by the Electronic Industries

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

external capacitors whose value ranges from 0.1µf to 22µf.

FIG.3.19 TYPICAL OPERATING CIRCUIT OF THE MAX 232 IC

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

design the following steps are considered:

• Understand the problem

• Plan the logic

• Code the program

• Translate the program to machine language

• Test the program

• Put the program to production

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

below. A screen shot of the programmer is also shown as follows.

61
FIG. 3.22 SCREEN SHOT OF PROGRAMME IDE

62
FIG. 3.23 FLOWCHART OF PROGRAM

63
SECTION B: CONSTRUCTION PROCEDURE

3.5.1 CIRCIUT DESIGN USING PRINTED CIRCIUT BOARD (PCB)

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.

Why use customized PCB’s instead of ready-made project board?

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

full of holes everywhere, making ready-made boards weaker. [12]

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

components to be soldered on the board.

64
FIG. 3.24 PCB LAYOUT

PLATE 3.1 SOLDERED COMPONENTS MOUNTED ON PCB

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.

FIG. 3.25 PLY WOOD SURFACE MOUNTING

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

FIG. 3.27 INSIDE VIEW OF PVC 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

PERFORMANCE AND COST EVALUATION

4.0 PERFORMANCE EVALUATION

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

unit component of the system.

4.1 DESIGN SIMULATION

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.

4.2 PERFORMANCE TEST

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

PLATE 4.2 THE METER UNIT WITH LOAD 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

command to communicate with the meter unit is as follows:

73
TABLE 4.1 SMS COMMAND AND FUNCTIONS

SMS COMMAND FUNCTION

Connect To connect the unit to power grid

Disconnect To disconnect the unit from power grid

Report To get the status and reading of the unit

Load 1000 To recharge the meter with 1000 units

Reset Resets the meter unit to default mode

4.3 COST EVALUATION

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

not be required as it is used in the model for comparism.

The table below shows the list of all components used and the corresponding unit cost.

74
TABLE 4.1 COST EVALUATION

S/N ITEMS DESCRIPTION QUANTITY RATE(₦) AMOUNT(₦)

1 PIC18F2550 MICRCONTROLLER 1 1,500 1,500

2 ACS755-100CB CURRENT SENSOR 1 1,700 1,700

3 20×4 LCD DISPLAY 1 1,500 1,500

4 MAX 232 MAX 232 1 900 900

5 1N4007 DIODE 1 20 20

6 1N5242B ZENER DIODE 1 20 20

7 BC 547 TRANSISTOR 1 50 50

8 TIP41C TRANSISTOR 1 60 60

9 LM317T VOLTAGE 1 50 50

REGULATOR

10 2W005G BRIDGE RECTIFIER 1 60 60

11 PIN SOCKET IC SOCKET 4 50 200

12 BUZZER BUZZER 1 50 50

13 RELAY RELAY SWITCH 1 100 100

14 R1-R15 RESISTORS 15 5 75

75
15 C1, C2, C3, C8, CERAMIC 7 30 210

C10, C13.
CAPACITORS

16 C4, C5, C7,C8, C9 POLARIZED 5 50 250

CAPACITORS

17 C11 CAPACITOR 1 100 100

18 D3, D4, D5 LED 3 10 30

19 16MHz CRYSTAL OSCILLATOR 1 50 50

20 SIM 900 GSM MODEM 1 11,000 11,000

21 SIM CARD MTN SIM CARD 1 100 100

22 JUMPERS CONNECTORS - - 150

23 COMPIM DB9 CONNECTOR 1 75 75

24 POTENTIOMETE POTENTIOMETER 1 50 50

25 PCB BOARD 1 500 500

26 100W BULBS BULBS 1 100 100

27 LAMP LAMP 1 50 50

HOLDERS HOLDERS

28 PLYWOOD SURFACE MOUNTING - 250 250

76
29 CASING PACKAGING - 800 800

30 CARDBOARD - 50 50

31 CABLES POWER CORD - 150 150

32 ANALOG METER ANALOG METER 1 5,000 5,000

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

power to consumers is found to be more effective.

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

company and consumer:

 Connect the unit to power Grid.

 Disconnect the unit from power Grid.

78
 Take meter reading.

 Recharge the meter unit.

 Reset the meter unit.

Therefore meeting the requirements of providing a solution to power theft, load

control, proper documentation of individual consumer energy usage over a period of

time. Providing the power utility company to proper plan and design sufficient

infrastructure equipment for power transmission.

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

internet as well as improvement in the cost of development and the incorporation of a

Graphical user interface (GUI).

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

power generation and transmission as this is a great bane to national development.

79
REFERENCES

[1] Electronic Energy Prepayment Meter Overview, Nigeria Technology News,

http://www.nairaland.com/electronicenergyprepaymentoverview6486487/hrfh

[2] http://en.wikipedia.org/wiki/electricenergymeter

[3] Abhinandan Jain, Department of Electronics &Electrical Communication, PEC

University of Technology, Chandigarh, India, Dilip Kumar, Department of Academic and

Consultancy Services Division C-DAC, Mohali, India. Jyoti Kedia, Department of

Electronics & Electrical Communication PEC University of Technology, Chandigarh, India.

Design and Development of GSM based Energy Meter, International Journal of Computer

Applications (0975 – 888) Volume 47– No.12, June 2012

[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

Conference, pp. 465 -469

[5] PHCN: BENEFITS OF THE NEW PREPAYMENT METERS

http://www.naijatechguide.com/2012/11/phcn-benefits-of-new-prepayment

[6] A. Abdollahi, M. Dehghani, and N. Zamanzadeh,"SMS-based reconfigurable

automatic meter reading system, IEEE International Conference Control Applications.,

Oct. 2007.pdf

[7] Md. Ashiquzzaman, Nadia Afroze, Taufiq Md. Abdullah, Design and Implementation

of Wireless Digital Energy Meter using Microcontroller, Global Journal of researches in

engineering, Electrical and electronics engineering, Stamford University Bangladesh, Dhaka,

Volume 12 Issue 2 Version 1.0 February 2012

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

Monitoring and Controlling Power Consumption, International Journal of Recent

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

[13] 2W005G 2.0A Glass Passivated Bridge Rectifier, Diodes Incorporated.

[14] 1N5221B - 1N5263B Zener Diodes, Fairchild Semiconductor Corporation

www.fairchildsemi.com

[15] Zener Diode as Voltage Regulator, www.allaboutcircuits.com

[16] LM317 3-Terminal Positive Adjustable Regulator, Fairchild Semiconductor

Corporation www.fairchildsemi.com

[17] BC547 NPN general purpose transistors, Philips Electronics.

www.datasheetcatalog.com

[18] Applications of Relays In Electronic Circuits, Panasonic Corporation Automation

Controls Business Unit. industrial.panasonic.com/ac/e/

[19] PIC18F2550 Data Sheet, Microchip Technology Inc. www.datasheetcatalog.com

81
[20] Microcontroller interfacing circuits, Revolution Education Ltd. Business Innovation

Centre.

[21] GSM/GPRS MODEMS WORKING OPERATIONS. www.ehow.com

[22] RS232 Communication with PIC Microcontroller, www.picprojects.net

82
APPENDICE A

SOURCE CODE FOR GSM BASED ENERGY METER

//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 putch(uint8_t c){


LCDPutC(&lcd, c);
}

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);

if (TimeSpan(SMSTime) > TimeToTick(15) && modem.ModemConnected && memSet


&& smsSet){
uint8_t in;
bool found = FALSE;
SystemSetRedLED(TRUE);
LCDLine(&lcd, 4, TRUE);
printf("Checking for SMS...");
for (in = 1; in < 5; in++){
if (ModemReadSMSTextMode(&modem, in, txt, sizeof(txt),
NULL, contact) > 0){
bool sent = FALSE;
found = TRUE;
uint8_t i = 0;
LCDLine(&lcd, 4, TRUE);
printf(">%15.0s", txt);
SystemDelayMs(2000);
if (strcpy(txtMatch, "Report"), strcmp(txt,
txtMatch) == 0){
sent = SendReport();
}
else if (strcpy(txtMatch, "Load "), strncmp(txt,
txtMatch, 5) == 0){
LCDLine(&lcd, 4, TRUE);
printf("Adding Card...");
M += atof(&txt[5]);
if (M < 0)
M = 0;
connected = TRUE;
WriteEEPROMS(sizeof(jValid) + sizeof(J),
(uint8_t*)&M, sizeof(M));
sent = SendReport();

}
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

You might also like