0% found this document useful (0 votes)
73 views35 pages

Good One Project

This document describes a semester project to design an automatic voltage regulator to mitigate voltage fluctuations. The project aims to maintain the output voltage within 4% of 220V to protect electrical appliances from damage. The key components of the design include a PIC16F877A microcontroller, transformers, capacitors, diodes, and electronic relays. The microcontroller senses the voltage level and controls the multi-tap transformer through relays to regulate the output voltage within the specified range. This voltage stabilizer is expected to save costs by preventing damage to electrical equipment from voltage fluctuations.

Uploaded by

Mintesnot Alemu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
73 views35 pages

Good One Project

This document describes a semester project to design an automatic voltage regulator to mitigate voltage fluctuations. The project aims to maintain the output voltage within 4% of 220V to protect electrical appliances from damage. The key components of the design include a PIC16F877A microcontroller, transformers, capacitors, diodes, and electronic relays. The microcontroller senses the voltage level and controls the multi-tap transformer through relays to regulate the output voltage within the specified range. This voltage stabilizer is expected to save costs by preventing damage to electrical equipment from voltage fluctuations.

Uploaded by

Mintesnot Alemu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 35

ADDIS ABABA UNIVERSITY

ADDIS ABABA INSTITUTE OF TECHNOLOGY

SCHOOL OF ELECTRICAL AND COMPUTER ENGINEERING

POWER STREAM

SEMESTER PROJECT

Project Title: Voltage Fluctuation Mitigation by Automatic voltage


regulator

Acknowledgment
Whenwe are going to do this project our advisor Amare Assefa help us starting from
selection of title to the completion of this semester project. So we would like to thanks for
sacrificing his time and help us in order to correct our mistakes. And thenwe would like to thank
school of Electrical and Computer Engineering to do this kind of project, in order to develop our
ability of problem solving. Finally we would like to thank all people who help us to finish our
semester project.
Abstract
A voltage regulator is a device which is used to sense inappropriate voltage levels and
correct them to produce a reasonably stable output where the load is connected. Here we will
study the design of a simple automatic AC voltage stabilizer which can be used for the
above purpose. In this circuit, active and passive devices, such as diodes, transformer,
resistor, capacitor, relay, IC etc. have been used. One step down transformer and one multi
tap transformer have also been used in this work. The relay contacts are appropriately integrated
to the transformer taps for executing the above actions as per the commands

This project is all about mitigation of voltage fluctuation by designing an AC automatic


voltage regulator. That is, it helps to protect all electrical appliances from damage.The AVR
operates as a voltage stabilizer and controller because the output voltage is controlled and
regulated through a power electronic system. Basically the purpose of this project is to maintain
a voltage that fluctuates randomly from time to time at a specified limit. In our case the value of
the output voltage should be 4% deviation from the standard value of 220v. That is the value of
the output voltage should be in between 211 and 229 V.

The basic building blocks for this design are PIC16F877A microcontroller, electronic
relays, transformers, capacitors, and diodes. Finally at the end of this project,there may not be
any damaging of electrical equipment, this implies saving of costs of electrical materials.

2|Page
Table of Contents
Acknowledgment ...................................................................................................................................... 1
Abstract ......................................................................................................................................................... 2
Chapter One .................................................................................................................................................. 5
Introduction .................................................................................................................................................. 5
1.1 motivation ........................................................................................................................................... 6
Chapter two .................................................................................................................................................. 7
Theoretical background and review of literature ......................................................................................... 7
2.1 Review of literature ............................................................................................................................ 7
2.2 Theoretical Background ...................................................................................................................... 8
2.3 objectives .......................................................................................................................................... 10
2.3.1 General objectives ..................................................................................................................... 10
2.3.2 Specific objectives ...................................................................................................................... 10
Chapter Three ............................................................................................................................................. 11
Methodology............................................................................................................................................... 11
3.1 Block diagram representation of the whole system ............................................................................. 11
3.2 Flow chart for microcontroller operation ......................................................................................... 12
Chapter four ................................................................................................................................................ 14
Design and simulation................................................................................................................................. 14
4.1 design specifications ......................................................................................................................... 14
4.2 Transformer ratio calculations .......................................................................................................... 16
4.3 Description of the system components ............................................................................................ 17
4.3.1 Ac input voltage ......................................................................................................................... 17
4.3.2 Protection from undesired input signal ..................................................................................... 17
4.3.3 Step down transformer .............................................................................................................. 18
4.3.4 AC to DC converter (Rectifier) .................................................................................................... 19
4.3.5 DC input ..................................................................................................................................... 19
4.3.6 Microcontroller .......................................................................................................................... 20
4.3.7 Multi tap transformer ................................................................................................................ 21
4.3.8 Electronic relays/ switches......................................................................................................... 22
4.3.9 Desired regulated voltage .......................................................................................................... 23

3|Page
4.3.10 Light Emitting Diodes ............................................................................................................... 23
4.3.11 Capacitors ................................................................................................................................ 24
4.4 mikroC Coding ................................................................................................................................... 24
4.4.1 PIC16F877A pin description ....................................................................................................... 25
4.5 PROTEUS Simulation ......................................................................................................................... 26
Chapter Five ................................................................................................................................................ 28
Conclusion ................................................................................................................................................... 28
Chapter six .................................................................................................................................................. 29
Results and Recommendations................................................................................................................... 29
6.1 Results ................................................................................................................................................... 29
6.2 Recommendation.............................................................................................................................. 30
References .................................................................................................................................................. 31
Appendix ..................................................................................................................................................... 32

4|Page
Chapter One

Introduction
A voltage regulator is a device which is used to sense inappropriate voltage levels and
correct them to produce a reasonably stable output at the output where the load is connected.
Which is fabricated using transistor and other discrete components. It can be used to protect
loads such as TV, Refrigerator and other home appliances from undesirable over and under
line voltages, as well as surges caused due to sudden failure/resumption of mains power
supply. This circuit can be directly as standalone circuit between the main supply and the
load, or it may be inserted between an existing automatic/manual stabilizer and the load.

Currently systems available locally lack precision and suffer the problem of oscillating
between two output voltage and hence creating surge at the output which can damage
valuable electronics. That requires the maintenance of stable voltage and rapid reaction
against the sudden change of input voltage and load. This project defines the
shortcomings and introduces a new system in the tolerable and substantial stable of 220V
with 4% output accuracy for any deviation of input supply voltage within 150V-290V. To
control the whole system automatically a microcontroller is used with some protection devices
where to detect fault and the circuit implementation in this system are simple and flexible
than conventional analog control circuitry. A simulation for both circuit and program has been
accomplished for establishing better performance.

5|Page
1.1 motivation
There is a serious problem of fluctuation of voltage at the utility level. This fluctuation
causes big problem at the consumer side, such as damaging of electrical devices. This implies
that customers need to buy new electrical devices. Therefore, to solve this problem we need to
design an automatic voltage regulator that maintains the output voltage at a reasonable value.
Therefore, this project is highly valuable for countries like Ethiopia. Because the voltage from
the utility side fluctuates randomly.

6|Page
Chapter two

Theoretical background and review of literature


2.1 Review of literature

In our country Ethiopia voltage fluctuation is a very serious issue. Especially if you go to
rural part of the country(regions), you will see how voltage fluctuation disturbs the customers.
By different months of the year there is different load values, this is due to weather conditions,
increased number of customers, faults and other unknown problems.The electrical equipment’s
become damaged easily by this issue. So to solve this issue we are going to design an automatic
voltage regulator. This device will be used by each customer as house hold appliance.

We hope that at end of hardware implementation this project will solve that critical issue of
random voltage fluctuations. And then it will preserve all electrical appliance in their home.
Saving of this expensive electrical appliances implies that saving of their higher value of cost.
This makes the utility customers more economical.

7|Page
2.2 Theoretical Background
Automatic voltage regulators are used to maintain load voltages within specified
tolerance ranges. With the widespread use of electronic devices, electrical power issues such as
sags, harmonics and outages have become increasingly important. Of these issues, power outages
and under voltages have the greatest potential to disrupt the operation of sensitive electronic
equipment. For example, frequent power outages can result in a latent failure of computer
components such as hard-drives which can cause the outright failure of the entire computer
system. Thus, during outage periods, critical equipment’s are usually powered using power
generating sets or battery-powered inverters, which are preferred because they operate
noiselessly and do not pollute the environment.

The automatic voltage regulator or AVR, as the name implies, is a device intended to
regulate voltage automatically: that is to take a varying voltage level and turn it into a constant
voltage level. Automatic voltage regulators are widely used in electrical power field to obtain the
stability and good regulation of the electric system. In typical AVRs, switching is done by
electromagnetic relays, or servomotor, or electronic device, which automatically selected taps in
the transformer to get the required voltage to boost (add) or buck (subtract) the input voltage. In
this project, it is aimed to implement PIC microcontroller based relay switching automatic
voltage regulator.

It is common in developing countries, such as Ethiopia, for the mains voltage to deviate
significantly from the specified standard range. Such deviations are usually corrected with
electronic equipment known as Automatic voltage regulators (AVRs). AVRs maintain their
output voltage within a narrow range over a much larger range of input mains voltage. Automatic
voltage regulators can be used to solve problems of power outages, under voltage and
overvoltage.

In this work, a microcontroller based circuit that performs the functions of an automatic
voltage regulator was developed. When the utility supply is restored, the circuit compensates for
deviations in the utility voltage levels from the standard 211-229V range. It achieved this by
changing the taps of a multi-tap transformer in response to changes in the input mains voltage.
When the input voltage exceeds 290 volts, the circuit simply isolates the load from the utility
supply to prevent damaging the load.

8|Page
Similarly when the input voltage is below 150 V, it interrupts the signal and closes before
it reaches to the electrical devices. That is, it saves the life of the equipment’s from damage.

AVR mainly functions to measure and regulate the input voltage for producing the stable
output and to provide the Protection against sag, surge, spike, impulse, notch, brown out, over
voltage, under voltage, over current and hysteresis to the sophisticated equipment and
machineries. In this system, the whole operations are implemented by a microcontroller.
Microcontroller here performs all actions in accordance with the program maintaining proper
precision and hysteresis as we desire and the undesired input transitions are handled by the AC
protection devices.

9|Page
2.3 objectives
2.3.1 Generalobjectives
The general objectives of this project are

 To keep a certain voltage at constant level


 Reducing electrical devices damage
 Minimizing cost

2.3.2 Specific objectives


The specific objectives of this project are

 To use this device at the load level


 To get very accurate output voltage
 To tolerate system faults and overload
 To get better line voltage
 To avoid under voltage and over voltage

10 | P a g e
Chapter Three

Methodology

3.1 Block diagram representation of the whole system


The methods we use when we are going to design an AC automatic voltage regulator
include assembling all the necessary electrical components. Like resistors, capacitors, inductors,
transistors, diodes, microcontrollers, etc. We have also simulated this system by using Proteus
software, and at the end of this simulation we will also develop hardware parts. The general
block diagram of the system we are going to design is as shown in figure3.1.

Step down
transformer Ac low AC to DC Dc Microcontroller
voltage converter input

Protection Multi taped Regulated


Ac Input ac Secondary
from Switches ac voltage
input to multi tap to
undesired Transformer
primary switch
inputs

Figure 3.1: Block diagram representation of the whole system

11 | P a g e
3.2 Flow chart for microcontroller operation
The principle of operation of the microcontroller is first if the input voltage is below and
above the given values it makes the whole system switch off in order to save the equipment. That
is in our case when the input value is below 2.59 and above 5.0 V. But when the values of the
input DC values to the microcontroller from the rectifier circuit are between 2.59 and 5.0 V it
will operate as per the given instruction. The flow chart for the microcontroller operation is as
shown on the figure below.

Figure 3.2: mikroC code flow chart representation an automatic voltage regulator system

12 | P a g e
Start

Measure voltage
level

Yes
input<2.59? NOP
o
No
Yes
2.59<=input<2.93? B0
No o
Yes
2.93<=input<3.27? B1
o
No
Yes
3.27<=input<3.62? B2
o
No
Yes
3.62<=input<3.96? B3
o
No

Yes
3.96<=input<4.31? B4
o
No

Yes
4.31<=input<4.66? B5
o
No
Yes
4.66<=input<=5? B6
o
No

Yes
Input>5? NOP
o

13 | P a g e
Chapter four

Design and simulation


4.1 design specifications
For this automatic voltage regulator, the parameters were decided initially:
Output voltage must lie between 211V and 229V for all input voltages between150 and 290 V.
Generally for our design
 Input voltage range must be 150V to 290V, preferably wider.
 Output frequency and waveform should be unchanged from the input frequency and
waveform.
 The voltage regulator must be inexpensive.
 Input and output frequency are the same
 High cut feature at 290V
 Low cut feature at 150V
 Input voltage is displayed (to the nearest voltage, ±1V) on a Voltmeter display
 8 relays are used
 The multi tap transformer tapings are 150V, 170V, 190V, 210V, 230V, 250V, 270V and
290V (notice that the tapping voltage ratings are in 20V increments)

The input AC voltage is first rectified to DC using a bridge rectifier. This is then filtered
with a relatively large high voltage capacitor to reduce/minimize the DC voltage ripple to obtain
a constant smooth DC voltage for the microcontroller. That is the input ac voltage is stepped
down to a low-voltage AC level, this value of voltage is then rectified by a bridge rectifier to get
appropriate value for the microcontroller (that is within bounds acceptable by the
microcontroller). This value of voltage is loaded to the memory of the microcontroller in order to
take an action.

14 | P a g e
While this is all good and well, there are two things here that could potentially disrupt
proper operation of the circuit: the input filter capacitance and the input impedance for the PIC
ADC (the voltage divider circuit). If too large an input filter capacitance is selected, it will
discharge slower and give poorer response to quick voltage drops. Thus, a value of the
capacitance should be used such that the voltage ripple is low but the response to quick voltage
drops does not suffer too much.

As the designing commitment which is to stabilize automatically a large range (150V-


290V) variation of input voltage at a normal prescribed level output voltage with a great
precision. For this the voltage regulation of input supply is designed which is regulated
automatically in such a way that when the input voltage varies, the output voltage will remain
stable at a constant value. To achieve this, a microcontroller has been programmed in such
a way that when the dc input to microcontroller varies in accordance with the variation of input
voltage, microcontroller will operate the suitable switch to get a regulated output from desired
transformer tap. Firstly, the microcontroller compares a converted variable DC voltage which is
found by stepped down the ac supply voltage with the range and is set to the memory of the
microcontroller.

For the input voltage between 150 v and 290 v, the microcontroller is programmed to set
the output to a desired value. Since the microcontroller needs a maximum of 5v dc. So we need
to step down the ac value to get 5 v. This value is changed to a 5v dc by a bridge circuit and used
by the microcontroller. But in our case we have a set of values of a dc value to the
microcontroller.

15 | P a g e
4.2 Transformer ratio calculations
In order to determine the turn ratio of a step down transformer. That is

Let Np: turn of primary

Ns: turn of secondary

Turn ratio can be calculated as follows.

Np/NS= Vp/Vs, but Vp=290V and VS= 5 v

Implies that Np/Ns= 290/5= 58;

Then let us use voltage values by a difference of 20.The turn ratios are as follows for different
values of input

150/58 = 2.59

170/58= 2.93

190/58 = 3.27

210/58= 3.62

230/58= 3.96

250/58 = 4.31

270/58= 4.66

290/58 = 5

Similarly for the multi tapped transformer selection value, we have to use also different
tapped ratios. That is it depends on the input ac value. We assume that the desired output value
should be in between 211_ 229 V. so to get this values we use a tapped ratio of the multi tapped
transformers. That is we have to design the tap transformer according to these ratios. I.e. the ratio
between the primary winding and the taps on the secondary side.

16 | P a g e
For output values between 211 _ 229 V, we use

(211 + 229)/ (150 + 170)=1.38

(211 + 229)/(170 + 190)=1.22

(211 + 229)/(210+ 190)= 1.1

(211 + 229)/(210+ 230) = 1

(211 + 229)/(230 + 250)= 0.92

(211 + 229)/(250+ 270)= 0.85

(211 + 229)/(270+290)= 0.78

Therefore the microcontroller program switches on one of the taps with the appropriate values.

4.3 Description of the system components


4.3.1 Ac input voltage
An AC input is a voltage signal given by the utility of the country. But most of the time it
is varied randomly from time to time due to different factors. Among the causes of fluctuation
weather, increased number of customers are few of them.

Figure 4.1: an Ac input signal

4.3.2 Protection from undesired input signal


Since the input voltage may be higher for a very short time, in milliseconds. This is called
transient. And also there are other related faults, such as surges, overvoltage, under voltage,
spike etc. so to avoid this we need to use an AC automatic circuit breaker before reach to the
transformers of the device that we are going to design.

17 | P a g e
4.3.3 Step down transformer
A transformer designed to reduce voltage from primary to secondary is called a step-
down transformer. The transformation ratio of a transformer will be equal to the square root of
its primary to secondary inductance (L) ratio.

𝐿 𝑠𝑒𝑜𝑛𝑑𝑎𝑟𝑦
Voltage transformation ratio = √______________= Ns/Np
𝐿 𝑝𝑟𝑖𝑚𝑎𝑟𝑦

Figure 4.2: step down transformer

A step down transformer: is one whose secondary voltage is less than its primary voltage.
It is designed to reduce the voltage from the primary winding to the secondary winding. This
kind of transformer “steps down” the voltage applied to it.As a step-down unit, the transformer
converts high-voltage, low-current power into low-voltage, high-current power. In our case we
need to change the input voltage to a lower one. That is used for an input for a microcontroller by
converting to DC value.

18 | P a g e
4.3.4 AC to DC converter (Rectifier)
A rectifier is an electrical device that convertsalternating current (AC), which
periodically reverses direction, to direct current (DC), which flows in only one direction. The
process is known as rectification. But on this design we are using a bridge rectifier, consists of
four diodes, and also at the output terminal we also connect a capacitor to reduce undesired the
harmonics.

Figure 4.3: Bridge rectifier circuit

The four diodes labelled D3, D4, D5and D8 are arranged in “series pairs” with only two
diodes conducting current during each half cycle. During the positive half cycle of the supply,
diodes D3 and D4 conduct in series while diodes D5 and D8 are reverse biased and the current
flows through the load. During the negative half cycle of the supply, diodes D5 and D8 conduct in
series, but diodes D3 and D4 switch “OFF” as they are now reverse biased. The current flowing
through the load is the same direction.

4.3.5 DC input
Dc input is supplied by the rectifier circuit. This is used for an input to the
microcontroller. Then by using this values the microcontroller takes an action to switch ON or to
switch OFF the relays that are connected on its terminals.

19 | P a g e
4.3.6 Microcontroller

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


processor core, memory, and programmableinput/output peripherals. Program memory in the
form of Ferroelectric RAM, 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.

Microcontrollers are used in automatically controlled products and devices. 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. Some microcontrollers may use four-bit words and operate at clock rate
frequencies as low as 4 kHz, for low power consumption (single-digit Milliwatts or microwatts).

The microcontroller we have used in our design is PIC16F877A and operates at 8 kHz.
And programmed by using mikroC language.Microcontrollers were originally programmed only
in assembly language, but various high-level programming languages are now also in common
use to target microcontrollers. These languages are either designed especially for the purpose, or
versions of general purpose languages such as the C programming language. Compilers for
general purpose languages will typically have some restrictions as well as enhancements to better
support the unique characteristics of microcontrollers. Some microcontrollers have environments
to aid developing certain types of applications.

4.3.6.1Microcontroller PIC 16F877A


The automatic voltage regulator is controlled by a PIC 16F877A microcontroller. The
voltage conversion and control are done by using one multi tap transformer along with eight
relays (all control signals are obviously generated by the microcontroller). The microcontroller
senses the input voltage and turns the relays on/off as required to provide an output voltage
between 211V and 229V for all input voltages between 150V and 290V.

20 | P a g e
Figure 4.4: PIC16F877A microcontroller

4.3.7 Multi tap transformer


A Multi Tap Transformer is a step up or down transformer that has multiple taps on either
the primary winding or the secondary winding. A Multi Tap Transformer provides flexibility in
your input and output voltage requirements.

Figure 4.5: Three Tap transformer

Multi Tap Transformers are used in heating element applications. The resistance of the
heating elements increases with age which results in reduced current through the heating
element. To restore the heating element current back to its original value, the voltage applied to

21 | P a g e
the heating element must be increased. Multi tap transformer connections provide the additional
taps to compensate for the change.

Multi tap transformers are also used in compensating for the variation of input power
voltages to a customer facility. Input power to the equipment changes due to the load conditions
as well as the proximity of the utility power to the customer facility and many other causes. This
results in a mismatched input voltage to a customer facility. The multi tap transformer wiring
configurations would be able to provide necessary taps to compensate for the variation of input
voltages.

4.3.8 Electronic relays/ switches


A relay is an electrical switch that opens and closes under the control of another electrical
circuit. It is therefore connected to output pins of the microcontroller and used to turn on/off
high-power devices such as motors, transformers, heaters, bulbs, etc. These devices are almost
always placed away from the board’s sensitive components. There are various types of relays,
but all of them operate in the same way. When current flows through the coil, the relay is
operated by an electromagnet to open or close one or more sets of contacts. Relays usually
demand both higher voltage and higher current to start operation, but there are also miniature
ones that can be activated by low current directly obtained from a microcontroller pin.

A relayis a switch that’s controlled by a small electric current. Relays take advantage of the
fact that when you pass an electric current through a wire, a magnetic field is generated
surrounding the wire as well. This is called induction. When you place two pieces of ferrous
metal near a coil of wire and pass current through the wire, the magnetic field can move the two
pieces of metal towards each other. Those pieces of metal can form a switch, which can be
turned on and off by putting current through the coil.

22 | P a g e
Figure 4.6: symbolic diagram electronic relays

These relays work in conjunction with the multi tap transformer to step up or down the
input voltage to provide the required output. One relay opens at a time. No two relays open at
one time. That is one relay opens at one time with in a given range.

4.3.9 Desired regulated voltage


This value of voltage is the final output of the automatic voltage regulator. It is used as an
input value for electrical equipment’s that we use in our day to day life.

4.3.10 Light Emitting Diodes


LEDs are very commonly used as indicators on embedded systems. When bringing up a
new design, getting the LED to flash is usually the first step in checking out the hardware. LEDs
are diodes. Diodes conduct current when they are forward biased. LEDs give off light when a
current flows through them. The amount of light given off, or its brightness, will be proportional
to the current. The more current that is allowed to flow, the brighter it will get. This will continue
until you get one bright flash, after which it no longer emits light, or acts as a diode for that
matter.

23 | P a g e
Figure 4.7: LED symbolic diagram

4.3.11 Capacitors
Capacitors connected across bridge rectifier circuits are simply for filtering purpose. That
is to get pure dc voltage, free from harmonics.it converts the full-wave rippled output of the
rectifier into a smooth DC output voltage.

4.4 mikroCCoding
The code we have already used is mikroC programming for PIC. This is simply changed
to assembly language automatically when we run the written code,and then loaded to the
microcontroller. This code is applicable for commanding the microcontroller to take an action
appropriately. If we do not program by using mikroC, the microcontroller will never take any
action.

24 | P a g e
4.4.1 PIC16F877A pin description

Figure 4.8: PIC16F877A microcontroller

4.4.1.1 Memory

Memory of the PIC16F877 divided into 3 types of memories:

 Program Memory - A memory that contains the program(which we had written), after
we've burned it. As a reminder, Program Counter executes commands stored in the
program memory, one after the other.
 Data Memory – This is RAM memory type, which contains a special registers like SFR
(Special Faction Register) and GPR (General Purpose Register). The variables that we
store in the Data Memory during the program are deleted after we turn of the micro.

These two memories have separated data buses, which makes the access to each one of
them very easy.

25 | P a g e
 Data EEPROM (Electrically Erasable Programmable Read-Only Memory) - A memory
that allows storing the variables as a result of burning the written program.

Each one of them has a different role. Program Memory and Data Memory two memories
that are needed to build a program, and Data EEPROM is used to save data after the
microcontroller is turn off.

4.4.1.2 Ports

A port is the microcontrollers’ interface into the real world. All the data manipulation and
operations that are done within the microcontroller ultimately manifests as output signals through
the ports.Physically, ports are some of the pins that are seen in the IC package. There are 5 ports
for PIC 16f877a. They are named as PORTA, PORTB, PORTC, PORTD and PORTE. Ports B,
C and D are 8 bit wide (8 pins each), while PORTA is 5bitand PORTE is 3 bit wide.

4.5 PROTEUS Simulation


The following figure, figure 4.2 shows what the overall Proteus simulations seems. As we
know Proteus isone of the frequently used software to implement electrical engineering project’s
simulations.

The principle of operation of this simulations is, first we have to give an input supply ac
source. Then for the microcontroller, it must be reduced to moderately low voltage and rectified
to appropriate DC value. After it is changed to dc value, it is used by the microcontroller to
control the switching ON and OFF of the relays.

On the other hand the input voltage also be given to the multi tap transformer. Then this
transformer steps up or steps down depending on the instruction of the microcontroller. Finally
the output of this transformer voltage will be the desired voltage and used by the electrical
equipment’s at house hold or in any low voltage level at the load.

26 | P a g e
Figure 4.9: The overall representation an automatic voltage regulator simulation

27 | P a g e
Chapter Five

Conclusion
The function of the Automatic Voltage Regulator (AVR) is to maintain constant voltage and
power line conditioning to the equipment load under a wide variety of conditions, even when the
utility input voltage or load vary widely. Therefore, by using a microcontroller we can get an
output voltage within a reasonable range.

As we know voltage fluctuation is a very serious issue that is why we are going to design an
automatic voltage regulator. And this device will solve voltage flicker also, it helps longer life
for their electrical equipment’s including their house hold lamp.

When we are going to do this project we have selected PIC microcontroller which is
programmed by mikroC language. And also for practical simulation purpose we have also used
Proteus ISIS library. This microcontroller need a DC value of voltage not more than 5 V. so to
get this voltage we need to step down the incoming ac voltage to the appropriate value. That is
nearly five volt. And also this value of voltage is not directly given to the microcontroller,
because of its AC nature. So it must be changed to equivalent DC value by using bridge rectifier.
Therefore, this value of voltage is given to the microcontroller.

We have used eight electronic relays for switching purpose. That is one relay opens at a time.
No two relays will open at one time. These relays perform their action as per the instruction
gained from the microcontroller.

The appropriate tap number of the tapping transformer is selected by this electronic relays.
So in our case we have eight voltage intervals, so we need eight relays to open or close the multi
tap transformer tapping.

The voltmeters are used to measure both the input and output voltages. That is used for
measuring the incoming (varying) and the final desired voltage.

Generally this system plays a vital role in avoiding voltage fluctuations. So at the end of the
project everyone can buy with in a low price and use as a house appliance to save the costs
associated with equipment damage.

28 | P a g e
Chapter six

Results and Recommendations

6.1 Results
The main purpose of this project is getting a reasonable output voltage for all electrical
appliances at the load level. Therefore, to do this we have to know the input voltage. Here for
some typical AC input voltage supply, the regulated output approximate to be on desired level.
From this, it is clearly revealed that this automatic voltage regulator is able to regulate any
variation of input voltage of a system within 150V-290V at a stable range of 211V-229V
and also to defend the system from damage due to extreme decrease and increase in AC supply
voltage which is out of the range of 150V-290V.

Figure 6.1 output voltage value for input value of 290v.

Therefore by varying the input values in between the specified range we can get a desired
output value.

29 | P a g e
6.2 Recommendation
When we do this semester project, we have faced different problems. Among those
problems the university educational schedule is one of them. That is after final exam they are not
voluntary to give us enough time to prepare our documentation and simulation. This makes
ourselves not to do what we want.

The next thing we would like to mention here is that, when we were doing our simulation
by using Proteus professional software the appropriate components are not found there. For
example there is no multi tap transformer in the Proteus library. This makes to select a wide
voltage interval for the ac input. This makes our activity challengeable.

30 | P a g e
References
1. Electrical Technology by B.L Theraja Volume II
2. Elements of power system analysis ; Stevenson fourth edition
3. www.Google.com// implementation of automatic voltage regulator
4. C programming language; By Tony Crawford, Peter Prinz
5. Problem solving and programming concept; by Maureen Sprankle& Jim Habbard

31 | P a g e
Appendix
The mikroC code for microcontroller of an Automatic voltage regulator design seems as
follows.

Source code

#define A PORTB.F0

#define B PORTB.F1

#define C PORTB.F2

#define D PORTB.F3

#define ON 1

#define OFF

unsignedint ADC;

float v;

void main() {

TRISB.F0 = 0; //Makes RB0 an output pin

TRISB.F1 = 0;

TRISB.F2 = 0;

TRISB.F3 = 0;

TRISE1_bit = 1;

ADC_Init();

do

32 | P a g e
ADC = ADC_Get_Sample(6);

v =(ADC*5000.0)/1023.0;

v = v/1000.0;

if(v<2.1)

A= OFF;

B = OFF;

C = OFF;

D = OFF;

if(v>=2.1 && v<2.6)

A = ON; //Turns ON relay

B = OFF; //Turns OFF realy

C = OFF;

D = OFF;

if(v>=2.6 && v<3.1 )

A = OFF;

B = ON;

33 | P a g e
C = OFF;

D = OFF;

if(v>=3.1 && v<3.4)

A = OFF;

B = OFF;

C = ON;

D = OFF;

if(v>=3.4 && v <= 4.0)

A = OFF;

B = OFF;

C = OFF;

D = ON;

if(v>4.0)

PORTB.F0 = 0;

PORTB.F1 = 0;

34 | P a g e
TRISB.F2 = 0;

TRISB.F3 = 0;

Delay_ms(1000); //1000mS delay

}while(1);

35 | P a g e

You might also like