76
“Meter Reading Through PSTN Line” 1.1 Background perspective Electricity and the Telephony system have been developed as the essential basic needs of the 21 st century life style. The current world witnesses a large web of telephone networks and a wide range of application of Electric energy. Even Nepal has made a huge leap in the development of these systems. With the wire line networks being decades older, the mobile technology in Nepal has passed through some couple of years of service. Also the electricity service has the history of more than 99 years. It was started in 1911A.D. However, how far the technology goes it’s only human to want more and people are always looking for better facilities that make the daily life more comfortable as well as cost effective. The PSTN is the network of the world's public circuit-switched telephone networks. PSTN is the world's collection of interconnected voice-oriented public telephone networks, both commercial and government-owned. Public Switched Telephone Network, which refers to the international telephone system based on copper wires carrying analog voice data. Electric energy is the major source of energy used across the world. Modern world is so dependent on the electric energy that it’s almost impossible to imagine the life without it. Electric energy is being used from the domestic purposes to the industrial applications. Nepal Telecom (NTC) and Nepal Electricity Authority (NEA) are the service providers that bring the 1

Final Year Project

Embed Size (px)

DESCRIPTION

Digital Meter Reading Through PSTN Line

Citation preview

Page 1: Final Year Project

“Meter Reading Through PSTN Line”

1.1Background perspectiveElectricity and the Telephony system have been developed as the essential basic needs of

the 21st century life style. The current world witnesses a large web of telephone networks

and a wide range of application of Electric energy. Even Nepal has made a huge leap in

the development of these systems. With the wire line networks being decades older, the

mobile technology in Nepal has passed through some couple of years of service. Also the

electricity service has the history of more than 99 years. It was started in 1911A.D.

However, how far the technology goes it’s only human to want more and people are

always looking for better facilities that make the daily life more comfortable as well as

cost effective. The PSTN is the network of the world's public circuit-switched telephone

networks. PSTN is the world's collection of interconnected voice-oriented public

telephone networks, both commercial and government-owned. Public Switched

Telephone Network, which refers to the international telephone system based on copper

wires carrying analog voice data. Electric energy is the major source of energy used

across the world. Modern world is so dependent on the electric energy that it’s almost

impossible to imagine the life without it. Electric energy is being used from the domestic

purposes to the industrial applications. Nepal Telecom (NTC) and Nepal Electricity

Authority (NEA) are the service providers that bring the PSTN service and the electricity

service in this nation. Nepal Telecom as a progressive, customer spirited and consumer

responsive Entity, is committed to provide nation-wide reliable telecommunication

service to serve as an impetus to the social, political and economic development of the

Country. NTC is a dominant player in telecommunication sector in the Country while

also extending reliable and cost effective services to all the customers. NEA is the one

and only authority that provides the electricity service to Nepal. The major resource that

NEA utilizes to generate electricity, is the hydro powers, abundantly available in Nepal.

NEA installs a electric meter in each of the subscribers household to record the data of

electricity consumption. NEA has recruited thousands of Meter Readers for the purpose

of collecting and recording the data from these meters.

1

Page 2: Final Year Project

“Meter Reading Through PSTN Line”

1.2Project OverviewThe project entitled “Meter Reading through PSTN Line” is aimed to read the data of the

electricity consumption via PSTN line. Such data acquisition can be achieved through

other means like power line cable, wireless, but the alternative we choose is easily

accessible PSTN line. NEA has been employing thousands of Meter Readers to go every

client’s houses for meter reading purpose. A large deal of economy and the time, NEA

has to spend for that purpose, moreover it is more tedious and time consuming. Although

it was practical in the past, these days it seems impractical as the technology is

flourishing day by day.

Technology, in today’s world is progressing with pace never been witnessed before in

history. Now the world enters into the age of automation and mechanization. As we know

the today’s world is in information age where the timely information is the valuable asset.

So the information about any system or place play vital role for developing their industry

and hence the country. The online necessity of the data in various systems drives the

modern system to bear the quality of being fast, precise and accurate. Time delay in

acquiring such information is the most intolerable loss since time is money, time is the

asset and time is everything in this age of faster pace.

So keeping these things in mind we came up with an idea of designing an electronic

system which can automate the meter reading operation without going to each costumer.

Presently it seems feasible for us to use phone lines to transfer data from the meter. This

project seems to be very useful as well as economical for the power system utility as it

cuts-off millions Rupees per year for the meter reading purpose.

2

Page 3: Final Year Project

“Meter Reading Through PSTN Line”

1.3Objectives

This application involves acquiring data, monitoring data, and using it for some type of

billing operation.

1.3.1 Specific Objective

To read the data of the electricity consumer using the PSTN line.

To transfer data via telephone line in the efficient manner.

To monitor and display the received data.

1.3.2 General objective

To measure and store the physical variable with high degree of accuracy.

To facilitate the use of stored data to analyze a product or process and look

for ways to improve it.

To view the data both during and after the acquisition.

To use DTMF generator to generate numbers for dialing.

TO use DTMF receiver to receive data.

To be familiar with different elements like microcontroller, DTMF IC etc.

1.4 Current situation

Although there are many PSTN users who are currently served by NTC, till now PSTN

users are provided mainly the voice communication only. Some users are facilitated with

several services like caller-id service, conference call, busy call transfer etc. These

facilities could not utilize the cost and implementation of huge wire network. PSTN is

now almost digital, and now includes mobile as well as fixed telephones lines. The PSTN

was the earliest example of traffic engineering to deliver Quality of Service. Many

observers believe that the long term future of the PSTN is not to be limited to just one

application i.e. voice communication. Data communication Service is the type of

communication performed by sending the data message instead of voice conversation.

Although the transmission of low rate data through the PSTN line is possible, it still

hasn’t been implemented in PSTN lines In Nepal. Considering the current scenario where

3

Page 4: Final Year Project

“Meter Reading Through PSTN Line”

the reliable PSTN line being abundantly available, the lines can also be utilized for the

purpose of data communication to transmit the electric meter record.

1.5 Scope of the project

Automatic meter reading, or AMR, is the technology of automatically collecting

consumption, diagnostic, and status data from or energy metering devices and

transferring that data to a central database for billing, troubleshooting, and analyzing.

This advance mainly saves utility providers the expense of periodic trips to each physical

location to read a meter. Another advantage is billing can be based on near real time

consumption rather than on estimates based on previous or predicted consumption. This

timely information coupled with analysis, can help both utility providers and customers

better control the use and production of electric energy.

The benefits of smart metering are clear and proven.

Accurate meter reading, no more estimates Improved billing Accurate Profile Classes and Measurement Classes, true costs applied Improved Security for premises Energy Management through profile data graphs Less financial burden correcting mistakes Less accrued expenditure Transparency of “cost to read” metering Improved procurement power though more accurate data - “de-risking” price

Figure 1.1: scope of the project

2.1 Introduction to Telephony System

4

Page 5: Final Year Project

“Meter Reading Through PSTN Line”

The name is a reflection of the telephone service still available after the advent of more

advanced forms of telephony. It has been available almost since the introduction of the

public telephone system in the late 19th century, in a form mostly unchanged to the

normal user. Despite the introduction of Touch-Tone dialing, electronic telephone

exchanges and fiber-optic communication into the public switched telephone network

(PSTN), a term which describes the voice-grade telephone service that remains the basic

form of residential and small business service connection to the telephone network in

most parts of the world. The system was originally known as the Post Office Telephone

Service or Post Office Telephone System in many countries. Telephony services include:

Bi-directional, or full duplex, voice path with limited frequency range of 300 to

3400 Hz: in other words, a signal to carry the sound of the human voice both

ways at once

call-progress tones , such as dial tone and ringing signal

subscriber dialing

operator services, such as directory assistance, long distance, and conference

calling assistance

A telephone uses an electric current to convey sound information from calling subscriber

to called subscriber. When two of them are talking on the telephone, the telephone

company is sending a steady electric current through telephones. The two telephones,

calling subscriber and called subscriber, are sharing this steady current. But as they talk

into their telephone's microphone, the current that the telephone draws from the telephone

company fluctuates up and down. These fluctuations are directly related to the air

pressure fluctuations that are the sound of voice at the microphone. Because the

telephones are sharing the total current, any change in the current through one telephone

causes a change in the current through another telephone. Thus as subscribers talk, the

current through another telephone fluctuates. A subscriber in that telephone responds to

these current fluctuations by compressing and rarefying the air. The resulting air pressure

fluctuations reproduce the sound of the voice. Although the nature of telephones and the

circuits connecting them have changed radically in the past few decades, the telephone

system still functions in a manner that at least simulates this behavior. It is typically

5

Page 6: Final Year Project

“Meter Reading Through PSTN Line”

powered by -48V direct current (DC) and backed up by a large bank of batteries

(connected in series) in the central office, resulting in continuation of service during most

commercial power outages. The 48v voltage is sent to the telephone line through some

resistors and inductors (typically there is 2000 to 4000 ohms in series) with the 48v

power source. When the telephone is in on-hook state the ‘Tip’ is at about 0v, while

‘Ring’ is about -48v with respect to earth ground. When the telephone is hooked off,

current is drawn; ‘Tip’ goes negative and ‘Ring’ goes positive. A typical hook off

condition is ‘Tip’ at about -20v and ‘Ring’ at about -28v. This means that there is about

8v between the wires going to telephone in normal operation condition. The DC

resistance of typical telephone equipment is in 200-300 ohm range and current flowing

through the telephone is in 20-50mA range.

2.1.1 Why 48v is used in Telephone System?

The 48v was selected because it was enough to get through kilometers of thin telephone

wire and still low enough to be safe (electrical safety regulations in many countries

consider DC voltages lower than 50v to be safe low voltage circuits). 48v voltage is also

easy to generate from normal lead acid batteries (4 * 12v car batteries in series). Batteries

are needed in telephone Central Office (CO) to make sure that it operates also when

mains voltage is cut and they also give very stable output voltage which is needed for

reliable operation of all the circuit in the CO. Typically the CO actually runs off of the

battery chargers with the batteries in parallel getting a floating charge.

2.2 Signaling TonesThe numbers of signaling functions are involved in establishing, maintaining and

releasing a telephone conversation. These functions are performed by an operator in the

manual exchange .In an automatic switching system, the verbal signaling of the operator

replaced by the series of distinctive tone. Five subscribers related signaling functions are

performed by the exchange. They are

Respond to the calling subscribers to obtain the identification of the called party.

Inform the calling subscriber that the call is being established.

Ring the bell of the called party.

Inform the calling subscriber, if the called party is busy.

6

Page 7: Final Year Project

“Meter Reading Through PSTN Line”

Inform the calling subscriber, if the called party is unobtainable for some reason.

The telephone CO can send any different types of signals to the caller telling the status of

telephone call. Those signals are typically audio tones generated by the CO. Typically

these kinds of tones are dialing tones (typically constant in other end is ringing) or busy

tone (usually like quickly on and off switch dialing tones). The exact tones used vary

from country to country.

The Characteristics of tones and ringing current are as follows:

Dial tone.

Ringing tone.

Busy tone.

Number unobtainable tone.

Call in progress tone.

2.2.1 Dial tone

This tone indicates that the exchange is ready to accept dialed digits from a subscriber.

The subscribers should start dialing only after hearing the dialed tone. Otherwise, initial

dial pulses may be missed by the exchange, which may result in a call landing on a wrong

number. The dial tone is a 33Hz or 50 Hz or 400 Hz continuous tone

2.2.2 Ringing tone

When the called party is obtained, the exchange send out the ringing current to the

telephone of the called party. This ringing current has the familiar double ring pattern.

Simultaneously, the control equipment sends out a ringing tone to a calling subscriber,

which has a pattern similar to that of the ringing current the two rings in the double

pattern are separated by a gap of 0.2 sec and two double ring patterns by a gap of two

7

30 or 50 or 400 Hz Continuous

Figure 2.1 Dial Tone

Page 8: Final Year Project

“Meter Reading Through PSTN Line”

seconds. The ring bursts has duration of 0.4 sec. The frequency of ringing tone is 133

Hz, sometimes modulated with 25Hz or 33 Hz.

2.2.3 Busy tone

It is a burst of 400 Hz signal with silence period in between. The burst and silence is of

same duration about 0.75 sec or 0.375 sec. A busy tone is sent to the calling subscriber

whenever the switching equipment or junction line is not available to put through the call

or called subscriber line is engaged.

2.2.4 Number unobtainable tone

It is a continuous 400 Hz signal. This tone may be sent to the calling subscriber due to

various reasons.

Figure 2.4 Number unobtainable tones

8

0.4sec 0.2sec 0.4sec 2sec

400 or 133Hz

toneFigure 2.2 Ringing Tone

400Hz

continuous

continuous

0.75sec 0.75sec

400Hz

Figure 2.3 busy tone

Page 9: Final Year Project

“Meter Reading Through PSTN Line”

2.2.5 Call in progress tone

It is a 400 Hz or 800 Hz intermittent pattern. In electromechanical system, it is usually

800 Hz with 50 % duty ratio and 0.5 sec ON OFF period. In analog electronic exchange,

it is 400 Hz pattern with 0.5 sec ON period and 2.5 sec OFF period. In digital exchanges

it has 0.1 sec ON OFF periods at 400 Hz.

Tone dialing is advanced dialing method and usually called Touch Tone or Dual Tone

Multiple Frequency (DTMF) or Multi Frequency. Touch tone is fast and less prone to

error than pulse dialing. DTMF is the dialing system that could travel across microwave

links and work rapidly with computer controlled exchanges. Touch tone can therefore,

send signals around the world via the telephone lines and can be used to control phone

answering machines and computers. Each transmitted digit consists of two separate audio

tones that are mixed together; one of the frequencies is from the higher frequency band

whereas the other one is from the lower frequency band. Three vertical columns on the

key pad are known as the high group and the four horizontal rows as the low group.

Standard DTMF dials will produce a tone as long as a key is pressed.

2.3 ReliabilityWhile PSTN provides limited features, low bandwidth and no mobile capabilities, it does

provide greater reliability than other telephony systems (mobile phone, CDMA, etc.).

Landline phones also give, in most cases, greater voice clarity, and many are sited in

offices or other locations suited for conversation. The communications circuits of the

PSTN continue to be modernized by advances in digital communications, however, other

9

400 Hz or 800 Hz intermittent pattern

0.5sec 0.25sec

Figure: 2.5 call in progress tones

Page 10: Final Year Project

“Meter Reading Through PSTN Line”

than improving sound quality, these changes have been mainly transparent to the POTS

(Post Office Telephone System) customer Due to the wide availability of POTS, new

forms of communications devices such as modems and facsimile machines are designed

to use the POTS service to transmit digital information.

2.4 Tone Dialing or Dual Tone Multiple Frequency (DTMF) 2.4.1 Definition

DTMF signaling is used for telephone signaling over the line in the voice-frequency band

to the call switching center. The version of DTMF used for telephone tone dialing is

known by the trademarked term Touch-Tone, and is standardized by ITU-T

Recommendation. Other multi-frequency systems are used for signaling internal to the

telephone network. Dual Tone Multi-Frequency or DTMF is a method for instructing a

telephone switching system of the telephone number to be dialed, or to issue commands

to switching systems or related telephony equipment.

Pulse Dialing system originated with a rotary dial integrated into telephone instruments,

for the purpose of signaling. The pulses are generated through the making and breaking

of the telephone connection (akin to flicking a light switch on and off); the audible clicks

are a side effect of this. As a result, all that is really needed to dial a number with pulse

dialing is a switch. Each digit in the number is represented by a different number of rapid

clicks. Most fixed-line phones now use dual tone multi frequency (DTMF, also called

touch tone or tone dialing) rather than pulse dialing, but most telephone equipment

retains support for pulse dialing for backward compatibility. Some models of keypad

phones have a tone/pulse switch which can be toggled to switch between the two, making

these phones usable in areas where DTMF dialing is not accepted.

The touch-tone dialing scheme is shown in figure below. The rotary dial is replaced by

push button keyboard. ‘Touching’ a button generates a ‘tone’, which is combination of

two frequencies, one from lower band and from upper band. For example, pressing the

push button 9 transmits 850Hz and 1477Hz. An extended design provides for an

additional frequency 1633Hz in the upper band and could produce 16 distinct signals.

When used to dial a telephone number, pressing a single key will produce a pitch

consisting of two simultaneous pure tone sinusoidal frequencies. The row in which the

10

Page 11: Final Year Project

“Meter Reading Through PSTN Line”

key appears determines the low frequency, and the column determines the high

frequency. For example, pressing the '1' key will result in a sound composed of both a

697 and a 1209 hertz (Hz) tone.

Table 2.1: DTMF keypad arrangement

The tone frequencies are defined by the Precise Tone Plan which is selected such that

harmonics and inter modulation products will not cause an unreliable signal. No

frequency is a multiple of another, the difference between any two frequencies does not

equal any of the frequencies, and the sum of any two frequencies does not equal any of

the frequencies. The frequencies were initially designed with a ratio of 21/19, which is

slightly less than a whole tone. The frequencies may not vary more than ±1.5% from their

nominal frequency, or the switching center will ignore the signal. The high frequencies

may be the same volume or louder as the low frequencies when sent across the line. The

loudness difference between the high and low frequencies can be as large as 3 decibels

(dB) and is referred to as "twist". The minimum duration of the tone should be at least 70

ms, although in some countries and applications DTMF receivers must be able to reliably

detect DTMF tones as short as 45ms.

1209

Hz

1336

Hz

1477

Hz

697 Hz 1 2 3

770 Hz 4 5 6

852 Hz 7 8 9

941 Hz * 0 #

11

Page 12: Final Year Project

“Meter Reading Through PSTN Line”

Figure 2.6: A standard modern telephone keypad

3.1 ResistorThe resistor is the simplest, most basic electronic component. In an electronic

circuit, the resistor opposes the flow of electrical current through itself. It accomplishes

this by absorbing some of the electrical energy applied to it and then dissipating that

energy as heat. By doing this, the resistor provides a means of limiting or controlling the

amount of electrical current that can pass through a given circuit.

Figure 3.1: Resistors

3.2 CapacitorA capacitor stores electric charge. A capacitor is used with a resistor in a timing

circuit. It can also be used as a filter, to block DC signal but pass DC signals but AC

signals. The dielectric of ceramic capacitors is made of ceramic materials. Dielectrics are

the insulating material between the plates of ceramic capacitors. This material is chosen

for its ability to permit electrostatic attraction and repulsion to take place across it.

Ceramics offer material will have the property that energy required to establish an

electric field is recoverable in whole or in whole or in part, as electric energy. There are a

number of ceramic materials and compositions that are used in ceramic capacitors.

Common ceramic capacitors comprise a solid body of high temperature, ceramic resistive

material with bonded metal contacts. Ceramic has a high Q, low K temperature

compensating type of dielectric with stable electrical properties under varying voltage,

temperature, frequency and time. It is suitable for circuits that require low cost, as well as

timing and tuning applications.

12

Page 13: Final Year Project

“Meter Reading Through PSTN Line”

Figure 3.2: Capacitor

3.3 Diode A diode is a two-terminal electronic component that conducts electric current in only one

direction. The term usually refers to a semiconductor diode, which is a crystal of

semiconductor connected to two electric terminals, a P-N junction.

The most common function of a diode is to allow an electric current in forward biased

condition while blocking current in reversed biased condition. Thus, the diode can be

thought of as an electronic version of a check valve. This unidirectional operation of the

diode is called rectification, and is used to convert alternating current to direct current.

Figure 3.3: V-I Characteristic of Diodes

13

Page 14: Final Year Project

“Meter Reading Through PSTN Line”

3.4 Zener diodeA Zener diode is a type of diode that permits current not only in the forward direction

like a normal diode, but also in the reverse direction if the voltage is larger than the

breakdown voltage known as "Zener knee voltage" or "Zener voltage". The device was

named after Clarence Zener, who discovered this electrical property.

A conventional solid-state diode will not allow significant current if it is reverse-biased

below its reverse breakdown voltage. When the reverse bias breakdown voltage is

exceeded, a conventional diode is subject to high current due to avalanche breakdown.

Unless this current is limited by circuitry, the diode will be permanently damaged. In case

of large forward bias (current in the direction of the arrow), the diode exhibits a voltage

drop due to its junction built-in voltage and internal resistance. The amount of the voltage

drop depends on the semiconductor material and the doping concentrations.

A Zener diode exhibits almost the same properties, except the device is specially

designed so as to have a greatly reduced breakdown voltage, the so-called Zener voltage.

By contrast with the conventional device, a reverse-biased Zener diode will exhibit a

controlled breakdown and allow the current to keep the voltage across the Zener diode at

the Zener voltage. For example, a diode with a Zener breakdown voltage of 3.2 V will

exhibit a voltage drop of 3.2 V if reverse bias voltage applied across it is more than its

Zener voltage. The Zener diode is therefore ideal for applications such as the generation

of a reference voltage (e.g. for an amplifier stage), or as a voltage stabilizer for low-

current applications.

14

Figure 3.4: V-I Characteristics of Zener Diode

Page 15: Final Year Project

“Meter Reading Through PSTN Line”

3.5 TransistorA transistor is a semiconductor device that uses a small amount of voltage or electrical

current to control a larger change in voltage or current. Because of its fast response and

accuracy, it may be used in a wide variety of applications, including amplification,

switching voltage stabilization, signal modulation, and as an oscillator. The transistor is

the fundamental building block of both digital and analog circuits’ .The circuitry that

governs the operation of computers, cellular phones, and all other modern electronics.

Transistors may be packaged individually or as part of an integrated circuit chip, which

may hold thousands of transistors in a very small area.

Transistors are divided into two main categories: bipolar junction transistors (BJTs) and

field effect transistors (FETs). Application of current in BJTs and voltage in FETs

between the input and common terminals increases the conductivity between the common

and output terminals, thereby controlling current flow between them.

3.5.1 Types of Transistor

There are two types of standard transistors, NPN and PNP, with different circuit symbols.

The letters refer to the layers of semiconductor material used to make the transistor. Most

transistors used today are NPN because this is the easiest type to make from silicon.

Figure3.5: NPN and PNP Transistors

The labeled terms are base (B), collector (C) and emitter (E).

15

Page 16: Final Year Project

“Meter Reading Through PSTN Line”

3.5.2 BC547

FEATURES

Low current (max. 100 mA)

Low voltage (max. 65 V).

APPLICATIONS

General purpose switching and amplification.

DESCRIPTION

NPN transistor in a TO-92; SOT54 plastic package.

PNP complements: BC556 and BC557.

3.5.3 Tip 122

Designed for general–purpose amplifier and low–speed switching applications.

High DC Current Gain

hFE = 2500 (Typ) @ IC = 4.0 Adc

Collector–Emitter Sustaining Voltage — @ 100 mAdc

VCEO(sus) = 60 Vdc (Min) — TIP120, TIP125 = 80 Vdc (Min) — TIP121, TIP126 = 100

Vdc (Min) — TIP122, TIP127

Low Collector–Emitter Saturation Voltage — VCE(sat) = 2.0 Vdc (Max) @ IC = 3.0

Adc = 4.0 Vdc (Max) @ IC = 5.0 Adc

PIN Description

1 emitter

2 base

3 collector

16

Figure 3.6: BC547 and its pin configuration

Page 17: Final Year Project

“Meter Reading Through PSTN Line”

Monolithic Construction with Built–In Base–Emitter Shunt Resistors

TO–220AB Compact Package

Figure3.7: TIP122

3.5.4 SL100

3.6 RegulatorIn electronics, a linear regulator is a voltage regulator based on an active device (such as

a bipolar junction transistor, field effect transistor or vacuum tube) operating in its "linear

region" (in contrast, a switching regulator is based on a transistor forced to act as an

on/off switch) or passive devices like zener diodes operated in their breakdown region.

The regulating device is made to act like a variable resistor, continuously adjusting a

17

Page 18: Final Year Project

“Meter Reading Through PSTN Line”

voltage divider network to maintain a constant output voltage. It is very inefficient

compared to a switched-mode power supply, since it sheds the difference voltage by

dissipating heat.

3.6.1 Fixed Regulators

"Fixed" three-terminal linear regulators are commonly available to generate fixed

voltages of plus 3 V, and plus or minus 5 V, 9 V, 12 V, or 15 V when the load is less than

1.5 amperes.

The "78xx" series (7805, 7812, etc.) regulate positive voltages while the "79xx" series

(7905, 7912, etc.) regulate negative voltages. Often, the last two digits of the device

number are the output voltage; eg, a 7805 is a +5 V regulator, while a 7915 is a -15 V

regulator. The 78xx series ICs can supply up to 1.5 Amperes depending on the model.

Figure3.8: 78XX regulators

3.7 RelayA relay is an electrical switch that opens and closes under the control of another electrical

circuit. In the original form, the switch is operated by an electromagnet to open or close

one or many sets of contacts.

When a current flows through the coil, the resulting magnetic field attracts an armature

that is mechanically linked to a moving contact. The movement either makes or breaks a

connection with a fixed contact. When the current to the coil is switched off, the armature

is returned by a force approximately half as strong as the magnetic force to its relaxed

position. Usually this is a spring, but gravity is also used commonly in industrial motor

18

Page 19: Final Year Project

“Meter Reading Through PSTN Line”

starters. Most relays are manufactured to operate quickly. In a low voltage application,

this is to reduce noise. In a high voltage or high current application, this is to reduce

arcing. Relays are used:

To control a high-voltage circuit with a low-voltage signal

To control a high-current circuit with a low-current signal

To detect and isolate faults on transmission and distribution lines by opening and

closing circuit breakers

Figure 3.9: Double pole relay

3.8 Liquid crystal display A liquid crystal display (LCD) is a thin, flat panel used for electronically displaying

information such as characters, alphabets, and the symbols. Its uses include monitors for

computers, televisions, instrument panels, and other devices ranging from aircraft cockpit

displays, to every-day consumer devices such as video players, gaming devices, clocks,

watches, calculators, and telephones. Among its major features are its lightweight

construction, its portability, and its ability to be produced in much larger screen sizes than

are practical for the construction of cathode ray tube (CRT) display technology. Its low

19

Page 20: Final Year Project

“Meter Reading Through PSTN Line”

electrical power consumption enables it to be used in battery-powered electronic

equipment. It is an electronically-modulated optical device made up of any number of

pixels filled with liquid crystals and arrayed in front of a light source (backlight) or

reflector to produce images in color or monochrome. The earliest discovery leading to the

development of LCD technology, the discovery of liquid crystals, dates from 1888. By

2008, worldwide sales of televisions with LCD screens had surpassed the sale of CRT

units.

Figure 3.10: Liquid Crystal Display (LCD)

3.9 DTMF EncoderTelephone signaling is based on encoding keypad digits using two sinusoids of different

frequencies, hence the name DTMF. Each digit is represented by a low frequency and a

high frequency sinusoid. The frequencies used were recommended by AT&T such that

no two frequencies are integral multiples of each other. This facilitates correct decoding

even in the presence of non linearity of filters which cause higher harmonics to be

present. In DTMF each key is encoded using two sinusoids of different frequency .So

encoder can be implemented in DSP as a look up table corresponding to each key

pressed. Component used for encoding purpose is an 18 pin SC91215A single chip,

silicon gate, CMOS integrated circuit with an on-chip oscillator for a 3.58 MHz crystal or

ceramic resonator that takes the binary inputs on the basis of number pressed by selecting

the particular row and column and converts into the corresponding DTMF signal to be

passed over the telephone wire. The features of SC91215A are:-

One touch redials operation.

Tone/pulse switch able.

20

Page 21: Final Year Project

“Meter Reading Through PSTN Line”

Hands free control operation.

Wide operating voltage range of 2.2v to 5.5v

Figure 3.11: Pin Configuration of encoder UM91215A IC

3.10 DTMF DecoderDTMF Decoder is very easy to use to decode DTMF dial tones found on telephone lines

with touch tone phones. DTMF Decoder is also used for receiving data transmissions

over the air in amateur radio frequency bands. DTMF is used by most PSTN (public

switched telephone networks) systems for number dialing, and is also used for voice-

response systems such as telephone banking and sometimes over private radio networks

to provide signaling and transferring of small amounts of data. The standard defines the

DTMF tones for 16 keys, but telephones only use 12 of these 16 keys. The remaining 4

tones are sometimes used within the telephone networks, but unless you are a

telecommunication geek working for a telephone company or the military, you will

probably never get to hear one of these tones, but, if you are anxious to know what these

tones sound like, you can use our online DTMF tone generator to create and download

computer audio files containing DTMF tones from the elusive 4th column. An exact log

is displayed; when, which number was dialed. This log is automatically stored into a log

file for later exploration. In our project the used DTMF decoder is an 18 pin CM8870 IC

that converts the DTMF signal from the telephone to the binary bits to be processed by

the microcontroller. CM8870 IC is a complete DTMF receiver integrating both the band

21

Page 22: Final Year Project

“Meter Reading Through PSTN Line”

split filter and digital decoder functions. The filter section uses switched capacitor

functions for high and low group filters. The decoder uses digital counting techniques to

detect and decode all 16 DTMF tone pairs into a 4 bit code. As long as valid DTMF is

present in the input, it produces high Std pin.

The outputs from the DTMF decoder to the corresponding inputs are shown in table

below:

Input number Decoded digital data

1 0001

2 0010

3 0011

4 0100

5 0101

6 0110

7 0111

8 1000

9 1001

0 1010

* 1011

# 1100

Table 3.1: Input/output of the DTMF Decoder

The features of CM8870 are:-

Complete DTMF receiver.

Low power consumption.

Internal gain setting amplifier.

Power down mode.

Central Office quality.

22

Page 23: Final Year Project

“Meter Reading Through PSTN Line”

Figure 3.12: Pin Configuration of CM8870 decoder IC

3.11 Microcontroller3.11.1 Introduction of Microcontroller

A microcontroller is an integrated chip that is often part of an embedded system. The

microcontroller includes a CPU, RAM, ROM, I/O ports, and timers like a standard

computer, but because they are designed to execute only a single specific task to control a

single system, they are much smaller and simplified so that they can include all the

functions required on a single chip. Microcontrollers are sometimes called an embedded

microcontroller, which just means that they are part of an embedded system that is, one

part of a larger device or system. A microcontroller differs from a microprocessor, which

is a general-purpose chip that is used to create a multi-function computer or device and

requires multiple chips to handle various tasks. A microcontroller is meant to be more

self-contained and independent, and functions as a tiny dedicated computer.

The great advantage of microcontrollers, as opposed to using larger microprocessors, is

that the parts-count and design costs of the item being controlled can be kept to a

minimum. They are typically designed using CMOS (complementary metal oxide

semiconductor) technology, an efficient fabrication technique that uses less power and is

more immune to power spikes than other techniques.

There are also multiple architectures used, but the predominant architecture is CISC

(Complex Instruction Set Computer), which allows the microcontroller to contain

multiple control instructions that can be executed with a single macro instruction. Some

23

Page 24: Final Year Project

“Meter Reading Through PSTN Line”

use a RISC (Reduced Instruction Set Computer) architecture, which implements fewer

instructions, but delivers greater simplicity and lower power consumption.

Early controllers were typically built from logic components and were usually quite

large. Later, microprocessors were used, and controllers were able to fit onto a circuit

board. Microcontrollers now place all of the needed components onto a single chip.

Because they control a single function, some complex devices contain multiple

microprocessors. Microcontrollers have become common in many areas, and can be

found in home appliances, computer equipment, and instrumentation. They are often used

in automobiles, and have many industrial uses as well, and have become a central part of

industrial robotics. Because they are usually used to control a single process and execute

simple instructions, microcontrollers do not require significant processing power.

The automotive market has been a major driver of microcontrollers, many of which have

been developed for automotive applications. Because automotive microcontrollers have

to withstand harsh environmental conditions, they must be highly reliable and durable.

Nonetheless, automotive microcontrollers, like their counterparts, are very inexpensive

and are able to deliver powerful features that would otherwise be impossible, or too

costly to implement.

Figure 3.13: Basic Block Diagram of Microcontroller

24

Page 25: Final Year Project

“Meter Reading Through PSTN Line”

3.11.2 Comparison of Microcontroller and Microprocessor

The microprocessor contains no RAM, ROM and Input/output ports on the chip itself. On

the other hand microcontroller has CPU, RAM and ROM, input/output ports, timer,

interrupts and serial ports on a single chip.

Furthermore, microprocessor instruction sets are processing intensive, implying they

have powerful addressing modes with instruction sets catering to operations on large

volume of data. On the other hand, microcontroller has instruction sets catering to the

control of inputs and outputs. The interface too many inputs and outputs uses single bit.

Microcontroller has instructions to set and clear individual bits and perform other bit

oriented operations such as logically AND-ing, OR-ing and XOR-ing bits jumping if a bit

is set or clear and so on. This powerful feature is rarely present on microprocessor which

is usually designed to operate on bytes or larger units of data.

25

Page 26: Final Year Project

“Meter Reading Through PSTN Line”

Figure 3.14: Pin Configuration of AT89C5X Microcontroller

3.11.3 Pin Description of 89C5X Microcontroller

Port 0

Port 0 is an 8-bit open-drain bi-directional I/O port. As an output port, each pin can sink

eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as high

impedance inputs. Port 0 may also be configured to be the multiplexed low order

address/data bus during accesses to external programmed data memory. In this mode P0

has internal pull ups. Port 0 also receives the code bytes during Flash programming, and

outputs the code bytes during program verification. External pull-ups are required during

program verification.

Port 1

Port 1 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 1 output buffers

can sink/source four TTL inputs. When 1s are written to Port 1 pins they are pulled high

by the internal pull-ups and can be used as inputs. As inputs, Port 1 pins that are

externally being pulled low will source current because of the internal pull-ups. Port 1

also receives the low-order address bytes during Flash programming and verification.

Port 2

Port 2 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 2 output buffers

can sink/source four TTL inputs. When 1s are written to Port 2 pins they are pulled high

by the internal pull-ups and can be used as inputs.

Port 2 emits the high-order address byte during fetches from external program memory

and during accesses to external data memory that uses 16-bit addresses (MOVX

@DPTR). In this application, it uses strong internal pull-ups when emitting 1s. During

accesses to external data memory that uses 8-bit addresses (MOVX @ RI), Port 2 emits

the contents of the P2 Special Function Register. Port 2 also receives the high-order

address bits and some control signals during Flash programming and verification.

Port 3

26

Page 27: Final Year Project

“Meter Reading Through PSTN Line”

Port 3 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 3 output buffers

can sink/source four TTL inputs. When 1s are written to Port 3 pins they are pulled high

by the internal pull-ups and can be used as inputs. As inputs, Port 3 pins that are

externally being pulled low will source current because of the pull-ups. Port 3 also serves

the functions of various special features of the AT89C51 as listed below: Port 3 also

receives some control signals for Flash programming and verification. Port 3 also

receives some control signals for Flash programming and verification.

Table 3.2: Description of port 3 pins of microcontroller

RST

Reset input. A high on this pin for two machine cycles while the oscillator is running

resets the device.

ALE/PROG

Port Pin Alternate Functions

P3.0 RXD (serial input port)

P3.1 TXD (serial output port)

P3.2 INT0 (external interrupt 0)

P3.3 INT1 (external interrupt 1)

P3.4 T0 (timer 0 external input)

P3.5 T1 (timer 1 external input)

P3.6 WR (external data memory write strobe)

P3.7 RD (external data memory read strobe

27

Page 28: Final Year Project

“Meter Reading Through PSTN Line”

Address Latch Enable output pulse for latching the low byte of the address during access

to external memory. In normal operation ALE is emitted at a constant rate of 1/6 the

oscillator frequency, and may be used for external timing or clocking purposes. Note,

however, that one ALE pulse is skipped during each access to external Data Memory

If desired, ALE operation can be disabled by setting bit 0 of SFR location 8EH. With the

bit set, ALE is active only during a MOVX or MOVC instruction. Otherwise, the pin is

weakly pulled high. Setting the ALE-disable bit has no effect if the microcontroller is in

external execution mode.

PSEN

Program Store Enable is the read strobe to external program memory. When the

AT89C52 is executing code from external program memory, PSEN is activated twice

each machine cycle, except that two PSEN activations are skipped during each access to

external data memory.

XTAL1

Input to the inverting oscillator amplifier and input to the internal clock operating circuit.

XTAL2

Output from the inverting oscillator amplifier.

Oscillator CharacteristicsXTAL1 and XTAL2 are the input and output, respectively, of an inverting amplifier,

which can be configured for use as an on-chip oscillator. Either a quartz crystal or

ceramic resonator may be used. To drive the device from an external clock source,

XTAL2 should be left unconnected while XTAL1 is driven. There are no requirements

on the duty cycle of the external clock signal, since the input to the internal clocking

circuitry is through a divide-by-two flip-flop, but minimum and maximum voltage high

and low time specifications must be observed.

28

C1

C2

XTAL1

XTAL2

µcont.

GND

Figure 3.15: Oscillator connections.

Page 29: Final Year Project

“Meter Reading Through PSTN Line”

4.1 Hardware OperationsOur system enables us to send meter data via PSTN line. So we have to interface our

designed hardware unit with the PSTN line available to us. The sequential operation

to operate with our system is as follows:

At central office dials the client phone number java application program rest

on the central office computer via modem.

At client side the incoming caller id information is detected.

The caller id information is compared with the central office fixed number.

If the match is found the meter reading is transmitted toward the central

office.

Otherwise no meter access is permitted to the incoming call.

4.2 Hardware Configuration To achieve the above objectives the following hardware configuration is required.

4.2.1 Switching Unit

This unit helps us to change the mode of the system from normal mode to data

access mode

29

Page 30: Final Year Project

“Meter Reading Through PSTN Line”

Figure 4.1 Switching Unit

The switching unit mainly consists of the relay. The telephone set is connected on the

normally connected (NC) side and the voice circuit for the transmitter unit is connected to

the normally open (NO) side of the relay. It switches the telephone line to access the

meter if and only if the caller id number is matched with the fixed central office number.

During normal operation when the relay is not activated the telephone set is connected to

the telephone line. However when the relay is activated telephone set is disconnected.

4.2.2 DTMF Encoder Unit

30

Page 31: Final Year Project

“Meter Reading Through PSTN Line”

Figure 4.2 DTMF Encoder Unit

DTMF encoder unit is a unit that converts the binary coded signals into analog DTMF

signal or simply does the reverse of the DTMF decoder unit. This UM9125A Chip is an

18 pin chip which takes the binary signal and makes the pin high on the basis of number

pressed by selecting particular row and column.

In our project the output obtained from the encoder is not of much strength and to use the

two wires (mouth piece) among four wires from a hybrid transformer circuit, we use

voice circuit from a telephone circuit as amplifier as well as hybrid transformer.

4.2.3 DTMF Decoder Unit

Figure 4.3: DTMF Decoder Units

31

Page 32: Final Year Project

“Meter Reading Through PSTN Line”

DTMF decoder is a CM8870 IC. This 18 pin IC converts analog DTMF signal from the

telephone line into the corresponding 4-bit digital data. As long as the valid DTMF is

present at the input of the decoder IC, it produces high Std pin. This pin is used as the

control signal to the microcontroller to read valid binary data at its input port. In our

project we use this pin as interrupt signal for the microcontroller to read the valid DTMF

input. It can be used as the caller id detection at the client side while to decode the

transmitted data at the central office.

4.2.4 Hook Off Unit

Hook off unit consists of a BC547 transistor made inverter and SL100 transistor.

When the input to the BC547 is low, the collector output of BC547 is logic high

which turns on the SL100 which places the resistance of 330 ohm between the

‘Tip’ and ‘Ring’ which is equivalent to hook off?

Figure 4.4 Hook On/Off Unit

4.2.5 Microcontroller unit connection

4.2.5.1 Central office

The microcontroller used in our project is 89C51. It has four ports namely Port 0,

Port 1, Port 2, Port 3. Apart from its normal pin configuration, its port is assigned as

above.

Port 0

32

Page 33: Final Year Project

“Meter Reading Through PSTN Line”

Port 0.0 - 0.3 are to communicate with the decoder by saving the binary data on

the decoder when the Std pin goes high.

Port 0.4 - P0.7 is grounded.

Port 1

Its all pin Port 1.0-1.7 are used as data lines for LCD.

Port 2

Port 2.0 – 2.2 are used as the control pins for the LCD.

Port 2.3 - 2.7 are not used.

Port 3

Port 3.2 is used as the STD signal interrupt.

Figure 4.5 microcontroller connections on the central office

4.2.5.2 Client side

33

Page 34: Final Year Project

“Meter Reading Through PSTN Line”

The microcontroller used in our project is 89C51. It has got four ports namely Port 0, Port

1, Port 2, Port 3. Apart from its normal pin configuration, its port is assigned as above.

Port 0

Port 0.0 - 0.4 are to communicate with the decoder by saving the binary data on the

decoder when the Std pin goes high.

Port 0.4 - P0.7 is grounded.

Port 1

Port 1.0 - 1.6 are to communicate with the encoder by selecting the specific row and

column.

Figure 4.6 microcontroller connections on the client side

Port 2

Port 2.0 is used for the hook-off circuit.

Port 2.1 is used for the switching unit.

Port 3

Port 3.2 is interrupting STD input for the valid data reading using interrupt.

34

Page 35: Final Year Project

“Meter Reading Through PSTN Line”

Port 3.4 is timer/counter-0, in our project it is used to count the pulse from the meter

it counts the 6400 pulses and reset.

Port 3.5 is timer/counter-1, in our project it is used to count the number of unit

consumed by the customer.

Port 3.6 is used for giving the pulse to timer/counter-1when the timer flag 0 is not

zero.

4.2.6 LCD unit connection

The output unit of our project is JHD 16*2A LCD display. It is of 16 pin and its pin

configuration is as below:

Pin 1 is grounded.

Pin 2 is connected to Vcc.

Pin 1, 2, 3 are used for selecting the intensity of the display by keeping the

appropriate resistor between pin 3&1 and 3&2.

Pin 4, 5, 6 are used for handshaking with the microcontroller through port 2.0 –

2.2 at central office microcontroller.

Pin 7-14 are used as data pins from microcontroller port 1.0-1.7.

Pin 15 is connected to Vcc and pin 16 is connected to ground for the backlight.

35

Page 36: Final Year Project

“Meter Reading Through PSTN Line”

Figure 4.7 LCD Unit Connections

4.3 Block Diagram

36

Page 37: Final Year Project

“Meter Reading Through PSTN Line”

Figure 4.8: Block Diagram of over all system

The desired client number and the central office telephone line are connected via the

switching centre. The data transfer mode is enabled only when the fixed telephone

37

Page 38: Final Year Project

“Meter Reading Through PSTN Line”

number of central office is matched with dialing telephone number using the caller id

information at client side; otherwise the access is not permitted to the meter data.

In the data transfer mode, the data stored in the microcontroller is transmitted through

PSTN line. Corresponding to the BCD data, DTMF transmitter generates the DTMF

wave which gets transmitted through the telephone via the switching centre to the central

office. At the central office, the control signal decoder (DTMF to binary converter)

decodes the DTMF wave and provides the four bit BCD data. The received data is then

displayed on LCD using microcontroller.

4.4 AlgorithmStep 1: Start

Step 2: Terminal application initialization at the central office

Step 3: Client telephone number acquisition from the database

Step4: Dial through the computer modem

Step5: Abstract the caller id information from the PSTN line at client side

Step 6: Check for the match with the central office number?

6.1: If yes!

6.1.1: Switch the PSTN line to activate the interface card.

6.1.2: Enable the auto hook off circuit.

6.1.3: Send the counter data to the DTMF encoder.

6.1.4: Encode the count value DTMF format.

6.1.5: Transmit data through the PSTN line in appropriate format using the

voice circuits

6.1.6: After the ending the transmissions disable the auto hook off circuit

6.1.7: Release back the connection of PSTN line to the telephone set.

6.1.8: check for the valid data format at central office side.

6.1.8.1: if yes! Display the count values in LCD

6.1.8.2: else Neglect it.

6.2: else

Do not activate the interface card and keep the PSTN line connected to the

telephone set.

38

Page 39: Final Year Project

“Meter Reading Through PSTN Line”

Step7: End

4.5 Flowchart

39

No Yes

Start

Initialize Terminal Application at central office

Phone number acquisition from

database

Dial through the computer modem

ISMatch found?

Abstract the caller id information at client side

A

Switch line to the interface card

Auto Hook-Off the telephone line

Don’t activate the interface card

B

Initialize the counter and caller id circuit at client side

Count the pulse from the meter

Count the no of units 6400 meter pulse = 1unit

Is call originate?

YesNo

C

D

Another customer at server?

Send the counter data on DTMF encoder

A

Encode the count value in DTMF format

Transmit through PSTN line using voice circuit

Release the Hook-off circuit

Release back the PSTN line to telephone set

Detect whether valid data present at central office?

Display on LCD Neglect it

B

End terminal application at central office

Yes

No

D

Yes

No

WhateverC

Page 40: Final Year Project

“Meter Reading Through PSTN Line”

4.6 Circuit Diagram

40

Page 41: Final Year Project

“Meter Reading Through PSTN Line”

4.6.1 Central office side.

4.6.2 Client side

41

Page 42: Final Year Project

“Meter Reading Through PSTN Line”

4.7 Printed Circuit Board (PCB)

42

Page 43: Final Year Project

“Meter Reading Through PSTN Line”

A printed circuit board, or PCB, is used to mechanically support and electrically

connect electronics components using conductive pathways, tracks or traces from

copper sheets laminated onto a non-conductive substrate. It is also referred to as

printed wiring board (PWB) or etched wiring board. A PCB populated with

electronic components is a printed circuit assembly (PCA), also known as a

printed circuit board assembly (PCBA).

4.7.1 Central office side

4.7.2 Client side

5.1 Definition

43

Page 44: Final Year Project

“Meter Reading Through PSTN Line”

Software is the soul of the hardware part. Software is that tool in the embedded system

which controls the overall functioning of our embedded circuit. Software can be stored in

external memory or in the inbuilt memory of the microcontroller itself. We have stored

program in a microcontroller. The inputs are taken from meter pulses and output is shown

in the LCD. Software, being a crucial part of our project, is going to be discussed in detail

in this section.

5.2 Choice of Programming Language to program microcontrollerAs stated earlier the programming language is to be chosen in such a way that it can be

used for the successful operation of the hardware configuration. It should programmer

friendly as well as a powerful tool.

Unlike the other programming languages, assembly language is not a single language, but

rather a group of languages. Each processor family (and sometimes individual processors

within a processor family) has its own assembly language.   In contrast to high level

languages, data structures and program structures in assembly language are created by

directly implementing them on the underlying hardware. So, instead of cataloguing the

data structures and program structures that can be built, hardware capabilities of various

processor families can be compared and contrasted.  Assembly languages are close to a

one to one correspondence between symbolic instructions and executable machine codes.

Assembly languages also include directives to the assembler, directives to the linker,

directives for organizing data space, and macros. Macros can be used to combine several

assembly language instructions into a high level language-like construct (as well as other

purposes). There are cases where a symbolic instruction is translated into more than one

machine instruction. But in general, symbolic assembly language instructions correspond

to individual executable machine instructions. High level languages are abstract.

Typically a single high level instruction is translated into several (sometimes dozens or in

rare cases even hundreds) executable machine language instructions. Assembly language

is much harder to program than high level languages. The programmer must pay attention

to far more detail and must have an intimate knowledge of the processor in use. But high

quality hand crafted assembly language programs can run much faster and use much less

memory and other resources than a similar program written in a high level language.

44

Page 45: Final Year Project

“Meter Reading Through PSTN Line”

Speed increases of two to 20 times faster are fairly common, and increases of hundreds of

times faster are occasionally possible. Assembly language programming also gives direct

access to key machine features essential for implementing certain kinds of low level

routines, such as an operating system kernel or microkernel, device drivers, and machine

control.  High level programming languages are much easier to work in and for semi-

technical managers to supervise. And high level languages allow faster development

times than work in assembly language, even with highly skilled programmers.

Development time increases of 10 to 100 times faster are fairly common. Programs

written in high level languages (especially object oriented programming languages) are

much easier and less expensive to maintain than similar programs written in assembly

language (and for a successful software project, the vast majority of the work and

expense is in maintenance, not initial development).

So we have chosen the assembly language programming for its various advantages.

However the high level programming language such as C,C++ etc could also be used to

program the microcontroller. Since we got used to with the assembly language program

and have some prior experience in the same, it made feel easy to choose the assembly

programming.

5.3 About the assemblerThe Microsoft Macro Assembler is an x86 assembler for MS-DOS and Microsoft

Windows. It supports a wide variety of macro facilities and structured programming

idioms, including high-level functions for looping and procedures. Later versions added

the capability of producing programs for Windows. MASM is one of the few Microsoft

development tools that target 16-bit, 32-bit and is supplied as a 64 bit version ML64.EXE

for 64-bit platforms. Versions 5.0 and earlier were MS-DOS applications. Versions 5.1

and 6.0 were available as both MS-DOS and OS/2 applications. Versions 6.12 to 6.14

were implemented as patches for version 6.11 which converted them from 16 bit MZ

executables to 32 bit PE executable files. All later versions have been 32 bit PE

executable files built as Win32 console mode applications.

45

Page 46: Final Year Project

“Meter Reading Through PSTN Line”

5.4 Choice of Programming Language to develop terminal application

in central office. A wide variety of high level programming languages are available to develop the

software tools required for the systems .C, C++, Visual Basic, C#, .net are some of such

examples of the high level programming languages. The language we selected here for

our purpose is JAVA programming. The basic features of this language are Inheritance

Polymorphism, Data Encapsulation, Data Abstraction etc. Special features of Java are:

Multimedia: The packages java.awt.image and javax.swing.sound contain classes

for manipulating images and sounds.

Drag-and-Drop: Drag-and-drop refers to dragging an item that is to be processed

and dropping it onto the item that you want to process it. An example is dragging

a file and dropping it into the trash. Drag-and-Drop support in Java is provided in

the package java.awt.dnd.

Accessibility: Not everyone can see a computer screen, hear sounds, use a mouse,

and type on a keyboard. A typical user interface is not accessible to these people.

Java has an infrastructure that can be used to make programs accessible. It is

defined in the package javax.accessibility.

Security: The package java.security can be used for secure, encrypted network

communication.

Database: JDBC (Java DataBase Connectivity) refers to set of classes that is used

to connect to databases and retrieve information from them. The basic classes are

defined in the package java.sql (but to use them, you also need a "driver" for the

specific type of database that you want to connect to).

XML: XML is a data representation format that is similar to HTML. Like HTML,

it can be used to describe documents. But it is also used to represent arbitrary

structured data. With the release of Java Version 1.4, XML is a standard part of

Java. Currently, XML is probably generating more excitement and hype than any

other single computing technology.

46

Page 47: Final Year Project

“Meter Reading Through PSTN Line”

The main reason for selecting the java for programming the central office terminal

program is the wide availability of the source codes in internet, since JAVA is a open

source programming language. Moreover it’s also a platform independent programming

47

Page 48: Final Year Project

“Meter Reading Through PSTN Line”

6.1 Problem statementThe existing system employs a large number of manpower for the meter reading purpose.

However the system has many defects. The extensive delay involved in collecting the

data manually is especially not tolerable in modern age of fast pace. Furthermore it is not

always possible for the meter reader to have access to the electric meter all the time. The

culprit and dishonest meter readers may provide the fake and inaccurate readings to the

central office. All such reasons cause the huge amount of economical loss to electricity

service provider office. Moreover the current readings of the electric meters are not

obtainable in the present system.

6.2 Project applicationThe project entitled “Meter Reading through PSTN Line” has the objective of automating

the meter reading operation. The electric meter records can directly be accessed from the

central office without sending any personal to the client household. It enables the timely

availability of the current data at the moment of requirement. Furthermore it makes it

possible to obtain the accurate data without any error and fake. No manpower is required

to roam each and every client’s house for the collection of data that saves the large

amount of economy.

6.3 Problem facedAs the project is concerned with data transfer through the PSTN lines, the circuit design

is very difficult and requires the suitable noise immunity.

Some other problems faced during the project completion are as follows:

Defect in breadboard and dc power supply

Other defective & inaccurate devices and electronic component

Slow internet connection and inadequate related sources

Problem in hex digit dial in DTMF format

Problem in coupling the transmitting DTMF signal in PSTN line

Problem in dialing and detecting DTMF signal through modem in server site

computer

Unavailability of the DTMF encoders and decoders in proteus circuit simulations.

48

Page 49: Final Year Project

“Meter Reading Through PSTN Line”

.6.4 Project LimitationsThe project has some limitations due to various reasons. Some of the limitations are:

PSTN lines are not installed in every household even in the urban areas. Moreover

the remote areas are still away from the reach of telephone networks.

The manual manipulation and calculations are necessary for the purpose of billing

using the data displayed in LCD.

The security system of the interface card installed along with the meter in client

side is not so strong.

An authorized personal from the central office need to check for the break of the

seal in electric meter and interface card in regular time basis.

A battery backup is required in the situations of power outage.

6.5 Future EnhancementThere is a possibility of large future enhancement in this project which we could not get

completed, since we fall short of time and other reasons. Following are the some of the

possible future extension.

Automatic calculation of the billing information in central office terminal

application

Wireless system adaptation of the project where the PSTN lines are not available.

Develop a security system to detect the break of seal.

Using a memory device such as NVRAM to retain the meter count data in the

conditions of power outage.

49

Page 50: Final Year Project

“Meter Reading Through PSTN Line”

6.6 Cost EstimationParticulars Quantity Price per piece(Rs) Total cost(Rs)

Diode 1 packet 15 15

Zener diode 2 pieces 8 16

Resistors 1 packet 60 60

Capacitors 5 packets 10 50

Connecting wires 4 packets 45 180

MT8870DE 1 piece 120 120

UM91215A 2 pieces 90 180

BC547 10 pieces 2.5 25

SL100 4 pieces 15 60

Crystal(11.0592MHz) 2 pieces 40 80

Crystal(3.58Mhz) 3 pieces 40 120

AT89C51 2 pieces 250 500

Mechanical Relay 2 pieces 30 30

LCD 2 Pieces 150 300

C8050 2 pieces 50 100

Modem 1 piece 600 600

Telephone set 3 pieces 500 1500

PCB Print 2 pieces 550 1100

Miscellenous - 1000

Total cost Rs.6036

Table 6.1: Cost estimation6.7Gantt chart

50

Page 51: Final Year Project

“Meter Reading Through PSTN Line”

S.N.

Activity duration

July Aug. Sept

Oct. Nov. Dec. Jan. Feb. Mar.

1 Preliminary investigation

4wks

2 Feasibility study

2wks

3 Proposal preparation

2wks

4 Definition 2wks5 Circuit design 14wks6 Program

coding12wks

7 Debugging and testing

8wks

8 Report writing 8wks9 Presentation &

demonstration2wk

6.8 Conclusion

51

Page 52: Final Year Project

“Meter Reading Through PSTN Line”

The project is aimed at reading the electric meter through the PSTN line. Our project

seems to be beneficial to both the electricity service provider and the consumers, since

the electricity units can be transmitted to the central office via the PSTN line. No

manpower is required at the office to roam each and every home for collecting the units.

With the reduced manpower cost at the office, the extra income can be used to invest on

the other useful project thereby prospering the central office as well as the consumer in

the long run. Due to such benefits and feasibilities of this project we hope that the project

very useful for the real time implementation.

The different units required to complete this project has been developed, tested and

verified to meet the aimed objectives. The work we have done so far has given us an idea

and exposed to the world data transfer of telephony. It had also enabled us to realize the

aspects of hardware designing and the implementations.

We have performed yet our level best to achieve the objective of our project.

52

Page 53: Final Year Project

“Meter Reading Through PSTN Line”

Bibliography

Books

Ayala Kenneth J., “The 8051 Microcontroller” 2nd edition, 2003 Penram

International Publishing (India) Pvt. Ltd.

Muhammad Ali Mazidi, Janice Gillispie Mazidi, Rolin D. Mckinlay; “The 8051

microcontroller and Embedded systems Using Assembly and c” second edition,

2007 Prentice Hall of India

Thiagarajan Vishwanathan, “Telecommunication Switching Systems and

Networks”, Twenty Second Printing, Prentice Hall of India Pvt. Ltd., 2004.

Sedra Adel S., Smith Kenneth C., “Microelectronic Circuit” 5th Edition, Oxford

University Press INC, USA

“National Analog and Interface Products Databook” 2002 Edition.

Web Sites

http://scholar.google.com/scholar?

q=dtmf+encoder+interface+with+microcontroller+8051&hl=en&um=1&ie=UTF-

8&oi=scholart

http://publib.boulder.ibm.com/infocenter/pdthelp/v1r1/index.jsp?topic=/

com.ibm.entpli4.doc/ibml2mst03.html

http://www.talkingelectronics.com/projects/CircuitsOnWeb/CircuitsOnWeb.html

http://www.8051projects.net/downloads167.html

http://www.planet-source-code.com/vb/default.asp?lngWId=3#categories

http://www.google.com.np/search?

q=sms+through+telephone+line+&hl=en&start=20&sa=N

www.Microcontroller.com

www.alldatasheet.com

53