Documente Academic
Documente Profesional
Documente Cultură
METHODOLOGY ADOPTED
(System Description and Hardware Implementation)
Fig: Block diagram of an Automatic Power Factor Controller Using PIC Microcontroller.
System Description and function
The circuit is been supplied from 230V ac by a potential transformer (PT) connected in parallel
to the line, who steps down the voltage to 12V ac. The voltage is fed to a bridge rectifier for
rectification, to the capacitor for filtration and then the voltage regulator to give a constant
voltage (5V) at the output suitable for both the microcontroller, LCD and the LED indicator.
Part of the rectified voltage is connected to a voltage regulator to provide 12V dc to supply the
zero-crossing detectors both voltage (V) and current (I), as well as the relay drivers with her
relays respectively. Both the unregulated 12Vdc after the rectifier circuit and the regulated 5Vdc
are been fed as inputs to the zero-crossing detector (voltage) circuit for pulse production. The
current transformer (CT) connected in series on the line, senses the current in the line which is
then rectified by a bridge rectifier and fed to the input of the zero crossing detector (I) circuit for
the generation of current pulses.
The microcontroller is coded in mikro C pro for PIC, it reads and interprets the pulses from the
zero crossing detector circuits, then fined a phase difference between. The phase difference
between those two pulses result to either a leading or lagging power factor. The microcontroller
issue a pulse to the relay driver to turn on the corresponding relays connected to capacitors, only
when the power factor is lagging (PF<unity) due to inductive loads. Then it releases the pulse
when there is a leading power factor (PF ~= unity).
The power factor is then corrected by inducing shunt capacitors in parallel with the inductive
loads such as induction motors.
The LCD display outputs the current power factor from the microcontroller.
Fig: Complete circuit diagram of automatic power factor correction.
Hardware Implementation
It involves the details of the set of design specifications. The hardware design consists of, the
selection of system components as per the requirement, the details of subsystems that are
required for the complete implementation of the system has been carried out. It involves the
component selection, component description and hardware details of the system design.
1. POWER SUPPLY
2. PIC16F877A MICROCONTROLLER
5. RELAY
6. LCD DISPLAY (Liquid crystal display)
7. CAPACITOR BANKS
1. Transformer:
A diode bridge is a device that changes Alternating Current (AC) to Direct Current (DC). A
diode bridge is an arrangement of four (or more) diodes in a bridge configuration that provides
the same polarity of output for either polarity of input. When used in its most common
application, for conversion of an alternating current (AC) input into direct current a (DC) output,
it is known as a bridge rectifier.
Fig: A bridge rectifier
Positive Voltage Regulators - IC1 7805 AND IC1 7812.
Positive voltage regulators are electrical regulators designed to automatically maintain a constant
positive voltage level at the output regardless of changes in load currents with considering the
change of voltage in it input.
PIC MICROCONTROLLER.
The PIC microcontroller PIC16f877a is one of the most renowned microcontrollers in the
industry. This controller is very convenient to use, the coding or programming of this controller
is also easier. One of the main advantages is that it can be write-erase as many times as possible
because it use FLASH memory technology. It has a total number of 40 pins and there are 33 pins
for input and output. PIC16F877A is used in many pic microcontroller projects.
Fig: PIC16F877A microcontroller
PIC16f877a finds its applications in a huge number of devices. It is used in remote sensors,
security and safety devices, home automation and in many industrial instruments. An EEPROM
is also featured in it which makes it possible to store some of the information permanently like
transmitter codes and receiver frequencies and some other related data. The cost of this controller
is low and its handling is also easy. Its flexible and can be used in areas where microcontrollers
have never been used before as in coprocessor applications and timer functions etc.
Features
Operating frequency DC 20MHz
Resets (and delays) POR , BOR (PWRT , OST)
Flash program Memory (14-bit word) 8K
Data Memory (bytes) 368
EEPROM Data Memory (bytes) 256
Interrupts 15
I/O ports Port A,B,C,D,E
Timers 3
Capture/Compare/PWM modules 2
Serial Communications MSSP,USART
Parallel communications PSP
10-bit Analog-to-Digital Module 8 input channels
Analog comparators 2
Instruction Set 35 Instructions
Packages 40-pin PDIP
The LM 358N has dual OPAMs. With few components around it, form a zero crossing detector
circuit for current and voltage respectively.
Fig: Operational amplifier
Zero Crossing Detector
The zero crossing detector is a sine-wave to square-wave converter. The reference voltage in this
case is set to zero. The output voltage waveform shows when and in what direction an input
signal crosses zero volt. If input voltage is a low frequency signal, then output voltage will be
less quick to switch from one saturation point to another. And if there is noise in between the two
input nodes, the output may fluctuate between positive and negative saturation voltage Vsat.
RELAY
Alphanumeric displays are used in a wide range of applications, including palmtop computers,
word processors, photocopiers, point of sale terminals, medical instruments, cellular phones, etc.
The 16 x 4 intelligent alphanumeric dot matrix display is capable of displaying 448 different
characters and symbols. It requires a single power supply (+5V).The LCD used in this project is
been configure in 4 bits mode.
Fig: LCD configured in 4 bit mode.
Pin descriptions
Pins Functions
VSS Ground
VDD Power supply
VEE Contrast adjust
RS Register select signal
R/W Read/write input
E Enable input
D1-D7 Data inputs
Capacitor Banks
MikroC is a powerful, feature rich development tool for PIC controllers. It is designed to provide
the user with the easiest possible solution for developing application for embedded systems,
without compromising performance or control. MikroC provides a successful match featuring
highly advanced Integrated Development Environment, American National standards institute
compliant compiler, broad set of hard libraries, comprehensive documentation, and plenty of
ready-to-run examples.
MikroC allows quickly develop and deploy complex applications. For programming PIC with
mikroC C code is first written using the highly advanced Code Editor, the include mikroC
libraries are used to speed up the development: data acquisition, memory, display and
conversions function. Functions are used to monitor program structure, variables, and functions
in the Code Explorer. MikroC generates commented, human-readable assembly, and standard
HEX compatible with all programmers. The program is finely inspected with flow and debugs
executable logic with the integrated Debugger.
ALGORITHM
Algorithm for determining the different parameters: