Sie sind auf Seite 1von 53

A PROJECT REPORT ON

GSM BASED WIRELESS POWER THEFT


DETECTION
SYSTEM

MADHU VACHASPATI
INSTITUTE OF
ENGINEERING &
TECHNOLOGY

UNDER THE GUIDENCE OF:

MR. BINDU JI GYANISH

SUBMITTED BY:
SHIVENDR A SAURABH (B.Tech EE IVth year)

1
DHEERAJ (B. Tech EE IVth
year)
ZAHID AKHTAR (B.Tech EE IVth
year)

CERTIFICATE

DECLARATION:
That the project “GSM BASED WIRELESS POWER THEFT DETECTION SYSTEM”
done by me/us under the guidence of “MR. BINDU JI GYANISH”meets the curricular
partial requirement of APJAKTU for successful completion of B.Tech course of in
discipline ELECTRICAL ENGINEERING at Madhu Vachaspati Institute of Engineering
& Technology Kaushambi, Allahabad.

I/We undertake hereby that the work done for the project is solely due to our own effort
and in no way duplicate the effort of any outside agencies.

Name(s) of Student(s): Signature


1.SHIVENDRA SAURABH …………………………
2.DHEERAJ …………………………
3.ZAHID AKHTAR …………………………

CERTIFIED BY:
Guide:
Mr./Mrs./Ms./Dr./Prof. …………………………………………
(Signature)
H.O.D.
Mr./Mrs./Ms./Dr./Prof. …………………………………………
(Signature)

2
DIRECTOR:
Mr./Mrs./Ms./Dr./Prof. …………………………………………
(Signature)

ACKNOWLEDGEMENT

We wish to express my profound gratitude and indebtedness to


Mr. Bindu Ji Gyanish .Department of Electrical Engineering.
MVIET kaushambi, for introducing the present topic and for their
inspiring guidance . cponstructive criticism and valuable
suggestion throughout the project work.
Special thanks to our H.O.D. Mr. Anupam Agrawal for provide me
inspirational,motivational and moral guiance .
.

1.SHIVENDRA SAURABH

2.DHEERAJ

3
3.ZAHID AKHTAR

GSM BASED ENERGY METER


DSF
DC Motor Control
DC Motor Control

SMS
PORT1

8051
Level
Convert
er

4
CONTENTS:

0. ABSTRACT
1. INTRODUCTION
2. INTRODUCTION TO MICROCONTROLLER
3. MICROCONTROLLER FAMILY
4. BLOCK DIAGARM OF THE SYSTEM
5. MAIN COMPONENTS AND THEIR WORKING
6. ADVANTAGES ,LIMITATIONS AND FUTURE SCOPE
7. CONCLUSION AND REFRENCES

5
ABSTRACT

Electricity is indispensable to our daily life. Traditional remote meter reading system uses
telephone
lines and Modem to transmit data and control signals, but with the drawbacks of high
maintenance
costs, poor scalability and instable performance of Modem that is charged for too long.
The objective
of this project is to design a system in order to avoid the displeasure for the users from
paying hefty bill
irrespective of use of the electricity due to theft using Gsm module.
Key Terms - Power Theft, GSM Module, PC Interface, Current Sensors

6
CHAPTER NO:- 1

1.1 INTRODUCTION
Generation, transmission and distribution of electrical energy involve many
operational losses. Whereas, losses implicated in generation can be technically defined,
but T&D losses cannot be precisely quantified with the sending end information. This
illustrates the involvement of nontechnical parameters in T&D of electricity. Overall
technical losses occur naturally and are caused because of power dissipation in
transmission lines, transformers, and other power system components. Technical losses in
T&D are computed with the information about total load and the total energy billed. NTL
cannot be precisely computed, but can be estimated from the difference between the total
energy supplied to the customers and the total energy billed. NTL are caused by the
factors external to the power system. In many developing countries, NTL are a serious
concern for utility companies as they account to about 10 to 40% of their total generation
capacity. Data regarding NTL is uncertain and it is very difficult to analyze theft in terms
of actions that cause these losses. Electricity theft forms a major chunk of the NTL.
Electricity theft includes bypassing, tampering with the energy meter and other
physical methods to evade payment. Illegal tapping of electricity from the feeder and
tampering with the meter are the most identified and accounted ways of theft. Electricity
theft can also be defined as, using electricity from the utility company without a contract
or valid obligation to alter its measurement is called electricity theft.

7
1.2 FACTORS THAT INFLUENCE ILLEGAL CONSUMERS
There are many factors that encourage people to steal electricity. Of which socio
economic factors influences people to a great extent in stealing electricity. A common
notion in many people is that, it is dishonest to steal something from their neighbour but
not from the state or public owned utility company.

In addition, other factors that influence illegal consumers are:


• Higher energy prices deject consumers from buying electricity. In light of this, rich and
highly educated communities also steal electricity to escape from huge utility bills.
• Growing unemployment rate show severe effect on the customer’s economic situation.
• Lower illiteracy rate in under developed communities has greater impact on illegal
consumers, as they might not be aware of the issues, laws and offenses related to the
theft.
• Weak economic situation in many countries has implied its effect directly on common
man.
• In view of socio economic conditions of the customer, electricity theft is proportional to
the tariff of electricity utilization.
• Countries with weak enforcement of law against electricity theft have recorded high
proportion of theft.
• Corrupt political leaders and employees of the utility company are responsible for
billing irregularities.

8
Fig 1.1: Electricity consumption in different sectors of India

9
1.3 EFFECTS OF ELECTRICITY THEFT
Negative effects of electricity theft are severe and dangerous. Primarily, electricity
theft affects the utility company and then its customers. In addition, electricity theft
overloads the generation unit. In energy market, utility companies expect their money
back from the customers for the electricity supplied, most of which is lost by them due to
the NTL (Non technical losses).Electricity theft is a serious concern for utility companies
as they are under threat of survival because of these incurring economic losses. It is
evident that some utility companies in developing countries are losing about 10 to 30
percent of their total revenue, which shows that they could not invest on measures to
reduce the electricity theft. These economic losses affect the utility company’s interest in
development of the devices in view of improving the quality of supply or for
electrification process.

10
1.4 METHODS OF THEFT
Methods used to commit theft fall into the Following broad categories:
A. Connection of supply without a meter
Connection of supply without a meter following disconnection for non payment or by
“squatters” occupying empty properties.
B. Bypassing the meter with a cable
It coveted into the supply side of the metering installation (i.e. the meter terminals, the
metering cables, the cut-out or the service cable).
C. Interfering with the meter to slow or stop
The disc, including use of electrical devices which stop the meter or cause it to reverse
(so-called 'black boxes).
D. Interfering with the timing control.

11
1.5 IDENTIFICATION OF THEFT
A. Financial Rewards
Utility companies encourage consumers to report electricity theft, sometimes
offering big rewards for information leading to conviction of anyone stealing electricity.
Unfortunately, most cases are never identified in the apartment industry due to lack of
timely information.

B. Periodic Checks
Electricity theft frequently takes place after service has been disconnected.
Some utility companies periodically check disconnected meters if the customer has not
contacted them to reconnect service. This labour-intensive, manual process has little
chance of success given that the apartment industry averages 70% turnover of tenants
annually.

C. Meter Readers
Utility meter readers typically suspect that electricity theft is taking place when
they find a broken meter tag or other signs of tampering. But as more utility companies
outsource the meter reading function to third parties, training meter readers to detect theft
is becoming more difficult and less efficient. In addition, third party meter readers do not
read disconnected meters.

12
1.6 IMPLEMENTATION OF SYSTEM

We can detect power theft wirelessly. Illegal usage of electricity can be solved
electronically without any human control, using Radio frequency (RF) Technology.
Electric Power is transforming from transmitter to the receiver at that time if load is apply
in between transmission of power and if difference is find between the transforming and
receiving power then there is stealing of power from unauthorized person i.e. whenever
energy is passing from supplier to the receiver at that time if the total amount of power is
not received by the receiver then there is possibility of theft of energy.

Fig 1.2: Block diagarm of Power Theft Detection system

13
CHAPTER NO:- 2

2.1 INTRODUCTION TO MICROCONTROLLER


Microcontroller are widely used in Embedded System products. An Embedded
product uses the microprocessor(or microcontroller) to do one task & one task only. A
printer is an example of Embedded system since the processor inside it perform one task
only namely getting the data and printing it. Contrast this with Pentium based PC. A PC
can be used for any no. of applications such as word processor, print server, bank teller
terminal, video game player, network server or internet terminal. Software for variety of
applications can be loaded and run. Of course the reason a PC can perform multiple task
is that it has RAM memory and an operating system that loads the application software
into RAM & lets the CPU run it. In and Embedded system there is only one application
software that is typically burn into ROM. An x86PC Contain or its connected to various
Embedded Products such as keyboard, printer, modem, Disc controller, Sound card, CD-
Rom Driver, Mouse & so on. Each one of these peripherals as a microcontroller inside it
that performs only one task. For example inside every mouse there is microcontroller to
perform the task of finding the mouse position and sending it to PC.
Although microcontroller are preferred choice for many Embedded systems,
There are times that a microcontroller is inadequate for the task. For this reason in recent
years many manufactures of general purpose microprocessors such as INTEL, Motorolla,
AMD & Cyrix have targeted their microprocessors for the high end of Embedded market.
While INTEL, AMD, Cyrix push their x86 processors for both the embedded and desktop
pc market, Motorolla is determined to keep the 68000 families alive by targeting it
mainly for high end of embedded system.
One of the most critical needs of the embedded system is to decrease power
consumptions and space. This can be achieved by integrating more functions into the
CPU chips. All the embedded processors based on the x86 and 680x0 have low power
consumptions in additions to some forms of I/O, Com port & ROM all on a single chip.

14
In higher performance Embedded system the trend is to integrate more & more function
on the CPU chip & let the designer decide which feature he/she wants to use.

2.2 INTRODUCTION TO EMBEDDED SYSTEM


An Embedded System employs a combination of hardware & software (a
“computational engine”) to perform a specific function; is part of a larger system that
may not be a “computer works in a reactive and time-constrained environment. Software
is used for providing features and flexibility Hardware = {Processors, ASICs, Memory...}
is used for performance (& sometimes security).
An embedded system is a special purpose system in which the computer is completely
encapsulated by the device it controls. Unlike a general purpose computer, such as a PC,
an embedded system performs predefined task’s usually with very specific tasks design
engineers can optimize it reducing the size and cost of the product. Embedded systems
are often mass produced, so the cost savings may be multiplied by million of items.
The core of any embedded system is formed by one or several microprocessor or micro
controller programmed to perform a small number of tasks. In contrast to a general
purpose computer, which can run any software application, the user chooses, the software
on an embedded system is semi-permanent, so it is often called firmware.
2.2.1 EXAMPLES OF EMBEDDED SYSTEM:-
o Automated tiller machines (ATMS).
o Avionic, such as inertial guidance systems, flight control hardware / software and
letter integrated system in aircraft and missile.
o Cellular telephones and telephonic switches.
o Computer network equipment, including routers timeservers and firewalls
o Computer printers, Copiers.
o Disk drives (floppy disk drive and hard disk drive)
o Engine controllers and antilock brake controllers for automobiles.
o Home automation products like thermostat, air conditioners sprinkles and security
monitoring system.

15
2.3 MICROPROCESSOR (MPU)
A microprocessor is a general-purpose digital computer central processing unit
(CPU). Although popularly known as a “computer on a chip” is in no sense a complete
digital computer. The block diagram of a microprocessor CPU is shown, which
contains an arithmetic and logical unit (ALU), a program counter (PC), a stack pointer
(SP),some working registers, a clock timing circuit, and interrupt circuits.

CPU Data Bus


General-
Serial
Purpose RAM ROM I/O Timer
COM
Micro- Port
Port
processor

Fig 2.1: Block diagram of Microprocessor

16
2.4 MICROCONTROLLERS (MCU)
Figure shows the block diagram of a typical microcontroller, which is a true
computer on a chip. The design incorporates all of the features found in micro-
processor CPU, ALU, PC, SP, and registers. It also added the other features needed to
make a complete computer: ROM, RAM, parallel I/O,serial I/O, counters, and clock
circuit.

CPU RAM ROM


A single chip
I/O Serial
Timer
Port COM
Port
Fig 2.2: Block diagram of Microcontroller

17
2.5 THE CENTRAL PROCESSING UNIT
The central processing unit (CPU) does all the computing: it fetches, decodes
and executes program instructions and directs the flow of data to and from memory. The
CPU performs the calculations required by program instructions and places the results of
these calculations, if required, into memory space. Most CPUs are synchronous. This
means that they depend on the cycles of a processor clock. A clock generates a high-
frequency square wave usually driven by a crystal, a RC (resistor capacitor) or an
external source. The clock is sometimes referred to as an oscillator. The clock speed, or
oscillation rate, is measured in megahertz (MHz), which represents one million
cycles/second. For example, if the clock speed is 3 MHz then there are 3,000,000-clock
cycles/second. Clock configurations are micro controller dependant. One part of the CPU
is responsible for performing calculations and executing instructions. This part is called
the arithmetic logic unit, or ALU. There are a variety of subsidiary components, which
support the ALU. These components include the decoder, the sequencer and a variety of
registers. The decoder converts instructions stored in program memory into codes, which
the ALU can understand. The sequencer manages the flow of data along the micro
controller’s data bus. The CPU to temporarily store vital data, which are volatile, uses
registers: they can change during program execution.

18
Fig 2.3: Block diagram CPU

These include:
“# THE STACK POINTER
The stack pointer contains the address of the next location on the stack. The address in
the stack pointer is decremented when data is pushed on the stack and incremented when
data is popped from the stack.

“# THE INDEX REGISTERS


The index register is used to specify an address when certain addressing modes are used.
It is also known as the pointer register. The Microchip devices use the name FSR (file
select register).

“# THE PROGRAM COUNTER


Perhaps the single most important CPU register is the program counter (PC). The PC
holds the address of the next instruction in program memory space. It contains the
address of the next instruction the CPU will process. As each instruction is fetched and
processed by the ALU, the CPU increments the PC and thereby steps through the
program stored in the program memory space.

“# THE ACCUMULATOR
The accumulator is a register that can hold operands or results of operations as necessary.
The Microchip devices use the name W (working) register. Other registers may reflect
results from the instruction just executed, control the options available on the device, and
enable access to certain areas of memory.

19
2.6 ARCHITECTURES
There are two basic types of architecture: Harvard and Von Neumann.
Microcontrollers most often use a Harvard or a modified Harvard-based architecture.
2.6.1 VON NEUMANN
Von Neumann architecture has a single, common memory space where both
program instructions and data are stored. There is a single data bus which fetches both
instructions and data. Each time the CPU fetches a program instruction it may have to
perform one or more read/write operations to data memory space. It must wait until these
subsequent operations are complete before it can fetch and decode the next program
instruction. The advantage to this architecture lies in its simplicity and economy.

Fig 2.4: Von Neumann

2.6.2 HARVARD
Harvard architecture computers have separate memory areas for program
instructions and data. There are two or more internal data buses which allow
simultaneous access to both instructions and data. The CPU fetches instructions on the
program memory bus. If the fetched instruction requires an operation on data memory,
the CPU can fetch the next program instruction while it uses the data bus for its data
operation. This speeds up execution time at the cost of more hardware complexity.

20
Fig 2.5: Harvard Architecture

2.7 The CISC approach


The primary goal of CISC architecture is to complete a task in as few lines of
assembly as possible. This is achieved by building processor hardware that is capable of
understanding and executing a series of operations. For this particular task, a CISC
processor would come prepared with a specific instruction (we'll call it "MULT"). When
executed, this instruction loads the two values into separate registers, multiplies the
operands in the execution unit, and then stores the product in the appropriate register.
Thus, the entire task of multiplying two numbers can be completed with one instruction:
MULT 2:3, 5:2
MULT is what is known as a "complex instruction." It operates directly on the
computer's memory banks and does not require the programmer to explicitly call any
loading or storing functions. It closely resembles a command in a higher level language.
For instance, if we let "a" represent the value of 2:3 and "b" represent the value of 5:2,
then this command is identical to the C statement "a = a * b."
One of the primary advantages of this system is that the compiler has to do very little
work to translate a high-level language statement into assembly. Because the length of the
code is relatively short, very little RAM is required to store instructions. The emphasis is
put on building complex instructions directly into the hardware.

21
2.8 The RISC approach
RISC processors only use simple instructions that can be executed within one
clock cycle. Thus, the "MULT" command described above could be divided into three
separate commands: "LOAD," which moves data from the memory bank to a register,
"PROD," which finds the product of two operands located within the registers, and
"STORE," which moves data from a register to the memory banks.

22
CHAPTER NO:- 3

3.1 THE “8051” MICROCONTROLLER FAMILY

3.1.1 DESCRIPTION
The P89C51RB2/RC2/RD2 device contains a non-volatile 16kB/32kB/64kB
Flash program memory that is both parallel programmable and serial In-System and In-
Application Programmable. In-System Programming (ISP) allows the user to download
new code while the microcontroller sits in the application. In-Application Programming
(IAP) means that the microcontroller fetches new program code and reprograms itself
while in the system. This allows for remote programming over a modem link.
A default serial loader (boot loader) program in ROM allows serial In-System
programming of the Flash memory via the UART without the need for a loader in the
Flash code. For In-Application Programming, the user program erases and reprograms
the Flash memory by use of standard routines contained in ROM. This device executes
one machine cycle in 6 clock cycles, hence providing twice the speed of a conventional
80C51

23
3.2 FEATURES OF THE P89C51RD2
• 80C51 Central Processing Unit.
• On-chip Flash Program Memory with In-System Programming (ISP) and In-
Application Programming (IAP) capability.
• Boot ROM contains low level Flash programming routines for downloading via the
UART.
• Can be programmed by the end-user application (IAP).
• 6 clocks per machine cycle operation (standard).
• 12 clocks per machine cycle operation (optional).

• Speed up to 20 MHz with 6 clock cycles per machine cycle (40 MHz equivalent
Performance); up to 33 MHz with 12 clocks per machine cycle.
• Fully static operation.
• RAM expandable externally to 64 Kb.
• 4 level priority interrupt.
• 7 interrupt sources.
• Four 8-bit I/O ports.
• Full-duplex enhanced UART
– Framing error detection.
– Automatic address recognition.
• Power control modes.
– Clock can be stopped and resumed.
– Idle mode.
– Power down mode.
• Programmable clock out.
• Second DPTR register.
• Asynchronous port reset.
• Low EMI (inhibit ALE).
• Programmable Counter Array (PCA.)
– PWM. – Capture/compare.

24
3.3 PIN DESCRIPTION OF THE P89C51RD2
Although 8051 family members come in different packages such DIP(dual in line
package),QFP(Quad flat package), and LLC(leadless chi0p carrier),they all have 40 pins
that are dedicated to various functions such as I/O,RD,WR,address,data and interrupts.

Fig 3.1: Pin diagram of P89C51RD2


VCC:
Pin 40 provides supply voltage to the chip. The voltage source is +5 Volts.

GND:
Pin 20 is the ground.

XTAL1 and XTAL2:


The 8051 has an on chip oscillator but requires an external clock to run it. Most
often a quartz crystal oscillator is connected to inputs XTAL1 (pin 19) and XTAL2 (pin
18). The quartz crystal oscillator connected to XTAL1 and XTAL2 also needs two
capacitors of 30 pf value. One side of each capacitor is connected to the ground. Speed
refers to the maximum oscillator frequency connected to XTAL .When the 8051 is

25
connected to a crystal oscillator is powered up we can observe the frequency on the
XTAL2 pin using the oscilloscope.
RST:
Pin 9 is the RESET pin. It is an input and is active high. Upon applying a high
pulse to this pin the microcontroller well reset and terminate all activities. This is often
referred to as a power on reset .Activating a power on reset will cause all values the
registers to be lost. It will set program counter to all 0s.
In order for the RESET input to be effective it must have a minimum duration of two
machine cycles. In other words the high pulse must be high for a minimum of two
machine cycles before it is allowed to go low.

EA:
The 8051 family members such as the 8751/52, 89C51/52 or DS89C4*0 all come
with on chip ROM to store programs. In such cases the EA pin is connected to Vcc. For
family members such as the 8031 and 8032 in which there is no on chip ROM, code is
stored on an external ROM and is fetched by 8031/32. Therefore for the 8031 the EA pin
must be connected to GND to indicate that the code is stored externally. EA which stands
for “external access” is pin number 31 in the DIP packages. It is an input pin and must be
connected to either Vcc or GND. In other words it can not be unconnected.

PSEN:
This is an output pin. PSEN stands for “program store enable”. In an 8031 based
system in which an external ROM holds the program code, this pin is connected to the
OE pin of the ROM.

ALE:
ALE stands for “address latch enable. It is an output pin and is active high. When
connecting an 8031 to external memory, port 0 provides both address and data. In other
words the 8031 multiplexes address and data through port 0 to save pins. The ALE pin is
used for de-multiplexing the address and data by connecting to G pin of the 74LS373
chip.

26
PORTS 0,1,2,3:
All the ports upon RESET are configured as input, since P0-P3 have value FFH
on them. The following is a summary of features of P0-P3.

PORT 0:
Port 0 is also designated as AD0-AD7 allowing it to be used for both address and
data. When connecting an 8051/31 to an external memory, port 0 provides both address
and data. The 8051 multiplexes address and data through port 0 to save pins. ALE
indicates if p0 has address A0-A7.in the 8051 based systems where there is no external
memory connection the pins of P0 must be connected externally to 10k-ohm pull-up
resistor. This is due to the fact that P0 is an open drain, unlike P1, P2 and P3. Open drain
is a term used for MOS chips in the same way that open collector is used for TTL chips.
In many systems using the 8751, 89c51 or DS89c4*0 chips we normally connect P0 to
pull up resistors.

PORT 1, PORT 2:
In 8051 based systems with no external memory connection both P1 and P2 are
used as simple I/O. however in 8031/51 based systems with external memory connections
P2 must be used along with P0 to provide the 16-bit address for the external memory. P2
is also designated as A8-A15 indicating its dual function. Since an 8031/51 is capable of
accessing 64k bytes of external memory it needs a path for the 16 bits of address. While
P0 provides the lower 8 bits via A0-a7 it is the job P2 to provide bits A8-A15 of the
address. In other words when the 8031/51 is connected to external memory P2 is used for
the upper 8 bits of the 16 bit address and it cannot be used for I/O.

PORT 3:
Port 3 occupies a total of 8 pins 10 through 17. It can be used as input or output.
P3 does not need any pull-up resistors the same as P1 and P2 did not. Although port 3 is
configured as input port upon reset this is not the way it is most commonly used. Port 3
has the additional function of providing some extremely important signals such as
interrupts.

27
3.4 PROGRAMMING MODEL OF 8051
In programming model of 8051 we have different types of registers are available
and te4hse registers are used to store temporarily data is then the information could be a
byte of data to be processed or an address pointing to the data to be fetched the majority
of registers is 8051 are 8-bikt registers.

3.4.1 ACCUMULATOR (REGISTER A):-


Accumulator is a mathematical register where all the arithmetic and logical
operations are done is this register and after execution of instructions the outpour data is
stored in the register is bit addressable near. We can access any of the single bit of this
register.

3.4.2 B REGISTER:-
B register is same as that of accumulator of. It is also an 8 bit register and every
bit of this is accessible. This is also a mathematical register B which is used mostly for
multiplication and division.

3.4.3 PSW (PROGRAM STATUS WORD) Register:-


Program status word register is an 8 bit register. It is also referred to as the flag
register. Although the PSW register is 8 bits wide, only 6 bits of it are used by the 8051.
The unused bits are user-definable flags. Four of the flags are called conditional flags,
meaning that they indicate some conditions that result after an instruction is executed.
These four are CY (carry), AC (auxiliary carry), P (parity) and OV (overflow).

28
3.5 SPECIAL FUNCTION REGISTER (SFR) MEMORY:-
Special Function Registers (SFRs) are areas of memory that control specific
functionality of the 8051 processor. For example, four SFRs permit access to the 8051s
32 input/output lines. Another SFR allows a program to read or write to the 8051s serial
port. Other SFRs allow the user to set the serial baud rate, control and access timers, and
configure the 8051s interrupt system. When programming, SFRs have the illusion of
being Internal Memory.

29
3.6 BASIC REGISTERS
3.6.1 THE ACCUMULATOR
The Accumulator, as its name suggests, is used as a general register to accumulate
the results of a large number of instructions. It can hold an 8-bit (1-byte) value and is the
most versatile register the 8051 has due to the shear number of instructions that make use
of the accumulator. More than half of the 8051s 255 instructions manipulate or use the
accumulator in some way.
For example, if you want to add the number 10 and 20, the resulting 30 will be
stored in the Accumulator. Once you have a value in the Accumulator you may continue
processing the value or you may store it in another register or in memory.
3.6.2 THE DATA POINTER (DPTR)
The Data Pointer (DPTR) is the 8051s only user-accessible 16-bit (2-byte)
register. The Accumulator, "R" registers, and "B" register are all 1-byte values.
DPTR, as the name suggests, is used to point to data. It is used by a number of
commands, which allow the 8051 to access external memory. When the 8051 accesses
external memory, it will access external memory at the address indicated by DPTR.
While DPTR is most often used to point to data in external memory, many programmers
often take advantage of the fact that it’s the only true 16-bit register available. It is often
used to store 2-byte values, which have nothing to do with memory locations.
3.6.3 THE PROGRAM COUNTER (PC)
The Program Counter (PC) is a 2-byte address, which tells the 8051 where the
next instruction to execute is found in memory. When the 8051 is initialized PC always
starts at 0000h and is incremented each time an instruction is executed. It is important to
note that PC isn’t always incremented by one. Since some instructions require 2 or 3
bytes the PC will be incremented by 2 or 3 in these cases.
The Program Counter is special in that there is no way to directly modify its value. That
is to say, you can’t do something like PC=2430h. On the other hand, if you execute LJMP
2430h you’ve effectively accomplished the same thing.

30
3.6.4 THE STACK POINTER (SP)
The Stack Pointer, like all registers except DPTR and PC, may hold an 8-bit (1-
byte) value. The Stack Pointer is used to indicate where the next value to be removed
from the stack should be taken from. When you push a value onto the stack, the 8051 first
increments the value of SP and then stores the value at the resulting memory location.
When you pop a value off the stack, the 8051 returns the value from the memory location
indicated by SP and then decrements the value of SP.
This order of operation is important. When the 8051 is initialized SP will be initialized to
07h. If you immediately push a value onto the stack, the value will be stored in Internal
RAM address 08h. This makes sense taking into account what was mentioned two
paragraphs above: First the 8051 will increment the value of SP (from 07h to 08h) and
then will store the pushed value at that memory address (08h).
SP is modified directly by the 8051 by six instructions: PUSH, POP, ACALL, LCALL,
RET, and RETI. It is also used intrinsically whenever an interrupt is triggered.

31
3.7 REGISTERS
3.7.1 STATUS REGISTER
The Status register contains the arithmetic status of the ALU, the Reset status and
the bank select bits for data memory. The Status register can be the destination for any an
instruction that affects the Z, DC or C bits, then the write to these three bits is disabled.
These bits are set or cleared according to the device logic. Furthermore, the TO and PD
bits are not writable, therefore, the result of an instruction with the Status register as
destination may be different than intended.

Fig 3.2: Status Register

32
3.7.2 OPTION_REG REGISTER
The OPTION_REG Register is a readable and writable register, which contains
various control bits to configure the prescaler), the external INT interrupt, TMR0 and the
weak pull-ups on PORTB.

Fig 3.3: Option_Reg Register

33
3.7.3 PCON REGISTER
The Power Control (PCON) register contains flag bits to allow differentiation
between a Power-on Reset (POR), a Brown-out Reset (BOR), a Watchdog Reset (WDT)
and an external MCLR Reset.

Note: BOR is unknown on Power-on Reset. It must be set by the user and checked on
subsequent Resets to see if BOR is clear, indicating a brown-out has occurred. The BOR
status bit is a “don’t care” and is not predictable if the brown-out circuit is disabled (by
clearing the BODEN bit in the configuration word).

Fig 3.4: PCON register

34
CHAPTER NO:- 4

4.1 BLOCK DIAGRAM OF THE SYSTEM

MICRO
TRANSMITTER RECIEVER CONTROLLER DISPLAY

Fig 4.1: Block diagram of Power Theft Detection System

4.2 BLOCK DIAGRAM DESCRIPTION


The block diagram is broadly divided in 4 parts

4.2.1 TRANSMITTER:-
IR led is used to transmit infrared rays to receiver. This is also most commonly
used in other devices like remote controls. Its on obstruction of these rays that receiver
senses person entering.IR led is used because of good range and the frequency is also
different from the ordinary room light’s frequency. So there is no fear of intermixing
of the two signals.

4.2.2 RECIEVER
Phototransistor is used as a receiver in our project. It receives the infrared light
from the led and produces voltage 0.9v and 3.17 volt resp. photo transistor was used
because it responds very well to the obstruction producing 2 voltages that are quiet
differentiable and hence can be easily sensed by controller.

35
Fig 4.2: Circuit of Transmitter and Receiver

4.2.3 MICROCONTROLLER
We have used microcontroller 8051 in our project. It is a 40 pin IC. It requires
+5v to function. The crystal provides a frequency of 11.0592 MHz. There are 4 ports
that can be used as input or output. 20th pin is ground. We have used 2 pins of port 1 to
receive input from phototransistor. 3rd pin of Port3 is connected to relay section.4 th pin of
port 3 is connected to 7 segment, acts as a control.Port0 is connected to 7 segment and
used to transmit data to 7 segment for display. The controller plays the most prominent
role in this project. It is the device that senses the obstruction and sends count to 7
segment as well as switch on/off relay. This is done by programming 8051 in C.

36
Fig 4.3: PIN connection of 8051 Microcontroller

4.2.4 DISPLAY
The display is used to show the number of times obstruction has been placed or
the number of people entered the room. We have used one 7segment as a display. This
means the maximum count possible is 9. We can use 2 seven segments to count upto 99.
Also LCD can be used to display the number or some message. The seven segment used
in our project works in common anode mode. This means the anode of the diodes is
common and to forward bias the particular diode negative voltage is applied to that
particular diode’s cathode. There is a transistor that is used to switch the segment. If we
use two segments then we have to give control signal in our program.

37
CHAPTER NO:- 5

5.1 MAIN COMPONENTS AND THIER WORKING


5.1.1 COMPARATOR
Comparator as its name implies compares a signal voltage on one input with a
known Voltage called the reference voltage on the other input.The output may be + or –
saturation voltage, depending on which input is larger. In our project we have used 2
variable resistors of 10 kilo ohm each to produce reference voltage on one of its input..
the resistors are set to 5 and 4 kilo ohm approximately. Producing reference voltage of
2.34v.
On 2nd pin is a phototransistor ie receiver again there is a 10k variable resistor(set
to 4k) connected to its collector but base is open. 4th pin is connected to 5 v and 11th pin is
grounded. 1st pin is the output. Feedback resistor of 470 E is used and is connected to
anode of LED that is used to indicate that receiver and transmitter are working properly.
So 470 E is selected according to maximum current capability of led .

Fig 5.1: Comparators

Output at the pin 1st is different from that of phototransistor(0.9v and 4.6 v) .
Since practically the output of comparator is very different from the ideal case so output
is not +v sat or –v sat but 3.17v and 0.89v.

38
There are 2 comparators used as there are 2 leds and transmitters(though 1
comparator can also be used).

Fig 5.2: Basic Operation of Voltage Comparator

5.1.2 TRANSMITTER (IR led)

39
The transmitter is an IR led. It is connected to Vcc through resistor of 330 E.this
value is chosen for good intensity of led and according to maximum current capability.
When 5 v battery is connected the led starts emmiting infrared light that is not visible to
naked eye but can be seen through the camera lense. There are 2 leds used . this are for
the purpose of identifying weather person is entering or leaving. It is done through
programming .

Fig 5.3: Transmitters

Common infrared LED that emits infrared rays has the same appearance with
visible light LED. Its appropriate operating voltage is around 1.4v and the current is
generally smaller than 20mA. Current limiting resistances are usually connected in series
in the infrared LED circuits to adjust the voltages, helping the LED.

When using infrared rays to control correspondent unit, the controlling distance is
in direct ratio with the emitting power. In order to lengthen its controlling distance,
infrared LED should be operated under pulse state as the effective transmitting distance
of the pulsed light (modulated light) is in proportion with the wind-induced current of the
pulses. Thus, by increasing the peak value (Ip) of the pulses, the emitting distance of the
infrared LED can also be lengthened. One way to increase Ip is to diminish the duty ratio
of the pulse; that is to reduce the width of the pulse (T).

The duty ratios of the working pulses for some color TV’s infrared remote
controllers are around 1/3-1/4; and for some other electronic products, the duty ratios of
the infrared remote controllers can even be as small as 1/10. Through reducing the duty
ratio of the pulses, the emitting distance for small power infrared LED can also be
increased in a large extent. Ordinary infrared LEDs can be divided into the following
three types:

40
 small power one (1mW-10mW),
 medium power LED (10mW-50mW)
 large power LED (50mW-100mW and above). The modulated light can be
generated by adding pulse voltage with specific frequency on the driving diode.

The controller with infrared LED can emit infrared rays to take control of
correspondent unit, and at the controlled unit end, there is also a receiving device to turn
the infrared light into electricity, such as infrared light receiving diode, photoelectric
triode and so on. Emitting and receiving matched infrared diode has also been applied in
practical use.

There are a couple key differences in the electrical characteristics of infrared


LEDs versus visible light LEDs. Infrared LEDs have a lower forward voltage, and a
higher rated current compared to visible LEDs. This is due to differences in the material
properties of the junction. A typical drive current for an infrared LED can be as high as
50 milliamps, so dropping in a visible LED as a replacement for an infrared LED could
be a problem with some circuit designs.

IR LEDs aren’t rated in millicandelas, since their output isn’t visible (and
candelas measure light in a way weighted to the peak of the visible spectrum). They are
usually rated in milliwatts, and conversions to canelas aren’t especially meaningful.

5.1.3 RECEIVER (PHOTO TRANSISTOR)

41
Receiver used is a phototransistor L14G3. Photo transistor was used because it
responds very well to the obstruction producing 2 voltages that are quiet differentiable
and hence can be easily sensed by controller.there are 2 phototransistors to differentiate
person entering or exiting. When ir signal of the first led is obstructed means the person is
entering but when the light from second led is cut first then person is leaving and counter
should decrement.

Fig 5.4: Photo Transistors

Phototransistors also consist of a photodiode with internal gain. A


phototransistor is in essence nothing more than a bipolar transistor that is encased in a
transparent case so that light can reach the base-collector junction. The electrons that are
generated by photons in the base-collector junction are injected into the base, and this
photodiode current is amplified by the transistor's current gain β (or h fe). Note that while
phototransistors have a higher responsivity for light they are not able to detect low levels
of light any better than photodiodes.[citation needed] Phototransistors also have slower response
times.
Like diodes, all transistors are light-sensitive. Phototransistors are designed
specifically to take advantage of this fact. The most-common variant is an NPN bipolar
transistor with an exposed base region. Here, light striking the base replaces what would
ordinarily be voltage applied to the base -- so, a phototransistor amplifies variations in the
light striking it. Note that phototransistors may or may not have a base lead (if they do,
the base lead allows you to bias the phototransistor's light responseNote that photodiodes
also can provide a similar function, although with much lower gain (i.e., photodiodes
allow much less current to flow than do phototransistors). You can use this diagram to
help you see the difference (both circuits are equivalent):

5.1.4 MICROCONTROLLER

42
MICROCONTROLLER 8051 used in the project is a 40 pin IC. It requires +5v
to function. The crystal provides a frequency of 11.0592 MHz. There are 4 ports that can
be used as input or output. 20th pin is ground. We have used 2 pins of port 1 to receive
input from phototransistor. 3rd pin of Port3 is connected to relay section.4 th pin of port 3
is connected to 7 segment, acts as a control.Port0 is connected to 7 segment and used to
transmit data to 7 segment for display.

Fig 5.5: PIN diagram of 8051 Microcontroller

The controller plays the most prominentRole in this project . It is the device that
senses the obstruction and sends count to 7 segment as well as switch on/off relay. This is
done by programming 8051 in C. The 2 voltage levels at the output pin of comparator are
used as a signal to controller. The controller differentiates the 2 voltages and according to
the program performs the function. Its programmed to switch on the relay on obstruction
of ir first time and show count on 7 segment by sending the code for ‘1’.
Pull up resistor of 10k is used on port0 so as to pull up the voltage level. Otherwise port0
remains in the intermediate state and cannot differentiate between 2 levels. Other ports
have internal pull up resistors.

 8-bit data bus - It can access 8 bits of data in one operation (hence it is an 8-bit
microcontroller)

43
 16-bit address bus - It can access 216 memory locations - 64 kB each of RAM and
ROM
 On-chip RAM - 128 bytes ("Data Memory")
 On-chip ROM - 4 kB ("Program Memory")
 Four byte bi-directional input/output port
 UART (serial port)
 Two 16-bit Counter/timers
 Two-level interrupt priority
 Power saving mode

 It provides many functions (CPU, RAM, ROM, I/O, interrupt logic, timer, etc.) in
a single package
 8-bit data bus - It can access 8 bits of data in one operation (hence it is an 8-bit
microcontroller)
 16-bit address bus - It can access 216 memory locations - 64 kB each of RAM and
ROM
 On-chip RAM - 128 bytes ("Data Memory")
 On-chip ROM - 4 kB ("Program Memory")
 Four byte bi-directional input/output port
 UART (serial port)
 Two 16-bit Counter/timers
 Two-level interrupt priority
 Power saving mode

44
5.1.5 SEGMENT DISPLAY
The Light Emitting Diode (LED), finds its place in many applications in this
modern electronic fields. One of them is the Seven Segment Display. Seven-segment
displays contains the arrangement of the LEDs in “Eight” (8) passion, and a Dot (.) with a
common electrode, lead (Anode or Cathode). The purpose of arranging it in that passion
is that we can make any number out of that by switching ON and OFF the particular
LED's.

Fig 5.6: Segment Display

LED’s are basically of two types:-


 Common Cathode Type (CC)
 Common Anode Type (CA)
In a CA LED, all the 8 legs ('a' through 'h') are of cathode type and the common
anode will be connected to the +5v supply. By energizing any of the legs with 0Volts will
lead to switch the correspondent segment ON. In the microprocessor binary system,
0Volts will be considered as Binary 0, and 5Volts will be considered as Binary1.
Considering these two condition, we can make an arrangement as the microcontroller
gives OUT the 0s and 1s through its ports, which is connected to the 8 legs of the LED.
Of course, we can control the Port Output; implicitly we can Switch-ON required legs of
the display.

45
Fig 5.7: Circuit diagram for Common Anode 7-Segment Display
For common Cathode :

Seven Segment conversion Seven Segment


Hex Number
Dot G F e D c b A equivalent
0 0 0 1 1 1 1 1 1 3F
1 0 0 0 0 0 1 1 0 06
2 0 1 0 1 1 0 1 1 5B
3 0 1 0 0 1 1 1 1 4F
4 0 1 1 0 0 1 1 0 66
5 0 1 1 0 1 1 0 1 6D
6 0 1 1 1 1 1 0 1 7D
7 0 0 0 0 0 1 1 1 07
8 0 1 1 1 1 1 1 1 7F
9 0 1 1 0 0 1 1 1 67

For common Anode :

46
Seven Segment conversion Seven Segment
Hex Number
Dot G F e D c B A equivalent
0 1 1 0 0 0 0 0 0 C0
1 1 1 1 1 1 0 0 1 F9
2 1 0 1 0 0 1 0 0 A4
3 1 0 1 1 0 0 0 0 B0
4 1 0 0 1 1 0 0 1 99
5 1 0 0 1 0 0 1 0 92
6 1 0 0 0 0 0 1 0 82
7 1 1 1 1 1 0 0 0 F8
8 1 0 0 0 0 0 0 0 80
9 1 0 0 1 1 0 0 0 98

5.1.6 OSCILLATORS
Any circuit which is used to generate a.c. voltage without a.c. input signal is
called an oscillator. To generate a.c. voltage, the circuit is supplied energy from a d.c.

47
source. An oscillator is one of the basic device which is used in electronics and electrical
measurements. An oscillator generate a sinusoidal signal, however, it does not create
energy but simply acts as an energy converter. The function of an oscillator is just the
reverse of a rectifier and, therefore, sometimes called an inverter.

5.1.6.1 XT OSCILLATOR
Crystal oscillator is kept in metal housing with two pins where you have written
down the frequency at which crystal oscillates. One ceramic capacitor of 30pF whose
other end is connected to the ground needs to be connected with each pin.
Oscillator and capacitors can be packed in joint case with three pins. Such element is
called ceramic resonator and is represented in charts like the one below. Center pins of
the element are the ground, while end pins are connected with OSC1 and OSC2 pins on
the microcontroller. When designing a device, the rule is to 100place an oscillator nearer
a microcontroller, so as to avoid any interference on lines on which microcontroller is
receiving a clock.

Fig 5.8: Connecting the oscillator to controller

Fig 5.9: Connecting resonator to controller

5.1.6.2 RC OSCILLATOR
In applications where great time precision is not necessary, RC oscillator offers
additional savings during purchase. Resonant frequency of RC oscillator depends on

48
supply voltage rate, resistance R, capacity C and working temperature. It should be
mentioned here that resonant frequency is also influenced by normal variations in process
parameters, by tolerance of external R and C components, etc.
below diagram shows how RC oscillator is connected with PIC16F84. With value of
resistor R being below 2.2k, oscillator can become unstable, or it can even stop the
oscillation. With very high value of R (ex.1M) oscillator becomes very sensitive to noise

Fig 5.10: RC oscillator with PIC16F84


and humidity. It is recommended that value of resistor R should be between 3 and 100k.
Even though oscillator will work without an external capacitor (C=0pF), capacitor above
20pF should still be used for noise and stability. No matter which oscillator is being used,
in order to get a clock that microcontroller works upon; a clock of the oscillator must be
divided by 4. Oscillator clock divided by 4 can also be obtained on OSC2/CLKOUT pin,
and can be used for testing or synchronizing other logical circuits.

CHAPTER NO:- 6
6.1 ADVANTAGES
The advantages are:-

49
(i) The proposed system provides the solution for some of the main problems faced by
the existing Indian grid system, such as wastage of energy, power theft, manual
billing system, and transmission line fault.

(ii) This method will reduce the energy wastage and save a lot of energy for future use.

(iii) We can detect the location from where the power is being stolen which was not
possible before.

(iv) Optimized use of energy.

(v) Real time theft monitoring.

(vi) Currently used energy meters can be modified into this sensor, so no need to replace
currently used energy meters.

6.2 LIMITATIONS

The limitations are:-

(i) One major disadvantage of this project is that it is not capable of detecting the exact
location from where the power is being stolen.

(ii) Cannot determine who is stealing, but no any other existing system is capable.

(iii) If implemented on a large scale it may take a lot of time and manual input.

6.3 FUTURE SCOPE

In future, this project can be implemented and validated in remote areas. Future
enhancements can be incorporated to suit the system for three phase electric distribution

50
system in India. Along with all this new architectural components can be incorporated, so
that the system can be completely used for optimizing the energy consumption. This
method will reduce the energy wastage and save a lot of energy for future use. GSM
module can also be used in place of Zigbee module.

CHAPTER NO:- 7
7.1 CONCLUSION

51
This project is aimed at reducing the heavy power and revenue losses that occur
due to power theft by the customers. By this design it can be concluded that power theft
can be effectively curbed by detecting where the power theft occurs and informing the
authorities. Also an automatic circuit breaker may be integrated to the unit so as to
remotely cut off the power supply to the house or consumer who tries to indulge in power
theft. The ability of the proposed system to inform or send data digitally to a remote
station using wireless radio link adds a large amount of possibilities to the way the power
supply is controlled by the electricity board. The system design mainly concentrates on
single phase electric distribution system, especially. The proposed system provides the
solution for some of the main problems faced by the existing Indian grid system, such as
wastage of energy, power theft, and transmission line fault.

7.2 REFRENCES
1. www.wikipedia.com.
2. V.K. Mehta and Rohit Mehta, “Principles of Power Systems”, 4th ed, S.Chand
Publications,2008.

52
3. Ashfaq Hussain, “Electrical Power Systems”, 5th ed, CBS Publishers, 2007.
4. Kenneth J. Ayala, The 8051 Microcontroller, Penram International Publication.
5. Instrumentation Amplifiers and Signal Conditioning, Tata-McGraw-Hill Ltd.
6. Sunil S. Rao, “Switchgear Protection and Power Systems”, 9th ed, Khanna
Publications, 2012.
7. “Smart Grid”, www.wikipedia.com.

53

Das könnte Ihnen auch gefallen