You are on page 1of 39

TRADE PROJECT

TITLE: TRANSFORMER VANDALISM PROTECTION

TABLE OF CONTENTS
Declaration
i
Abstract

.ii

Acknowledgement

iii

Dedication
iv

List of figures

.v

List of tables

..vi

Chapter 1: Introduction.............................................................................. 1
1.0 Background........................................................................................... 1
1.1 Objective............................................................................................... 1
1.1.1 Aims.................................................................................................. 2
1.2 Discription of block diagram.....................................................................2
Specifications.............................................................................................. 5
Chapter 2: literature review.......................................................................6
2.0 Introduction........................................................................................... 6
2.1 Power supply......................................................................................... 6
2.1.3Battery charger.................................................................................... 7
2.2 Keyboard.............................................................................................. 7
2.3 Switches............................................................................................... 7
2.3.1 Types of switches................................................................................ 8
2.4 microcontroller....................................................................................... 8
2.5 Programs.............................................................................................. 9
2.6 Voltage detector..................................................................................... 9

1
2.7 Operational amplifiers...........................................................................10
2.8 High frequency generator......................................................................12
2.8.1Multivibrators..................................................................................... 12
2.8.2 A stable multvibrator...........................................................................12
2.9 Voltage multiplier.................................................................................. 14
2.9.1Transistor.......................................................................................... 14
2.9.2 Transistor as a switch.........................................................................15
2.10 Relay................................................................................................ 16

Chapter 3: methodology..........................................................................18
3.0 Introduction......................................................................................... 18
3.1 Power supply....................................................................................... 18
3.2 Sensor................................................................................................ 20
3.3 Voltage detector................................................................................... 21
3.4 Keyboard............................................................................................ 21
3.5 Microcontroller..................................................................................... 23
3.6 High frequency generator......................................................................25
3.7 Voltage multiplier.................................................................................. 28
3.8 Alarm.................................................................................................. 29
3.9 Program development...........................................................................30
3.9 Lab review.......................................................................................... 31
Chapter 4: circuit implementation.................................................................32
4.0 Introduction......................................................................................... 32
4.1 Complete circuit diagram.......................................................................33
4.2 Circuit operation................................................................................... 34
Chapter 5: results and conclusion................................................................35
5.0 Introduction......................................................................................... 35
5.1Test results........................................................................................... 35
5.2 Conclusion.......................................................................................... 35
5.3 Recommendations............................................................................... 35
5.4 References.......................................................................................... 37
appendices

2
CHAPTER ONE

INTRODUCTION

1.0 BACKGROUND
Transformer vandalism is a menace that has seen the Kenya power and lighting
company loose a lot of money replacing the transformers. Also this menace has seen
many people and companies suffer due to lack of electricity as a result of stolen
transformers or oil siphoning. Transformers contain two expensive materials which
people are looking for. One is the copper which is used for the windings and the
second is oil used for cooling the big transformers. When transformer cooling oil is
drained, the coiling effect is lowered as a result the transformer will breakdown. This
will mean the people powered from the transformer will stay without power until when
the transformer is replaced. Kenya power has tried to solve the issue of vandalism by
using dry transformers but they end up being expensive that they cannot afford to
replace all of them. They have also been replacing the big three phase transformers
with three single phase transformers which contain little oil that the thieves ignore
though this also increases the cost. They have also been surrounding the
transformers with a live conductor but most vandalism is done when there is power
failure because the conductor around the transformer also goes off. That is why I saw
it necessary to come up with a transformer vandalism detector which makes the
transformer intruder case live when there is power failure. The transformer vandalism
protector will detect when the mains fail and produce a high voltage which will be
connected to the transformer intruder case to ensure that anybody who touches the
transformer will be electrocuted. To ensure innocent people are safe a sign will be
mounted next to the transformer. But since the transformer intruder casing will be live
all the time another problem will arise. The Kenya power personnel will not be able to
touch the transformer too. So to give the authorized personnel access to the
transformer the system will employ a password deactivation option. The password
will be entered via a detachable keyboard. This will ensure the unauthorized people
cannot try to crack the password since there will be no keyboard. The password will

3
employ 6 digit combinations making it very hard for a person with even the keyboard
to crack the password. The system will employ a microcontroller hence making it
more efficient.

1.1 OBJECTIVE
To design, construct and test an effective microcontroller based
transformer vandalism protector system.

1.1.1 AIMS
To develop a system that can detect when the grid supply has failed
To develop a system that can generate a high voltage only when the grids
supply fail.
To develop a system that can ensure the transformer cover is always live
when the grids supply fail.
To develop a system that can be deactivated using the correct password.

1.2 BLOCK DIAGRAM

Sensor Alarm

Voltage Microcontroll Switching High Voltage


detecto er circuit frequen multipli
r cy er
generat

Keyboard Battery Anti


intruder
protectio
n cover

Fig 1.1 Block diagram of Microcontroller based transformer vandalism detector.

1.3 DESCRIPTION OF BLOCK DIAGRAM


Keyboard

A keyboard is a typewriter-style device, which uses an arrangement of buttons


or keys, to act as mechanical levers or electronic switches. Following the decline
of punch cards and paper tape, interaction via teleprinter-style keyboards became
the main input device for computers. A keyboard typically has

4
characters engraved or printed on the keys and each press of a key typically
corresponds to a single written symbol. There are various types of keyboards which
include standard keyboard, laptop thump type corded, software, numeric and hexa
decimal keyboards. My project employs a standard keyboard to enter the
deactivating code to the logic control circuit.

Microcontroller

A microcontroller is a small computer on a single integrated circuit containing a


processor core, memory, and programmable input/output peripherals Microcontrollers
are designed for embedded applications, in contrast to the microprocessors used in
personal computers or other general purpose applications. The circuit in this project
employs a microcontroller to detect the password entered and deactivate the system
when the correct code is entered. Also the circuit will detect the status of the grid
supply and give the activation signal to the high frequency generator when the mains
fail.

Voltage detector

A voltage detector is a circuit that can be used to measure the voltage level from a
source or can be used to notice when the voltage fails. In the project it is used to
compare the output from the rectifier and the output from the battery and give a
signal to the control logic control circuit and the device employed is a voltage
comparator.

Sensor

A sensor (also called detector) is a converter that measures a physical quantity and
converts it into a signal which can be read by an observer or by an (today
mostly electronic) instrument. For example, a mercury-in-glass thermometer converts
the measured temperature into expansion and contraction of a liquid which can be
read on a calibrated glass tube. A thermocouple converts temperature to an output
voltage which can be read by a voltmeter. In this project, an infrared emitter and an
infrared detector is used to detect the presence of an intruder below the transformer
poles.

Switching circuit

5
Switching circuit is the mathematical study of the properties of networks of idealized
switches. Such networks may be strictly combinational logic, in which their output
state is only a function of the present state of their inputs; or may also
contain sequential elements, where the present state depends on the present state
and past states; in that sense, sequential circuits are said to include "memory" of
past states.

This is used to convert the low power from the microcontroller to a higher level which
can drive the alarm device and the high rest of the circuit.

Alarm device

An alarm device or system of alarm devices gives an audible, visual or other form
of alarm signal about a problem or condition.

Alarms have the capability of causing a fight-or-flight response in humans; a person


under this mindset will panic and either flee the perceived danger or attempt to
eliminate it, often ignoring rational thought in either case. In this project alarm is used
to generate an audio alert when an intruder is detected across the transformer poles.

High frequency generator

Signal generators, also known variously as function generators, RF and microwave


signal generators, pitch generators, arbitrary waveform generators, digital pattern
generators or frequency generators are electronic devices that generate repeating or
non-repeating electronic signals (in either the analog or digital domains). They are
generally used in designing, testing, troubleshooting, and repairing electronic or
electro acoustic devices; though they often have artistic uses as well.

There are many different types of signal generators, with different purposes and
applications (and at varying levels of expense); in general, no device is suitable for all
possible applications.

Traditionally, signal generators have been embedded hardware units, but since the
age of multimedia-PCs, flexible, programmable software tone generators have also
been available.

This will be used to convert the DC voltage from the battery to a high frequency
pulsing signal. The circuit will consist of an astablemultivibrator.

6
Voltage multiplier

A voltage multiplier is an electrical circuit that converts AC electrical power from a


lower voltage to a higher DC voltage, typically using a network
of capacitors and diodes.

Voltage multipliers can be used to generate a few volts for electronic appliances, to
millions of volts for purposes such as high-energy physics experiments and lightning
safety testing. The most common type of voltage multiplier is the half-wave series
multiplier, also called the Villard cascade (but actually invented by Heinrich
Greinacher).

This is used to step-up the voltage from the frequency generator from 12V to 2KV.
The circuit will employ a switching circuit and a high frequency transformer.

1.4 SPECIFICATIONS

Table 1.1 shows specification of the project.

No Detail Value Input Output

1 Voltage detector (Op amp) 12Vdc, 5Vdc 5Vdc

2 Battery voltage 12Vdc

3 Microcontroller operating voltage 5Vdc 5Vdc

4 Voltage multiplier 12Vdc 2KV pulsing

5 Password combination (keyboard) 6 digit

6 Battery charging current 2A

7 Battery charging voltage 13.8Vdc 12.7Vdc

7
8 Infrared detector 5Vdc 0V,5Vdc

CHAPTER 1: LITERATURE REVIEW

2.0 INTRODUCTION
This chapter covers the explanations of the components used to develop the project.
The chapter also covers the component construction and the formula derivation.

2.1 POWER SUPPLY


This consists of a battery which provides DC power to the circuit.

2.1.1 Battery

Batteries are devices which store power for future use and are classified in to two
categories:

i. primary batteries
ii. secondary batteries

Some of the important factors which must be considered when selecting a battery
are:

Recharging method
Performance at various temperature
Life cycle
Maintenance

Secondary batteries or cells can be recharged after discharge

These types include:

8
Load acid batteries
Nickel cadmium
Nickel Zinc e.t.c.

2.1.2 Lead acid batteries

It stores electrical energy in the form of chemical energy. This chemical energy is
converted into electrical energy when the battery is in use.The battery consists of a
number of cells which consist of the following.

Positive and negative plates they consist of lattice type of grid and made of
cats antimonies lead alloy.
Electrolyte Dilute sulphuric acid which fills up the compartment where the
cell is immersed completely.
Container This is where compartments and the cells are contained made of
vulcanized rubber.
Separators sheets of porous materials placed between the positive and
negative electrodes to prevent them from coming in to contact with each

2.1.3 Battery charger


A battery charger is a device used to put energy into a secondary cell or
rechargeablebattery by forcing an electric current through it.

The charge current depends upon the technology and capacity of the battery being
charged. For example, the current that should be applied to recharge a 12 Vcar
battery will be very different from the current for a mobile phone battery.

2.1.4 Types of battery chargers

Simple Trickle, Timer-based, Intelligent, Fast, Pulse, Inductive, Solar chargers, USB-
based, Universal battery chargeranalyzers and Motion-powered charger.

2.2 KEYBOARD
A keyboard is a typewriter-style device, which uses an arrangement of buttons
or keys, to act as mechanical levers or electronic switches. Following the decline
of punch cards and paper tape, interaction via teleprinter-style keyboards became
the main input device for computers.

2.3 SWITCHES
In electronics, a switch is an electrical component that can break an electrical circuit,
interrupting the current or diverting it from one conductor to another. The most
familiar form of switch is a manually operated electromechanical device with one or

9
more sets of electrical contacts. Each set of contacts can be in one of two states:
either 'closed' meaning the contacts are touching and electricity can flow between
them, or 'open', meaning the contacts are separated and non-conducting. A switch
may be directly manipulated by a human as a control signal to a system, such as a
computer keyboard button, or to control power flow in a circuit,

2.3.1 Types of switches


Standard switches

ON-OFF
Single Pole, Single Throw = SPST
(ON)-OFF
Push-to-make = SPST Momentary
ON-(OFF)
Push-to-break = SPST Momentary
ON-ON
Single Pole, Double Throw = SPD
ON-OFF-ON
SPDT Centre Off

Special switches

Special switches includes: Multi-way Switch, Multi-pole Switch, DIP Switch, Reed
Switch, Tilt Switch, Key switch, Micro switch and Push-Push Switch.

The switches used in the circuit will be push since they make contact only when
pushed and break the when release.

2.4 MICROCONTROLLER
A microcontroller (sometimes abbreviated C, uC or MCU) is a small computer on a
single integrated circuit containing a processor core, memory, and programmable
input/output peripherals. Program memory in the form of NOR flash or OTP ROM is
also often included on chip, as well as a typically small amount of RAM.
Microcontrollers are designed for embedded applications, in contrast to the
microprocessors used in personal computers or other general purpose applications.

Microcontrollers are used in automatically controlled products and devices, such as


automobile engine control systems, implantable medical devices, remote controls,

10
office machines, appliances, power tools, toys and other embedded systems. By
reducing the size and cost compared to a design that uses a separate
microprocessor, memory, and input/output devices, microcontrollers make it
economical to digitally control even more devices and processes. Mixed signal
microcontrollers are common, integrating analog components needed to control non-
digital electronic systems.

Some microcontrollers may use four-bit words and operate at clock rate frequencies
as low as 4 kHz, for low power consumption (milliwatts or microwatts). They will
generally have the ability to retain functionality while waiting for an event such as a
button press or other interrupt; power consumption while sleeping (CPU clock and
most peripherals off) may be just nanowatts, making many of them well suited for
long lasting battery applications. Other microcontrollers may serve performance-
critical roles,where they may need to act more like a digital signal processor (DSP),
with higher clock speeds and power consumption.

2.5 PROGRAMS
Microcontroller programs must fit in the available on-chip program memory, since it
would be costly to provide a system with external, expandable, memory. Compilers
and assemblers are used to convert high-level language and assembler language
codes into a compact machine code for storage in the microcontroller's memory.
Depending on the device, the program memory may be permanent, read-only
memory that can only be programmed at the factory, or program memory may be
field-alterable flash or erasable read-only memory.

2.6 VOLTAGE DETECTOR


This consists of a voltage comparator which compares transformer output and the
output from the battery.

11
+12V

IC8
LM741
From regulator + To microcontroller

From battery

GND

Fig 2.1 voltage detector circuit diagram

2.7 OPERATIONAL AMPLIFIERS


These are very high dc coupled differential amplifiers with single ended output. They
have a gain ranging from and relatively lower impedance.

Schematic symbol

A Output
B
Figure 2.2 symbol of operational amplifier

Point A shows inverting terminal and B non-inverting terminal.

This does not mean that one terminal is kept positive relative to the other but just
gives the relative phase of the output which is important in keeping the negative

12
feedback negative. The output goes positive when the non-inverting input goes more
positive than the inverting input.

Common Design of Op-amps

Off-set Null 1 8 No connection


U1 7 + v e ( u s u a l l y + v e 1 5 v )
OPAMP5
Inverting Input 2 +
6 Output
Non-inverting input 3

-ve (uaually -ve 15v)4


5 Off-set Null

Fig. 2.3 common design of op-amps

Voltage Comparator

Its a circuit which compares the signal and voltage levels. It is the simplest because
it needs no additional external components. If and are equal to , should ideally be
zero. Even if differs from by a very small amount, is large because of the amplifiers
high gain. Hence, the circuit can detect very small change.

Where:-

- Open loop gain

- Output voltage

- Non-inverting input voltage

-Entering voltage input

13
VCC

V1 + Vo

V2

GND

Fig. 2.4 Comparator connection

When is greater than, is positive to maximum value being the positives which it has
when /. The Op-amp is then saturated. For example, for an amplifier of =, and
saturation occurs when () +15v/ i.e. 150microvolts. will be -15v if is greater than by
150microvolts.

A small change in () causes to switch between positives and negatives and enable
the op-amp to indicate when is greater or less than i.e. to act as a differential
amplifier and compare the two voltages.

2.8 HIGH FREQUENCY GENERATOR


This comprises of an oscillator which is used to generate the frequency

2.8.1 Multivibrators
When an input signal to one amplifier is large enough, the transistor can be driven
into cutoff, and its collector voltage will be almost VCC. However, when the transistor
is driven into saturation, its collector voltage will be about 0 volts. A circuit that is
designed to go quickly from cutoff to saturation will produce a square or rectangular
wave at its output. This principle is used in multivibrators. Multivibrators are classified
according to the number of steady (stable) states of the circuit. A steady state exists
when circuit operation is essentially constant; that is, one transistor remains in
conduction and the other remains at cut off until an external signal is applied.

There three types of multvibrators

14
A stablemultivibrator

Bi-stable multivibrator

Monostablemultivibrator

2.8.2 A stable multivibrator


The astable circuit has no stable state. With no external signal applied, the
transistors alternately switch from cutoff to saturation at a frequency determined by
the RC time constants of the coupling circuits. The circuit employs a 555 timer
astablemultvibrator since it needs a continuous pulsing.

VOUT
Fig. 2.5 Circuit of 555 a stable multivibrator

The waveforms depicting the operation of the 555 as a stable oscillator are as shown
in above circuit.

15
Fig. 2.6 a stable multivibrator

Formulae for the time durations tIO and tHI are as follows.

The time that the output is HIGH (t HI) is how long it takes C1 to charge from 1/3VCC to
2/3VCC and is given by

tHI = -ln()(R1+R2)C1

= 0.693(R1+R2) C1

The time that the output is LOW (tLO) is how long it takes C1 to discharge from 2/3VCC
to 1/3VCC and is given by

tLO= -ln ()(R2) C1

= 0.693 (R2) C1

Period T, is the sum of the tLO and tHI time and is given by

T = tLO + tHI

= 0.693(R2) C1 + 0.693 (R1+R2) C1

= 0.693(R1+2R2) C1

The output frequency of the circuit is given by the inverse of the period

f = 1/T

2.9 VOLTAGE MULTIPLIER

2.9.1Transistor
A transistor is an electronic device which can be used as a switch or an amplifier.

16
C
C
B
B NPN PNP T R A N S I S T O R

TRANSISTOR
E E

Fig. 2.8(a) symbol of npn transistor fig 2.8 (b) symbol of pnp transistor

The transistors in the circuit are used as switches and employs both PNP and NPN
transistors since the output used to switch on the transistors are negative and
positive voltage respectively

vcc

Q1
PNP
RB

RC

Fig 2.8(c) common emmitter configuration

Rc= ,RB = and IB = where,

IB Base current

The load line diagram illustrates all possible values of collector current (I C) and the
collector voltage (VCE in this case) for a given (RC).

The point on the load line where it intersects the collector current axis is referred to
as saturation point. At this point, the transistor current is maximum and voltage
across collector is minimum, for a given load. For this circuit, IC-SAT= VCC/RC.

The cutoff point is the point where the load line intersects with the collector voltage
axis. Here the transistor current is minimum (approximately zero) and emitter is
grounded. Hence VCE-CUTOFF=Vcc

The operating point of the circuit in this configuration is generally designed to be in


the active region, approximately between middle of the load line and close to

17
saturation point. In this region, the collector current is proportional to the base
current, and hence useful for amplifier applications.

2.9.2 Transistor as a switch


It is biased to be non-conducting or conducting the maximum possible collector or
ON. If the base current of a transistor with collector resistor R1 increases gradually
from 0, the collector current will increase as well.

Since Ic = hfe1

Vcc will fall since VcE= - IcRc. The point will be reached of which VCE has fallen to its
minimum possible value. The maximum voltage is the collector saturation voltage.
VCE (SAT) the transistor is saturated. The collector current at the saturation is
labeled as Ic (SAT) and the base emitter voltage that just produces saturation as V BE
(SAT)

VBE = (SAT) = 0.7V VCE (SAT) = 0.2V

When used as a switch, transistor is rapidly switched between two states.

When transistor is off, it only conducts the leakage current; therefore voltage across
the transistor is equal to VCC.

When the transistor is driven to saturations, It is ON state, voltage across the


transistor is equal to collector saturation voltage VCE (SAT)

2.10 RELAY
A relay is an electrically operated switch. Many relays use an electromagnet to
operate a switching mechanism, but other operating principles are also used.

VCC

Free
wheelling RLY1
12VCOIL
Diode
Base current
Q1
NPN

GND

18
Fig 2.9 circuit diagram of relay

Relay Resistance=

Relays find applications where it is necessary to control a circuit by a low-power


signal, or where several circuits must be controlled by one signal. The first relays
were used in long distance telegraph circuits, repeating the signal coming in from one
circuit and re-transmitting it to another. Relays found extensive use in telephone
exchanges and early computers to perform logical operations. A type of relay that can
handle the high power required to directly drive an electric motor is called a
contractor. Solid-state relays control power circuits with no moving parts, instead
using a semiconductor device to perform switching. Relays with calibrated operating
characteristics and sometimes multiple operating coils are used to protect electrical
circuits from overload or faults; in modern electric power systems these functions are
performed by digital instruments still called "protection relays".

19
CHAPTER 2: METHODOLOGY

3.0 INTRODUCTION
This chapter covers block by block circuit diagrams and the mathematical analysis of
all the components used in the sub circuits.

3.1 POWER SUPPLY


This consist of a step down transformer which steps down the mains voltage from
240V to 12vac, a full wave bridge rectifier which converts the ac voltage from
transformer to dc, a shunt capacitor filter which smoothens the rectified dc voltage
and a voltage regulator which regulates the smoothened dc voltage.

T1 12V
1to2
D1 D2 IC1
D7 78L05
240Vac 12V IN OUT
5V
D3 COM
D4 D6
D5
+

C2
C1
+

+ V1
12V

GND

Fig. 3.1 power supply

The charging current is 2A. The transformer employed should be rated 2A.

TX power = TX output voltage X TX output current

= 12 X 2A

= 24VA

20
TX1 is a 240 to 12V 24VA step-down transformer.

Diode D1 to D4 forms the full wave bridge rectifier. The diodes used are determined
by the maximum inverse voltage across each diode. I inversefor a full wave bridge is
equal to the transformer peak voltage.

Iinverse =Vp

Vp = VRMS2 = 122 =17V

Inverse = 17V

The diodes used should be rated more than 17V and 2A

Diode IN5400 rated 50V Inverse max and 3A IF(AV) is used

C1 form the shunt capacitor filter. The minimum capacitor that can be used is
determined from the equation

Where Vdc = 12V, Vp = 17V, Idc = 2 and F = 50Hz

17000C = 24

C=1412 F

C = 2200F standard capacitor

C1 = 2200F 25V

The capacitor is rated 25V since the voltage across its terminal will increase to Vp

IC1 is the voltage regulator which regulates the voltage to attain 5V to power the
microcontroller and signal conditioner. The IC used should be rated 5V output voltage
and current of 1A. IC L7805 rated 5V and 1A is selected from the catalogue. Battery
BT1 provides the power when the mains fail. The battery used should be rated 12V
and 2A.diode D5 is used to charge the battery. When the battery is full the diode is
reverse biased and the charging stops. When the mains fail diode D6 is forward
biased and the voltage from the battery powers the circuit. The diodes used should
be rated 12V and 2A, diode 1N5400 is used for D5 and D6. The regulator datasheet

21
recommends a 10F shunt capacitor filter be connected at the regulator output.
C2=10F

3.2 SENSOR
This consists of an infrared emitter and an infrared detector. The infrared emitter
emits an infrared beam which is received by the infrared detector. When the infrared
beam is blocked the circuit will give a trigger signal to the microcontroller.

5V

R2

R1

ID1
To microcontroller

IE1

GND

Fig 3.2 sensor circuit diagram

IE1 is the infrared emitter. Emitter SFH415T rated 100mA IF and 0.5S rise and fall
time and a matching infrared detector SFH309FArated 15mA IC max and 9S rise
and fall time @ 1mA IC is selected from the catalogue.

R1=

R1=

R1=50

R1=56

Setting the collector current to be 150A

R2=

R2=

R2= 33.33K

22
R2= 33K

When the infrared beam is blocked the circuit will give a positive output to the
microcontroller.

3.3 VOLTAGE DETECTOR


This consists of a voltage comparator which compares transformer output and the
output from the battery.

5V

IC2
LM741
+ To microcontroller

From rectifier

GND

Fig 3.3 voltage detector circuit diagram

IC2 is a general purpose op-amp connected as a voltage comparator. The op-amp


used is attained from LM741 which is a general purpose op-amp.

When the mains are okay the output from the battery is less than the output from the
regulator hence the voltage comparator output is low. When the supply voltage fails
the rectifier output will be zero hence the voltage comparator output is positive VCC
(high). This will give a high signal to the microcontroller.

23
3.4 KEYBOARD
This consists of 10 switches which will be used to enter the required password to
disenable the system for repair purpose. The first 10 are used to enter 0 to 9 and the
other two will be used to enter the functions such as change password and check
password used to disenable the system for the last recent two times.

KEYPAD1

x1 x2 x3 x4
F
B
7
3
y4 C D E
y3 8 9 A
y2 4 5 6
y1 0 1 2
To microcontroller

R6
R4
R3
R5

GND

Fig 3.4 keyboard circuit diagram

The keypad employed is DJ2rated 100mA @30Vdc contact rating which is a 4 by 3


matrix keypad.

When he switches are pressed the output to register in the microcontroller will be as
shown below

Resistors R3 to R6 are use to ground the microcontroller input terminals. The


maximum input/output ports current rating is 20mA.

R3-R6=

R3-R6=

R3-R6=

R3-R6=

24
The table below shows keyboard output truth table

Switch no. QD QC QB QA
1 0 0 0 1
2 0 0 1 0
3 0 0 1 1
4 0 1 0 0
5 0 1 0 1
6 0 1 1 0
7 0 1 1 1
8 1 0 0 0
9 1 0 0 1
0 0 0 0 0

Table 3.1 keyboard output truth table

25
3.5 MICROCONTROLLER
This consists of microcontroller PIC16F873A which is used to loads the operating
passwords from the keyboard and stores them to the registers. The microcontroller
will monitor the outputs from the voltage detector and the output from the sensor and
give outputs according to the outputs from the two. The microcontroller will switch on
the high voltage generator and trigger the phone to call the service center when the
mains fail and a person is detected along the transformer.

5V

1 20

11
`12
13 To high frequency
14 28 generator
From keyboard R8
15 27
16 R9
17
26 R10
18 IC4
25
From sensor
6 To phone
IC3 9
C3
7 30pF
From voltage detector XTAL1
PIC16F873A
4MHZ C4
30pF
10
19 LED2
8
LED1

GND

Fig 3.5 microcontroller circuit diagram

IC3 is the microcontroller. The IC used is PIC16F873A which has flash EEPROM to
store the program.

XTAL1 is the crystal oscillator used to generate the operating frequency. The
microcontroller can operate with frequency from DC to 20MHZ. so the crystal
oscillator selected should be rated in that range. In the circuit the operating frequency
is 8MHZ. crystal oscillator HC49/U rated 8MHZ is selected. The oscillator datasheet
recommends a load capacitor of 30pF capacitor C3 and C4 are rated 30pF.

26
The LEDs used for LED1-LED2 are rated 20mA IF. Resistor R 9-R10 are used to limit
the current flowing through the LEDs

R9-R10 =

R9-R10 =

R9-R10 = 250

R9-R10 = 270

IC4 is a transistor optical coupler which is used to trigger the phone call the service
center, coupler SFH615 rated 10mA IF and 100mA IC max is picked from the
catalogue for IC4.

R8=

R8=

R8=500

R8=560

3.6 HIGH FREQUENCY GENERATOR


This consists of an astablemultvibrator which converts the DC voltage from the
battery to a pulsing ac voltage.

27
12V

D8
RLY1
12V
R11

5V R8
Q1
NPN IC5
555

Gnd Vcc
Trg Dis
Out Thr
Rst Ctl
From microcontroller R12

To high frequency
generator

C6
C5
GND

Fig. 3.6 high frequency generator circuit diagram

IC5 is a 555 timer IC chip connected as an astablemultivibrator. The IC used is


NE555

The timer frequency is to be set at 20KHZ and the frequency is set by R 11, R12 and C5
as shown in the equation below.

F=20KHZ

F=20KHZ

Setting C5 to be 2.2nF

Since there are two variables the value of one resistor must be set to determine the
other. Setting R11 to be 3.3K

= 33K- 3.3K

= 29.7K

The data sheet recommends that, the voltage control terminal be connected to
ground when not in use via a 10nF decoupling capacitor.

C6 = 10nF

28
RL1is the relay used to switch on the battery power to the high voltage generator and
voltage multiplier.

The operating current is 2A. The relay used should be rated 2A. Relay G2R-14-T130
rated 12V coil voltage

10A @ 250a.c contact Rating

160 coil resistance is used

The current flowing through Q1 collector terminal is;

IC =

IC =

IC = 75mA

The transistor used for Q1 should be rated more than 75mA

Transistor 2N2222 rated 800mA IC max and 100HFE is selected from the catalogue
for Q1.

R7 =

IB==

IB= 750A

R8=

R8 = 6.7K

Diode D8 is a freewheeling diode. The diode used should be rated more than the
current drawn by the relay coil. Diode IN4148 rated 75V V inverse max and 150mA IF is
selected from the catalogue.

3.7 VOLTAGE MULTIPLIER


This consists of a high frequency transformer and a transistor which is used to switch
the DC voltage to the transformer according to the high frequency generator.

29
2KV
12V

To shield fence
T2
1to2

D9

12V R13
Q2
NPN
From high frequency
generator

GND

Fig. 3.7 voltage multiplier circuit diagram

The battery output current is 4A. The transistor used for Q2 should be rated more
than 4A.

Transistor BDX53C rated IC (max) 8A and HFE 750 is selected from the catalogue.
Resistor R18 is used to limit the transistor base current

IB==

IB=5.33mA

Diode D9 is a freewheeling diode. The diode used should be rated more than voltage
connected to the transformer. Diode IN4001 rated 50V and 1A is used for D9

D9= IN4001

T2 is a high frequency transformer. The transformer employed is 530A7 which is TV

fly back transformer.

3.8 ALARM
This consists of a buzzer which is used to produce sound when powered.

30
12V
BZZ1
12V

START
Fig 3.8 alarm circuit diagram

BZ1 is the buzzer which is used to give an audible sound when powered. The buzzer
Initialize I/O ports
to be used should be rated 12Vdc and current less than 4A since the battery
maximum current output is 4A, buzzer KPE651 rate 6-35V supply voltage, operating
current 4-18mA and sound level 95dB is selected from the catalogue.

Check keyboard us

Check password used


Check old password

Store new password Display

Check mains status


3.9 PROGRAM DEVELOPMENT
On repeat

Check sensor o/p


Password change user check

Output high voltage, dial and sound alarm

Check password

Correct

Deactivate high voltage and alarm


31

End
Incorrect

Off

Low (no intruder)

High (intruder present)

Incorrect

Correct

Fig 3.9 program flow chart

32
3.10 COMPLETE CIRCUIT DIAGRAM
T1 TP1
1to2
D1 D 2 T P 2 D7 IC1
78L05 TP3
IN OUT TP9
COM
2KV
D4 D3
D8
1 20 TP10
TP1 R2
RLY1
D6 33k 12V
SW1
D5 R11
11

x1 x2 x3 x4
F
B
7
3
`12 3.3k

E
A
6
2
R1 R7 T2
56R 13 TP8 1to2

D
9
5
y1 0 1
6.8k Q1
28

y4 C
y3 8
y2 4
14 NPN IC5
R8 555 D9
560R
15 27 Gnd Vcc
Trg Dis
16 R9
Out Thr
Rst Ctl
270R
17
26 R10 R12
IC2 18 270R
LM741 25 15K
+ TP4 IC4
6 SFH615
+ V1 TP5
IC3 9
12V TP6 C3
TP7 7 30pF
XTAL1 R13
PIC16F873A 2.2k Q2
+

C2 4MHZ C4 NPN
30pF
10uF 10
C1 R6 To phone
+

ID1 R3 R4 R5
2200uF 19 LED2
8
270R 270R 270R
270R LED1 BZZ1
IE1 12V
COM

33
Fig 3.10 shows a complete circuit diagram

34
3.11 CIRCUIT OPERATION
When the circuit is switched on, the transformer TX1 steps down the mains voltage
from 240Vac to 12Vac. The full wave bridge rectifier formed by D1 to D4 converts the
ac voltage to DC. The shunt capacitor filter C1 is connected at the rectifier output to
smoothen the DC voltage to eliminate the ripples. When the mains are okay, diode
D5 is forward biased and charges the battery. When the battery is full the diode is
reverse biased and the charging stops. When the mains are ok diode D6 is reverse
biased. When the mains fail diode D6 is forward biased and powers the circuit. The
voltage regulator formed by IC1 stabilizes the voltage from the rectifier to attain a
fixed 5Vdc to power the microcontroller. The microcontroller runs the start-up
program which sets the I/O ports RC7 to RC4 as the input ports while the I/O ports
RC3 and RC0 as output ports. PORTA is set as input port and PORTB is set as
output port. PORTC is used to host the keyboard.

When the mains are okay the output from the regulator is less than the output from
the rectifier hence the voltage comparator output is low. When the supply voltage
fails the rectifier output will be zero hence the voltage comparator output is positive
VCC (high). This will give a high signal to the microcontroller.

The high voltage will enable the microcontroller to run a standby program. The
standby program will monitor the output from the sensor. When the infrared ray is
blocked the sensor output will go high. The high output will enable the microcontroller
to output 5V which is used to bias transistor Q1 which energizes the relay RLY1. The
relay connects the 12V from the battery to the rest of the circuit

The astablemultivibrator formed by IC5 to generate a pulsing output signal. The signal
biases transistor Q2 which switches the supply to the high frequency transformer T2.
T2 steps the voltage from 12V to 2KV which mounted to the transformer casing.
Diode D7 is used to offer a smooth way for the induced EMF across the transformer
when the transistor is switched off.

Also the microcontroller outputs high outputs at the PORTB this forward biases the
led to indicate the status of the circuit and forward biases IC 4 to activate the phone to
call.

When the correct password is entered the microcontroller disenables the high voltage
generator. The keyboard will have extra keys which will be used to enable password
change and view the password used for the last two used passwords.

35
CHAPTER 4: RESULTS AND CONCLUSION

4.0 INTRODUCTION
This chapter comprise of the final results attained after all the sub circuits are
interconnected. Also the circuit will highlight conclusions make after fabrication of the
circuit and give recommendation which can be made to improve the project.

4.1TEST RESULTS
Table 5.1 test results

No Test point Expected Measure


.
1 Transformer output (Tp1) 12Vac
2 Rectifier output (Tp2) 12Vdc
3 Regulator output (Tp3) 5Vdc
4 Voltage detector with mains on (Tp4) 0Vdc
5 Voltage detector with mains off(Tp5) 5Vdc
6 Infrared output without intruder (Tp6) 0Vdc
7 Infrared output with intruder(Tp7) 5Vdc
8 Microcontroller output (Tp8) 5Vdc
9 Relay output (Tp9) 12Vdc
10 Voltage multiplier output (Tp10) 2KV

4.2 CONCLUSION
When the mains failed the op-amp output was 4.44Vdc instead of 5V still the output
worked ok since it was supposed to represent a high to the microcontroller. When the
infrared detector was blocked the output across its terminals was 4.93Vdc which
represented a high input. When the mains failed and the infrared detector was

36
blocked the relay output was 13.07Vdc which powered the high voltage generator.
The high voltage from the voltage multiplier was tested using a phase tester. The
phase tester indicated power without touching the metal cap. When the system
detected the mains had failed it activated the phone connected to the system to dial
the predetermined number. This concluded the project operated as expected and can
be employed to monitor and protect transformers from vandalism.

4.3 RECOMMENDATIONS
To generate a more powerful output the voltage multiplier can be replaced with one
which has higher output rating. The system can be improved by ensuring the
predetermined numbers are more than one. For more reliable method of alert and
record keeping the microcontroller program can be improved to enable the phone dial
and send an SMS. The SMS can be more reliable since even if the receiving phones
are engaged the message can be received later.

37
4.4 REFERENCES
Books

S.K. Bhattacharya, 2006. Electrical machines 2nd edition.

William Stallings. 2006. Computer organization& architecture 7th edition.

John Uffenbeck. 2006. Design, Programming and Interfacing 1st edition.

Dr. A.K. Gupta & Dr. L.P. Singh. 2005. Industrial electronics 1st edition.

38
B.L. Theraja& A.K. Theraja. 2002. Electrical Technology 3rd edition page 1651-1718.

Edward Hughes. 1995. Electrical Technology 7th edition.

Tom Duncan. 1992. Success in Electronics 1st edition.

Millman, J. 1987. Microelectronics 2nd ed. McGraw-Hill Inc.

39

You might also like