Professional Documents
Culture Documents
ABSTRACT
Science and technology with all its miraculous
advancements has fascinated human life to a great extent that
imagining a world without these innovations is hardly possible.
While technology is on the raising slope, we should also note the
increasing immoral activities. With a technical view, "Power Theft" is
a non-ignorable crime that is highly prevalent, and at the same time
it directly affects the economy of a nation.
1
GSM BASED POWER THEFT SUBSTATION
CHAPTER - 1
CHAPTER 1
2
GSM BASED POWER THEFT SUBSTATION
INTRODUCTION
1.1. OVERVIEW:
"TODAY'S TECHNICIANS ARE SO FOCUSSED ON THE TREES OF TECHNOLOGICAL
CHANGE THAT THEY FAIL TO SEE THE FOREST; THE UNDERLYING ECONOMIC
FORCES THAT DETERMINE SUCCESS AND FAILURE..."
"TECHNOLOGY CHANGES ECONOMY LAWS DO NOT"
3
GSM BASED POWER THEFT SUBSTATION
MODES OF THEFT:
It has been seen that there are 4 common methods of
power theft as given below:-
Bogus seals and tampering of seals.
Meter tampering, meter tilting, meter interface
and
Meter bypassing.
Changing connection.
Direct tapping from line. Due to introduction of modern
electronic metering equipments, power thieves are utilizing more
technological methods. Recent cases of power theft discovered by
British inspectors included customers tunneling out to roadside
mains cables and splicing into the supply, a garage taking its night
time power supply from the nearest lamp post and domestic
customers drilling holes into meter boxes and attempting to stop the
counter wheels from turning. Another method of Power theft is by
keeping a strong magnet in front of the disc in the energy meter
and thus arresting the rotation of the disc, connecting the load
directly to the power line bypassing the energy meter. But, it can be
avoided easily by providing a non magnetic enclosure.
4
GSM BASED POWER THEFT SUBSTATION
1. 89s52 Microcontroller
2. MAX-232
3. 555
4. DB9 connector
5. IR Sensor
6. Photo Diode
89s52 Microcontroller:
The device also has four 8-bit I/O ports, three 16-bit
timer/event counters, a multi-source, a four-priority-level, nested
interrupt structure, an enhanced UART on-chip oscillator and timing
circuits. The added features of 89c51 make it a powerful
microcontroller for applications that require pulse width modulation,
high-speed I/O and up/down counting capabilities such as motor
control.
5
GSM BASED POWER THEFT SUBSTATION
MAX-232:
The MAX232 is a dual driver/receiver that includes a capacitive
voltage generator to supply 232 voltage levels from a single 5-V
supply. Each receiver converts 232 inputs to 5-V TTL/CMOS levels.
These receivers have a typical threshold of 1.3 V and a typical
hysteresis of 0.5 V, and can accept 30-V inputs. Each driver
converts TTL/CMOS input levels into 232 levels.
555:
The LM555 is a highly stable device for generating accurate
time delays or oscillation. Additional terminals are provided for
triggering or resetting if desired. In the time delay mode of
operation, the time is precisely controlled by one external resistor
and capacitor. For astable operation as an oscillator, the free
running frequency and duty cycle are accurately controlled with two
external resistors and one capacitor. The circuit may be triggered
and reset on falling waveforms, and the output circuit can source or
sink up to 200mA or drive TTL circuits.
IR Sensor:
The MAX232 is a dual driver/receiver that includes a capacitive
voltage generator to supply EIA-232 voltage levels from a single 5-V
supply. Each receiver converts EIA-232 inputs to 5-V TTL/CMOS
levels. These receivers have a typical threshold of 1.3 V and a
typical hysteresis of 0.5 V, and can accept 30-V inputs. Each
driver converts TTL/CMOS input levels into EIA-232 levels.
Photo Diode:
A photodiode consists of an active p-n junction which is
operated in reverse bias. When light falls on the junction, reverse
current flows which is proportional to the illuminance. The linear
response to light makes it an element in useful photo detectors for
6
GSM BASED POWER THEFT SUBSTATION
DESIGN LAYOUT:
GSM
modem
Sensor 89s52
microcontroller
Circuit
7
GSM BASED POWER THEFT SUBSTATION
Semiconductors:
IC1 - 89s52 Microcontroller
IC2 - MAX-232
IC3 - 555
Resistors:
R1 - 8.2-kilo-ohm
R2, R3 - 1-kilo-ohm
R4, R5 - 100-ohm
R6-R9 - 10K-Preset
Capacitors:
C1 - 10F Electrolytic
C2-C5 - 1F Electrolytic
C6, C7 - 33PF Ceramic Disk
Miscellaneous:
XTAL - 11.0592MHz
Modem - GSM-300MHz
D1, D2 - IR Diode
D3, D4 - Photo Diode
Connector - DB9
Battery - 5V
8
GSM BASED POWER THEFT SUBSTATION
9
GSM BASED POWER THEFT SUBSTATION
CHAPTER - 2
CHAPTER 2
10
GSM BASED POWER THEFT SUBSTATION
INTRODUCTION TO MICROCONTROLLERS
2.1 Definition:
Microprocessors and microcontrollers stems from the same
basic idea, microprocessor is a general purpose digital computer
central processing unit popularly known as memory usually
ROM,RAM, computer on chip .To make a complete microcomputer
, one must add memory, usually ROM, RAM Memory decoders, an
isolator and a number of I/O devices, such as parallel and serial
data ports. The design of microcontroller added all these features
along with ALU, PC, SP and registers.
2.2 History:
The past three decades have seen the introduction that has radically
changed the way in which we analyze and control the world around us.
Born of parallel developments in computer on chip first becomes a
commercial reality in 1971 with the introduction of the 4-bit 4004 by a
small, unknown company by the name of Intel corporation other, well
11
GSM BASED POWER THEFT SUBSTATION
12
GSM BASED POWER THEFT SUBSTATION
Memory components are exactly like that. For a certain input we get
Two new concepts are brought to us: addressing and memory location.
but selecting one of them. This means that we need to select the
desired memory location on one hand, and on the other hand we need
memory location, memory must also provide for writing onto it. This is
14
GSM BASED POWER THEFT SUBSTATION
Typically, the amount of ROM type memory will vary between around
512 bytes and 4096 bytes, although some 16 bit microcontrollers such
as the Hitachi H8/3048 can have as much as 128 Kbytes of ROM type
memory.
RAM is used for data storage and stack management tasks. It is also
used for register stacks (as in the microchip PIC range of
microcontrollers).
15
GSM BASED POWER THEFT SUBSTATION
Let add 3 more memory locations to a specific block that will have a
built in capability to multiply, divide, subtract, and move its contents
from one memory location onto another. The part we just added in is
called "central processing unit" (CPU). Its memory locations are called
registers.
2.7 EEPROM:
EEPROM means Electrical Erasable Programmable Read Only Memory
and also referred to as EPROM chip or i2c.
16
GSM BASED POWER THEFT SUBSTATION
the equipment itself. Since it can be both electrically written into and
erased in circuit for reprogramming without taking them out from the
main board.
Monitor. The current settings of the monitor will not be erased even
the monitor settings, the CPU updates the setting in the EEPROM
operation.
18
GSM BASED POWER THEFT SUBSTATION
CHAPTER - 3
CHAPTER 3
19
GSM BASED POWER THEFT SUBSTATION
HARDWARE DISCRIPTION
3.1. 89S52:
Features
Compatible with MCS-51 Products
8K Bytes of In-System Programmable
(ISP) Flash Memory Endurance: 1000
Write/Erase Cycles
4.0V to 5.5V Operating Range
Fully Static Operation: 0 Hz to 33 MHz
Three-level Program Memory Lock
256 x 8-bit Internal RAM
32 Programmable I/O Lines
Three 16-bit Timer/Counters
Eight Interrupt Sources
Full Duplex UART Serial Channel
Low-power Idle and Power-down Modes
Interrupt Recovery from Power-down Mode
Watchdog Timer
Dual Data Pointer
Power-off Flag
Description:
The AT89S52 is a low-power, high-performance CMOS 8-bit
microcontroller with 8K bytes of in-system programmable Flash
memory. The device is manufactured using Atmels high-density
nonvolatile memory technology and is compatible with the indus-
try-standard 80C51 instruction set and pinout. The on-chip Flash
allows the program memory to be reprogrammed in-system or by a
conventional nonvolatile memory pro-grammer. By combining a
versatile 8-bit CPU with in-system programmable Flash on a
monolithic chip, the Atmel AT89S52 is a powerful microcontroller
which provides a highly-flexible and cost-effective solution to many
embedded control applications.
The AT89S52 provides the following standard features: 8K bytes of
Flash, 256 bytes of RAM, 32 I/O lines, Watchdog timer, two data
pointers, three 16-bit timer/counters, a six-vector two-level
interrupt architecture, a full duplex serial port, on-chip oscillator,
and clock circuitry. In addition, the AT89S52 is designed with static
logic for operation down to zero frequency and supports two
software selectable power saving modes. The Idle Mode stops the
CPU while allowing the RAM, timer/counters, serial port, and
20
GSM BASED POWER THEFT SUBSTATION
23
GSM BASED POWER THEFT SUBSTATION
25
GSM BASED POWER THEFT SUBSTATION
26
GSM BASED POWER THEFT SUBSTATION
28
GSM BASED POWER THEFT SUBSTATION
30
GSM BASED POWER THEFT SUBSTATION
3.2.5. WORKING:
The GSM module is connected with the controller. As the
controller is keeping on monitoring the door when the door gets
opened, the microcontroller sends the command AT to initiate the
module. Now the module sends a sms as Theft Occurred to the
already fed mobile number. Thus the information is passed from the
module to the Authorized person.
3.2.6. FEATURES:
Performance - Fast with high real throughput
Integrity - Secure controlled data transfer
31
GSM BASED POWER THEFT SUBSTATION
3.3. MAX-232:
So, the maximum RS-232 signal levels are far too high for today's
computer logic electronics, and the negative RS-232 voltage can't
be rocked at all by the computer logic. Therefore, to receive serial
data from an RS-232 interface the voltage has to be reduced, and
the 0 and 1 voltage levels inverted. In the other direction (sending
data from some logic over RS-232) the low logic voltage has to be
"bumped up", and a negative voltage has to be generated, too.
32
GSM BASED POWER THEFT SUBSTATION
The MAX232 from Maxim was the first IC which in one package
contains the necessary drivers (two) and receivers (also two), to
adapt the RS-232 signal voltage levels to TTL logic. It became
popular, because it just needs one voltage (+5V) and generates the
necessary RS-232 voltage levels (approx. -10V and +10V)
internally. This greatly simplified the design of circuitry. Circuitry
designers no longer need to design and build a power supply with
three voltages (e.g. -12V, +5V, and +12V), but could just provide
one +5V power supply, e.g. with the help of a simple 78x05 voltage
converter. The MAX232 has a successor, the MAX232A. The ICs are
almost identical, however, the MAX232A is much more often used
(and easier to get) than the original MAX232, and the MAX232A
only needs external capacitors 1/10th the capacity of what the
original MAX232 needs.
33
GSM BASED POWER THEFT SUBSTATION
The MAX232 and MAX232A were once rather expensive ICs, but
today they are cheap. It has also helped that many companies now
produce clones (i.e. SiPix). These clones sometimes need different
external circuitry, e.g. the capacities of the external capacitors vary.
It is recommended to check the data sheet of the particular
manufacturer of an IC instead of relying on Maxim's original data
sheet.
34
GSM BASED POWER THEFT SUBSTATION
+---v---+
C1+ -|1 16|- Vcc
V+ -|2 15|- GND
C1- -|3 14|- T1out
C2+ -|4 13|- R1in
C2- -|5 12|- R1out
V- -|6 11|- T1in
T2out -|7 10|- T2in
R2in -|8 9|- R2out
+-------+
35
GSM BASED POWER THEFT SUBSTATION
only present on the larger connector are shown in red. Note, that
the protective ground is assigned to a pin at the large connector
where the connector outside is used for that purpose with the DB9
connector version.
3.5. 555-Timer:
37
GSM BASED POWER THEFT SUBSTATION
costing around 30p. A 'dual' version called the 556 is also available
which includes two independent 555 ICs in one package.
The following illustration shows both the 555 (8-pin) and the 556
(14-pin).
In a circuit diagram the 555 timer chip is often drawn like the
illustration below. Notice how the pins are not in the same order as
the actual chip, this is because it is much easier to recognize the
function of each pin, and makes drawing circuit diagrams much
easier.
38
GSM BASED POWER THEFT SUBSTATION
39
GSM BASED POWER THEFT SUBSTATION
Pin 1 (Ground):
Connects to the 0v power supply.
Pin 2 (Trigger):
Detects 1/3 of rail voltage to make output HIGH. Pin 2 has control
over pin 6. If pin 2 is LOW, and pin 6 LOW, output goes and stays
HIGH. If pin 6 HIGH, and pin 2 goes LOW, output goes LOW while
pin 2 LOW. This pin has a very high impedance (about 10M) and will
trigger with about 1uA.
Pin 3 (Output):
(Pins 3 and 7 are "in phase.") Goes HIGH (about 2v less than rail)
and LOW (about 0.5v less than 0v) and will deliver up to 200mA.
Pin 4 (Reset):
Internally connected HIGH via 100k. Must be taken below 0.8v to
reset the chip.
Pin 5 (Control):
A voltage applied to this pin will vary the timing of the RC network
(quite considerably).
Pin 6 (Threshold):
Detects 2/3 of rail voltage to make output LOW only if pin 2 is
HIGH. This pin has very high impedance (about 10M) and will
trigger with about 0.2uA.
Pin 7 (Discharge):
Goes LOW when pin 6 detects 2/3 rail voltage but pin 2 must be
HIGH. If pin 2 is HIGH, pin 6 can be HIGH or LOW and pin 7
remains LOW. Goes OPEN (HIGH) and stays HIGH when pin 2
detects 1/3 rail voltage (even as a LOW pulse) when pin 6 is LOW.
(Pins 7 and 3 are "in phase.") Pin 7 is equal to pin 3 but pin 7 does
not go high - it goes OPEN. But it goes LOW and will sink about
200mA.
40
GSM BASED POWER THEFT SUBSTATION
Pin 8 (Supply):
Connects to the positive power supply (Vs). This can be any voltage
between 4.5V and 15V DC, but is commonly 5V DC when working
with digital ICs.
3.6. INFRA-RED:
The term infrared is a Latin word meaning beyond the red.
Infrared is commonly shortened to IR. The process of detecting
or sensing infrared radiation from a target without being in
physical contact with that target is known as remote sensing.
Active and passive systems are used for remote sensing. Active
systems send a signal to the target and receive a return signal.
Radar sets are examples of active systems. Passive systems detect
a signal or disturbance originating at the target. The signal may
be emitted either by the target or another source.
Photography using natural light is an example of a passive system
Humans can see only a small part of the entire electromagnetic
spectrum. However, even though we cannot see them, other parts
of the spectrum contain useful information. The infrared spectrum is
a small portion of the entire electromagnetic spectrum. IR radiation
is a form of electromagnetic energy. IR waves have certain
characteristics similar to those of light and RF waves. These
characteristics include reflection, refraction, absorption, and
speed of transmission. IR waves differ from light, RF, and
other electromagnetic waves only in wavelengths and frequency
of oscillation. The IR frequency range is from about 300 gigahertz
to 400 terahertz. Its place in the electromagnetic
spectrum (fig. 6-1) is between visible light and the microwave
region used for high-definition radar. The IR region of the
electromagnetic spectrum lies between wavelengths of 0.72 and
41
GSM BASED POWER THEFT SUBSTATION
42
GSM BASED POWER THEFT SUBSTATION
unsignedinti;
for(i=0;i<y;i++){;}
43
GSM BASED POWER THEFT SUBSTATION
voidmain()
{
//P2.0 IR control pin going to the sensor
//P2.1 IR output pin coming from the sensor
while(1){
P2_0=1; //sendIR
delay(20);
ir1=P2_1;
P2_0 = 0; //stop IR
delay(98);
ir2 = P2_1;
The correct positioning of the sender LED, the receiver LED with
regard to each other and to the Op-Amp can also increase the
performance of the sensor. First, we need to adjust the position of
44
GSM BASED POWER THEFT SUBSTATION
the sender LED with respect to the receiver LED, in such a way they
are as near as possible to each others , while preventing any IR
light to be picked up by the receiver LED before it hit and object
and returns back. The easiest way to do that is to put the sender(s)
LED(s) from one side of the PCB, and the receiver LED from the
other side, as shown in the 3D model below.
This 3D model shows the position of the LEDs. The green plate is
the PCB holding the electronic components of the sensor. you can
notice that the receiver LED is positioned under the PCB, this way,
there wont be ambient light falling directly on it, as ambient light
usually comes from the top. It is also clear that this way of
positioning the LEDs prevent the emitted IR light to be detected
before hitting an eventual obstacle.
45
GSM BASED POWER THEFT SUBSTATION
Figure 3-33 illustrates the schematic symbols for the various types
of phototransistors. Phototransistors may be of the two-terminal
type, in which the light intensity on the photodiode alone
determines the amount of conduction. They may also be of the
three-terminal type, which have an added base lead that allows an
electrical bias to be applied to the base. The bias allows an optimum
transistor conduction level, and thus compensates for ambient
(normal room) light intensity.
46
GSM BASED POWER THEFT SUBSTATION
47
GSM BASED POWER THEFT SUBSTATION
Note:
As a general rule the input voltage should be limited to 2 to 3 volts
above the output voltage. The LM78XX series can handle up to 36
volts input, be advised that the power difference between the input
and output appears as heat. If the input voltage is unnecessarily
high, the regulator will overheat. Unless sufficient heat dissipation is
provided through heat sinking, the regulator will shut down.
48
GSM BASED POWER THEFT SUBSTATION
CHAPTER - 4
49
GSM BASED POWER THEFT SUBSTATION
CHAPTER - 4
SOFTWARE DESCRIPTION
51
GSM BASED POWER THEFT SUBSTATION
52
GSM BASED POWER THEFT SUBSTATION
the toolbar to change the project options for the currently selected
target. In the Project Workspace, you may right-click the target,
group, or source file to open the options dialog specific to that item.
The Options Dialog offers several Tabs where you specify option
settings:
The Device tab allows you to select the device for this target. The
Target tab allows you to specify the memory model and memory
parameters. You may enter the external (or off-chip) memory
address ranges under External Memory. When you start a new
project, you typically only need to setup the options on this tab. The
Output tab allows you to specify the contents of the output files
generated by the assembler, compiler, and linker.
The Listing tab allows you to configure the contents of the listing
files. The C/C++, Asm, and Linker tabs allow you to enter tool-
specific options and display the current tool settings. The Debug tab
configures the LVision Debugger. The Utilities tab configures Flash
memory programming for your target system.
54
GSM BASED POWER THEFT SUBSTATION
Each target has its own tool configuration settings. Files and groups
may be included or excluded as needed for startup or other target-
specific source code.
Click the Setup Editor Button to manage the targets maintained
in your project. In the Project Components tab, you may configure
the Project Targets, Groups, and Files in your project.
Each Target has its own option settings and output file name
that you may define. You may create one Target for testing with the
simulator and another Target for a release version of your
application that will be programmed into Flash ROM. Within Targets,
you may have one or more file Groups which allow you to associate
source files together. Groups are useful for grouping files into
functional blocks or for identifying engineers in a software team.
Files are simply the source files within a group.
55
GSM BASED POWER THEFT SUBSTATION
Building Projects:
LVision includes an integrated make facility that compiles,
assembles, and links your program. Click the Build Target button on
the toolbar to compile and assemble the source files in your project
and link them together into an absolute, executable program. The
assembler and compiler automatically generate file dependencies
and add them to the project. File dependency information is used
during the make process to build only those files that have changed
or that include other files that have changed.
56
GSM BASED POWER THEFT SUBSTATION
CHAPTER - 5
57
GSM BASED POWER THEFT SUBSTATION
CHAPTER 5
RESULTS
58
GSM BASED POWER THEFT SUBSTATION
CONCLUSION
59
GSM BASED POWER THEFT SUBSTATION
BIBLIOGRAPHY
Books Referred:
60