Академический Документы
Профессиональный Документы
Культура Документы
IN
____________________________________ENGINEERING
SUBMITTED BY
-------------------- (--------------)
--------------------- (---------------)
--------------------- (---------------)
1
CERTIFICATE
________________ ____________
(Head of the department, ECE) (Assistant
Professor)
EXTERNAL EXAMINER
2
ACKNOWLEDGEMENT
The satisfaction and euphoria that accompany the successful completion of any
task would be incomplete without the mentioning of the people whose constant
guidance and encouragement made it possible. We take pleasure in presenting
before you, our project, which is result of studied blend of both research and
knowledge.
Finally, we express our gratitude to all other members who are involved either
directly or indirectly for the completion of this project.
3
DECLARATION
We, the undersigned, declare that the project entitled FACTS BY TSR,
FLEXIBLE AC TRANSMISSION, being submitted in partial
fulfillment for the award of Bachelor of Engineering Degree in Electronics
and Communication Engineering, affiliated to _________ University, is the
work carried out by us.
4
CONTENTS PAGE NO.
1. ABSTRACT
3. BLOCK DIAGRAM 15
4. HARDWARE REQUIREMENTS
4.1 TRANSFORMERS 17
4.3 RECTIFIER
4.4 FILTER
4.6 RELAY
4.9 LCD
4.10 LM339
4.15 LED
5
4.16 1N4008 / 1N4148
4.17 RESISTOR
4.18 CAPACITOR
6. SCHEMATIC DIAGRAM 66
6.1 DESCRIPTION 67
7. LAYOUT DIAGRAM 71
8. BILL OF MATERIALS 72
9. CODING 75
9.1 COMPILER 76
11. RESULTS 69
12. CONCLUSION 93
13. BIBLIOGRAPHY 94
6
LIST OF FIGURES PAGE NO.
2(b) V DIAGRAM 19
REGULATOR
OF VOLTAGE REGULATOR 21
4.6(a) RELAY
4.6(c) ULN2003
4.8 LCD
7
1. ABSTRACT
This method is used either when charging the transmission line, or, when there is very low load
at the receiving end. Due to very low or no load a very low current flows through the
transmission line. Shunt capacitance in the transmission line causes voltage amplification
(Ferranti Effect). The receiving end voltage may become double the sending end voltage
(generally in case of very long transmission lines). To compensate, shunt inductors are connected
across the transmission line. The lead time between the zero voltage pulse and zero current pulse
duly generated by suitable operational amplifier circuits in comparator mode are fed to two
interrupt pins of the microcontroller where the program takes over to actuate appropriate number
of opto-isolators interfaced to back to back SCRs at its output for bringing shunt reactors into
the load circuit to get the voltage duly compensated. The microcontroller used in the project is of
The power supply consists of a step down transformer 230/12V, which steps down the voltage to
12V AC. This is converted to DC using a Bridge rectifier. The ripples are removed using a
capacitive filter and it is then regulated to +5V using a voltage regulator 7805 which is required
9
FIG: WAVEFORMS FOR CAPACITIVE LOAD
Whatever the power factor is, however, the generating authority must install machines
capable of delivering a particular voltage and current even though, in a particular case, not all the
voltage and current products is being put to good use. The generators must be able to withstand
the rated voltage and current regardless of the power delivered. For example, if an alternator is
rated to deliver 1000A at 11000 volts, the machine coils must be capable of carrying rated
current. The apparent power of such a machine is 11 M V A and if the load power factor is unit
this 11 MVA will be delivered and used as 11 MW of active power i.e. the alternator is being
used to the best of its ability. If, however, the load power factor is say, 0.8 lagging, then only 8.8
MW are taken and provide revenue, even though the generator still has to be rated at 1000A at 11
kV. The lower the power factor, the worse the situation becomes from the supply authorities
viewpoint. Accordingly, consumers are encouraged to improve their load power factor and in
many cases are penalized if they do not. Improving the power factor means reducing the angle of
lag between supply voltage and supply current.
10
Location of power-factor improvement capacitor banks:
Any installation including the following types of machinery or equipment is likely to have
low power factor which can be corrected, with a consequent saving in charges, by way of
reduced demand charges, lesser low power factor penalties:
1. Induction motors of all types (which from by far the greatest industrial load on a. c.
mains).
2. Power thyristor installation (for D.C. motor control and electro-chemical processes).
3. Power transformers and voltage regulators.
4. Welding machines
5. Electric-arc and induction furnaces.
6. Choke coils and magnetic system.
7. Neon signs and fluorescent lighting.
Apart from penalties like maximum demand charges, penalty for low power factor, the
factory cabling and supply equipment can be relieved of a considerable wattles or reactive load,
which will enable additional machinery to be connected to the supply without enlarging these
services. Additionally, the voltage drop in the system is reduced.
The method employed to achieve the improvements outlined involves introducing reactive
kVA (kvar) into the system in phase opposition to the wattles or reactive current mentioned
above the effectively cancels its effect in the system. This is achieved either with rotary machines
(synchronous condensers)
In an electric power system, a load with a low power factor draws more current than a
load with a high power factor for the same amount of useful power transferred. The higher
currents increase the energy lost in the distribution system, and require larger wires and other
equipment. Because of the costs of larger equipment and wasted energy, electrical utilities will
usually charge a higher cost to industrial or commercial customers where there is a low power
factor.
Linear loads with low power factor (such as induction motors) can be corrected with a
passive network of capacitors or inductors. Non-linear loads, such as rectifiers, distort the current
drawn from the system. In such cases, active or passive power factor correction may be used to
counteract the distortion and raise the power factor. The devices for correction of the power
factor may be at a central substation, spread out over a distribution system, or built into power-
consuming equipment.
In a purely resistive AC circuit, voltage and current waveforms are in step (or in phase),
changing polarity at the same instant in each cycle. All the power entering the loads is consumed.
Where reactive loads are present, such as with capacitors or inductors, energy storage in the
loads result in a time difference between the current and voltage waveforms. During each cycle
of the AC voltage, extra energy, in addition to any energy consumed in the load, is temporarily
12
stored in the load in electric or magnetic fields, and then returned to the power grid a fraction of
a second later in the cycle. The "ebb and flow" of this non productive power increases the current
in the line. Thus, a circuit with a low power factor will use higher currents to transfer a given
quantity of real power than a circuit with a high power factor. A linear load does not change the
shape of the waveform of the current, but may change the relative timing (phase) between
voltage and current.
Circuits containing purely resistive heating elements (filament lamps, strip heaters, cooking
stoves, etc.) have a power factor of 1.0. Circuits containing inductive or capacitive elements
(electric motors, solenoid valves, lamp ballasts, and others) often have a power factor below 1.0.
AC power flow has the three components: real power (also known as active power) (P),
measured in watts (W); apparent power (S), measured in volt-amperes (VA); and reactive power
(Q), measured in reactive volt-amperes
If is the phase angle between the current and voltage, then the power factor is equal to the cosine
of the angle, and:
Since the units are consistent, the power factor is by definition a dimensionless number
between 0 and 1. When power factor is equal to 0, the energy flow is entirely reactive, and stored
energy in the load returns to the source on each cycle. When the power factor is 1, all the energy
supplied by the source is consumed by the load. Power factors are usually stated as "leading" or
"lagging" to show the sign of the phase angle.
13
If a purely resistive load is connected to a power supply, current and voltage will change
polarity in step, the power factor will be unity (1), and the electrical energy flows in a single
direction across the network in each cycle. Inductive loads such as transformers and motors (any
type of wound coil) consume reactive power with current waveform lagging the voltage.
Capacitive loads such as capacitor banks or buried cable generate reactive power with current
phase leading the voltage. Both types of loads will absorb energy during part of the AC cycle,
which is stored in the device's magnetic or electric field, only to return this energy back to the
source during the rest of the cycle.
For example, to get 1 kW of real power, if the power factor is unity, 1 kVA of apparent
power needs to be transferred (1 kW 1 = 1 kVA). At low values of power factor, more apparent
power needs to be transferred to get the same real power. To get 1 kW of real power at 0.2 power
factor, 5 kVA of apparent power needs to be transferred (1 kW 0.2 = 5 kVA). This apparent
power must be produced and transmitted to the load in the conventional fashion, and is subject to
the usual distributed losses in the production and transmission processes.
Electrical loads consuming alternating current power consume both real power and reactive
power. The vector sum of real and reactive power is the apparent power. The presence of reactive
power causes the real power to be less than the apparent power, and so, the electric load has a
power factor of less than 1.
It is often desirable to adjust the power factor of a system to near 1.0. This power factor
correction (PFC) is achieved by switching in or out banks of inductors or capacitors. For
example the inductive effect of motor loads may be offset by locally connected capacitors. When
reactive elements supply or absorb reactive power near the load, the apparent power is reduced.
Power factor correction may be applied by an electrical power transmission utility to improve the
stability and efficiency of the transmission network. Correction equipment may be installed by
individual electrical customers to reduce the costs charged to them by their electricity supplier. A
14
high power factor is generally desirable in a transmission system to reduce transmission losses
and improve voltage regulation at the load.
Power factor correction brings the power factor of an AC power circuit closer to 1 by
supplying reactive power of opposite sign, adding capacitors or inductors which act to cancel the
inductive or capacitive effects of the load, respectively. For example, the inductive effect of
motor loads may be offset by locally connected capacitors. If a load had a capacitive value,
inductors (also known as reactors in this context) are connected to correct the power factor. In
the electricity industry, inductors are said to consume reactive power and capacitors are said to
supply it, even though the reactive power is actually just moving back and forth on each AC
cycle.
The reactive elements can create voltage fluctuations and harmonic noise when switched
on or off. They will supply or sink reactive power regardless of whether there is a corresponding
load operating nearby, increasing the system's no-load losses. In a worst case, reactive elements
can interact with the system and with each other to create resonant conditions, resulting in
system instability and severe overvoltage fluctuations. As such, reactive elements cannot simply
be applied at will, and power factor correction is normally subject to engineering analysis.
An automatic power factor correction unit is used to improve power factor. A power
factor correction unit usually consists of a number of capacitors that are switched by means of
contactors. These contactors are controlled by a regulator that measures power factor in an
electrical network. To be able to measure power factor, the regulator uses a current transformer to
measure the current in one phase.
Depending on the load and power factor of the network, the power factor controller will
switch the necessary blocks of capacitors in steps to make sure the power factor stays above a
selected value (usually demanded by the energy supplier), say 0.9.
Instead of using a set of switched capacitors, an unloaded synchronous motor can supply
reactive power. The reactive power drawn by the synchronous motor is a function of its field
excitation. This is referred to as a synchronous condenser. It is started and connected to the
15
electrical network. It operates at a leading power factor and puts VARS onto the network as
required to support a systems voltage or to maintain the system power factor at a specified level.
The condensers installation and operation are identical to large electric motors. Its principal
advantage is the ease with which the amount of correction can be adjusted; it behaves like an
electrically variable capacitor. Unlike capacitors, the amount of reactive power supplied is
proportional to voltage, not the square of voltage; this improves voltage stability on large
networks. Synchronous condensers are often used in connection with high voltage direct current
transmission projects or in large industrial plants such as steel mills.
Non-linear loads
Non-sinusoidal components
Non-linear loads change the shape of the current waveform from a sine wave to some
other form. Non-linear loads create harmonic currents in addition to the original (fundamental
frequency) AC current. Filters consisting of linear capacitors and inductors can prevent harmonic
currents from entering the supplying system.
In linear circuits having only sinusoidal currents and voltages of one frequency, the
power factor arises only from the difference in phase between the current and voltage. This is
"displacement power factor". The concept can be generalized to a total, distortion, or true power
factor where the apparent power includes all harmonic components. This is of importance in
practical power systems which contain non-linear loads such as rectifiers, some forms of electric
16
lighting, electric arc furnaces, welding equipment, switched-mode power supplies and other
devices.
A typical multimeter will give incorrect results when attempting to measure the AC
current drawn by a non-sinusoidal load; the instruments sense the average value of a rectified
waveform. The average response is then calibrated to the effective, RMS value. An RMS sensing
multimeter must be used to measure the actual RMS currents and voltages (and therefore
apparent power). To measure the real power or reactive power, a wattmeter designed to work
properly with non-sinusoidal currents must be used.
The distortion power factor' describes how the harmonic distortion of a load current
decreases the average power transferred to the load.
THDi is the total harmonic distortion of the load current. This definition assumes that the voltage
stays undistorted (sinusoidal, without harmonics). This simplification is often a good
approximation in practice. I1,rms is the fundamental component of the current and Irms is the total
current - both are root mean square-values.
The result when multiplied with the displacement power factor (DPF) is the overall, true power
factor or just power factor (PF):
18
EMBEDDED SYSTEM DESIGN CYCLE
Hardware-in-the-Loop
Rapid Prototyping Testing
Targeting
Figuren 2(b) V Diagram
19
Throughput Our system may need to handle a lot of data in a short period of
time.
ResponseOur system may need to react to events quickly
TestabilitySetting up equipment to test embedded software can be difficult
DebugabilityWithout a screen or a keyboard, finding out what the software is
doing wrong (other than not working) is a troublesome problem
Reliability embedded systems must be able to handle any situation without
human intervention
Memory space Memory is limited on embedded systems, and you must make
the software and the data fit into whatever memory exists
Program installation you will need special tools to get your software into
embedded systems
Power consumption Portable systems must run on battery power, and the
software in these systems must conserve power
Processor hogs computing that requires large amounts of CPU time can
complicate the response problem
Cost Reducing the cost of the hardware is a concern in many embedded system
projects; software often operates on hardware that is barely adequate for the job.
RTS CLASSIFICATION
Hard Real Time Systems
Soft Real Time System
21
3. PROJECT BLOCK DIAGRAM
22
4.HARDWARE REQUIREMENTS
HARDWARE COMPONENTS:
2. VOLTAGE REGULATOR
3. RECTIFIER
4. FILTER
5. MICROCONTROLLER (AT89S52/AT89C51)
6. OPTO-ISOLATOR (MOC3063)
7. SCR
8. PUSH BUTTONS
9. LCD
10. LM339
14. LED
16. RESISTOR
17. CAPACITOR
23
4.1 TRANSFORMER
Transformers convert AC electricity from one voltage to another with a little loss of power.
Step-up transformers increase voltage, step-down transformers reduce voltage. Most power
supplies use a step-down transformer to reduce the dangerously high voltage to a safer low
voltage.
The input coil is called the primary and the output coil is called the secondary. There is
no electrical connection between the two coils; instead they are linked by an alternating magnetic
field created in the soft-iron core of the transformer. The two lines in the middle of the circuit
symbol represent the core. Transformers waste very little power so the power out is (almost)
equal to the power in. Note that as voltage is stepped down and current is stepped up.
The ratio of the number of turns on each coil, called the turns ratio, determines the ratio
of the voltages. A step-down transformer has a large number of turns on its primary (input) coil
which is connected to the high voltage mains supply, and a small number of turns on its
secondary (output) coil to give a low output voltage.
TURNS RATIO = (Vp / Vs) = ( Np / Ns )
Where,
Vp = primary (input) voltage.
Vs = secondary (output) voltage
Np = number of turns on primary coil
24
Ns = number of turns on secondary coil
Ip = primary (input) current
Is = secondary (output) current.
If the secondary coil is attached to a load that allows current to flow, electrical power is
transmitted from the primary circuit to the secondary circuit. Ideally, the transformer is perfectly
efficient; all the incoming energy is transformed from the primary circuit to the magnetic field
and into the secondary circuit. If this condition is met, the incoming electric power must equal
the outgoing power:
25
If the voltage is increased, then the current is decreased by the same factor. The
impedance in one circuit is transformed by the square of the turns ratio. For example, if an
impedance Zs is attached across the terminals of the secondary coil, it appears to the primary
circuit to have an impedance of (Np/Ns)2Zs. This relationship is reciprocal, so that the impedance
Zp of the primary circuit appears to the secondary to be (Ns/Np)2Zp.
Features
Output Current up to 1A.
Output Voltages of 5, 6, 8, 9, 10, 12, 15, 18, 24V.
Thermal Overload Protection.
Short Circuit Protection.
Output Transistor Safe Operating Area Protection.
Description
The LM78XX/LM78XXA series of three-terminal positive regulators are available in the
TO-220/D-PAK package and with several fixed output voltages, making them useful in a Wide
range of applications. Each type employs internal current limiting, thermal shutdown and safe
26
operating area protection, making it essentially indestructible. If adequate heat sinking is
provided, they can deliver over 1A output Current. Although designed primarily as fixed voltage
regulators, these devices can be used with external components to obtain adjustable voltages and
currents.
27
Absolute Maximum Ratings
4.3 RECTIFIER
A rectifier is an electrical device that converts alternating current (AC), which
periodically reverses direction, to direct current (DC), current that flows in only one direction, a
process known as rectification. Rectifiers have many uses including as components of power
supplies and as detectors of radio signals. Rectifiers may be made of solid state diodes, vacuum
tube diodes, mercury arc valves, and other components. The output from the transformer is fed to
the rectifier. It converts A.C. into pulsating D.C. The rectifier may be a half wave or a full wave
rectifier. In this project, a bridge rectifier is used because of its merits like good stability and full
wave rectification. In positive half cycle only two diodes (1 set of parallel diodes) will conduct,
28
in negative half cycle remaining two diodes will conduct and they will conduct only in forward
bias only.
4.4 FILTER
Capacitive filter is used in this project. It removes the ripples from the output of rectifier
and smoothens the D.C. Output received from this filter is constant until the mains voltage and
load is maintained constant. However, if either of the two is varied, D.C. voltage received at this
point changes. Therefore a regulator is applied at the output stage.
The simple capacitor filter is the most basic type of power supply filter. The use of this
filter is very limited. It is sometimes used on extremely high-voltage, low-current power supplies
for cathode-ray and similar electron tubes that require very little load current from the supply.
29
This filter is also used in circuits where the power-supply ripple frequency is not critical and can
be relatively high. Below figure can show how the capacitor charges and discharges.
Watchdog Timer
Power-off Flag
31
Block Diagram of AT89S52:
32
Pin Configurations of AT89S52
Pin Description:
VCC:
Supply voltage.
GND:
Ground.
Port 0:
Port 0 is an 8-bit open drain bidirectional I/O port. As an output port, each pin can sink
eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as high-impedance
33
inputs. Port 0 can also be configured to be the multiplexed low-order address/data bus during
accesses to external program and data memory. In this mode, P0 has internal pull-ups. Port 0 also
receives the code bytes during Flash programming and outputs the code bytes during program
verification. External pull-ups are required during program verification.
Port 1:
Port 1 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 1 output buffers
can sink/source four TTL inputs. When 1s are written to Port 1 pins, they are pulled high by the
internal pull-ups and can be used as inputs. As inputs, Port 1 pins that are externally being pulled
low will source current (IIL) because of the internal pull-ups. In addition, P1.0 and P1.1 can be
configured to be the timer/counter 2 external count input (P1.0/T2) and the timer/counter 2
trigger input (P1.1/T2EX).
Port 2:
Port 2 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 2 output buffers
can sink/source four TTL inputs. When 1s are written to Port 2 pins, they are pulled high by the
internal pull-ups and can be used as inputs. As inputs, Port 2 pins that are externally being pulled
low will source current (IIL) because of the internal pull-ups. Port 2 emits the high-order address
byte during fetches from external program memory and during accesses to external data memory
that use 16-bit addresses (MOVX @ DPTR). In this application, Port 2 uses strong internal pull-
ups when emitting 1s. During accesses to external data memory that use 8-bit addresses (MOVX
@ RI), Port 2 emits the contents of the P2 Special Function Register.
Port 3:
Port 3 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 3 output buffers
can sink/source four TTL inputs. When 1s are written to Port 3 pins, they are pulled high by the
internal pull-ups and can be used as inputs. As inputs, Port 3 pins that are externally being pulled
low will source current (IIL) because of the pull-ups.
RST:
34
Reset input. A high on this pin for two machine cycles while the oscillator is running
resets the device. This pin drives high for 98 oscillator periods after the Watchdog times out. The
DISRTO bit in SFR AUXR (address 8EH) can be used to disable this feature. In the default state
of bit DISRTO, the RESET HIGH out feature is enabled.
ALE/PROG:
Address Latch Enable (ALE) is an output pulse for latching the low byte of the address
during accesses to external memory. This pin is also the program pulse input (PROG) during
Flash programming.
In normal operation, ALE is emitted at a constant rate of 1/6 the oscillator frequency and
may be used for external timing or clocking purposes. Note, however, that one ALE pulse is
skipped during each access to external data memory.
PSEN:
Program Store Enable (PSEN) is the read strobe to external program memory. When the
AT89S52 is executing code from external program memory, PSEN is activated twice each
machine cycle, except that two PSEN activations are skipped during each access to external data
memory.
EA/VPP:
External Access Enable. EA must be strapped to GND in order to enable the device to
fetch code from external program memory locations starting at 0000H up to FFFFH. Note,
however, that if lock bit 1 is programmed, EA will be internally latched on reset. EA should be
strapped to VCC for internal program executions. This pin also receives the 12-volt
programming enable voltage (VPP) during Flash programming.
XTAL1:
Input to the inverting oscillator amplifier and input to the internal clock operating circuit.
XTAL2:
35
Output from the inverting oscillator amplifier.
Oscillator Characteristics:
XTAL1 and XTAL2 are the input and output, respectively, of an inverting amplifier
which can be configured for use as an on-chip oscillator, as shown in Figure 1. Either a quartz
crystal or ceramic resonator may be used. To drive the device from an external clock source,
XTAL2 should be left unconnected while XTAL1 is driven as shown in Figure 6.2. There are no
requirements on the duty cycle of the external clock signal, since the input to the internal
clocking circuitry is through a divide-by-two flip-flop, but minimum and maximum voltage high
and low time specifications must be observed.
In the power down mode the oscillator is stopped, and the instruction that invokes power
down is the last instruction executed. The on-chip RAM and Special Function Registers retain
their values until the power down mode is terminated. The only exit from power down is a
hardware reset. Reset redefines the SFRs but does not change the on-chip RAM. The reset should
not be activated before VCC is restored to its normal operating level and must be held active
long enough to allow the oscillator to restart and stabilize
The light is proportional to the signal, so the signal is thus transferred to the
phototransistor. Optocouplers may also comes in few module such
as the SCR, photodiodes, TRIAC of other semiconductor switch as
an output, and incandescent lamps, neon bulbs or other light
source.
If the optocoupler IC breakdown, it will cause the equipment to have low power, blink, no
power, erratic power and even power shut down once switch on the equipment. Many
technicians and engineers do not know that they can actually test the optocoupler with their
analog multimeter. Most of them thought that there is no way of testing an IC with an analog
meter.
This is the principle used in OptoTriacs and optoSCRs, which are readily available in
Integrated circuit (I.C.) form, and do not need very complex circuitry to make them work.
Simply provide a small pulse at the right time to the Light Emitting Diode in the package. The
light produced by the LED activates the light sensitive properties of the Triac or Thyristor gate
and the power is switched on. The isolation between the low power and high power circuits in
these optically connected devices is typically several thousand volts.
38
4.7 THYRISTOR (SCR)
39
Construction of SCR
40
Modes of operation
In the normal "off" state, the device restricts current to the leakage current. When the
gate-to-cathode voltage exceeds a certain threshold, the device turns "on" and conducts current.
The device will remain in the "on" state even after gate current is removed so long as current
through the device remains above the holding current. Once current falls below the holding
current for an appropriate period of time, the device will switch "off". If the gate is pulsed and
the current through the device is below the holding current, the device will remain in the "off"
state.
If the applied voltage increases rapidly enough, capacitive coupling may induce enough charge
into the gate to trigger the device into the "on" state; this is referred to as "dv/dt triggering." This
is usually prevented by limiting the rate of voltage rise across the device, perhaps by using a
snubber. "dv/dt triggering" may not switch the SCR into full conduction rapidly and the
partially-triggered SCR may dissipate more power than is usual, possibly harming the device.
SCRs can also be triggered by increasing the forward voltage beyond their rated breakdown
voltage (also called as break over voltage), but again, this does not rapidly switch the entire
device into conduction and so may be harmful so this mode of operation is also usually avoided.
Also, the actual breakdown voltage may be substantially higher than the rated breakdown
voltage, so the exact trigger point will vary from device to device. This device is generally used
in switching applications.
Reverse Bias
SCR are available with or without reverse blocking capability. Reverse blocking
capability adds to the forward voltage drop because of the need to have a long, low doped P1
region. Usually, the reverse blocking voltage rating and forward blocking voltage rating are the
same. The typical application for reverse blocking SCR is in current source inverters.
SCR incapable of blocking reverse voltage are known as asymmetrical SCR, abbreviated
ASCR. They typically have a reverse breakdown rating in the 10's of volts. ASCR are used
41
where either a reverse conducting diode is applied in parallel (for example, in voltage source
inverters) or where reverse voltage would never occur (for example, in switching power supplies
or DC traction choppers).
Asymmetrical SCR can be fabricated with a reverse conducting diode in the same package.
These are known as RCT, for reverse conducting thyristor.
Application of SCRs
SCRs are mainly used in devices where the control of high power, possibly coupled with
high voltage, is demanded. Their operation makes them suitable for use in medium to high-
voltage AC power control applications, such as lamp dimming, regulators and motor control.
A push-button (also spelled pushbutton) or simply button is a simple switch mechanism for
controlling some aspect of a machine or a process. Buttons are typically made out of hard
material, usually plastic or metal. The surface is usually flat or shaped to accommodate the
human finger or hand, so as to be easily depressed or pushed. Buttons are most often biased
switches, though even many un-biased buttons (due to their physical nature) require a spring to
return to their un-pushed state. Different people use different terms for the "pushing" of the
button, such as press, depress, mash, and punch.
42
Uses:
In industrial and commercial applications push buttons can be linked together by a mechanical
linkage so that the act of pushing one button causes the other button to be released. In this way, a
stop button can "force" a start button to be released. This method of linkage is used in simple
manual operations in which the machine or process have no electrical circuits for control.
Pushbuttons are often color-coded to associate them with their function so that the
operator will not push the wrong button in error. Commonly used colors are red for stopping the
machine or process and green for starting the machine or process.
Red pushbuttons can also have large heads (mushroom shaped) for easy operation and to
facilitate the stopping of a machine. These pushbuttons are called emergency stop buttons and
are mandated by the electrical code in many jurisdictions for increased safety. This large
mushroom shape can also be found in buttons for use with operators who need to wear gloves for
their work and could not actuate a regular flush-mounted push button. As an aid for operators
and users in industrial or commercial applications, a pilot light is commonly added to draw the
attention of the user and to provide feedback if the button is pushed. Typically this light is
included into the center of the pushbutton and a lens replaces the pushbutton hard center disk.
The source of the energy to illuminate the light is not directly tied to the contacts on the
back of the pushbutton but to the action the pushbutton controls. In this way a start button when
pushed will cause the process or machine operation to be started and a secondary contact
designed into the operation or process will close to turn on the pilot light and signify the action
of pushing the button caused the resultant process or action to start.
In popular culture, the phrase "the button" refers to a (usually fictional) button that a
military or government leader could press to launch nuclear weapons.
43
Push to ON button:
Initially the two contacts of the button are open. When the button is pressed they become
connected. This makes the switching operation using the push button.
This is the first interfacing example for the Parallel Port. We will start with something
simple. This example doesn't use the Bi-directional feature found on newer ports, thus it should
work with most, if not all Parallel Ports. It however doesn't show the use of the Status Port as an
input for a 16 Character x 2 Line LCD Module to the Parallel Port. These LCD Modules are very
common these days, and are quite simple to work with, as all the logic required running them is
on board.
LCD Background:
Frequently, an 8051 program must interact with the outside world using input and output
devices that communicate directly with a human being. One of the most common devices
attached to an 8051 is an LCD display. Some of the most common LCDs connected to the 8051
are 16x2 and 20x2 displays. This means 16 characters per line by 2 lines and 20 characters per
line by 2 lines, respectively.
Fortunately, a very popular standard exists which allows us to communicate with the vast
majority of LCDs regardless of their manufacturer. The standard is referred to as HD44780U,
44
which refers to the controller chip which receives data from an external source (in this case, the
8051) and communicates directly with the LCD.
The 44780 standard requires 3 control lines as well as either 4 or 8 I/O lines for the data
bus. The user may select whether the LCD is to operate with a 4-bit data bus or an 8-bit data bus.
If a 4-bit data bus is used the LCD will require a total of 7 data lines (3 control lines plus the 4
lines for the data bus). If an 8-bit data bus is used the LCD will require a total of 11 data lines (3
control lines plus the 8 lines for the data bus).
45
The three control lines are referred to as EN, RS, and RW.
The EN line is called "Enable." This control line is used to tell the LCD that you are sending it
data. To send data to the LCD, your program should make sure this line is low (0) and then set
the other two control lines and/or put data on the data bus. When the other lines are completely
ready, bring EN high (1) and wait for the minimum amount of time required by the LCD
datasheet (this varies from LCD to LCD), and end by bringing it low (0) again.
The RS line is the "Register Select" line. When RS is low (0), the data is to be treated as a
command or special instruction (such as clear screen, position cursor, etc.). When RS is high (1),
the data being sent is text data which should be displayed on the screen. For example, to display
the letter "T" on the screen you would set RS high.
The RW line is the "Read/Write" control line. When RW is low (0), the information on the data
bus is being written to the LCD. When RW is high (1), the program is effectively querying (or
reading) the LCD. Only one instruction ("Get LCD status") is a read command. All others are
write commands--so RW will almost always be low .Finally, the data bus consists of 4 or 8 lines
(depending on the mode of operation selected by the user). In the case of an 8-bit data bus, the
lines are referred to as DB0, DB1, DB2, DB3, DB4, DB5, DB6, and DB7.
DESCRIPTION
The LM339 consists of four independent precision voltage comparators, with an offset
voltage specification as low as 20 max for each comparator, which were designed specifically
to operate from a single power supply over a wide range of voltages. Operation from split power
supplies is also possible and the low power supply current drain is independent of the magnitude
of the power supply voltage.
46
These comparators also have a unique characteristic in
that the input common-mode voltage range includes ground, even
though they are operated from a single power supply voltage. The
LM339 series was designed to directly interface with TTL and
CMOS. When operated from both plus and minus power
supplies, the LM339 series will directly interface with MOS logic where their low power drain is
a distinct advantage over standard comparators.
FEATURES
APPLICATION
A/D Converters
Wide range VOC
47
MOS clock generator
High voltage logic gate
Multivibrators
48
4.11 CURRENT TRANSFORMER
49
A load that is predominantly inductive, so that the alternating load current lags behind the
alternating voltage of the load. Also known as lagging load. Any devices that have coils of wire
in there manufacture can be classed as inductive loads. E.g. motors, solenoids and contactor coils
are a few. Example of resistive loads can be baseboard heaters, filament light bulbs, toasters and
stove top elements.
Shunt capacitor banks are used to improve the quality of the electrical supply and the
efficient operation of the power system. Studies show that a flat voltage profile on the system can
significantly reduce line losses. Shunt capacitor banks are relatively inexpensive and can be
easily installed anywhere on the network.
50
4.14 LED
LEDs are semiconductor devices. Like transistors, and other diodes, LEDs are made out
of silicon. What makes an LED give off light are the small amounts of chemical impurities that
are added to the silicon, such as gallium, arsenide, indium, and nitride.
When current passes through the LED, it emits photons as a byproduct. Normal light
bulbs produce light by heating a metal filament until it is white hot. LEDs produce photons
directly and not via heat, they are far more efficient than incandescent bulbs.
Not long ago LEDs were only bright enough to be used as indicators on dashboards or
electronic equipment. But recent advances have made LEDs bright enough to rival traditional
lighting technologies. Modern LEDs can replace incandescent bulbs in almost any application.
51
Types of LEDS
LEDs are produced in an array of shapes and sizes. The 5 mm cylindrical package is the most
common, estimated at 80% of world production. The color of the plastic lens is often the same as the
actual color of light emitted, but not always. For instance, purple plastic is often used for infrared
LEDs, and most blue devices have clear housings. There are also LEDs in extremely tiny packages,
such as those found on blinkers and on cell phone keypads. The main types of LEDs are miniature,
high power devices and custom designs such as alphanumeric or multi-color.
Conventional LEDS are made from a variety of inorganic semiconductor materials, the
following table shows the available colours with wavelength range, voltage drop and material.
White LEDS
52
Light Emitting Diodes (LED) have recently become available that are white and bright,
so bright that they seriously compete with incandescent lamps in lighting applications. They are
still pretty expensive as compared to a GOW lamp but draw much less current and project a
fairly well focused beam.
The diode in the photo came with a neat little reflector that tends to sharpen the beam a
little but doesn't seem to add much to the overall intensity.
When run within their ratings, they are more reliable than lamps as well. Red LEDs are
now being used in automotive and truck tail lights and in red traffic signal lights. You will be
able to detect them because they look like an array of point sources and they go on and off
53
LEDs are monochromatic (one color) devices. The color is determined by the band gap of
the semiconductor used to make them. Red, green, yellow and blue LEDs are fairly common.
White light contains all colors and cannot be directly created by a single LED. The most
common form of "white" LED really isn't white. It is a Gallium Nitride blue LED coated with a
phosphor that, when excited by the blue LED light, emits a broad range spectrum that in addition
to the blue emission, makes a fairly white light.
There is a claim that these white LED's have a limited life. After 1000 hours or so of
operation, they tend to yellow and dim to some extent. Running the LEDs at more than their
rated current will certainly accelerate this process.
There are two primary ways of producing high intensity white-light using LEDS. One is
to use individual LEDS that emit three primary coloursred, green, and blueand then mix all
the colours to form white light. The other is to use a phosphor material to convert
monochromatic light from a blue or UV LED to broad-spectrum white light, much in the same
way a fluorescent light bulb works. Due to metamerism, it is possible to have quite different
spectra that appear white.
4.15 1N4007
Diodes are used to convert AC into DC these are used as half wave rectifier or full wave rectifier.
Three points must he kept in mind while using any type of diode.
54
1. Maximum forward current capacity
2. Maximum reverse voltage capacity
3. Maximum forward voltage capacity
The number and voltage capacity of some of the important diodes available in the market are as
follows:
Diodes of number IN4001, IN4002, IN4003, IN4004, IN4005, IN4006 and IN4007 have
maximum reverse bias voltage capacity of 50V and maximum forward current capacity
of 1 Amp.
Diode of same capacities can be used in place of one another. Besides this diode of more
capacity can be used in place of diode of low capacity but diode of low capacity cannot
be used in place of diode of high capacity. For example, in place of IN4002; IN4001 or
55
IN4007 can be used but IN4001 or IN4002 cannot be used in place of IN4007.The diode
BY125made by company BEL is equivalent of diode from IN4001 to IN4003. BY 126 is
equivalent to diodes IN4004 to 4006 and BY 127 is equivalent to diode IN4007.
PN JUNCTION OPERATION
Now that you are familiar with P- and N-type materials, how these materials are joined
together to form a diode, and the function of the diode, let us continue our discussion with the
operation of the PN junction. But before we can understand how the PN junction works, we must
first consider current flow in the materials that make up the junction and what happens initially
within the junction when these two materials are joined together.
56
1N4148
The 1N4148 is a standard small signal silicon diode used in signal processing. Its name
follows the JEDEC nomenclature. The 1N4148 is generally available in a DO-35 glass package
and is very useful at high frequencies with a reverse recovery time of no more than 4ns. This
permits rectification and detection of radio frequency signals very effectively, as long as their
amplitude is above the forward conduction threshold of silicon (around 0.7V) or the diode is
biased.
Fig:1N4148 diode
Specifications:
Applications
High-speed switching
Features
1) Glass sealed envelope. (GSD)
2) High speed.
3) High Reliability
Construction
Silicon epitaxial planar
4.16 RESISTORS
58
The primary characteristics of resistors are their resistance and the power they can
dissipate. Other characteristics include temperature coefficient, noise, and inductance. Less well-
known is critical resistance, the value below which power dissipation limits the maximum
permitted current flow, and above which the limit is applied voltage. Critical resistance depends
upon the materials constituting the resistor as well as its physical dimensions; it's determined by
design.
Resistors can be integrated into hybrid and printed circuits, as well as integrated
circuits. Size, and position of leads (or terminals) are relevant to equipment designers; resistors
must be physically large enough not to overheat when dissipating their power.
Resistors are common elements of electrical networks and electronic circuits and are
ubiquitous in most electronic equipment. Practical resistors can be made of various compounds
and films, as well as resistance wire (wire made of a high-resistivity alloy, such as nickel-
59
chrome). Resistors are also implemented within integrated circuits, particularly analog devices,
and can also be integrated into hybrid and printed circuits.
The series inductance of a practical resistor causes its behavior to depart from ohms law;
this specification can be important in some high-frequency applications for smaller values of
resistance. In a low-noise amplifier or pre-amp the noise characteristics of a resistor may be an
issue. The unwanted inductance, excess noise, and temperature coefficient are mainly dependent
on the technology used in manufacturing the resistor. They are not normally specified
individually for a particular family of resistors manufactured using a particular technology. A
family of discrete resistors is also characterized according to its form factor, that is, the size of
the device and position of its leads (or terminals) which is relevant in the practical manufacturing
of circuits using them.
Units
The ohm (symbol: ) is the SI unit of electrical resistance, named after Georg Simon
Ohm. An ohm is equivalent to a volt per ampere. Since resistors are specified and manufactured
over a very large range of values, the derived units of milliohm (1 m = 103 ), kilohm (1 k =
103 ), and megohm (1 M = 106 ) are also in common usage.
60
The reciprocal of resistance R is called conductance G = 1/R and is measured in Siemens
(SI unit), sometimes referred to as a mho. Thus a Siemens is the reciprocal of an ohm: S = 1.
Although the concept of conductance is often used in circuit analysis, practical resistors are
always specified in terms of their resistance (ohms) rather than conductance.
Variable resistors
Adjustable resistors
A resistor may have one or more fixed tapping points so that the resistance can be
changed by moving the connecting wires to different terminals. Some wirewound power resistors
have a tapping point that can slide along the resistance element, allowing a larger or smaller part
of the resistance to be used.
Potentiometers
61
4.17 CAPACITORS
62
A capacitor (formerly known as condenser) is a device for storing electric charge. The
forms of practical capacitors vary widely, but all contain at least two conductors separated by a
non-conductor. Capacitors used as parts of electrical systems, for example, consist of metal foils
separated by a layer of insulating film.
Capacitors are widely used in electronic circuits for blocking direct current while
allowing alternating current to pass, in filter networks, for smoothing the output of power
supplies, in the resonant circuits that tune radios to particular frequencies and for many other
purposes.
63
The capacitance is greatest when there is a narrow separation between large areas of
conductor, hence capacitor conductors are often called "plates", referring to an early means of
construction. In practice the dielectric between the plates passes a small amount of leakage
current and also has an electric field strength limit, resulting in a breakdown voltage, while the
conductors and leads introduce an undesired inductance and resistance.
Theory of operation
Capacitance
64
the dielectric is just an electrical insulator. Examples of dielectric mediums are glass, air, paper,
vacuum, and even a semiconductor depletion region chemically identical to the conductors. A
capacitor is assumed to be self-contained and isolated, with no net electric charge and no
influence from any external electric field. The conductors thus hold equal and opposite charges
on their facing surfaces, and the dielectric develops an electric field. In SI units, a capacitance of
one farad means that one coulomb of charge on each conductor causes a voltage of one volt
across the device.
The capacitor is a reasonably general model for electric fields within electric circuits. An ideal
capacitor is wholly characterized by a constant capacitance C, defined as the ratio of charge Q
on each conductor to the voltage V between them:
Sometimes charge build-up affects the capacitor mechanically, causing its capacitance to vary. In
this case, capacitance is defined in terms of incremental changes:
Energy storage
Work must be done by an external influence to "move" charge between the conductors in a
capacitor. When the external influence is removed the charge separation persists in the electric
field and energy is stored to be released when the charge is allowed to return to its equilibrium
position. The work done in establishing the electric field, and hence the amount of energy stored,
is given by:
Current-voltage relation
The current i(t) through any component in an electric circuit is defined as the rate of flow of a
charge q(t) passing through it, but actual charges, electrons, cannot pass through the dielectric
65
layer of a capacitor, rather an electron accumulates on the negative plate for each one that leaves
the positive plate, resulting in an electron depletion and consequent positive charge on one
electrode that is equal and opposite to the accumulated negative charge on the other. Thus the
charge on the electrodes is equal to the integral of the current as well as proportional to the
voltage as discussed above. As with any antiderivative, a constant of integration is added to
represent the initial voltage v (t0). This is the integral form of the capacitor equation,
Taking the derivative of this, and multiplying by C, yields the derivative form,
The dual of the capacitor is the inductor, which stores energy in the magnetic field rather than the
electric field. Its current-voltage relation is obtained by exchanging current and voltage in the
capacitor equations and replacing C with the inductance L.
66
5. SOFTWARE REQUIREMENT
Keil is a cross compiler. So first we have to understand the concept of compilers and
cross compilers. After then we shall learn how to work with keil.
Compilers are programs used to convert a High Level Language to object code. Desktop
compilers produce an output object code for the underlying microprocessor, but not for other
microprocessors. I.E the programs written in one of the HLL like C will compile the code to
run on the system for a particular processor like x86 (underlying microprocessor in the
computer). For example compilers for Dos platform is different from the Compilers for Unix
platform So if one wants to define a compiler then compiler is a program that translates source
code into object code.
The compiler derives its name from the way it works, looking at the entire piece of
source code and collecting and reorganizing the instruction. See there is a bit little difference
between compiler and an interpreter. Interpreter just interprets whole program at a time while
compiler analyses and execute each line of source code in succession, without looking at the
entire program.
67
The advantage of interpreters is that they can execute a program immediately. Secondly
programs produced by compilers run much faster than the same programs executed by an
interpreter. However compilers require some time before an executable program emerges. Now
as compilers translate source code into object code, which is unique for each type of computer,
many compilers are available for the same language.
A cross compiler is similar to the compilers but we write a program for the target
processor (like 8051 and its derivatives) on the host processors (like computer of x86). It means
being in one environment you are writing a code for another environment is called cross
development. And the compiler used for cross development is called cross compiler. So the
definition of cross compiler is a compiler that runs on one computer but produces object code for
a different type of computer.
Project Manager
Simulator
Debugger
68
The Keil ARM tool kit includes three main tools, assembler, compiler and linker. An
assembler is used to assemble the ARM assembly program. A compiler is used to compile the C
source code into an object file. A linker is used to create an absolute object module suitable for
our in-circuit emulator.
70
and reports illegal memory accesses. In addition to memory mapping, the simulator also provides
support for the integrated peripherals of the various 8051 derivatives. The on-chip peripherals of
the CPU you have selected are configured from the Device.
5.12 Database selection
You have made when you create your project target. Refer to page 58 for more
Information about selecting a device. You may select and display the on-chip peripheral
components using the Debug menu. You can also change the aspects of each peripheral using the
controls in the dialog boxes.
5.13 Start Debugging
You start the debug mode of Vision2 with the Debug Start/Stop Debug
Session Command. Depending on the Options for Target Debug Configuration, Vision2 will
load the application program and run the startup code Vision2 saves the editor screen layout
and restores the screen layout of the last debug session. If the program execution stops, Vision2
opens an editor window with the source text or shows CPU instructions in the disassembly
window. The next executable statement is marked with a yellow arrow. During debugging, most
editor features are still available.
For example, you can use the find command or correct program errors. Program source
text of your application is shown in the same windows. The Vision2 debug mode differs from
the edit mode in the following aspects:
_ The Debug Menu and Debug Commands described on page 28 are available. The additional
debug windows are discussed in the following.
_ The project structure or tool parameters cannot be modified. All build commands are disabled.
5.14 Disassembly Window
The Disassembly window shows your target program as mixed source and assembly
program or just assembly code. A trace history of previously executed instructions may be
displayed with Debug View Trace Records. To enable the trace history, set Debug
Enable/Disable Trace Recording.
If you select the Disassembly Window as the active window all program step commands
work on CPU instruction level rather than program source lines. You can select a text line and set
or modify code breakpoints using toolbar buttons or the context menu commands.
71
You may use the dialog Debug Inline Assembly to modify the CPU instructions. That
allows you to correct mistakes or to make temporary changes to the target program you are
debugging. Numerous example programs are included to help you get started with the most
popular embedded 8051 devices.
The Keil Vision Debugger accurately simulates on-chip peripherals (IC, CAN, UART,
SPI, Interrupts, I/O Ports, A/D Converter, D/A Converter, and PWM Modules) of your 8051
device. Simulation helps you understand hardware configurations and avoids time wasted on
setup problems. Additionally, with simulation, you can write and test applications before target
hardware is available.
5.15 EMBEDDED C
Use of embedded processors in passenger cars, mobile phones, medical equipment,
aerospace systems and defense systems is widespread, and even everyday domestic appliances
such as dish washers, televisions, washing machines and video recorders now include at least one
such device.
Because most embedded projects have severe cost constraints, they tend to use low-cost
processors like the 8051 family of devices considered in this book. These popular chips have
very limited resources available most such devices have around 256 bytes (not megabytes!) of
RAM, and the available processor power is around 1000 times less than that of a desktop
processor. As a result, developing embedded software presents significant new challenges, even
for experienced desktop programmers. If you have some programming experience - in C, C++
or Java - then this book and its accompanying CD will help make your move to the embedded
world as quick and painless as possible.
72
5. SCHEMATIC DIAGRAM
73
74
6.1 DESCRIPTION
POWER SUPPLY
The circuit uses standard power supply comprising of a step-down transformer from
230Vto 12V and 4 diodes forming a bridge rectifier that delivers pulsating dc which is then
filtered by an electrolytic capacitor of about 470F to 1000F. The filtered dc being unregulated,
IC LM7805 is used to get 5V DC constant at its pin no 3 irrespective of input DC varying from
7V to 15V. The input dc shall be varying in the event of input ac at 230volts section varies from
160V to 270V in the ratio of the transformer primary voltage V1 to secondary voltage V2
governed by the formula V1/V2=N1/N2. As N1/N2 i.e. no. of turns in the primary to the no. of
turns in the secondary remains unchanged V2 is directly proportional to V1.Thus if the
transformer delivers 12V at 220V input it will give 8.72V at 160V.Similarly at 270V it will give
14.72V.Thus the dc voltage at the input of the regulator changes from about 8V to 15V because
of A.C voltage variation from 160V to 270V the regulator output will remain constant at 5V.
The regulated 5V DC is further filtered by a small electrolytic capacitor of 10F for any
noise so generated by the circuit. One LED is connected of this 5V point in series with a current
limiting resistor of 330 to the ground i.e., negative voltage to indicate 5V power supply
availability. The unregulated 12V point is used for other applications as and when required.
ATMEL series of 8051 family of micro controllers need certain standard connections.
The actual number of the Microcontroller could be 89C51 , 89C52, 89S51, 89S52, and
as regards to 20 pin configuration a number of 89C2051. The 4 set of I/O ports are used based
on the project requirement. Every microcontroller requires a timing reference for its internal
program execution therefore an oscillator needs to be functional with a desired frequency to
obtain the timing reference as t =1/f.
75
A crystal ranging from 2 to 20 MHz is required to be used at its pin number 18 and 19 for
the internal oscillator. It may be noted here the crystal is not to be understood as crystal oscillator
It is just a crystal, while connected to the appropriate pin of the microcontroller it results in
oscillator function inside the microcontroller. Typically 11.0592 MHz crystal is used in general
for most of the circuits using 8051 series microcontroller. Two small value ceramic capacitors of
33pF each is used as a standard connection for the crystal as shown in the circuit diagram.
RESET
Pin no 9 is provided with an re-set arrangement by a combination of an electrolytic
capacitor and a register forming RC time constant. At the time of switch on, the capacitor gets
charged, and it behaves as a full short circuit from the positive to the pin number 9. After the
capacitor gets fully charged the current stops flowing and pin number 9 goes low which is pulled
down by a 10k resistor to the ground. This arrangement of reset at pin 9 going high initially and
then to logic 0 i.e., low helps the program execution to start from the beginning. In absence of
this the program execution could have taken place arbitrarily anywhere from the program cycle.
A pushbutton switch is connected across the capacitor so that at any given time as desired it can
be pressed such that it discharges the capacitor and while released the capacitor starts charging
again and then pin number 9 goes to high and then back to low, to enable the program execution
from the beginning. This operation of high to low of the reset pin takes place in fraction of a
second as decided by the time constant R and C.
For example: A 10F capacitor and a 10k resistor would render a 100ms time to pin number 9
from logic high to low, there after the pin number 9 remains low.
External Access(EA):
Pin no 31 of 40 pin 8051 microcontroller termed as EA is required to be connected to 5V for
accessing the program form the on-chip program memory. If it is connected to ground then the
controller accesses the program from external memory. However as we are using the internal
memory it is always connected to +5V.
76
COMPARATOR
How an op-amp can be used as a comparator?
Potential dividers are connected to the inverting and non inverting inputs of the op-amp
to give some voltage at these terminals. Supply voltage is given to +Vss and Vss is connected
to ground. The output of this comparator will be logic high (i.e., supply voltage) if the non-
inverting terminal input is greater than the inverting terminal input of the comparator.
i.e., Non inverting input (+) > inverting input (-) = output is logic high
If the inverting terminal input is greater than the non-inverting terminal input then the
output of the comparator will be logic low (i.e., gnd)
i.e., inverting input (-) > Non inverting input (+) = output is logic low
Two SCRS are connected back to back and are triggered from Opto-isolatorsU9 and
U10. MOC3063 Opto-isolator is a LED-TRIAC combination. Two Opto-isolator input leds are
connected in series while their output diac are used for triggering each SCR. One inductor
/choke in series with a bulb of 100W is connected in series with a pair of SCRs U11 and U12
connected in anti parallel .R28 and C7 are used as a snubber network across the SCRs for
inductive nature of load.
78
79
OPERATION EXPLANATION
CONNECTIONS
The output of power supply which is 5v is connected to the 40 th pin of microcontroller
and gnd to the 20th pin or pin 20 of microcontroller. Port 0.0 of microcontroller is connected to
Pin 2 of opto-isolator U10. Port 0.5 to 0.7 of microcontroller is connected to Pin 4, 5 and 6 of
LCD display. Port 2.0 to 2.7 of microcontroller is connected to Pin 7 to 14 of data pins of LCD
display. Port 3.1 of microcontroller is connected to output of the OP-Amp (A) LM339. Port 3.3
of microcontroller is connected to output of OP-Amp (B) LM339.
WORKING
The output of the regulator 7805 is given to the Microcontroller 40th pin. The pulsating dc
is fed to R11 and R24 Resistors. The unregulated voltage is fed to 7812. 7805 output which is 5v
is fed to 40th pin of Microcontroller. The output of the 7812 regulator is 12v and is fed to op-
Amp. In this circuit we have another bridge rectifier it gives an output as pulsating dc
corresponding to the current flowing across the load. The LCD display is connected to
corresponding pins. Relay driver drives relays and the contacts of relays switch ON the shunt
capacitors.
Description of ZVS:
In order to generate ZVP (Zero crossing Voltage Pulses) first we need to step down the
supply voltage to 12 V and then it is converted into pulsating D.C. Then with the help of
potential divider the voltage of 3 V is taken, which is given to a comparator. The comparator
generates the zero crossing pulses by comparing this pulsating D.C with a constant D.C voltage
of 0.6 V which is taken across a diode.
Similarly for ZVC (Zero crossing Current Pulses) the voltage drop proportional to the
load current across a resistor is taken and is stepped up to generate ZVC same as above. The zero
crossing pulses from a pulsating D.C are shown in the figure.
80
CIRCUIT EXPLAINATION:
This circuit consists of DC power supply unit, zero voltage crossing detectors, Micro-
controller, LCD display, opto-isolator, SCR and Capacitor. Let us see how it operates. The required
DC power supply for Micro-controller and other peripherals is supplied by the DC power supply.
For the calculation of the power factor by the Micro-controller we need digitized voltage
and current signals. The voltage signal from the mains is taken and it is converted into pulsating
DC by bridge rectifier and is given to a comparator which generates the digital voltage signal.
Similarly the current signal is converted into the voltage signal by taking the voltage drop of the
load current across a resistor of 10 ohms. This A.C signal is again converted into the digital signal
as done for the voltage signal. Then these digitized voltage and current signals are sent to the
micro-controller. The micro-controller calculates the time difference between the zero crossing
points of current and voltage, which is directly proportional to the power factor and it determines
the range in which the power factor is. Micro-controller sends information regarding time
difference between current and voltage and power factor to the LCD display to display them,
Depending on the range it sends the signals to the opto-isolators that in turn switch ON back to
back connected SCRs (power switches) to bring the capacitors in shunt across the load. Thus, the
required numbers of capacitors are connected in parallel to the load as required. By this the power
factor will be improved.
82
7. LAYOUT DIAGRAM
FIG 7: LAYOUT
83
8. BILL OF MATERIALS
84
85
9. CODING
86
3. Click on the Project menu from the title bar
4. Then Click on New Project
5. Save the Project by typing suitable project name with no extension in u r own folder
sited in either C:\ or D:\
87
6. Then Click on Save button above.
7. Select the component for u r project. i.e. Atmel
8. Click on the + Symbol beside of Atmel
88
10. Then Click on OK
11. The Following fig will appear
89
14. Now double click on the Target1, you would get another option Source group 1 as
shown in next page.
15. Click on the file option from menu bar and select new.
16. The next screen will be as shown in next page, and just maximize it by double
clicking on its blue boarder.
90
17. Now start writing program in either in EMBEDDED C or ASM.
18. For a program written in Assembly, then save it with extension . asm and for
EMBEDDED C based program save it with extension .C
19. Now right click on Source group 1 and click on Add files to Group Source.
91
20. Now you will get another window, on which by default EMBEDDED C files will
appear.
21. Now select as per your file extension given while saving the file
23. Now Press function key F7 to compile. Any error will appear if so happen.
92
24. If the file contains no error, then press Control+F5 simultaneously.
27. Now click on the Peripherals from menu bar, and check your required port as shown
in fig below.
93
28. Drag the port a side and click in the program file.
29. Now keep Pressing function key F11 slowly and observe.
94
10. HARDWARE TESTING
In electronics, a continuity test is the checking of an electric circuit to see if current flows
(that it is in fact a complete circuit). A continuity test is performed by placing a small voltage
(wired in series with an LED or noise-producing component such as a piezoelectric speaker)
across the chosen path. If electron flow is inhibited by broken conductors, damaged components,
or excessive resistance, the circuit is "open".
Devices that can be used to perform continuity tests include multi meters which measure
current and specialized continuity testers which are cheaper, more basic devices, generally with a
simple light bulb that lights up when current flows.
An important application is the continuity test of a bundle of wires so as to find the two ends
belonging to a particular one of these wires; there will be a negligible resistance between the
"right" ends, and only between the "right" ends.
This test is the performed just after the hardware soldering and configuration has been
completed. This test aims at finding any electrical open paths in the circuit after the soldering.
Many a times, the electrical continuity in the circuit is lost due to improper soldering, wrong and
rough handling of the PCB, improper usage of the soldering iron, component failures and
presence of bugs in the circuit diagram. We use a multi meter to perform this test. We keep the
multi meter in buzzer mode and connect the ground terminal of the multi meter to the ground.
We connect both the terminals across the path that needs to be checked. If there is continuation
then you will hear the beep sound.
95
is performed without microcontroller. Firstly, we check the output of the transformer, whether we
get the required 12 v AC voltage.
Then we apply this voltage to the power supply circuit. Note that we do this test without
microcontroller because if there is any excessive voltage, this may lead to damaging the
controller. We check for the input to the voltage regulator i.e., are we getting an input of 12v and
an output of 5v. This 5v output is given to the microcontrollers 40 th pin. Hence we check for the
voltage level at 40th pin. Similarly, we check for the other terminals for the required voltage. In
this way we can assure that the voltage at all the terminals is as per the requirement.
96
11 RESULTS
97
8. CONCLUSION
98
9.BIBLIOGRAPHY
1. The 8051 Microcontroller and Embedded systems by Muhammad Ali Mazidi and Janice
WEBSITES
www.atmel.com
www.beyondlogic.org
www.wikipedia.org
www.howstuffworks.com
www.alldatasheets.com
99