Sunteți pe pagina 1din 72

EMBEDDED PREPAID ENERGY METER WITH OVER 1

VOLTAGE AND OVERLOAD PROTECTION SYSTEM

1.1 INTRODUCTION:

In recent years, Indian power sector is facing serious problems in terms of lean revenue
collection in lieu of energy supplied and increasing energy requirements. All the steps
taken so far, regarding the improvement of the power scenario, are concerning the human
factor of the system but the metering and meter-reading system has to improve if revenue
collection is to be increased.

Electronic energy meters are replacing traditional electromechanical meters in


many residential, commercial and industrial applications because of the versatility and
low-cost afforded by electronic meter designs. In addition to that an electronic design can
protect against meter tampering and theft of service. An electronic energy meter can also
enable automatic meter reading (AMR), where energy metering data is transmitted to the
utility over an RF, power line or even infrared communications link. Improved accuracy
and lower power consumption are other benefits of electronic metering. With a
mechanical meter, the error in the basic energy usage measurement is on the order of 1%.
But with an electronic implementation, it is possible to reduce that error to less than
0.1%. Moreover, running the mechanical meter with its continuously spinning dial may
require hundreds of milliamps where as that power consumption can be reduced to a
couple milliamps in an electronic energy meter, producing big power savings for the
utility. Electronic meter designs also change the economics of manufacturing energy
meters. A single hardware design may be customized for different customers and markets
through changes in software. In addition, calibrating the finished meter is much easier
with an electronic meter design. Another consideration is the demand for mechanical-
meter replacements that are as inexpensive as possible. In parts of the developing world
where many new customers are being connected to the grid, the low cost of the electronic
meter is its main attraction.
Electrical energy is measured by means of energy meter (watt-hour meter).
Energy meter is an integrating instrument and takes in to account both of the quantities
i.e. Power and time the product of which gives energy. Traditional energy monitoring
system is done through electromechanical energy meter installed in the premises of
customer. This present system is not to expected satisfaction to the energy supplying

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 2
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

authorities. It has many drawbacks like, some consumer manipulating the meter to cause
it to under register or even run backwards and in some cases various tampering
techniques are employed like breaking the meter housing and jamming the mechanism,
and bypass the energy meter. There has been an instance in which the representative had
not been gone to site to take the actual reading but guessed it depending on the last
reading, even though consumers are effectively using power without paying for it, taking
all these facts contribute for theft which is heavy loss to the power supplying company.
However, the advent of low cost microcontrollers enables the development of a
cost effective and higher precision electronic prepaid energy meter for residential and
industrial use where user will pay the amount in advance and then uses power until
validity . Where the added precision justifies the necessary investment and helps in
avoiding theft of energy.

REVIEW OF LITERATURE
Lot of investigation is carried towards the development of modern and more
precise pre-paid energy meters for customers and power supplying company. A brief
review of literature survey carried out in this regard is discussed in this section.
P.A.V.Loss, M.M. Lamego, G.C.D. Soma and J.L.F. Vieira [1] described a brief
literature on “A Single Phase Microcontroller Based Energy Meter”. The other important
studies are electronic meter does not possess any rotating parts, and the energy
consumption can be easily read from a four digits display. Besides that, energy
consumption is stored in the microcontroller EEPROM memory. This action is necessary
to ensure a correct measurement even in the event of an electrical outage or brown out.
As soon as the supply is restored, the meter restarts with the stored values.
S. Naiman, M.M. Kissaka and N. H. Mvungi [2] discuss on “Energy Meter
Reading and Tampering protection through Powerline Communication Channel”
important studies are the use of remote monitoring system to overcome the problem using
powerline communication has been identified as a solution. In this paper they have
identify different kinds of tampering and present simulated results of tampering detection
Rahul Anand, Saptarshi De, and A Naveen [3] present useful information on
“Design and Development of Vigilant Energy Metering System (VEMS) and its

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 3
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

Applications” VEMS is an intelligent solution to the revenue crisis and energy thefts
prevalent in Indian power sector. Technical advances in metering technology and the use
of information technology will result in enhanced efficiency, revenues, and better
management and customer services. It will also facilitate load forecasting and control,
identify potential areas of theft, losses and take measures to rectify it.
S.A. Al-Qatari and A.R. Nu-Ali [4] discuss about “Microcontroller based
automated billing system” they present digital energy modules equipped with credit card
reading capability and charge automatically. Also, all service metering modules are
facilitated with an automatic service connection and disconnection based on the available
credit. The software structure commands the whole process via the microcontroller
input/output ports.
I.Hakki Cavdar [5] identifies illegal electricity usage and present a paper on “A
Solution to Remote Detection of Illegal Electricity Usage via Power Line
Communications” where AMR system via PLC is set in a power delivery
system, a detection system for illegal electricity usage may be easily
added in the existing PLC network. In the detection system, the second
digitally energy meter chip is used and the value of energy is stored.
The recorded energy is compared with the value at the main kilowatt-
hour meter. In the case of the difference between two recorded energy
data, an error signal is generated and transmitted via PLC network.
STATEMENT OF THE PROBLEM
1. Tradition energy monitoring system is done by electromechanical energy meter
where the consumer manipulate the meter to cause it under register or even run
backwards and in some cases tampering techniques will be employed like
breaking the housing , jamming the mechanism and bypassing the energy meter
to effectively use electric energy.
2. In this busy world consumer has to wait in a long queue to pay the electricity bill.
3. There is no protection to our house hold electrical equipment as well as our life
due to over load and over voltage condition respectively.
4. Automated meter reading is not available in present mechanical energy meter
which could convey theft message to power supplying authority.

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 4
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

OBJECTIVE OF PRESENT WORK


1. Study of different tampering techniques and use of relay for isolation of that line.
2. Study and interfacing of 7- segment L.E.D to microcontroller.

METHODOLOGY
1. Project is implemented using 8 Bit CMOS FLASH microcontroller PIC16F877.
2. Pre-Paid Metering is done by Key Pad input and data which is converted in to
digital form can be displayed on 7-segment L.E.D.
3. Monitoring of three Parameters which are essential for energy measurement i.e.,
load current, neutral current, and voltage and thus helps in determining all kind of
tampering.

SCOPE OF THE PROJECT


The project is mainly designed for prepaid metering and the system is designed in
such a way that energy pilferage can be avoided effectively (tampering proof) .

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 5
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

2.1 Block Diagram:

EMBED PBrush

Fig.2.1 Block diagram of embedded prepaid energy meter

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 6
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

2.2 OPERATION:
The brief description and block diagram of the project is explained as below. The total
block diagram is divided in to various blocks as indicated below.
1. Microcontroller
2. Power supply unit
3. Keypad
4. Digital Display
5. RS 232 serial interface
6. Over voltage, under voltage and over load protection
7. Theft detection and Isolation
Microcontroller

In this project work the micro controller part plays a major role, which is used to
read and store the data received from the Keypad. According to the received information,
the micro controller displays the consumable energy and at the same time energizes the
relay. In this project Micro-controller unit is constructed with PIC 16F877 Micro-
controller chip. The PIC 16F877 is a low power, higher performance CMOS 8-bit
microcomputer with 8K bytes of flash programmable and erasable read only memory
(EEPROM).All this provides highly flexible and cost effective solution to control
applications.

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 7
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

Micro-controller works according to the program written in it. The program is


written in such a way, so that the controller output is used to drive the display as well as
relay and alarm.

Micro-controllers are "embedded" inside some other device so that they can
control the features or actions of the product. Another name for a micro-controller is
"embedded controller". Micro-controllers are dedicated to one task and run one specific
program. The program is stored in ROM (read-only memory) and generally does not
change.
Micro-controllers are often low-power devices. A battery-operated Micro
controller might consume 50 milli watts. A micro-controller also takes input from the
device it is controlling and controls the device by sending signals to different components
in the device.
Power supply unit
This power supply section will provide different DC voltages required for
different section of circuit. This unit converts the available 230volts AC to
required DC voltage level with help of transformer and filtering circuit. Since
Microcontroller operates with +5volts, and that of relay unit with 12 volts we
have developed that required voltage level. Filtering is done through electrolytic
capacitor and R.F interference can be avoided using 0.1µf capacitor. To avoid
change in output due to changes in the input we are using regulated I.C.
RFID Module : This is radio frequency identity module which can identify the
amount specified in the smart card and transfers the coded information to
Microcontroller.It is a wireless system with a small range .
Digital Display:
Digital display is constructed using 7-segment common cathode unit. This is a
dynamic display or time multiplexed display that means each display unit will
display one after the other for 20msec but out eye cannot recognize it, so it looks
like ON for all period. Sinking unit (ULN 2003) is used with 7 segment common
cathode unit.
Over voltage, under voltage and over load protection:

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 8
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

When the voltage variation is beyond the working range the equipments
connected may get damaged. To solve this problem we have provided this a
solution in this unit by cutting of the supply. Where predetermined voltage levels
are set by software or hardware.
Every device will have specific handling capacity which is in the range of few
milliamps to few amps. When the current flow through these devices exceeds the
maximum current capacity the device will damage immediately. This condition
may damage other circuitry & supporting units. Hence we are using this unit
which is going to measure current flow & switches off the load during overload
conditions.
It consists of current transformer which develops secondary voltage which
is proportional to load current which is then rectified, filtered & scaled before
connecting to analog input of microcontroller. Microcontroller will select this
analog input & converts it into digital value by using internal ADC. This digital
value is compared with the standard reference value to take decision about normal
or overload condition. If load current is abnormal the relay will turn off the load
& provides overload protection.

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 9
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

3.1 Power supply unit:

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 10
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

Fig.3.1 Power Supply Unit

The Power Supply Section is used to provide different DC voltages to different


sections of circuit. In our project we have design power supply to give +5v regulated
voltage at the output and also +12v and –12v regulated voltage at the output.

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 11
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

We are converting the 230v AC into required DC voltage. We have a step down
transformer at the input. The Switch controls the ON and OFF condition of the power
supply. The fuse of 1 Ampere safeguards the power supply for over current flow the
output voltage at the secondary of the transformer is 9v as shown in the circuit. This
AC voltage is given to rectifier circuit constructed by using bridge rectifier.
Electrolytic capacitor of 1000 mf is used as filter to give pure DC. The advantages of
full wave rectifier are low ripple factor (0.48) high ratio of rectification (0.812) and
peak inverse voltage (PIV=Vm) the output of rectifier is given to capacitor filter
polarity. This smoothens the rectified voltage and gives pure DC.
The output of the filter is a pure DC but unregulated. The output voltage changes with
variations in Input voltage and load current. To obtain the regulated output voltage we
are using 3 pin IC voltage regulators. We have used 7805 fixed positive voltage
regulator to give +5v and other IC’s are 7812 and 7912 voltage regulators to give
+12v and –12v respectively. These regulators are provided with built in heat sink and
have internal circuitry to provide short circuit protection. The regulator output is
connected to output terminal as shown to indicate the presence of voltage at output
terminals we have connected a LED.
Power supply unit voltage is present. We have connected a 0.1µ f capacitor across
the output terminals to suppress the effect of RF interference

3.2 LIQUID CRYSTAL DISPLAY (LCD):

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 12
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

The LCD panel used in this block interfaced with micro-controller through the
output port. This is a 16 character x 3Line LCD module, capable of display
numbers, characters, and graphics. The display contains two internal byte-wide
registers, one for commands (RS=0) and the second for characters to be
displayed (RS=1). It also contains a user. Programmed RAM area (the
character RAM) that can be programmed to generate any desired character that
can be formed using a dot matrix. To distinguish between these two data areas,
the hex command byte 80 will be used to signify that the display RAM address
00h is chosen.

LCDs can add a lot to your application in terms of providing a useful interface for the
user, debugging an application or just giving it a "professional" look. The most common
type of LCD controller is the Hitachi 44780 which provides a relatively simple interface
between a processor and an LCD. Using this interface is often not attempted by
inexperienced designers and programmers because it is difficult to find good
documentation on the interface, initializing the interface can be a problem and the
displays themselves are expensive.

Connection to a standard PC parallel port is mostly simple. Those displays can handle
eight bit input directly. They also need two extra lines to control which kind of data has
just arrived and when the data is meant to be stable. Those signals are called RS (Register
Select, i.e. instruction or data register) and EN (enable).

So we have to connect ten data lines (8 bits + RS + EN) and one common ground (GND)
line, which makes eleven lines to the parallel port. Data read back is not supported by the
driver and so we do not need extra lines for this.

The follwing table shows the needed connections:

25 pin par.port function LCD pin Function

1 STROBE 6 EN

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 13
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

2 Data 0 8 D0
3 Data 1 9 D1
4 Data 2 10 D2
5 Data 3 11 D3
6 Data 4 12 D4
7 Data 5 13 D5
8 Data 6 14 D6
9 Data 7 15 D7
14 Feed 4 RS
18-25 GND 1 GND

And since we only want to write data another connection is required. Make a permanent
connection from GND to pin 5 of the LCD module.

That's it! You may also want to connect the displays power supply pins (1 = GND, 3 =
+5V) to your gameport or your favourite +5V source.

This discription is only valid for my version of LCD display module! I will not be
responsible for any damage you might do to your display, your computer or anything if
your display is wired in another way. Please consult your databook, datasheet or the
LCD-module-FAQ for more information.

But anyway the above information should be correct for most display modules.

Block Diagram:

Microcon
troller
Parallel Port

Fig.3.2 Block diagram of LCD Display

3.3 Key Pad Unit:

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 14
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

Fig.3.3.1 Key Pad Unit

Embedded systems which require user interaction must interface with devices that accept
user input (such as a keypad, bar code reader, or smart card acceptor), as well as devices
that display information to the user (such as LED or LCD displays).

Figure above shows 4×4 Key pad interface to PIC 16F877 Microcontroller. In this 4 lines
of Port D is used as scan lines i.e., RD0-RD3 and remaining 4 lines are used as return
lines i.e., RD4-RD7. If no key is pressed in active scan row the return lines will be zero.
The scanning is repeated for all the rows sequentially. When scanning of all lines is
complete its start scanning the first row and repeats the operation until key depression is
found.
When any key is pressed the corresponding return line will have a high state and other
lines are zero. This is checked by scanning routine and identifies the pre determined key
position.

Block Diagram:

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 15
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

Fig.3.3.2 Block diagram


Parallel Port

Micro
controller

Fig.3.3.3

3.4 Darlington Amplifier: -

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 16
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

It is the name given to a pair of similar transistors so connected that emitter of one
is directly joined to the base of the other. These two transistors are mounted in a single
package that as only three leads normally as shown below-

1. Base. 2. Emitter. 3. Collector.

Fig.3.4 Darlington Amplifier

It forms a double collector stage in multistage amplifiers. It is so because a


Darlington connection can be considered equivalent to two cascaded emitter followers. In
our project we have TIP 127 IC as Darlington amplifier. It has two pins [base, collector &
emitter] and provide with built in heat sink. We have added an external heat sink with
pins to dissipate more heat easily. The Darlington transistor is used to drive the coils of
stepper motor.
The buffer supplies base current to transistor Q1 (which is equal to collector current)
becomes vase current of Q2 and is amplified by the current gain of Q2. The result of all
this is that the device acts likes a single transistor with a current gain (β of Q1 x β of
Q2) and base to emitter voltage of about 1.4v. The internal resistors help in turning off
the transistors. We have used TIP 127 in our project that has a minimum β of 1000 at
1Amp. If we assume 600mA as load current, then the constant base current must be

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 17
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

supplied by the buffer is only 0.6mA, which it can easily do. If the drive current required
for the Darlington is too high for the output. You can add a resistor from the transistor
base to +5v to supply added current.
. The Darlington pair is most often used in an emitter follower configuration
because of the excellent buffering it provides between a high impedance source and
low load impedance load.

ADVANTAGES OF THE DARLINGTON AMPLIFIER:

 It can be formed from two adjacent transistors in an IC.


 It has enormous impedance transformation capability.
 It can transform a low impedance load in to a high impedance load. Hence, it is
used in a high gain OP-AMP that depends on very high input impedance.

3.5 Buzzer:

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 18
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

The buzzer subsystem produces a 2 KHz audible tone when powered. The
buzzer will sound when the signal coming into the driver is high. It must be
connected to a transistor, Darlington or transducer driver subsystem.

The buzzer is connected between the supply rail (+ V) and the input
signal. This acts as load on the driver. When the input signal coming into the
buzzer subsystem is low, a potential difference across the buzzer causes current
to flow. It is this flow of current that causes the buzzer to sound.

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 19
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 20
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

3.6 Relays:

A relay is an electrical switch that opens and closes under 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.. a relay is able to control an output circuit of higher
power than the input circuit, it can be considered, in a broad sense, to be a form of
electrical amplifier.
These contacts can be either Normally Open (NO), Normally Closed (NC), or change-
over contacts.
Normally-open contacts connect the circuit when the relay is activated; the circuit
is disconnected when the relay is inactive. It is also called Form A Contact Or "Make"
Contact. Form A contact is ideal for applications that require to switch a high-current
power source from a remote device.
Normally-closed contacts disconnect the circuit when the relay is activated; the
circuit is connected when the relay is inactive. It is also called Form B Contact Or
"Break" Contact. Form B contact is ideal for applications that require the circuit to
remain closed until the relay is activated.
Change-over contacts control two circuits: one normally-open contact and one
normally-closed contact with a common terminal. It is also called Form C Contact.

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 21
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

OPERATION:

Fig.3.6.1

Relay unit
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 that is 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
starters. The magnetic flux in the armature induces a current in opposition to the current
provided to the coil called 'back emf'. There is a rush of current to operate the coil and
move the contacts, but once the armature is closed, the current required to hold the
armature closed is a small fraction of that, typically a tenth. 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.
If the coil is energized with DC current, regardless of the current through the
contacts, a diode is generally installed across the coil. When the coil is energized, a
magnetic field is established. When the coil is de-energized, the collapsing magnetic field

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 22
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

will generate a spike of current that could damage the rest of the circuit. If the coil is
energized with AC current, a small copper ring is crimped to the end of the solenoid.
Alternating current is at zero volts 120 times a second. At zero volts, there's no magnetic
force holding the contacts closed. The small copper ring provides a small out of phase
current called a shadow pole. The sum of the AC current and the shadow pole keeps the
armature engaged at all times.

Relays are used:

 To control a high-voltage circuit with a low-voltage signal, as in some types of


modems,
 To control a high-current circuit with a low-current signal, as in the starter
solenoid of an automobile,
 To detect and isolate faults on transmission and distribution lines by opening and
closing circuit breakers (protection relays),
 To isolate the controlling circuit from the controlled circuit when the two are at
different potentials, for example when controlling a mains-powered device from a
low-voltage switch

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 23
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

Relay circuit:

Relay circuit is used to activate the relay through microcontroller. In this circuit we
have to use a Darlington transistor (Tip122) for switch on the relay. The relay is an
electromagnetic device which energies when the supply is given. In this circuit, relay is
working in the positive logic. That means when the microcontroller gives high to the relay
circuit the Darlington transistor is switched on and also the relay is ON. When the
microcontroller gives low to the relay circuit the Darlington transistor is switched off and
also the relay is OFF. The two diodes are used for protecting t

he microcontroller from the load due to back EMF and EMI problems.

Fig.3.6.2 Circuit Diagram

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 24
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

3.7 MICRO SWITCH:

A micro switch is a generic term used to refer to an electric switch that is able to
be actuated by very little physical force. They are very common due to their low cost and
extreme durability, typically greater than 1 million cycles and up to 10 million cycles for
heavy duty models. This durability is a natural consequence of the design. Internally a
stiff metal strip must be bent to activate the switch. This produces a very distinctive
clicking sound and a very crisp feel. When pressure is removed the metal strip springs
back to its original state. Common applications of micro switches include computer
mouse buttons and arcade game's joysticks and buttons. Micro switches are commonly
used in tamper switches on gate valves on fire sprinkler systems and other water pipe
systems, where it is necessary to know if a valve has been opened or shut. They have also
been used as anti-handling devices in booby trapped improvised explosive devices
manufactured by paramilitary groups.
The defining feature of micro switches is that a relatively small movement at the
actuator button produces a relative large movement at the electrical contacts, which
occurs at high speed (regardless of the speed of actuation). Most successful designs also
exhibit hysteresis, meaning that a small reversal of the actuator is insufficient to reverse
the contacts; there must be a significant movement in the opposite direction. Both of
these characteristics help to achieve a clean and reliable interruption to the switched
circuit.

The first micro switch was invented by Peter McGall in 1932 in Freeport, Illinois.
McGall was an employee of the Burgess Battery Company at the time. In 1937 he started
the company MICRO SWITCH, which still exists as of 2005. It is now owned by
Honeywell Sensing and Control.

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 25
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 26
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

4.1 PIN CONFIGURATON OF PIC 16F874/7

4.0. Architecture of the PIC16F877 microcontroller

4.1. Overview of the File Registers

4.2. Overview of the 8-channel 10-bit ADC

4.3. Overview of the Hardware USART

4.3.1 Baud-Rate Generator, BRG

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 27
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

Figure 4.1: PIC16F877 microcontroller [W9]

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 28
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

“The PIC16F877 is a high-performance FLASH microcontroller that provides


engineers with the highest design flexibility possible. In addition to 8192x14
words of FLASH program memory, 256 data memory bytes, and 368 bytes of
user RAM, PIC16F877 also features an integrated 8-channel 10-bit Analogue-to-
Digital converter. Peripherals include two 8-bit timers, one 16-bit timer, a
Watchdog timer, Brown-Out-Reset (BOR), In-Circuit-Serial Programming™, RS-
485 type UART for multi-drop data acquisition applications, and I2C™ or SPI™
communications capability for peripheral expansion. Precision timing interfaces
are accommodated through two CCP modules and two PWM modules.” [W3]

Overview of the File Registers

The data memory is partitioned into multiple banks which contain the general
purpose registers and the special function registers. Bits RP1 and RP0 are the
bank select bits, these bits are found in the STATUS register (b6 & b5).

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 29
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

Figure 4.1a. PIC16F877 register file map

Each bank extends up to 7Fh (128 bytes). The lower locations of each bank are
reserved for the special function registers (shown in yellow). Above the special
function registers are general purpose registers (shown in blue), implemented as
static RAM. All implemented banks contain special function registers. Some “high
use” special function registers from one bank may be mirrored in another bank
for code reduction and quicker access. Also notice that there are 16 general
purpose global registers (shown in green), these registers can be accessed from
any bank.

Overview of the 8-Channel 10-bit ADC

At first it appears that the PIC16F877 has 8 built-in ADCs, but this is not the
case. Figure 4.2a shows a simplified block diagram of the analogue-to-digital
converter module, clearly there is only one 10-bit ADC which can be connected
to only one of eight input pins at any one time.

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 30
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

Figure 4.2a. Simplified block diagram of the PIC16F877 ADC module

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 31
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

The input analogue channels AN4..0 are shared with port A, and channels
AN7..5 are shard with port E. If less than eight analogue channels are required
then some of the pins can be assigned as digital I/O port lines using PCFG3..0
bits (see datasheet). For example, if PCFG3..0 = 0010 then AN4..0 are
configured as analogue inputs, while AN7..5 are digital (port E free), with V DD
used as the reference.

“On reset all pins are set to accept analogue signals. Pins that are reconfigured
as digital I/O should never be connected to an analogue signal. Such voltage
may bias the digital input buffer into its linear range and the resulting large
current could cause irreversible damage.” [B3]

The 10-bit ADC uses a technique know as ‘successive approximation’, the


following mechanical analogy will help explain how it works. Suppose there is an
unknown weight, a balance scale and a set of precision known weights 1, 2, 4
and 8 grams. A systemic technique can be used to calculate the unknown
weight.

Place the 8g weight on the pan and remove if it is too heavy. Next place the 4g
weight on the pan and remove if it is too heavy. Next place the 2g weight on the
pan and remove if it is too heavy. Next place the 1g weight on the pan and
remove if it is too heavy. The sum of the weights still on the pan yields the
nearest lower value of the unknown weight. This is illustrated in figures 4.2b to
4.2g.

Figure 4.2b. Unknown weight placed on the scales Figure 4.2c. 8g weight placed on the pan, not too heavy

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 32
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

Figure4.2d. 4g weight placed on thepan, Figure 4.2e. 2gweightplaced on the pan, not too heavy
too heavy (remove)

Figure 4.2f. 1g weight placed on the pan, Figure 4.2g. Unknown weight is about 10g (1010)
too heavy (remove)

The electronic equivalent to this successive approximation technique uses a


network of precision capacitors configured to allow consecutive halving of a fixed
voltage VREF to be switched in to an analogue comparator, which acts as the
balance scale.

Generally the network of capacitors are valued in powers of two to subdivide the
analogue reference voltage (e.g. 1,2,4,8,16, etc…). This sampling acquisition
process takes a finite time due to the charging time constant and is specified in
the datasheet as 19.72µS.

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 33
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

Overview of the Hardware USART

The Universal Synchronous Asynchronous Receiver Transmitter (USART)


module is one of the two serial I/O modules. The USART can be configured for
asynchronous operation (UART) for communication with a PC or synchronous
operation for communicating with peripheral devices such as DAC or DAC
integrated circuit.

Note bit SPEN (RCSTA:7) and bits TRISC:7..6 have to be set in order to
configure pin PC6/TX/CK and RC7/RX/DT for USART operation. CSS (C
compiler) will automatically configure these bits, but it is important to be aware
that if using fast_io(C) mode to manually configure port C, bits 7 & 6 must also be
manually set if using the hardware UART.

Baud-Rate Generator, BRG

This is basically a programmable 8-bit counter followed by a switchable


frequency flip flop chain which can be set up to give the appropriate sampling
and shifting rates for the desired baud rate, based on the PIC’s crystal frequency
XTAL (e.g. for 20MHz, XTAL = 20) giving: -

{4.3.1.1}

{4.3.1.2}

{4.3.1.3}

It may be advantageous to use the high baud rate (BRGH = 1) even for slower
baud clocks as this may reduce baud rate error in some cases.

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 34
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

ADVANTAGES OF MICRO CONTROLLER:

 Micro controller based system require less hard ware pcb size and cost is
less.
 Access time of on chip memory is less so speed of operation is more.
 Less flexible.
 Hard ware requirement is less.
 More number of pins are multifunctional.
 More number of bit handling instruction.
 Less number of instruction refers to memory.
 It consists of I/O ports, Memory,Timmer,Counter along with micro
processor circuit.

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 35
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

5.1 Circuit Diagram:

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 36
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

5.2 Circuit operation:

Analog signals obtained form C.T and P.T are connected to RA0 and RA1. These
voltages are proportional to AC mains voltage and the load current. This voltage is scaled
in such a way that the analog value will not exceed +5volts since this is the maximum
voltage microcontroller can handle. We have connected a zener diode of 5.1volts across
the preset so that even if the analog voltage increases the zener diode will not conduct
beyond 5.1v and thus protect the Microcontroller chip from damage. These analog
voltages are connected to mux. The channel select lines will select only one analog input
at a time and transfers analog voltage to input of 10 bit successive approximation ADC.
The channel number is selected in ADCONO register. Start of conversion is sent on GO
bit of ADCONO to start conversion process. When the conversion is complete this line
GO/DONE becomes zero and transfers the digital value in ADRES register CONVO this
value is saved in to data memory for processing.
The same operation is done for second analog input also by selecting channel lines. The
digital values are stored in to data memory CONV1 for further processing. The value
present in CONVO register is compared with pre determined min-max value to check for
under voltage and over voltage condition. If the digital value is below the minimum or
beyond the Max it indicates under voltage and over voltage indicator. The value of
CONV1 is checked for reference value which indicates Max load current if the value of
CONV1 exceeds this Max limit it indicates the overload condition.
The values of CONV0 and CONV1 indicate the voltage and current.
These values are processed by the software to calculate the energy consumed by the user
at that instant of time as the values of CONV0 and CONV1 changes the amount of
energy consumed will also change and indicate the same in display unit.
The key pad interfaced to microcontroller consisting of 16 keys, this is used for
recharging process.. In this 4 lines of Port D is used as scan lines i.e., RD0-RD3 and
remaining 4 lines are used as return lines i.e., RD4-RD7. This keyboard is designed so as
to form a matrix of rows and columns. When a key is pressed the contact gets closed and
generates a high signal to the controller. Finally, it is the function of the microcontroller

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 37
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

to scan the keyboard continuously to detect and identify the key pressed.When a key is
pressed in the keypad the software will scan the key code & store the corresponding
value into register file of RAM. This value indicates the character to be printed.
Depending on the inputted character microcontroller will issue binary combination to
stepper motors for printing the character is specified by the keypad entry. 4X4 keypad is
used to enter the pass word & other details of the alphanumeric character . It consists of
16 push to on switches.
We are using 16f877 microcontroller in our project. We are using port A as input
port, Rc4-Rc7 as input ports. Port B, Rc0-Rc3 and port D lines are used as output ports.
The driving capability of each port is 25mA.we can use each pin of each port as either
input port or output port. It also has watchdog timer, power up timer, power on
reset,oscillator,start up timer,ICD(in circuit debugger),LVP(low voltage
programming),three timers, the CCP(compare,capture&PWM
modules),EEPROM,8kX14 program memory,368 byte data memory, parallel slave port
etc.
We are using power supply unit constructed by using 12-0-12, 1A transformer.
The secondary voltage is applied to rectifier to convert AC to DC and then applied to
capacitor filter to get pure DC. This unregulated 12 volts DC voltage is connected to
relay circuit.The unregulated voltage is given to 7805 regulator IC to get +5v respectively
from the power supply unit. These voltages are applied to microcontroller,
buffer,relay,display driver & other circuitry as shown in circuit diagram
The software of our project will perform the entire operation one after
the other. This software is designed by using a window based software
microprocessor lab (MPLAB) and stored in to program memory of
microcontroller using programmer. This software can be modified easily to
suit the demands of the system.

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 38
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

CURRENT TRANSFORMER (C.T):

Input turns =9 Turns, Gauge =18 S.W.G


Secondary =228 Turns, Gauge =32 S.W.G, Shell type
Maximum Input Current=10 A.
Current Transformer is connected in series to the lines. It is used to transform the high
current of a power line to a lower value of suitable voltage. The Primary winding has less
number of turns, which is constructed by using thick conductor to handle more current
and secondary winding is made of thin conductor with more number of turns.

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 39
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

Start

Initialize GPR’S & SFR’S

Initialize the Scratch Card


Number

Initialize Counters and Data

Display

Check For Over Voltage

ADC Routine

Is
Voltage
>240v
Display High
Voltage

Voltage OK

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 40
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

Turn on Buzzer &


Turn off Load
Delay

Delay
Enter Scratch Card Number

Check Whether Card


Number Is Valid Or Not

Is Card
Numbe
r Valid

Display a Valid
Number
Display Not A Valid
Number
Display Amount Of
Power Which Can Be
Utilized

Turn On Load

Measure the
Power Consumed

Display
Energy Consumed
Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3
EMBEDDED PREPAID ENERGY METER WITH OVER 41
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

Compare the Load


Current

Is Load
Current
Maximum
Value Display over Load

No

Load Current OK Delay

Turn on Buzzer
Yes Turn Off Load
Is More
Than Ten
Units

No

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 42
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

Is 00
Units

Display
Validity Over
Display Ten Units
Remaining and
Request To Turn On Buzzer &
Recharge Turn Off Load

Delay

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 43
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

DELAY SUBROUTINE:
Star
t

Clear watchdog timer initialize


temp register with 02

Initialize Step register with 10

Initialize FMS with Count

Call monitor program to generate specific delay

Decrement FMS by 1 check for zero result

NO Is
Z=1

YES

Decrement step by one and check for zero

NO
Is Z=1

YES

Decrement temp by one and check for zero

NO
Is
Z=1
YES

Return

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 44
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

A D C ROUTINE

Star
t

Configure Port A pins as analog Input pins

Select A/D input channel and turn on ADC

Select A/D Conversion clock

Issue start of conversion on GO bit and ADCONO

Wait for Conversion

Check for end of conversion by polling GO/DONE for zero

NO
Is
conversion
complete

YES

Read A/D result register for converted data memory

Save the contents into data memory

Return

6.2 PROGRAMS

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 45
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

;project :pic based theft control system


;Timebase:Crystal
;Frequency:4 Mhz
;device used : 16F877
;oscillator :xt
;Watchdog :On

;------------------------------------------------

title" pic based theft control system"


list p=16F877

;-----------------------------------------------
timing EQU 01h
tmr0 equ 01h
pcl equ 02h
status equ 03h
fsr equ 04h
porta equ 05h
portb equ 06h
portc equ 07h
portd equ 08h
porte equ 09h
ADCON1 equ 9fh
ADCON0 equ 1fh
;---------------------------------------------------------

ram registers
reg
reg1
reg2
temp
del
digit
count
flags
msecond
thri
dely
ten
higher
msb
lsb
lower

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 46
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

conv
conv1
high3
high4
high2
high1
step
step1
stdel
tdel
nstep1
estep1

;------------------------------------------------

org 00h
goto begin
begin
;---------------------------------------------------------

clrf porta
clrf portb
clrf portc
clrf portd
clrf porte
goto start

seglut addwf pcl,1


retlw 0b7h
retlw 014h
retlw 073h
retlw 076h
retlw 0d4h
retlw 0e6h
retlw 0e7h
retlw 034h
retlw 0f7h
retlw 0f6h
retlw 00h

start

bsf status,5 ;select bank 1


movlw 03fh ;port A < 0:4 > output

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 47
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

movwf porta ;configure port A


movlw 00h ;port B < 0: 7 > output
movwf portb ;configure port B
movlw 00h
movwf portc
movlw 00h
movwf portd
movlw 00h
movwf porte
bcf status,5

;-------------------------------------------
movlw 0fh
movwf high4
movlw 0ah
movwf high3
movlw 015h
movwf high2
movlw 0ah
movwf high1
movlw 01h
movwf msb
movlw 0ah
movwf lsb
call display
call onesec ;delay
movlw 016h
movwf high4
movlw 00h
movwf high3
movlw 05h
movwf high2
movlw 0dh
movwf high1
movlw 01h
movwf msb
movlw 0ah
movwf lsb
call display
call onesec
;1--------------------------------------------------------------
see1
; call onesec
movlw 01
movwf time1
nop

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 48
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

nop
nop
movlw 01
movwf time2
nop
nop
movlw 01
movwf time3
nop
nop
movlw 01
movwf time4
nop

devtop1 movlw 0eh


movwf high4
movlw 0fh
movwf high3
movlw 019h
movwf high2
movlw 0ah
movwf high1
movlw 01h
movwf msb
movlw 0ah
movwf lsb
call display
call onesec ;delay
movlw 00h
movwf high4
movlw 019h
movwf high3
movlw 0fh
movwf high2
movlw 015h
movwf high1
movlw 0ah
movwf msb
movlw 0ah
movwf lsb
call display
call onesec
nop
nop
btfsc portc,2
goto devtop1

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 49
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

topp1 nop
nop
btfss porta,3
call incr1
nop
nop
btfss porta,0
call decr1
nop
nop
btfss porta,1
goto nextdev2
nop
nop
goto topp1

incr1 incf time1


movlw 0ah
call seglut
movwf high4
movwf high3
movwf high2
movwf high1
movwf msb
movf time1,0
call convert ;display
return
decr1
decf time1

movlw 0ah
call seglut
movwf high4
movwf high3
movwf high2
movwf high1
movwf msb
movf time1,0
call convert ;display
return
;2------------------

nextdev2 movlw 016h


movwf high4
movlw 0bh
movwf high3

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 50
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

movlw 05h
movwf high2
movlw 05h
movwf high1
movlw 0ah
movwf msb
movlw 0ah
movwf lsb
call display
call onesec

devtop2 movlw 0eh


movwf high4
movlw 0fh
movwf high3
movlw 019h
movwf high2
movlw 0ah
movwf high1
movlw 02h
movwf msb
movlw 0ah
movwf lsb
call display
call onesec ;delay
movlw 0ch
movwf high4
movlw 014h
movwf high3
movlw 00h
movwf high2
movlw 015h
movwf high1
movlw 0ah
movwf msb
movlw 0ah
movwf lsb
call display
call onesec
nop
nop
btfsc porta,2
goto devtop2
topp2 btfss porta,3
call incr2

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 51
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

btfss porta,0
call decr2
btfss porta,1
goto nextdev3
goto topp2
incr2 incf time2
movlw 0ah
call seglut
movwf high4
movwf high3
movwf high2
movwf high1
movwf msb
movf time2,0
call convert ;display
return
decr2 decf time2
movlw 0ah
call seglut
movwf high4
movwf high3
movwf high2
movwf high1
movwf msb
movf time2,0
call convert ;display
return

;3---------------------------------------
nextdev3 movlw 016h
movwf high4
movlw 0bh
movwf high3
movlw 05h
movwf high2
movlw 05h
movwf high1
movlw 0ah
movwf msb
movlw 0ah
movwf lsb
call display
call onesec

devtop3 movlw 0eh

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 52
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

movwf high4
movlw 0fh
movwf high3
movlw 019h
movwf high2
movlw 0ah
movwf high1
movlw 03h
movwf msb
movlw 0ah
movwf lsb
call display
call onesec ;delay
movlw 0dh
movwf high4
movlw 014h
movwf high3
movlw 0fh
movwf high2
movlw 0bh
movwf high1
movlw 015h
movwf msb
movlw 0ah
movwf lsb
call display
call onesec
btfsc porta,2
goto devtop3
topp3 nop
btfss porta,3
call incr3
btfss porta,0
call decr3
btfss porta,1
goto nextdev4
goto topp3

incr3 nop
nop
incf time3
nop
nop
movlw 0ah
call seglut
movwf high4

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 53
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

movwf high3
movwf high2
movwf high1
movwf msb
movf time3,0
call convert ;display
return

decr3 decf time3


movlw 0ah
call seglut
movwf high4
movwf high3
movwf high2
movwf high1
movwf msb
movf time3,0
call convert ;display
return
;4------------------------------------
nextdev4 movlw 016h
movwf high4
movlw 0bh
movwf high3
movlw 05h
movwf high2
movlw 05h
movwf high1
movlw 0ah
movwf msb
movlw 0ah
movwf lsb
call display
call onesec

devtop4 movlw 0eh


movwf high4
movlw 0fh
movwf high3
movlw 019h
movwf high2
movlw 0ah
movwf high1
movlw 04h
movwf msb
movlw 0ah

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 54
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

movwf lsb
call display
call onesec ;delay
movlw 0eh
movwf high4
movlw 017
movwf high3
movlw 01h
movwf high2
movlw 014h
movwf high1
movlw 0ah
movwf msb
movlw 0ah
movwf lsb
call display
call onesec
nop
nop
btfsc porta,2
goto devtop4
topp4 nop
nop
btfss porta,3
call incr4
nop
nop
btfss porta,0
call decr4
nop
nop
btfss porta,1
goto nextdev5
nop
nop
goto topp4

incr4 nop
nop
incf time4
nop
nop
movlw 0ah
call seglut
movwf high4
movwf high3

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 55
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

movwf high2
movwf high1
movwf msb
movf time4,0
call convert ;display
nop
nop
return

decr4 nop
nop
decf time4
nop
movlw 0ah
call seglut
movwf high4
movwf high3
movwf high2
movwf high1
movwf msb
nop
nop
movf time4,0
call convert ;display
nop
nop
return

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 56
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

7.1 ADVANTAGES

 It is easy to operate, one remaining while some units.


 Inform to recharge before the disconnection.
 It is rugged and reliable.
 Protects an authorized usage of power.
 Reduces the burden of vigilance system.

DIS-ADVANTAGES

 It has limited memory size and hence less numbers can be saved
 It is desired for single phase system.

APPLICATIONS

 It can be used in houses, shops,banks hospitals and institutions.


 It can be used in commercial applications like small scale and medium
scale and large scale industries.

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 57
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

7.2 CONCLUSION:

The project “MICRO CONTROLLER based prepaid energy meter with


over voltage protection” is working satisfactorily for different test conditions. The
performance of the project can be improved by using hall ticket current relays for
heavy loads and protecting the system from over load short circuit by providing
electric circuit breaker conditions. The same unit can be used to design 3 phase
energy meter by making small modifications in the circuit.It can be designed to
prevent power theft and unauthorized usage.

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 58
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

7.3 BIBILIOGRAPHY

Books:
1. Industrial and power electronics; devices, circuits, systems and application by
Harish .C. Rai, umesh publication, 10th edition.
2. OP-AMPs and Linear integrated circuits, Ramakant .A.Gayakwad, pearson
education, 4th edition.
3. Design with PIC microcontrllers, John.B.Peatman
4. The 8051 Microcontrroller and embedded system by Muhammad Ali Mazidi and
Janice Gillespie Mazidi,Low price edition
5. Electrical Machine design by A.K.Sawhney.
6. Microprocessor and TTL hand Book, B.P.B publication.
7. Power Electronics by Rashid.

Web sites:
1. www.google.com
2. www.fairchildsemicondutor.com
3. www.microchip.com
4. www.electronicprojects.com
5. www.ieeexplore.org

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 59
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

7.4 APPENDIX

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 60
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 61
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 62
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 63
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 64
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 65
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 66
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 67
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 68
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 69
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 70
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 71
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3


EMBEDDED PREPAID ENERGY METER WITH OVER 72
VOLTAGE AND OVERLOAD PROTECTION SYSTEM

Dept.Electronics & comm. Engg Siddaganga polytechnic, Tumkur-3

S-ar putea să vă placă și