Вы находитесь на странице: 1из 81

SPEED CONTROL OF A.C.

MOTOR BY USING TRIAC

Project Name
Submitted in partial fulfillment of the requirements for the award of
BACHELOR OF TECHNOLOGY
IN
Electronics Engineering
By
STUDENT_1 NAME Uni Roll No:
STUDENT_1 NAME Uni Roll No:
STUDENT_1 NAME Uni Roll No:
STUDENT_1 NAME Uni Roll No:
Under the Guidance of
[ ]

College name & logo


Affiliated to
U.P TECHNICAL UNIVERSITY LUCKNOW

SUBMITTED TO: …………………………

1
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

Contents
Power supply..........................................................................................................................12
Working..............................................................................................................................12

Linear power supply...........................................................................................................12

Switched-mode power supply.............................................................................................13

Electrical Transformer........................................................................................................14

The Basic Working Principle...........................................................................................15

Resistor...................................................................................................................................17
Ohm's law...............................................................................................................................18

Capacitor................................................................................................................................19

Voltage Regulator 7805..........................................................................................................21


Advantages........................................................................................................................21

Disadvantages....................................................................................................................22

Individual devices in the series........................................................................................22

Hardware and Software Required.......................................................................................25

Hardware........................................................................................................................25

Software..........................................................................................................................26

Circuit Set Up.....................................................................................................................26

Your First AVR Program....................................................................................................28

2
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

DECLARATION

I hereby declare that the project report entitled “Project Name” submitted is our original
work and the report has not formed the basis for the award of any degree, associate ship,
fellowship or any other similar title.
Signature:
Name:
Enrollment no:
Date:

3
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

CERTIFICATE
This is to certify that the project report entitled “Project Name” is the bonafide work
carried out by students of “College Name” during the year 2016 in partial fulfillment of
the requirements for the award of the Degree of B. Tech. The report has not formed the
basis for the award previously of any degree, diploma, associate ship, fellowship or any
other similar title.

Signature of the guide:


Date:

4
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

ACKNOWLEDGEMENT

It gives me great pleasure to express my gratitude and heart full thanks to all those who
are helping me in complete this project.
I want to thank to “guide name”, who has always encouraged and help me in
making this project. In addition to this, I am grateful to other faculties too who made me
in right direction and gave me their precious time and expert guidance whenever
necessary through which I could achieve this extent.
At last but not the least I am feeling glad to say about my family whose wishes
are always with me, without which it was not possible for me to reach this extent.
I hope my work is praised and my efforts render fruitful result.

THANK YOU
Signature:
Name:

5
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

CHAPTER 1:
INTRODUCTION
In this project we show that how we control the speed of ac motor with the help of
thyristor.
Here we use one Atmel base microcontroller to provide a automation. We use one
seven segment display to display the speed level of Ac load. In this project we provide
the output for load variations. The output is connected through Triac control circuit. In
this project we use Triac for loads.
We provide manual input for this controller to vary the intensity of load. We use
increment and decrement switch to vary the speed.
Zero cross over signal is provided to the controller via Opto-coupler circuit to pin
no 13 of the circuit .

6
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

1.1 COMPONENTS USED

Microcontroller = arduino.
MOC 3021= Opto-Coupler For Triac Driver (1)
PC 817 Optocoupler For Zero Cross Over Input (1)
16X2 LCD Display (1)
npn Transistor (2)
pnp Transisitor (3)
Diode= In 4007(8)
7805 Regulator
Push to on Switches (4)
Triac bt 136 (1)

Resistor:
16kΩ (4)
1k (2)
470 KΩ (3)
220 KΩ (5)

Capacitor
1000 µf (2)
10 µf (1)

7
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

1.2 TRIAC
Triac is a power electronic component that conducts in both directions when
triggered through gate. .As it can be seen that at time t1, angle of sinusoid is 45' which
means that if we triggered Triac at this angle i-e at 45', only shaded blue area will pass
through the Triac and hence through the load. Observe that shaded blue are has RMS
Voltage less than the pure sinusoid. This is the basic principle by which RMS Voltage
control is accomplished. Firing needs a small pulse at gate that can be give through
microcontroller also. Similarly at firing angle 90' (firing angle is an angle with reference
zero crossing at which the Triac is triggered using gate pulse) , only red part of sinusoid
will pass through the Triac giving us the RMS 110V for 220V.

Fig.2. sinusoidal waveform

8
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

Fig.3. Basic idea of voltage control

Courtesy of Motorola, Inc


MOC3021 is an optotriac (product of Motorola) that is used for isolation between
power and driving circuitry. Note that when C828 on the base is applied voltage>0.7V,
optotriac gets triggered. As the triac gets triggered now, the positive or negative voltage
(whatever maybe) get pass through the gate of BT136 (triac) and hence triggered it. It
should be noted here that by using above arrangement we can control the RMS voltage in
both directions. What needs to be taken care of, is the triggering time or firing angle.
There is a need of a zero-crossing detector that will give us the reference for providing
delay for desired firing angle. In above example, for firing angle to be 90' for 220V 50Hz
AC signal, we need to have a delay of 2.5 ms (t1=2.5ms) right after each zero crossing.
Usually MOC3021 is driven through microcontroller, which gives the firing pulse on the
basis of interrupt generated by the zero-crossing detector. 

9
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

Fig.4. circuits used for speed control of a.c. motor

10
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

The above circuit is mainly used as a dimmer and is often used speed controlling of AC
motor. There are other versions of the above circuits available that caters for the
inductive load which will be discussed later.

1.3 HARDWARE DESCRIPTION


Complete circuit is work on 5 volt regulated power supply. For this purpose we
use one step down transformer, two diode and on capacitor circuit. After capacitor we use
one 5 volt regulator circuit. Output of the regulator is connected to the 2051 regulator
circuit. .
One ac signal is also provided to the pin no p3.3 to give zero crossing action. For
this purpose we use one full wave rectifier and this pulsating dc is provided to the
optocoupler. Optocoupler convert this signal into opposite direction and the same time
give a optical isolation to this pin. Output of the phototransistor is connected to the
external interrupt no 1. There is a external interrupt in this microcontroller. In this
microcontroller is connected to the zero crossing ac voltage.
Output pins of the microcontroller is connected to the port p1. Note that output of
the microcontroller is active low,
P1.1, P1.1, P1.2, P1.3 is connected to the inverter ic 4049. This inverter ic is hex inverter
ic. We use two output of the inverter ic to the base of the npn transistor through 470 ohm
resistor. Emitter of the NPN transistor is connected to the forward bias. Collector is
reverse bias through the Relay coil. One reverse bias diode is connected between relay to
protect the transistor when relay off and send a back emf to the transistor.
Three more switches are connected to the circuit to on/off and control the speed of
the a.c. motor. Firstly we on the switch when the microcontroller send the a.c. motor on
signal then p1.6 p1.7 pins and low and output led is also on. Note that led is connected in
reverse bias on this pin. P1.4 and P1.5 are connected to two rest pins of the IC 4049.
Output available on the p1.5 and p1.6 is inverted by the inverter ic and this output is
connected to the pin no 2 of the opto triac. This opto triac is a very special triac. By this
triac we control the firing angle of the triac. Pin no 4 and 6 are connected to the triac
through load.

11
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

We control the brightness of the triac through the pulse train of the pulse width
modulation. As we as we press the up or down key. New pulse width is available on the
output. By this output we compare with the zero crossing action and by the result we
control the brightness of the lamp or speed of the fan. Pulse width modulation is
the most important part of this project to control the speed of the a.c. motor or control the
brightness of the lamp.

CHAPTER 2:
BASICS OF MOTION CONTROL
Definitions of motion control vary widely in industry today. Depending on the
application, motion control can refer to simple on/off control or a sequencing of events,
controlling the speed of a motor, moving objects from one point to another or precisely
constraining the speed, acceleration, and position of a system throughout a move.
Varying interpretations used in the field may confuse engineers working for the
first time in some aspect of motion control. Motion control means different things to
different sections of industry. As an introduction, this chapter differentiates among
motion control techniques. It puts each technique into perspective in terms of where
typical applications arise.
In many cases, motion control techniques are intimately tied to the controller as
well as to the positioning hardware and actuator. No overview of motion control would
be complete without a discussion of the various control options that are widely used.
These include simple timers and counters, chip level and board level computers,
programmable logic controllers, and pneumatic sequencers.

2.1 BASIC TYPES:


Industrial motion control can be divided into three categories:

2.1.1 SEQUENCING:

12
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

Sequencing refers to the control of several operations so that they all occur in a
particular order. Perhaps the simplest example of sequential motion is the progression of
events that take place through the mechanical linkages of a player piano. When a player
piano plays a tune, holes in a paper roll cause piano wires to be struck in a specific
sequence. Similarly, opening and closing valves can be sequenced mechanically with
camshafts.
Sequencing generally becomes too complicated to be handled mechanically in
industrial equipment such as conveyor lines, or process machines such as fryers in fast
food restaurants. The key factor that defines these as sequencing applications is a need
for move and stop on and off control of events that must take place in a certain
progression. Soak time or the position of material on an assembly line determine when
operations should start and stop.
For example, consider a conveyor line that moves parts from one assembly station
to another. The controller might position a part at one station until an operator punches an
“advance” button. This might start the part moving to the next station. Here it might enter
a cleaning bath for a programmed soak time. At the end of this period, it might move to a
new station for final assembly, and so forth.
This sort of timing and sequencing is handled through pneumatic, electronic, or
electromechanical controllers. Of these, electronic and electromechanical controls are
most common. For simple on off control, timers and counters may suffice. These devices
contain electrical contacts that can be opened and closed at time intervals that an operator
either enters on a keypad or sets with switches. Counters are similar devices that actuate
contacts when a count reaches a preset number. The count increments or decrements
when sensors such as proximity switches or limit switches sense an object.

2.1.2 SPEED CONTROL:


Speed control refers to applications involving machines run at varying speeds or
torques. The source of power for such applications is generally either an internal
combustion engine, or an electric, hydraulic, or pneumatic motor. Speed can be
controlled either mechanically or, in the case of electric motors electronically.

13
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

In contrast to mechanical speed control technology, which usually employs gearing or


belts to change speed, electronic speed control manipulates applied electrical power to
control velocity and torque. Electronic speed control in ac motors employ special
amplifiers or drives. These generally vary ac motor speed. Though such electronic
controls are more expensive than mechanical speed controls, they provide the advantage
of reduced energy costs. Applications for such equipment include fans, blowers, pumps
and compressors.

2.1.3 POINT TO POINT CONTROL:


Point to point motion control, in contrast with velocity control, generally refers to
applications where something must move from one point to another at a constant speed.
An important requirement in such applications is that there are two factors that must be
controlled speed and distance. Examples of point to point movement are in x-y tables and
in machining, where a tool moves in a straight line while it touches a workplace along
one axis.
Because such applications demand monitoring and control of both velocity and
position, they need a controller to keep track of system operating conditions at any given
time. These controllers can be either hardwired electronic logic, and computer or a PLC.
In general, the simplest positioning system of this sort might be found on older milling
machines. These contain an x-y positioning system for moving the fixture holding the
workplace. The positioning system involves ac or dc motors, an adjustable speed drive,
clutch, and a position transducer that reads out the position of each table axis. The
positioning mechanism for such a system is usually a ball screw.

14
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

CHAPTER 3:
arduino MICRO CONTROLLER
The arduino developed and launched in the early 80`s, is one of the most popular
micro controller in use today. It has a reasonably large amount of built in ROM and
RAM. In addition it has the ability to access external memory.
The generic term `8x51` is used to define the device. The value of x defining the kind of
ROM, i.e. x=0, indicates none, x=3, indicates mask ROM, x=7, indicates EPROM and
x=9 indicates EEPROM or Flash.

3.1 DIFFERENT MICRO CONTROLLERS IN MARKET


 PIC One of the famous microcontrollers used in the industries. It is based on
RISC Architecture which makes the microcontroller process faster than other
microcontroller.
 INTEL These are the first to manufacture microcontrollers. These are not as
sophisticated other microcontrollers but still the easiest one to learn.
 ATMEL Atmel’s AVR microcontrollers are one of the most powerful in the
embedded industry. This is the only microcontroller having 1kb of ram even the
entry stage. But it is unfortunate that in India we are unable to find this kind of
microcontroller.

15
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

3.2 HOW TO PROGRAM BLANK CHIP


Intel arduino is CISC architecture which is easy to program in assembly language
and also has a good support for High level languages.
The memory of the microcontroller can be extended up to 64k.
This microcontroller is one of the easiest microcontrollers to learn.
The arduino microcontroller is in the field for more than 20 years. There are lots of books
and study materials are readily available for arduino.
First of all we select and open the assembler and wrote a program code in the file.
After wrote a software we assemble the software by using internal assembler of the
arduino editor. If there is no error then assembler assemble the software abd 0 error is
show the output window.

Fig.5. To Program chip step1

16
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

now assembler generate a ASM file and HEX file. This hex file is useful for us to
program the blank chip.
Now we transfer the hex code into the blank chip with the help of serial programmer kit.
In the programmer we insert a blank chip 0f 89s51 series . these chips are multi –time
programmable chip. This programming kit is seperatally available in the market and we
transfer the hex code into blank chip with the help of the serial programmer kit

Fig.6. To Program Chip step2

17
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

Fig.7. To Program Chip step3

18
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

Fig.8. To Program Chip step4

19
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

CHAPTER 4:
Arduino MICROCONTROLLER
This is a 8-bit Microcontroller with 8K Bytes Flash.

4.1 FEATURES:
• Compatible with MCS-51™ Products
• 8K Bytes of In-System Reprogrammable Flash Memory
• Endurance: 1,000 Write/Erase Cycles
• Fully Static Operation: 0 Hz to 24 MHz
• Three-level Program Memory Lock
• 256 x 8-bit Internal RAM
• 32 Programmable I/O Lines
• Three 16-bit Timer/Counters
• Eight Interrupt Sources
• Programmable Serial Channel
• Low-power Idle and Power-down Modes

4.2 DESCRIPTION:
The Arduino is a low-power, high-performance CMOS 8-bit microcomputer with
8K bytes of Flash programmable and erasable read only memory (PEROM). The device
is manufactured using Atmel’s high-density nonvolatile memory technology and is
compatible with the industry-standard 80C51 and 80C52 instruction set and pinout.
The on-chip Flash allows the program memory to be reprogrammed in-system or
by a conventional nonvolatile memory programmer. By combining a versatile 8-bit CPU
with Flash on a monolithic chip, the Atmel Arduino is a powerful microcomputer which
provides a highly-flexible and cost-effective solution to many embedded control
applications.

20
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

Fig.9. Block Diagram of Arduino

21
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

The Arduino provides the following standard features: 8K bytes of Flash, 256 bytes of
RAM, 32 I/O lines, three 16-bit timer/counters, a six-vector two-level interrupt
architecture, full-duplex serial port, on-chip oscillator, and clock circuitry. In addition,
the Arduino is designed with static logic for operation down to zero frequency and
supports two software selectable power saving modes. The Idle Mode stops the CPU
while allowing the RAM, timer/counters, serial port, and interrupt system to continue
functioning. The Power-down mode saves the RAM contents but freezes the oscillator,
disabling all other chip functions until the next hardware reset.

4.3 PIN DESCRIPTION:


VCC: Supply voltage.
GND: Ground.
PORT 0: Port 0 is an 8-bit open drain bi-directional 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 inputs.
Port 0 can also be configured to be the multiplexed loworder 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 bi-directional 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), respectively, as
shown in the following table.
Port 1 also receives the low-order address bytes during Flash programming and
verification.

22
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

Port Pin Alternate Functions


P1.0 T2(external count input to timer/counter 2),
Clock out
P1.1 T2EX(Timer/counter 2 capture/reload trigger and
direction control )
Table 1. Alternate functions of port pin1

PORT 2: Port 2 is an 8-bit bi-directional 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 uses 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 uses 8-bit addresses (MOVX @ RI), Port 2
emits the contents of the P2 Special Function Register.
Port 2 also receives the high-order address bits and some control signals during Flash
programming and verification.

PORT 3: Port 3 is an 8-bit bi-directional 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 pullups 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.
Port 3 also serves the functions of various special features of the AT89S51, as
shown in the following table.
Port 3 also receives some control signals for Flash programming and verification.

23
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

Port Pin Alternate functions


P3.0 RXD (serial input port)
P3.1 TXD (serial output port)
P3.2 INTO (external interrupt 0)
P3.3 INT1 (external interrupt 1)
P3.4 TO (timer 0 external input)
P3.5 T1 (timer 1 external input)
P3.6 WR (external data memory write strobe)
P3.7 RD (external data memory read strobe)

Table 2. Alternate functions of Port Pin3

RST: Reset input. A high on this pin for two machine cycles while the oscillator is
running resets the device.
ALE/PROG: Address Latch Enable 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.
If desired, ALE operation can be disabled by setting bit 0 of SFR location 8EH.
With the bit set, ALE is active only during a MOVX or MOVC instruction. Otherwise,
the pin is weakly pulled high. Setting the ALE-disable bit has no effect if the
microcontroller is in external execution mode.
PSEN: Program Store Enable is the read strobe to external program memory. When the
Arduino 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.

24
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

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 when 12-volt programming is selected.
XTAL1: Input to the inverting oscillator amplifier and input to the internal clock
operating circuit.
XTAL2: Output from the inverting oscillator amplifier.

4.3.1 SPECIAL FUNCTION REGISTERS:


A map of the on-chip memory area called the Special Function Register (SFR)
.Note that not all of the addresses are occupied, and unoccupied addresses may not be
implemented on the chip. Read accesses to these addresses will in general return random
data, and write accesses will have an indeterminate effect.
User software should not write 1s to these unlisted locations, since they may be used in
future products to invoke new features. In that case, the reset or inactive values of the
new bits will always be 0.
TIMER 2 REGISTERS: Control and status bits are contained in registers T2CON for
Timer 2. The register pair (RCAP2H, RCAP2L) are the Capture/Reload registers for
Timer 2 in 16-bit capture mode or 16-bit auto-reload mode.
INTERRUPT REGISTERS: The individual interrupt enable bits are in the IE register.
Two priorities can be set for each of the six interrupt sources in the IP register.
DATA MEMORY: The Arduino implements 256 bytes of on-chip RAM. The upper 128
bytes occupy a parallel address space to the special Function Registers. That means the
upper 128 bytes have the same addresses as the SFR space but are physically separate
from SFR space.
When an instruction accesses an internal location above address 7FH, the address
mode used in the instruction specifies whether the CPU accesses the upper 128 bytes of
RAM or the SFR space. Instructions that use direct addressing access SFR space.

25
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

For example, the following direct addressing instruction accesses the SFR at location
0A0H (which is P2).
MOV 0A0H, #data
Instructions that use indirect addressing access the upper 128 bytes of RAM. For
example, the following indirect addressing instruction, where R0 contains 0A0H,
accesses the data byte at address 0A0H, rather than P2 (whose address is 0A0H).
MOV @R0, #data
Note that stack operations are examples of indirect addressing, so the upper 128
bytes of data RAM are available as stack space.
TIMER 0 AND 1: Timer 0 and Timer 1 in the Arduino operate the same way as Timer 0
and Timer 1 in the AT89S51.
TIMER 2: Timer 2 is a 16-bit Timer/Counter that can operate as either a timer or an event
counter. The type of operation is selected by bit C/T2 in the SFR T2CON
Timer 2 has three operating modes: capture, auto-reload (up or down counting),
and baud rate generator. The modes are selected by bits in T2CON, as shown in Table 3.
Timer 2 consists of two 8-bit registers, TH2 and TL2. In the Timer function, the TL2
register is incremented every machine cycle. Since a machine cycle consists of 12
oscillator periods, the count rate is 1/12 of the oscillator frequency.
In the Counter function, the register is incremented in response to a 1-to-0
transition at its corresponding external input pin, T2. In this function, the external input is
sampled during S5P2 of every machine cycle. When the samples show a high in one
cycle and a low in the next cycle, the count is incremented. The new count value appears
in the register during S3P1 of the cycle following the one in which the transition was
detected. Since two machine cycles (24 oscillator periods) are required to recognize a 1-
to-0 transition, the maximum count rate is 1/24 of the oscillator frequency. To ensure that
a given level is sampled at least once before it changes, the level should be held for at
least one full machine cycle.

26
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

CAPTURE MODE: In the capture mode, two options are selected by bit EXEN2 in
T2CON. If EXEN2 = 0, Timer 2 is a 16-bit timer or counter which upon overflow sets bit
TF2 in T2CON. This bit can then be used to generate an interrupt. If EXEN2 = 1, Timer
2 performs the same operation, but a 1- to-0 transition at external input T2EX also causes
the current value in TH2 and TL2 to be captured into RCAP2H and RCAP2L,
respectively. In addition, the transition at T2EX causes bit EXF2 in T2CON to be set.
The EXF2 bit, like TF2, can generate an interrupt. The capture mode is illustrated in
Figure 10
AUTO-RELOAD (UP OR DOWN COUNTER): Timer 2 can be programmed to count up
or down when configured in its 16-bit auto-reload mode. This feature is invoked by the
DCEN (Down Counter Enable) bit located in the SFR T2MOD. Upon reset, the DCEN
bit is set to 0 so that timer 2 will default to count up. When DCEN is set, Timer 2 can
count up or down, depending on the value of the T2EX pin.

Fig.10. Timer in Capture Mode

Figure 11 shows Timer 2 automatically counting up when DCEN = 0. In this mode, two
options are selected by bit EXEN2 in T2CON. If EXEN2 = 0, Timer 2 counts up to
0FFFFH and then sets the TF2 bit upon overflow. The overflow also causes the timer
registers to be reloaded with the 16-bit value in RCAP2H and RCAP2L. The values in
Timer in Capture ModeRCAP2H and RCAP2L are preset by software. If EXEN2 = 1, a
16-bit reload can be triggered either by an overflow or by a 1-to-0 transition at external

27
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

input T2EX. This transition also sets the EXF2 bit. Both the TF2 and EXF2 bits can
generate an interrupt if enabled.
Setting the DCEN bit enables Timer 2 to count up or down, as shown in Figure 3.
In this mode, the T2EX pin controls the direction of the count. A logic 1 at T2EX makes
Timer 2 count up. The timer will overflow at 0FFFFH and set the TF2 bit. This overflow
also causes the 16-bit value in RCAP2H and RCAP2L to be reloaded into the timer
registers, TH2 and TL2, respectively.
A logic 0 at T2EX makes Timer 2 count down. The timer underflows when TH2
and TL2 equal the values stored in RCAP2H and RCAP2L. The underflow sets the TF2
bit and causes 0FFFFH to be reloaded into the timer registers.
The EXF2 bit toggles whenever Timer 2 overflows or underflows and can be used
as a 17th bit of resolution. In this operating mode, EXF2 does not flag an interrupt.

28
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

Fig.11. Timer 2 auto reload mode (DCEN=0)

29
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

Fig.12. Timer 2 auto reload mode (DCEN=1)

Fig.13. Timer 2 in Baud Rate Generator Mode

30
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

4.3.2 BAUD RATE GENERATOR:


Timer 2 is selected as the baud rate generator by setting TCLK and/or RCLK in
T2CON (Table 2). Note that the baud rates for transmit and receive can be different if
Timer 2 is used for the receiver or transmitter and Timer 1 is used for the other function.
Setting RCLK and/or TCLK puts Timer 2 into its baud rate generator mode, as shown in
Figure 13.
The baud rate generator mode is similar to the auto-reload mode, in that a rollover
in TH2 causes the Timer 2 registers to be reloaded with the 16-bit value in registers
RCAP2H and RCAP2L, which are preset by software. The baud rates in Modes 1 and 3
are determined by Timer 2’s overflow rate according to the following equation.

The Timer can be configured for either timer or counter operation. In most
applications, it is configured for timer operation (CP/T2 = 0). The timer operation is
different for Timer 2 when it is used as a baud rate generator. Normally, as a timer, it
increments every machine cycle (at 1/12 the oscillator frequency). As a baud rate
generator, however, it increments every state time (at 1/2 the oscillator frequency). The
baud rate formula is given below.

where (RCAP2H, RCAP2L) is the content of RCAP2H and RCAP2L taken as a 16-bit
unsigned integer.
Timer 2 as a baud rate generator is shown in Figure 11. This figure is valid only if
RCLK or TCLK = 1 in T2CON. Note that a rollover in TH2 does not set TF2 and will
not generate an interrupt. Note too, that if EXEN2 is set, a 1-to-0 transition in T2EX will
set EXF2 but will not cause a reload from (RCAP2H, RCAP2L) to (TH2, TL2). Thus

31
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

when Timer 2 is in use as a baud rate generator, T2EX can be used as an extra external
interrupt.
Note that when Timer 2 is running (TR2 = 1) as a timer in the baud rate generator
mode, TH2 or TL2 should not be read from or written to. Under these conditions, the
Timer is incremented every state time, and the results of a read or write may not be
accurate. The RCAP2 registers may be read but should not be written to, because a write
might overlap a reload and cause write and/or reload errors. The timer should be turned
off (clear TR2) before accessing the Timer 2 or RCAP2 registers.

Fig.14. Timer 2 in clock out mode

4.3.3 PROGRAMMABLE CLOCK OUT


A 50% duty cycle clock can be programmed to come out on P1.0, as shown in
Figure 5. This pin, besides being a regular I/O pin, has two alternate functions. It can be
programmed to input the external clock for Timer/Counter 2 or to output a 50% duty
cycle clock ranging from 61 Hz to 4 MHz at a 16 MHz operating frequency. To configure
the Timer/Counter 2 as a clock generator, bit C/T2 (T2CON.1) must be cleared and bit
T2OE (T2MOD.1) must be set. Bit TR2 (T2CON.2) starts and stops the timer.
The clock-out frequency depends on the oscillator frequency and the reload value
of Timer 2 capture registers (RCAP2H, RCAP2L), as shown in the following equation.

32
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

In the clock-out mode, Timer 2 roll-overs will not generate an interrupt. This
behavior is similar to when Timer 2 is used as a baud-rate generator. It is possible to use
Timer 2 as a baud-rate generator and a clock generator simultaneously. Note, however,
that the baud-rate and clock-out frequencies cannot be determined independently from
one another since they both use RCAP2H and RCAP2L.
UART: The UART in the Arduino operates the same way as the UART in the AT89C51.
INTERRUPTS: The Arduino has a total of six interrupt vectors: two external interrupts
(INT0 and INT1), three timer interrupts (Timers 0, 1, and 2), and the serial port interrupt.
These interrupts are all shown in Figure 6.
Each of these interrupt sources can be individually enabled or disabled by setting or
clearing a bit in Special Function Register IE. IE also contains a global disable bit, EA,
which disables all interrupts at once.
Note that Table shows that bit position IE.6 is unimplemented. In the AT89S51,
bit position IE.5 is also unimplemented. User software should not write 1s to these bit
positions, since they may be used in future AT89 products.
Timer 2 interrupt is generated by the logical OR of bits TF2 and EXF2 in register
T2CON. Neither of these flags is cleared by hardware when the service routine is
vectored to. In fact, the service routine may have to determine whether it was TF2 or
EXF2 that generated the interrupt, and that bit will have to be cleared in software.
The Timer 0 and Timer 1 flags, TF0 and TF1, are set at S5P2 of the cycle in
which the timers overflow. The values are then polled by the circuitry in the next cycle.
However, the Timer 2 flag, TF2, is set at S2P2 and is polled in the same cycle in which
the timer overflows.

33
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

Table.3. Function of various symbols

Fig.15. interrupt sources

34
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

4.3.4 OSCILLATOR CHARACTERISTICS:


XTAL1 and XTAL2 are the input and output, respectively, of an inverting
amplifier that can be configured for use as an on-chip oscillator, as shown in Figure 7.
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 8. 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.
IDLE MODE: In idle mode, the CPU puts itself to sleep while all the on chip peripherals
remain active. The mode is invoked by software. The content of the on-chip RAM and all
the special functions registers remain unchanged during this mode. The idle mode can be
terminated by any enabled interrupt or by a hardware reset.
Note that when idle mode is terminated by a hardware reset, the device normally
resumes program execution from where it left off, up to two machine cycles before the
internal reset algorithm takes control. On-chip hardware inhibits access to internal RAM
in this event, but access to the port pins is not inhibited. To eliminate the possibility of an
unexpected write to a port pin when idle mode is terminated by a reset, the instruction
following the one that invokes idle mode should not write to a port pin or to external
memory.
POWER-DOWN MODE: 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.

35
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

Fig.16 External clock drive configuration

Fig.17. Oscillator connections

Table.4.Status of external Pins during idle & power down modes

36
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

Program Memory Lock Bits


The AT89C52 has three lock bits that can be left unprogrammed (U) or can be
programmed (P) to obtain the additional features listed in the following table.
When lock bit 1 is programmed, the logic level at the EA pin is sampled and latched
during reset. If the device is powered up without a reset, the latch initializes to a random
value and holds that value until reset is activated. The latched value of EA must agree
with the current logic level at that pin in order for the device to function properly.

4.4 PROGRAMMING THE FLASH:


The Arduino is normally shipped with the on-chip Flash memory array in the
erased state (that is, contents = FFH) and ready to be programmed. The programming
interface accepts either a high-voltage (12-volt) or a low-voltage (VCC) program enable
signal. The Low-voltage programming mode provides a convenient way to program the
Arduino inside the user’s system, while the high-voltage programming mode is
compatible with conventional third-party Flash or EPROM programmers.
The Arduino is shipped with either the high-voltage or low-voltage programming
mode enabled. The Arduino code memory array is programmed byte-by-byte in either
programming mode. To program any nonblank byte in the on-chip Flash Memory, the
entire memory must be erased using the Chip Erase Mode.
PROGRAMMING ALGORITHM: Before programming the Arduino, the address, data
and control signals should be set up according to the Flash programming mode table and
Figure 18 and Figure 19. To program the Arduino, take the following steps.
1. Input the desired memory location on the address lines.
2. Input the appropriate data byte on the data lines.
3. Activate the correct combination of control signals.
4. Raise EA/VPP to 12V for the high-voltage programming mode.
5. Pulse ALE/PROG once to program a byte in the Flash array or the lock bits. The byte-
write cycle is self-timed and typically takes no more than 1.5 ms. Repeat steps 1 through
5, changing the address and data for the entire array or until the end of the object file is
reached.

37
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

DATA POLLING: The Arduino features Data Polling to indicate the end of a write cycle.
During a write cycle, an attempted read of the last byte written will result in the
complement of the written data on PO.7. Once the write cycle has been completed, true
data is valid on all outputs, and the next cycle may begin. Data Polling may begin any
time after a write cycle has been initiated.
READY/BUSY: The progress of byte programming can also be monitored by the
RDY/BSY output signal. P3.4 is pulled low after ALE goes high during programming to
indicate BUSY. P3.4 is pulled high again when programming is done to indicate
READY.
PROGRAM VERIFY: If lock bits LB1 and LB2 have not been programmed, the
programmed code data can be read back via the address and data lines for verification.
The lock bits cannot be verified directly. Verification of the lock bits is achieved by
observing that their features are enabled.
CHIP ERASE: The entire Flash array is erased electrically by using the proper
combination of control signals and by holding ALE/PROG low for 10 ms. The code array
is written with all 1s. The chip erase operation must be executed before the code memory
can be reprogrammed.
READING THE SIGNATURE BYTES: The signature bytes are read by the same
procedure as a normal verification of locations 030H, 031H, and 032H, except that P3.6
and P3.7 must be pulled to a logic low. The values returned are as follows.
(030H) = 1EH indicates manufactured by Atmel
(031H) = 52H indicates 89C52
(032H) = FFH indicates 12V programming
(032H) = 05H indicates 5V programming
PROGRAMMING INTERFACE: Every code byte in the Flash array can be written, and
the entire array can be erased, by using the appropriate combination of control signals.
The write operation cycle is self timed and once initiated, will automatically time itself to
completion.
All major programming vendors offer worldwide support for the Atmel microcontroller
series. Please contact your local programming vendor for the appropriate software
revision.

38
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

Table.5.Flash Programming Modes

39
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

CHAPTER 5:
LIGHT EMITTING DIODE
Light emitting diode (LED) is basically a P-N junction semiconductor diode
particularly designed to emit visible light. There are infrared emitting LEDs which emit
invisible light. The LEDs are now available in many colours red, green and yellow. A
normal LED emits at 2.4V and consumes MA of current. The LEDs are made in the form
of flat tiny P-N junction enclosed in a semi-spherical dome made up of clear coloured
epoxy resin. The dome of a LED acts as a lens and diffuser of light. The diameter of the
base is less than a quarter of an inch. The actual diameter varies somewhat with different
makes. The common circuit symbols for the LED are shown in Fig. It is similar to the
conventional rectifier diode symbol with two arrows pointing out. There are two leads-
one for anode and the other for cathode.
LEDs often have leads of dissimilar length and the shorter one is the cathode. All
manufacturers do not strictly adhere this to. Sometimes the cathode side has a flat base. If
there is doubt, the polarity of the diode should be identified. A simple bench method is to
use the ohmmeter incorporating 3-volt cells for ohmmeter function. When connected with
the ohmmeter: one way there will be no deflection and when connected the other way
round there will be a large deflection of a pointer. When this occurs the anode lead is
connected to the negative of test lead and cathode to the positive test lead of the
ohmmeter.

Fig.22.LED and LED symbol


40
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

If low range (Rxl) of the ohmmeter is used the LED would light up in most cases because
the low range of ohmmeter can pass sufficient current to light up the LED.
Another safe method is to connect the test circuit shown in Fig. 2. Use any two
dry cells in series with a current limiting resistor of 68 to 100 ohms. The resistor limits
the forward diode current of the LED under test to a safe value. When the LED under test
is connected to the test terminals in any way: if it does not light up, reverse the test leads.
The LED will now light up. The anode of the LED is that which is connected to the “A”
terminal (positive pole of the battery). This method is safe, as reverse voltage can never
exceed 3 volts in this test.

5.1 ELECTRICAL CHARACTERISTICS OF LEDS:


Electrically, a LED is similar to the conventional diode in that it has relatively
low forward voltage threshold. Once this is exceeded the junction has a low slope
resistance and conducts current readily. An external resistor must limit this current.
Forward voltage drew across red LED is nominally 1.6 V but spread with commercial
diodes, it may be as high as 2 volts or so, while the Green LED drops 2.4V. This
difference accounts for use of lower limiting resistor used with the Green LED.
Another important parameter of the LED is its maximum reverse voltage rating. For
typical Red device it is of the order of 3 volts. But for Green LED it is somewhat higher-
5 to 10 volts.
The LED produces light only when a d.c. current is passed in the forward
direction and the amount of light emitted by a LED is proportional to the forward current
over a broad range. It means that light intensity increases in an approximately linear
manner with increasing current

41
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

5.2 SEVEN SEGMENT DISPLAY DECIMAL DISPLAY:


A popular type consists of seven small, bar-shaped LED segment arranged so that
depending on which combinations are energized, the numbers 0 to 9 light up. All the
LED cathodes (or sometimes anodes) are joined to form a common connection. Current
limiting resistors are required (e.g. 270 ohms), preferably one per segment. Common
cathode method of connecting an array of display elements.
The main requirements for a suitable LED material are:
1) It must have on energy gap of appropriate width.
2) Both P and N types must exist, preferably with low resistivities.
3) Efficient radioactive pathways must be present.
4) Generally, energy gaps greater than or equal to about 2 are required.

5.2.1 SOME COMMERCIAL LED MATERIALS:


 Gallium arsenide (Ga As) doped with Si
 Gallium Phosphide (GaP) doped with N & Bi
 Gallium arsenide Phosphide (Ga As1-x Px)
 Gallium aluminium arsenide (Gax Al1-x As)

5.3 LED CONSTRUCTIONS:


To reduce reflection losses in LEDs there are two obvious ways:
a) The first is to ensure that most rays strike the surface at less than the critical
angle. This may be achieved by shaping the semiconductor /air interface into a
hemisphere.
b) The second technique is to encapsulate the junction in a transparent medium of
high refractive index. This is usually a plastic material with refractive index of
about 1.5. Moulding the plastic into an approximately hemispherical shape can
minimize the losses at the plastic lair interface.

42
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

Fig.23. cut view of LED

43
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

Coding:

44
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

Power supply

Working
This design is based around 4 main parts. A transformer, bridge rectifier, a smoothing
capacitor and the LM7805 chip which contains a 'linear voltage regulator'. Transformer is
used to convert 220 VAC to 18 VAC. Bridge rectifier is used to convert AC to ripple DC.
Capacitor is used to filter ripples from dc. 7805 voltage regulator is used to regulate
voltage to 5 VDC. LED is used for indication power supply is working or not.

Linear power supply


A linear regulated power supply regulates the output voltage by dropping excess voltage
in a series dissipative component. They use a moderately complex regulator circuit to
achieve very low load and line regulation. Linear regulated power supplies also have very
little ripple and very little output noise. The above power supply is linear power supply.
Switched-mode power supply
In a switched-mode power supply (SMPS), the AC mains input is directly rectified and
then filtered to obtain a DC voltage. The resulting DC voltage is then switched on and off
at a high frequency by electronic switching circuitry, thus producing an AC current that
will pass through a high-frequency transformer or inductor. Switching occurs at a very
high frequency (typically 10 kHz — 1 MHz), thereby enabling the use of transformers

45
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

and filter capacitors that are much smaller, lighter, and less expensive than those found in
linear power supplies operating at mains frequency. After the inductor or transformer
secondary, the high frequency AC is rectified and filtered to produce the DC output
voltage. If the SMPS uses an adequately insulated high-frequency transformer, the output
will be electrically isolated from the mains; this feature is often essential for safety.
Switched-mode power supplies are usually regulated, and to keep the output voltage
constant, the power supply employs a feedback controller that monitors current drawn by
the load. The switching duty cycle increases as power output requirements increase.
SMPSs often include safety features such as current limiting or a crowbar circuit to help
protect the device and the user from harm. In the event that an abnormal high-current
power draw is detected, the switched-mode supply can assume this is a direct short and
will shut itself down before damage is done. PC power supplies often provide a power
good signal to the motherboard; the absence of this signal prevents operation when
abnormal supply voltages are present.
Some SMPSs have an absolute limit on their minimum current output. They are only able
to output above a certain power level and cannot function below that point. In a no-load
condition the frequency of the power slicing circuit increases to great speed, causing the
isolated transformer to act as a Tesla coil, causing damage due to the resulting very high
voltage power spikes. Switched-mode supplies with protection circuits may briefly turn
on but then shut down when no load has been detected. A very small low-power dummy
load such as a ceramic power resistor or 10-watt light bulb can be attached to the supply
to allow it to run with no primary load attached.
The switch-mode power supplies used in computers have historically had low power
factors and have also been significant sources of line interference (due to induced power
line harmonics and transients). In simple switch-mode power supplies, the input stage
may distort the line voltage waveform, which can adversely affect other loads (and result
in poor power quality for other utility customers), and cause unnecessary heating in wires
and distribution equipment. Furthermore, customers incur higher electric bills when
operating lower power factor loads. To circumvent these problems, some computer
switch-mode power supplies perform power factor correction, and may employ input
filters or additional switching stages to reduce line interference.

46
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

Electrical Transformer
Transformers are capable of receiving AC power at one voltage and delivering it at
another voltage. In this article, we will go through the working and construction of a 3
phase transformer by starting from its simplest form. We will also understand what power
transformer is and how it is constructed.
Why Transformers are used?
Transformers are ubiquitous devices. They are used to either step-up the A.C voltage or
to step-down it. But, why should we do this voltage transformation? It is a science fact
that a stepped-up voltage is associated with a reduced current. A reduced current leads to
low eddy current energy loss. In this way, transformers help achieve better transmission
efficiency while transferring the power over longer distances.

Fig.1 Transformers help in step-up or step-down the voltage; this in turn increases the
transmission efficiency

47
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

After the electrical power has transmitted to the desired spot, the voltage can be reduced
to the desired level, using a step-down transformer.
The Basic Working Principle
The basic working principle of a transformer is simple, electromagnetic induction.
According to this principle, a varying magnetic flux associated with a loop will induce an
electromotive force across it. Such a fluctuating magnetic field can easily be produced by
a coil and an alternating E.M.F (EP) system. A current carrying conductor produces a
magnetic field around it. The magnetic field produced by a coil will be as shown in the
first part of Fig.2. With the fluctuating nature of the alternating current, the magnetic
field associated with the coil will also fluctuate.
This magnetic flux can be effectively linked to a secondary winding with the help of a
core made up of a ferromagnetic material. The linked magnetic flux is shown in the
second part of Fig.2. This fluctuating magnetic field will induce an E.M.F in the
secondary coils due to electromagnetic induction. The induced E.M.F is denoted by ES.

Fig.2 AC current in a coil produces a fluctuating magnetic field; this magnetic field can
effectively linked to a secondary coil with the help of a core
Since the turns are arranged in a series, the net E.M.F induced across the winding will be
sum of the individual E.M.Fs (eS) induced in each turn. Nsrepresents, number of turns at
the secondary winding.

Since the same magnetic flux is passing through the primary and secondary coils, the
EMF per turn for both the primary and secondary coils will be the same.

48
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

The E.M.F per turn for the primary coil is related to the applied input voltage as shown.

By rearraging the above equations, it can be established that, the induced E.M.F at the
secondary coil is expressed as follows.

This simply means that with fewer turns in the secondary than in primary, one can lower
the voltage. Such transformers are known as step-down transformers. For the reverse
case, one can increase the voltage (step-up transformer).

But since energy is conserved, the primary and secondary currents have to obey the
following relationship.

Resistor

49
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

A resistor is a passivetwo-terminalelectrical component that implements electrical


resistance as a circuit element. In electronic circuits, resistors are used to reduce current
flow, adjust signal levels, to divide voltages, bias active elements, and terminate
transmission lines, among other uses. High-power resistors that can dissipate many watts
of electrical power as heat may be used as part of motor controls, in power distribution
systems, or as test loads for generators. Fixed resistors have resistances that only change
slightly with temperature, time or operating voltage. Variable resistors can be used to
adjust circuit elements (such as a volume control or a lamp dimmer), or as sensing
devices for heat, light, humidity, force, or chemical activity.
Resistors are common elements of electrical networks and electronic circuits and are
ubiquitous in electronic equipment. Practical resistors as discrete components can be
composed of various compounds and forms. Resistors are also implemented within
integrated circuits.
The electrical function of a resistor is specified by its resistance: common commercial
resistors are manufactured over a range of more than nine orders of magnitude. The
nominal value of the resistance falls within the manufacturing tolerance, indicated on the
component.
Ohm's law
The behavior of an ideal resistor is dictated by the relationship specified by Ohm's law:
Ohm's law states that the voltage (V) across a resistor is proportional to the current (I),
where the constant of proportionality is the resistance (R). For example, if a 300 ohm
resistor is attached across the terminals of a 12 volt battery, then a current of 12 / 300 =
0.04 amperes flows through that resistor.
Practical resistors also have some inductance and capacitance which affect the relation
between voltage and current in alternating current circuits.
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Ω =
10−3 Ω), kilohm (1 kΩ = 103 Ω), and megohm (1 MΩ = 106 Ω) are also in common usage.

Capacitor

50
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

A capacitor is a passivetwo-terminalelectrical component that stores electrical energy in


an electric field. The effect of a capacitor is known as self-capacitance. While
capacitance exists between any two electrical conductors of a circuit in sufficiently close
proximity, a capacitor is specifically designed to provide and enhance this effect for a
variety of practical applications by consideration of size, shape, and positioning of
closely spaced conductors, and the intervening dielectric material. A capacitor was there
for historically first known as an electric condenser.
The physical form and construction of practical capacitors vary widely and many
capacitor types are in common use. Most capacitors contain at least two electrical
conductors often in the form of metallic plates or surfaces separated by a dielectric
medium. The conductors may be foils, thin films, or sintered beads of metal or
conductive electrolyte. The no conducting dielectric acts to increase the capacitor's
charge capacity. Materials commonly used as dielectrics include glass, ceramic, plastic
film, paper, mica, and oxide layers. Capacitors are widely used as parts of electrical

51
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

circuits in many common electrical devices. Unlike a resistor, an ideal capacitor does not
dissipate energy.
When two conductors experience a potential difference, for example, when a capacitor is
attached across a battery, an electric field develops across the dielectric, causing a net
positive charge to collect on one plate and net negative charge to collect on the other
plate. No current actually flows through the dielectric; instead, the effect is a
displacement of charges through the source circuit. If the condition is maintained
sufficiently long, this displacement current through the battery seizes. However, if a time-
varying voltage is applied across the leads of the capacitor, the source experiences an
ongoing current due to the charging and discharging cycles of the capacitor.
Capacitance is defined as the ratio of the electric charge Q on each conductor to the
potential difference V between them. The unit of capacitance in the International System
of Units (SI) is the farad (F), which is equal to one coulomb per volt (1 C/V).
Capacitance values of typical capacitors for use in general electronics range from about
1 pF (10−12 F) to about 1 mF (10−3 F).

The parallel plate capacitor is the simplest form of capacitor. It can be constructed using
two metal or metallized foil plates at a distance parallel to each other, with its capacitance
value in Farads, being fixed by the surface area of the conductive plates and the distance
of separation between them. Altering any two of these values alters the value of its
capacitance and this forms the basis of operation of the variable capacitors.

52
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

 Also, because capacitors store the energy of the electrons in the form of an electrical
charge on the plates the larger the plates and/or smaller their separation the greater will
be the charge that the capacitor holds for any given voltage across its plates. In other
words, larger plates, smaller distance, more capacitance.
 By applying a voltage to a capacitor and measuring the charge on the plates, the ratio of
the charge Q to the voltage V will give the capacitance value of the capacitor and is
therefore given as: C = Q/V this equation can also be re-arranged to give the more
familiar formula for the quantity of charge on the plates as: Q = C x V.
Voltage Regulator 7805
The 78xx (sometimes L78xx, LM78xx, MC78xx...) is a family of self-contained fixed
linear voltage regulatorintegrated circuits. The 78xx family is commonly used in
electronic circuits requiring a regulated power supply due to their ease-of-use and low
cost. For ICs within the family, the xx is replaced with two digits, indicating the output
voltage (for example, the 7805 has a 5 volt output, while the 7812 produces 12 volts).
The 78xx line is positive voltage regulators: they produce a voltage that is positive
relative to a common ground. There is a related line of 79xx devices which are
complementary negative voltage regulators. 78xx and 79xx ICs can be used in
combination to provide positive and negative supply voltages in the same circuit.
78xx ICs have three terminals and are commonly found in the TO220 form factor,
although smaller surface-mount and larger TO3 packages are available. These devices
support an input voltage anywhere from a few volts over the intended output voltage, up
to a maximum of 35 to 40 volts depending on the make, and typically provide 1 or 1.5
amperes of current (though smaller or larger packages may have a lower or higher current
rating).
Advantages
78xx series ICs do not require additional components to provide a constant, regulated
source of power, making them easy to use, as well as economical and efficient uses of
space. Other voltage regulators may require additional components to set the output
voltage level, or to assist in the regulation process. Some other designs (such as a
switched-mode power supply) may need substantial engineering expertise to implement.

53
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

78xx series ICs have built-in protection against a circuit drawing too much current. They
have protection against overheating and short-circuits, making them quite robust in most
applications. In some cases, the current-limiting features of the 78xx devices can provide
protection not only for the 78xx itself, but also for other parts of the circuit.
Disadvantages
The input voltage must always be higher than the output voltage by some minimum
amount (typically 2.5 volts). This can make these devices unsuitable for powering some
devices from certain types of power sources (for example, powering a circuit that requires
5 volts using 6-volt batteries will not work using a 7805).
As they are based on a linear regulator design, the input current required is always the
same as the output current. As the input voltage must always be higher than the output
voltage, this means that the total power (voltage multiplied by current) going into the
78xx will be more than the output power provided. The difference is dissipated as heat.
This means both that for some applications an adequate heatsink must be provided, and
also that a (often substantial) portion of the input power is wasted during the process,
rendering them less efficient than some other types of power supplies. When the input
voltage is significantly higher than the regulated output voltage (for example, powering a
7805 using a 24 volt power source), this inefficiency can be a significant issue.
Individual devices in the series
TS7805 linear voltage regulator in a TO-220 variant package with electrically isolated
tab.
There are common configurations for 78xx ICs, including 7805 (5 volt), 7806 (6 volt),
7808 (8 volt), 7809 (9 volt), 7810 (10 volt), 7812 (12 volt), 7815 (15 volt), 7818
(18 volt), and 7824 (24 volt) versions. The 7805 is common, as its regulated 5 volt supply
provides a convenient power source for most TTL components. Each device in this series
has minimum input voltage to be maintained to get regulated output.

54
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

55
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

In this post I will walk you through the steps required to program an AVR chip using the
AVRISP mkII.

AVR chip, programmer, adapter, breadboard and power supply


Hardware and Software Required
Here is a list of things you’ll need
Hardware
4.7K resistor
1k resistor
LED
AVR Chip: I’ll use the atmega328p
Programmer: AVRISP mkII
AVR Programmer Adapter (optional)
Jumper Wires

56
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

5V Power supply. You can of course use batteries if you prefer.


Software
AVR Studio 5
Circuit Set Up
Simply find the pins in your programmer, match them to the pins in your chip and
connect them. Also connect the resistor from pin 7 to power.

AVRISP MKII pins

ATmega328p pin out

57
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

Now because the programmer doesn’t have one squared hole, or at least mine doesn’t, it
has many, let me show how how that looks in real life, and yes it is like a mirror image of
the image above (weird right?).

AVRispmkII holes
Now that we have everything connected…

58
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

AVRISP mkII: circuit to program

..let’s move on to the software. Check out the picture at the very top of this page to see
how much neater your circuit will be with the programming adapter.
Your First AVR Program
Let me go ahead and walk you through the steps of using AVR Studio 5.
Once you have opened AVR Studio click on File ->New -> Project.

59
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

Creating a new project in AVR Stduio 5

Name your project, I named mine firstprogram. Now click the OK button.

60
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

naming your project


Next you will be greeted with an almost blank C file.

61
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

AVR Studio blank template C file

So what software are we going to write? how about we make an led blinker. Connect an
LED to port C5 of your microcontroller through the 1k resistor and then to ground.

62
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

red led connected to port C5 (pin 28) of the ATmega328p


Now back to AVR Studio. Replace the text in the file with the following.
#include<avr/io.h>
#include<avr/delay.h>// has some delay functions you can use
 
int main(void)
{
DDRC=0xff;// all C ports as output
while(1)
{
//TODO:: Please write your application code

PORTC=0xff;// turn on all C porst

63
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

_delay_ms(200);// wait 200 milliseconds


PORTC=0x00;// turn off all c ports
_delay_ms(200);// wait 200 milliseconds

}
}
The code that gets uploaded to the microcontroller is actually a HEX file, but we have to
tell AVR Studio to make this file. To do that right click on your project’s name on the
right in the solution explorer window and click on The code that gets uploaded to the
microcontroller is actually a HEX file, but we have to tell AVR Studio to make this file.
To do that right click on your project’s name on the right in the solution explorer window
and click on properties.

64
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

65
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

66
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

67
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

68
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

69
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

70
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

hex file checkbox, make sure it's checked.


Now to actually generate the hex file click Build->Build Solution
avr studio build menuthis will compile the program and generate the hex file we need.
You should not get any errors, as shown below.
program compilation errorsno compilation errorsUpload The Code to The
Microcontroller
At last, we are done with all the software developing stuff, uploading is just as easy.
Click on Tools->AVR Programmingavr studio tools menu
avr studio tools menuYou’ll get the programming window. Make sure that your device is
selected.
avr programming windowthe programming windowNow in the following order, click on
the Apply button, then the voltage button (recycling/refresh looking icon) will become
active now click it, you should get some value close to 5 volts. Then click on the Read
button. If you didn’t get any error window you are good to go.

Clicking the Read and Voltage buttons is not necessary actually, but the Apply button
is.avr studio programming window: 5 volts and device idprogramming window after
clicking buttonslastly click on Memories and select your hex file then click Program, the
programmer will start blinking and stop when your program is done uploading.avr studio
memories window, hex file ready to uploadhex file ready for upload

71
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

If you are into electronics, PCBs are the most common things you will see. These boards
make our lives easier by eliminating all those connecting wires and breadboards. If
properly designed, it even makes our project look smaller and sexy.
What is a circuit board? A printed circuit board (PCB) mechanically supports and
electrically connects electronic components using conductive tracks, pads and other
features etched from copper sheets laminated onto a non-conductive substrate.A printed
circuit board has pre-designed copper tracks on a conducting sheet. The pre-defined
tracks reduce the wiring thereby reducing the faults arising due to lose connections. One
needs to simply place the components on the PCB and solder them.
In this cool tutorial, I will show you how you can make circuit boards at home easily.
Doing so will save you a lot of time from debugging and double checking the
connections on a breadboard. You could even make your own arduino after going
through this tutorial: DIY Arduino and the current one. So, sit back and see how its done
really easily :)
What are the different ways to make a Circuit Board?
There are in all three basic methods to make PCB:
Iron on Glossy paper method.
Circuit by hand on PCB.
Laser cutting edge etching.
Since laser method is industrial method to make PCB we will get in detail of first two
methods to make PCB at home.
PCB Design:
PCB design is usually done by converting your circuit’s schematic diagram into a PCB
layout using PCB layout software. There are many cool open source software packages
for PCB layout creation and design.
Some are listed here to give you a head-start:
Cadsoft Eagle (http://www.cadsoftusa.com/download-eagle/?language=en)
PCBWizard (http://pcb-wizard.software.informer.com/4.0/)
Design your circuit schematic in Cadsoft Eagle:
In Eagle: File> Export>ImageBe sure to set DPIG to 1200 for better quality
What are the stuff required to make a Circuit Board?

72
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

You also need: FeCl3 powder/solution (same as etching solution), photo/glossy paper,
permanent black marker, blade cutter, sandpaper, kitchen paper, cotton wool.
For this tutorial, lets consider making a PCB for a simple project- a Touch Switch using
IC555.
STEP 1: Take printout of circuit board layout
Take a print out of your PCB layout using the laser printer and the A4 photo paper/glossy
paper. Keep in mind the following points:

73
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

You should take the mirror print out.


Select the output in black both from the PCB design software and printer driver settings.
Make sure that the printout is made on the glossy side of the paper.

PCB print on glossy paper


STEP 2: Cutting the copper plate for the circuit board
Cut the copper board according to the size of layout using a hacksaw or a cutter.

Copper clad plate

74
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

Cutting the plate


  Next, rub the copper side of PCB using steel wool or abrasive spongy scrubs. This
removes the top oxide layer of copper as well as the photo resists layer. Sanded surfaces
also allows the image from the paper to stick better.

Rubbing away the top oxide layer


STEP 3: Transferring the PCB print onto the copper plate
Method 1 Iron on glossy paper method (for complex circuits): Transfer the printed
image (taken from a laser printer) from the photo paper to the board. Make sure to flip
top layer horizontally. Put the copper surface of the board on the printed layout. Ensure
that the board is aligned correctly along the borders of the printed layout.  And use tape to
hold the board and the printed paper in the correct position.

75
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

Place the printed side of the paper on the plate


Method 2 Circuit by hand on PCB (for simple and small circuits): Taking the circuit
as reference, draw a basic sketch on copper plate with pencil and then by  using a
permanent black marker.

Using the permanent marker for sketching the PCB


STEP 4: Ironing the circuit from the paper onto the PCB plate
After printing on glossy paper, we iron it image side down to copper side. Heat up the
electric iron to the maximum temperature.
Put the board and photo paper arrangement on a clean wooden table (covered with a table
cloth) with the back of the photo paper facing you.
Using pliers or a spatula, hold one end and keep it steady. Then put the hot iron on the
other end for about 10 seconds. Now, iron the photo paper all along using the tip and
applying little pressure for about 5 to 15 mins.
Pay attention towards the edges of the board – you need to apply pressure, do the ironing
slowly.
Doing a long hard press seems to work better than moving the iron around.

76
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

Here, the heat from the iron transfers the ink printed on the glossy paper to the copper
plate.

Iron the paper onto the plate


CAUTION: Do not directly touch copper plate because it is very hot due to ironing.
After ironing, place printed plate in luke warm water for around 10 minutes. Paper will
dissolve, then remove paper gently. Remove the paper off by peeling it from a low angle.

Peeling the paper


In some cases while removing the paper, some of the tracks get fainted. In the figure
below, you can see that the track is light in colour hence we can use a black marker to
darken it as shown.

77
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

Light trace

Darkening the trace


 STEP 5: Etching the plate
You need to be really careful while performing this step.
First put rubber or plastic gloves.
Place some newspaper on the bottom so that the etching solution does not spoil your
floor.
Take a plastic box and fill it up with some water.
Dissolve 2-3 tea spoon of ferric chloride power in the water.
Dip the PCB into the etching solution (Ferric chloride solution, FeCl3) for approximately
30 mins.
The FeCl3 reacts with the unmasked copper and removes the unwanted copper from the
PCB.

78
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

This process is called as Etching. Use pliers to take out the PCB and check if the entire
unmasked area has been etched or not. In case it is not etched leave it for some more time
in the solution.

Etching the plate


Gently move the plastic box to and fro so that etching solution reacts with the exposed
copper. The reaction is given as:
Cu + FeCl3 = CuCl3 + Fe
After every two minutes check if all the copper has been removed. If it hasn’t then place
it back in the solution and wait.
CAUTION: Always use gloves while touching the plate having the solution.

79
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

Etched copper plate


STEP 6: Cleaning, disposing and final touches for the circuit board
Be careful while disposing the etching solution, since its toxic to fish and other water
organisms. And don’t think about pouring it in the sink when you are done, it is illegal to
do so and might damage your pipes (hehe, who knew you could get arrested while
making a PCB!). So dilute the etching solution and then throw it away somewhere safe.
A few drops of thinner (nail polish remover works well) on a pinch of cotton wool will
remove completely the toner/ink on the plate, exposing the copper surface. Rinse
carefully and dry with a clean cloth or kitchen paper. Trim to final size and smoothen
edges with sandpaper.

80
SPEED CONTROL OF A.C. MOTOR BY USING TRIAC

Removing the ink


Now, drill holes using a PCB driller like this: PCB driller and solder all your cool
components. If you want that traditional green PCB look, apply solder resist paint on top:
PCB lacquer. And finally! your super cool circuit board would be ready!

81

Вам также может понравиться