0% found this document useful (0 votes)
121 views63 pages

Chapter No.:-01 Introuuction: Pulse-Width Modulation (PWM), Modulation (PDM)

This document discusses using pulse-width modulation (PWM) technique to control the speed of a DC motor. PWM works by rapidly switching voltage to the motor on and off. The average voltage delivered is controlled by varying the on-time as a percentage of the total cycle time, known as duty cycle. A microcontroller can generate a PWM signal to control duty cycle and thereby regulate motor speed. The document proposes using an L293D motor driver and optocoupler to isolate the microcontroller from the motor, allowing digital PWM control of the motor's speed.

Uploaded by

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

Chapter No.:-01 Introuuction: Pulse-Width Modulation (PWM), Modulation (PDM)

This document discusses using pulse-width modulation (PWM) technique to control the speed of a DC motor. PWM works by rapidly switching voltage to the motor on and off. The average voltage delivered is controlled by varying the on-time as a percentage of the total cycle time, known as duty cycle. A microcontroller can generate a PWM signal to control duty cycle and thereby regulate motor speed. The document proposes using an L293D motor driver and optocoupler to isolate the microcontroller from the motor, allowing digital PWM control of the motor's speed.

Uploaded by

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

SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE

USING OPTOCOUPLER.

CHAPTER NO.:- 01

INTROUUCTION
Pulse-width modulation (PWM), or pulse-duration modulation(PDM), is
a modulation technique that conforms the width of the pulse, formally the pulse duration, based
on modulator signal information. Although this modulation technique can be used to encode
information for transmission, its main use is to allow the control of the power supplied to
electrical devices, especially to inertial loads such as motors. In addition, PWM is one of the two
principal algorithms used in photovoltaic solar battery chargers, the other being MPPT.

The average value of voltage (and current) fed to the load is controlled by turning the switch
between supply and load on and off at a fast pace. The longer the switch is on compared to the
off periods, the higher the power supplied to the load is.

The PWM switching frequency has to be much faster than what would affect the load, which
is to say the device that uses the power. Typically switchings have to be done several times a
minute in an electric stove, 120 Hz in a lamp dimmer, from few kilohertz (kHz) to tens of kHz
for a motor drive and well into the tens or hundreds of kHz in audio amplifiers and computer
power supplies.

The term duty cycle describes the proportion of 'on' time to the regular interval or 'period' of
time; a low duty cycle corresponds to low power, because the power is off for most of the time.
Duty cycle is expressed in percent, 100% being fully on.

The main advantage of PWM is that power loss in the switching devices is very low. When a
switch is off there is practically no current, and when it is on, there is almost no voltage drop
across the switch. Power loss, being the product of voltage and current, is thus in both cases
close to zero. PWM also works well with digital controls, which, because of their on/off nature,
can easily set the needed duty cycle.

PWM has also been used in certain communication systems where its duty cycle has been
used to convey information over a communications channel.

1
SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE
USING OPTOCOUPLER.

PWM stands for Pulse Width Modulation. This means that we can generate a pulse whose
width (ie duration) can be altered. Microcontrollers have Analogue To Digitals Convertors
(ADC) to convert a voltage from the analogue world to a number but do not have Digital to
Analogue Convertors (DAC) to convert digital numbers back into variable voltages. PWM is the
closest solution. By turning an output pin repeatedly high and low very quickly then the result is
an average of the amount of time the output is high. If it is always low the result is 0v, always
high then the result is 5v, if half-and-half then the result is 2.5v. so we can generate analog
voltage from 0 to 5 volt by using PWM technique and by applying this variable D.C. voltage we
change Speed of D.C. motor For example: if you connect a motor to a battery then it will,
eventually, rotate at full speed. Disconnect the battery and the motor will take a little while to
slow down until it stops. Equally if the motor is only connected to the battery for a very short
time before being disconnected then it wont have enough time to get up to full speed. So if we
repeatedly connected and disconnected the battery then the motor would start turning, then slow
down, start turning, slow down etc. Obviously if we only did this a few times a second then it
would be kind of jerky - but if we did it fast enough then we could control the speed of the motor
dependent on the percentage of time the battery was connected versus not connected.

2
SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE
USING OPTOCOUPLER.

OBJECTIVE:-

1. Design and construction of speed control system of a dc motor.


2. To use voltage control method to control the speed of the dc motor.
3. Implementation of our project by an electronic circuit.
4. To use 8-bit data from computer through parallel cable to the DAC, then to op-amp, PWM
generator and to the MOSFET and to the motor, to control the speed of the dc motor.

IMPORTANCE:-

There are various types of motor drive working all over the world. These motors are used to
drive the various types of loads. With respect to the loads these motors requires various types of
speed. So, there is a great need of many speed controlling devices.

LIMITATION:-
The main limitation involved with our motor controller is the Electromagnetic interference
(EMI). We know the switching or commutation of any switch generates voltage and current
transients that are characterized by a whole spectrum of frequencies, ranging from the
fundamental power circuit frequency up into the radio frequency band . This EMI creates
problem for digital tachometer to show accurate speed reading of the motor. We also observed
that at slow speed heat sink heated up quickly. This is because at slow speed i.e. when pulse
width of the gate signal of the MOSFET decreases factor (ratio of the a.c components to the
average value) also increases and causes the heat sink to heat up quickly. Fluctuations of supply
voltage of our machine lab also create problems to control the speed of motor exactly

3
SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE
USING OPTOCOUPLER.

CHAPTER NO.:-02

PWM INTRODUCTION

2.1 How Do We Create A PWM Signal:-


Before we discuss the intricacies of how we program a microcontroller then let's consider
some basics to get a general idea of what we want to achieve.

Microcontrollers are very good with whole (integer) numbers. So assuming we have two
numbers: one called BOTTOM and a higher number called TOP. By making the microcontroller
start at BOTTOM, and then count upwards until it reaches TOP, and then repeat the process - if
we were to then plot the resulting numbers on a graph then we end up with what is called a
Sawtooth waveform that looks like this.

4
SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE
USING OPTOCOUPLER.

Of course you can never output this signal from your controller as it can only cope with on or
off and not all these numbers - it just shows how the number starts at BOTTOM, counts up to
TOP, and then starts all over again.

So the next step is to add a 'comparator' which is used to decide whether our output pin should
be high or low. This comparator is yet another number which is somewhere in the range between
BOTTOM and TOP. If the current Sawtooth number is less than the comparator value then the
output will be low, otherwise the output will be high.

If the value of the comparator was equal to BOTTOM then the Sawtooth value could never be
lower than bottom so our output pin would always be high. Equally if the comparator value
was equal to TOP then the output pin would always be low. However: if the comparator value
was the mid-value between BOTTOM and TOP then the output pin would spend 50% of its
time being low and the other 50% being high. By varying the comparator value we can change
the 'high' time anywhere between 0% and 100% of the time.

Looking back at the previous diagram we can see that the sawtooth waveform is 6 units high and
repeats every 3 units across. So if we were to set our comparator to be 2 units above the
BOTTOM value then what would happen?

The sawtooth waveform would spend 1/3 of the time below this value and the remaining 2/3 of
the time above value. So our digital output pin would be a square wave that is low for 1/3 of
the time and high for 2/3 of the time.

5
SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE
USING OPTOCOUPLER.

Frequency
In the above example the sawtooth waveform repeated every 3 units. Assuming that
each unit was 1ms then our waveform repeats every 3ms.
Given that Frequency = 1 / Time
then the signal frequency is 1/0.003, or 333.33 Hz. Note that with PWM this
frequency remains constant - we just use the comparator value to adjust the duty cycle.

6
SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE
USING OPTOCOUPLER.

2.2 Duty Cycle:-


The percentage of time that our output pin is high is called the duty time. In the example
above it is high for 2/3 of the time ie a 66.66% duty cycle.
So by changing duty cycle simple we change speed of motor

The L293D is a quadruple push-pull 4 channel driver capable of delivering 600 mA (1.2 A peak
surge) per channel. The L293D is ideal for controlling the forward/reverse/brake motions of
small DC motors controlled by a microcontroller
The L293D is a high voltage, high current four channel driver designed to accept standard
TTL logic levels and drive inductive loads (such as relays solenoids, DC and stepping motors)
and switching power transistors. The L293D is suitable for use in switching applications at
frequencies up to 5 KHz.

Features Include

 600 mA Output Current Capability Per Driver


 Pulsed Current 1.2 A / Driver
 Wide Supply Voltage Range: 4.5 V to 36 V
 Separate Input-Logic Supply
 NE Package Designed for Heat Sinking
 Thermal Shutdown & Internal ESD Protection
 High-Noise-Immunity Inputs

A simple schematic for interfacing a DC motor using L293D is shown below. As you can
see in the circuit, three pins are needed for interfacing a DC motor (A, B, Enable). If you
want the o/p to be enabled completely then you can connect Enable to VCC and only 2
pins needed from controller to make the motor work. As per the truth mentioned in the
image above it‘s fairly simple to program the microcontroller. Its also clear from the truth

7
SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE
USING OPTOCOUPLER.

table of BJT circuit and L293D the programming will be same for both of them, just
keeping in mind the allowed combinations of A and B.
As you can see in the circuit, three pins are needed for interfacing a DC motor (A, B, Enable).
If you want the o/p to be enabled completely then you can connect Enable to VCC and only 2
pins needed from controller to make the motor work. As per the truth mentioned in the image
above its fairly simple to program the microcontroller. Its also clear from the truth table of BJT
circuit and L293D the programming will be same for both of them, just keeping in mind the
allowed combinations of A and B.

8
SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE
USING OPTOCOUPLER.

Suppose you want to run motor by half of the its rating speed then send 50% duty cycle
square wave at enable pin effectively you will get 50% on tine but due to high frequency and
inertia motor seems to run continuously so code will be
2.3 Opto-Isolation:-
An optocoupler or sometimes refer to as optoisolator allows two circuits to exchange signals yet
remain electrically isolated. This is usually accomplished by using light to relay the signal. The
standard optocoupler circuits design uses a LED shining on a phototransistor-usually it is a npn
transistor and not pnp. The signal is applied to the LED, which then shines on the transistor in
the IC.
The light is proportional to the signal, so the signal is thus transferred to the phototransistor.
We will explain only the most commonly used opto coupler which is the combination of LED
and phototransistor. See the optocoupler ic schematic diagram below:

An Optocoupler Symbol or Schematic diag

2.4 Serial Communication Interface:-

The microcontroller 89c51 has two pins that are used for transferring and receiving data serially.

These two pins are called as TXD and RXD i.e. pin 11(P3.0) and pin 10(P3.1) respectively.
These pins are TTL compatible so it requires a line driver to make them RS 232 compatible.
Therefore a line driver such as the MAX 232 chip is used to boost the TTL voltage level to RS
232 voltage level and vice versa. So serial communication chip MAX 232 is interface between
microcontroller 89c51 and RS 232 connector.

9
SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE
USING OPTOCOUPLER.

2.5 LCD Display:-

In this project we use, crystallonics dot-matrix alphanumeric LCD display is used for displaying
speed of moter, which is interfaced with 8bit micro controller 89c51. This built in controller
and driver provides convenient connectivity between a dot matrix

LCD and 8bit micro controller. All the functions required for dot matrix LCD display drive are
internally provided. Internal refresh is provided in the module.As shown in figure, the LCD
display module is interfaced with 8bit microcontroller 89c51. For 4bit data interface, the bus
lines D4 to D7 are used for data transfer while D0 to D3 lines are disabled. The data transfer is
complete when 4bit data has been transferred twice. For 8bit data interface, all 8 bus lines D0
to D7 are used.

As shown in figure port P1.0 to P1.3 of microcontroller are connected directly to the data pins D4
to D7 of LCD module. The control pins of LCD i.e. RS and EN are connected to the port pins
P1.4 and P1.5 of microcontroller. They can be set/reset as per the requirements of instructions
code of the display operation by microcontroller.

The read/write input pin (R/W), allows the user to write information to the LCD so it is
connected to ground. Also there is a potentiometer (VR5) is connected between VCC and GND
pin of LCD module. Pin no. 3 i.e. liquid crystal drive voltage (VEE) varies this potentiometer for
controlling the LCD contrast.

Microcontroller sends low signal to RS pin i.e. RS=0. So instruction command code register is
selected and microcontroller send commands such as clear display, cursor at home or blink
the cursor etc.

When microcontroller calculate weight and amount of postage and ready to send data to the LCD
module, make RS pin high i.e. RS=1. Then microcontroller sends data to the data pins of LCD

i.e. D4 to D7. When data is supplied to the data pins twice, a high to low pulse must be applied to
the enable pin (EN) by the microcontroller. So that LCD latch the information or data present at
its data pins and display it.

10
SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE
USING OPTOCOUPLER.

Capacitor ―C5‖ and Resistance ―R5‖ are connected between RST (reset) pin of micro
controller. So that when power is turn ON programmed execution start from starting
memory location 000H between pin 18 & 19 (XTAL1 & XTAL2) quartz ceramic crystal of
12 MHz freq. Are connected to generate oscillation req. for machine cycle to fetch decode &
execution of instruction in micro controller.
For our project we req. regulated supply of +5v d.c. which can be generated using 230v/0-
15(1Amp) step-down transformer, full wave bridge rectifier & filter condenser. For stability
purpose we use 7805 voltage regulate IC at o/p at rectifier o/p we get +12v d.c. by dropping
and converting 15v AC.

11
SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE
USING OPTOCOUPLER.

CHAPTER NO.:-03
CIRCUIT OPERATION

CIRCUIT DIAGRAM:-

12
SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE
USING OPTOCOUPLER.

Basically, there are three ways to vary the speed of DC Motors:-

1. with the use of mechanical gears to achieve the desired speed. This method is generally
beyond the capability of most hobbyist home workshops.

2. Reducing the motor voltage with a series resistor .However this is inefficient (energy wasted
in resistor) and reduces torque. The current drawn by the motor increases as the load on the
motor increases. More current means a larger voltage drop across the series resistor and therefore
less voltage to the motor. The motor now tries to draw even more current, resulting in the motor
"stalling".

3. By applying the full supply voltage to the motor in bursts or pulses, eliminating the series
dropping effect. This is called pulse width modulation (PWM)and is the method used in this
Project. Short pulses means the motor runs slowly; longer pulses make the motor run faster.

3.1 WORKING:-
Pulse width modulation is implemented using a microcontroller, dependent on an input value for

generating variable pulse widths, for driving motor at variable speed.

Therefore, the input value used is given with the help of potentiometer.

The 2 terminals of potentiometer are connected to Vcc& GND, resulting in variable 44voltage in

range of 0-5V, in the terminal W of potentiometer. This pin serves as the input for

microcontroller.

The ATmega8L has inbuilt 10 bit ADC (Analog to Digital Converter), which means it can

convert any analog value between 0-5V to digital value of 10 bit resolution.

The program for generating results for pulse width is written into microcontroller‘s memory

using ISP (In System Programmer).

13
SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE
USING OPTOCOUPLER.

The variable output (between 0-5V) goes to the A (Analog Input) pin of the ADC (Analog to
Digital Converter) of the microcontroller and gets converted into 10 bit binary value. This 10 bit
10
binary value gets converted into corresponding decimal value of range 0-1023 (as 2 =1024),
which is responsible for triggering the output pin of microcontroller, for particular time duration,
which further triggers the MOSFET for same duration.

3.2 PRINCIPLES:-
Pulse width modulation (PWM) is a method for binary signals generation, which has 2 signal

periods (high and low). The width (W) of each pulse varies between 0 and the period (T). The

main principle is control of power by varying the duty cycle. Here the conduction time to the

load is controlled. Let for a time t1, the input voltage appears across the load i.e. ON state and

for t2 time the voltage across the load is zero.

• The average voltage at output is given by

Va = Vmax. *
Where,

TO =Time period for Pulse ON,


N

TOFF =Time period for Pulse OFF

• The average load current Ia= Va/R = kVs/R where, T is the total time period =t1+t2, k = t1/T is
the duty cycle.
• The duty cycle can be varied from 0 to 1 by varying t1, T or f. Therefore, the output voltage V0
can be varied from 0 to Vs by controlling k, and the power flow can be controlled.

• As the time t1 changes the width of pulse is varied and this type of control is called pulse width
modulation (PWM) control.

For better understanding of PWM these diagrammatic representations can be used. These figures
represent the waveforms obtained as output at different voltage requirements.
14
SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE
USING OPTOCOUPLER.

CHAPTER NO. :-04

FUCTIONAL DESCRIPTION OF THE CONTROLLER IC

Registers :-

The controller IC has two 8 bit Registers, an instruction Register ( IR)

And a data Register ( DR ) . The IR stores the Instruction codes and address

Information for display Data RAM( DD RAM ) and character Generator

RAM Written , but not read by the MPU.

The DR temporarily stores data to be written to / read from the DD RAM

Or CG RAM . The data written to DR by the MPU, is automatically written to the

DD RAM or CG RAM as an internal operation.

When an address code is written to IR the data ( of the specified address ) is

Automatically transferred from the DD RAM or CG RAM to the DR. Data transfer

Between the MPU is then MPU is then the completed when the MPU reads the DR.

Like wise , for the next MPU read of the DR , Data in DD RAM or CG RAM at the next

Address is sent to the DR automatically . Similarly , for the MPU write of the DR , the

Next DD RAM or CG RAM address is selected for the write operation . The Register

selection table is as shown below:-

RS R/W Operation

0 0 IR write as an internal operation

0 1 Read Busy Flag (DB7) and Address


counter (DBO to DB6)

1 0 DR write as an internal operation

15
SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE
USING OPTOCOUPLER.

(DR to DD RAM or CG RAM)

4.1 Busy Flag:-

When the busy flag is 1, the controller is in the internal operational mode , and
the next instruction will not be accepted.

When RS = 0 and R/W = 1, the busy flag is output to DB7.

The next instruction must be written after ensuring that the busy flag is 0.

4.2 Address Counter:-

The Address counter allocates the address for the DDRAM and

CG RAM Read / write operation. When the instruction code for a DD RAM address
setting , is input to IR , the address code is transferred from IR to the Address counter .
After writing / reading the display

Data to / from the DD RAM or CG RAM , the address counter increments / decrements
by one the address , as an internal operation .

The data of the Address counter is output to DBO to DB6 while R/W =1

And RS = 0.

Display Data RAM (DD RAM):-


The character to be displayed are written into the Display Data RAM

(DD RAM ) in the form of 8 bit character codes present in the character Font table .
The extended capacity of the DDRAM is 80 * 8 bits i.e.

80 characters.

16
SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE
USING OPTOCOUPLER.

Character Generator ROM (CG ROM)

The character Generator ROM generates 5 * 8 dots or 5 * 10 dot character

Patterns from 8 bit character codes ( refer character Font Table ) .

It can generate 208, 5 * 8 dot character patterns and 32, 5 * 10 dot character patens.

Character Generator RAM (CG RAM ) :-

In the character Generator RAM , the user can rewrite character patterns

By program. For 5 * 8 dots, eight character patterns can be written , and for 5 * 10
dots,four character patterns can be written.

17
SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE
USING OPTOCOUPLER.

Chapters NO.:-05

INTERFACING THE MICRO PROCESSOR / CONTROLLER

The module , interfaced to the system , can be treated as RAM( Memory mapping ), Input /
output , Expanded or parallel I/ O ( Input / Output Mapping ) .

Since there is no conventional chip select signal , developing a strobe signal for the Enable
signal ( E ) and applying appropriate signal to the Register select ( RS ) and Read / write ( R/
W ) signal are important .

The module is selected by gating a decoded module – address with the Host – processor `s
Read / write strobe . The resultant signal , applied to the LCD`s Enable (E ) input , clocks in
the data.

The ‗ E ‘ signal must be a positive going digital strobe , which is active while data
and control information are stable and true .

The falling edge of the Enable signal enables the Data / instruction Register of the
controller . All module timings are referenced to specific edges of the ‗ E ‘ signal . The ‗ E ‘
signal is applied only when a specific module transaction is desired .

The Read and write strobes of the Host , which provides the ‗ E ‘ signal , should not be linked to
the Modules R/ W line . An Address bit which sets up earlier in the Host Machine Cycle can be
used as R/W .S

When the Host processor is so fast that the strobes are too narrow to serve as the ‗ E ‘ pulse . :

A . Prolong these pulses by using the Host‗ Ready‘ input .

b. Prolong the Host by adding wait states .

c. Decrease the Host crystal frequency .

18
SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE
USING OPTOCOUPLER.

In spite of doing the above mentioned , if the problem continues ,latch both the data and
control information and then activate the ‗ E ‘ signal .

When the controller is performing an internal operation the Busy Flag (BF)

will be set and will not accept any instruction . the user should check the busy flag or
should provide a delay of approximated 2 ms after each instruction .

The module present no difficulties while interfacing slower .

the liquid crystal display module can be interfaced , either to 4 – bit or 8-bit MPUS.

For 4-bit data interface, the bus lines DB4 toDB7 are used for data transfer , while DBO
to DB3 lines are disabled .The data transfer is complete when the 4- bit data has been
transferred twice.

The Busy flag must be checked after the 4-bit data has been transferred twice . Two more 4-
bit operations then transfer the Busy Flag and Address counter Data .

For 8-bit data interface , all eight bus lines ( DBO to DB7 ) are used.

19
SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE
USING OPTOCOUPLER.

5.1 PIN DIAGRAM:-

5.2 PIN DESCRIPTION:-


Pin No Function Name
1 External count input to Timer/Counter 2, clock-out T2 P1.0
Timer/Counter 2 capture/reload trigger and direction
2 T2 EX P1.1
control
3 P1.2
4 P1.3
5 P1.4
8 bit input/output port (P1) pins P1.5
6
7 P1.6
8 P1.7
9 Reset pin; Active high Reset
Input (receiver) for serial
10 RxD P3.0
communication
Output (transmitter) for serial
11 TxD P3.1
communication
12 External interrupt 1 Int0 8 bit input/output P3.2
13 External interrupt 2 Int1 port (P3) pins P3.3
14 Timer1 external input T0 P3.4
15 Timer2 external input T1 P3.5
16 Write to external data memory Write P3.6
17 Read from external data memory Read P3.7
18 Crystal 2
Quartz crystal oscillator (up to 24 MHz) Crystal 1
19

20
SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE
USING OPTOCOUPLER.

20 Ground (0V) Ground


21 P2.0/ A8
22 P2.1/ A9
23 8 bit input/output port (P2) pins P2.2/ A10
24 / P2.3/ A11
25 High-order address bits when interfacing with external memory P2.4/ A12
26 P2.5/ A13
27 P2.6/ A14
28 P2.7/ A15
29 Program store enable; Read from external program memory PSEN
Address Latch Enable ALE
30
Program pulse input during Flash programming Prog
External Access Enable; Vcc for internal program executions EA
31
Programming enable voltage; 12V (during Flash programming) Vpp
32 P0.7/ AD7
33 P0.6/ AD6
34 8 bit input/output port (P0) pins P0.5/ AD5
35 P0.4/ AD4
36 Low-order address bits when interfacing with external memory P0.3/ AD3
37 P0.2/ AD2
38 P0.1/ AD1
39 P0.0/ AD0
40 Supply voltage; 5V (up to 6.6V) Vcc

21
SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE
USING OPTOCOUPLER.

CHAPTER NO.:-06

INITIALIZATION BY INSTRUCTION

The following procedure should be carried out, to initialize the module by instruction .

1. Turn on the power .

2. wait for more than 15 ms after VDD – rises to 4.5 V

3. Set interface as 8 bits long ( Function set )

4. Wait for more than 4.1 ms.

5. Set interface 8 bits long . ( Function set )

6. Wait for more than 100 us .

7. Set interface as 8 bits long ( Function set )

8. Busy Flag ( BF ) can be checked now .

When BF is not checked , the waiting time between instructions should be longer than
the instruction execution time ( about 2 ms on after this average .)

22
SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE
USING OPTOCOUPLER.

9. Set interface as 4 bits /8 bits , number of display lines character font ( Function set ).
The number of display lines and character font cannot be changed after this point .

10. check the Busy Flag or give a time delay of 2ms .


11. Set Display off ( Display on /off control .

12. Check the Busy Flag or give a time delay of 2 ms .


13. Set Display clear ( Clear Display )

14. Check the Busy Flag or give a time delay of 2 ms .

15. Set cursor move direction and specify display shift ( Entry mode set ) .

16. Check the Busy Flag or give a time delay of 2 ms .

17. Initialization complete.

6.1Entry Mode Set:-

Instruction 0 0 0 0 0 0 1 I/D S - 04H to 07H

Read / write 0

Reg. Select 0

I/D : Increments ( I / D = 1 ) or Decrements ( I / D =0 ) the DD RAM/ CG

RAM address by 1, when a character code is written into or read from

DD RAM / CG RAM. The curser or blinking moves to the right when

Increment by 1, and to the left when decremented by 1.

23
SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE
USING OPTOCOUPLER.

S: Shift the entire display either to the right ( I / D =0 )or to the left

( I/ D =1) when S is 1. The display does not shift if S is 0.

The curser will be shifted in the direction selected by I /D, during the read operation of DD
RAM, irrespective of the value of S. Similarly reading and writing the CG RAM always shifts
the curser .

Instruction execution time is 37 us

6.2 Display on / off :-

Instruction 0 0 0 0 1 D C B - 08H to OFH

Read / write 0

Reg . select 0

D: The display is ON when D is 1, and off when D is 0. when off , the

display data remains in DD RAM and can be displayed by setting

D to 1.

C : The curser is displayed when C is 1 and not displayed when C is 0.

th th
The curser is displayed in the 8 line and the 11 line for the character

Font selection of 5 * 8 dots and 5 * 10 dots respectively .

B: The character indicated by the curser blinks when B is 1.

The Blinking is displayed as switching between all blank dots and

displayed character ,at a speed of 409.6 ms intervals while the

controller IC operates at a clock frequency of 250 KHZ

24
SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE
USING OPTOCOUPLER.

CHAPTER NO.:-07

REGULATED POWER SUPPLY

A variable regulated power supply, also called a variable bench power supply, is one
where you can continuously adjust the output voltage to your requirements. Varying the output
of the power supply is the recommended way to test a project after having double checked parts
placement against circuit drawings and the parts placement guide. This type of regulation is ideal
for having a simple variable bench power supply. Actually this is quite important because one of
the first projects a hobbyist should undertake is the construction of a variable regulated power
supply. While a dedicated supply is quite handy e.g. 5V or 12V, it's much handier to have a
variable supply on hand, especially for testing. Most digital logic circuits and processors need a
5 volt power supply. To use these parts we need to build a regulated 5 volt source. Usually you
start with an unregulated power supply ranging from 9 volts to 24 volts DC (A 12 volt power
supply is included with the Beginner Kitand the Microcontroller Beginner Kit.). To make a 5
volt power supply, we use aLM7805 voltage regulator IC .

Fig. Voltage Regulator-LM7805


The LM7805 is simple to use. You simply connect the positive lead of your unregulated
DC power supply (anything from 9VDC to 24VDC) to the Input pin, connect the negative lead
to the Common pin and then when you turn on the power, you get a 5 volt supply from the
Output pin.

25
SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE
USING OPTOCOUPLER.

7.1 CIRCUIT FEATURES:

Brief description of operation:


Gives out well regulated +5V output, output current capability of 100 mA
Circuit protection:

Built-in overheating protection shuts down output when regulator IC gets too hot

Circuit complexity:

Very simple and easy to build

Circuit performance:

Very stable +5V output voltage, reliable operation

Availability of components:

Easy to get, uses only very common basic components

Design testing:

Based on datasheet example circuit, I have used this circuit successfully as part of many
electronics projects

Applications:

Part of electronics devices, small laboratory power supply

Power supply voltage:

Unregulated DC 8-18V power supply

Power supply current:

Needed output current + 5 mA

Component costs:

Few dollars for the electronics components + the input transformer cost .

26
SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE
USING OPTOCOUPLER.

BLOCK DIAGRAM

Fig : Block Diagram of Power Supply

CIRCUIT DIAGRAM

Fig : Circuit Diagram of Power Supply

27
SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE
USING OPTOCOUPLER.

7.2 BASIC POWER SUPPLY CIRCUIT:-

Above is the circuit of a basic unregulated dc power supply. A bridge rectifier D1 to D4


rectifies the ac from the transformer secondary, which may also be a block rectifier such as
WO4 or even four individual diodes such as 1N4001 types. (See later re rectifier ratings).

The principal advantage of a bridge rectifier is you do not need a centre tap on the
secondary of the transformer. A further but significant advantage is that the ripple frequency at
the output is twice the line frequency (i.e. 50 Hz or 60 Hz) and makes filtering somewhat easier.

As a design example consider we wanted a small unregulated bench supply for our
projects. Here we will go for a voltage of about 12 - 13V at a maximum output current (IL)
of 500ma (0.5A). Maximum ripple will be 2.5% and load regulation is 5%.

Now the RMS secondary voltage (primary is whatever is consistent with your area) for
our power transformer T1 must be our desired output Vo PLUS the voltage drops across D2 and
D4 ( 2 * 0.7V) divided by 1.414.

This means that Vsec = [13V + 1.4V] / 1.414 which equals about 10.2V. Depending
on the VA rating of your transformer, the secondary voltage will vary considerably in
accordance with the applied load. The secondary voltage on a transformer advertised as say
20VA will be much greater if the secondary is only lightly loaded.

If we accept the 2.5% ripple as adequate for our purposes then at 13V this becomes 13 *
0.025 = 0.325 Vrms. The peak to peak value is 2.828 times this value. Vrip = 0.325V X 2.828 =
0.92 V and this value is required to calculate the value of C1. Also required for this calculation is
the time interval for charging pulses. If you are on a 60Hz system it it 1/ (2 * 60 ) = 0.008333
which is 8.33 milliseconds. For a 50Hz system it is 0.01 sec or 10 milliseconds.

Remember the tolerance of the type of capacitor used here is very loose. The important
thing to be aware of is the voltage rating should be at least 13V X 1.414 or 18.33. Here you would
use at least the standard 25V or higher (absolutely not 16V).With our rectifier diodes or bridge
they should have a PIV rating of 2.828 times the Vsec or at least 29V. Don't search for

28
SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE
USING OPTOCOUPLER.

this rating because it doesn't exist. Use the next highest standard or even higher. The current
rating should be at least twice the load current maximum i.e. 2 X 0.5A or 1A. A good type to use
would be 1N4001, 1N4004 or 1N4008 types.

These are rated 1 Amp at 400PIV, 600PIV and 1000PIV respectively. Always be on the
lookout for the higher voltage ones when they are on special.

7.3 TRANSFORMER RATING:-

In our example above we were taking 0.5A out of the Vsec of 10V. The VA required is
10 X 0.5A = 5VA. This is a small PCB mount transformer available in Australia and probably
elsewhere.

This would be an absolute minimum and if you anticipated drawing the maximum
current all the time then go to a higher VA rating.

The two capacitors in the primary side are small value types and if you don't know
precisely and I mean precisely what you are doing then OMIT them. Their loss won't cause you
heartache or terrible problems.

The fuse F1 must be able to carry the primary current but blow under excessive current,
in this case we use the formula from the diagram. Here N = 240V / 10V or perhaps 120V /
10V. The fuse calculates in the first instance to [ 2 X 0.5A ] / [240 / 10] or .04A or 40 ma. In
the second case .08A or 80 ma. The difficulty here is to find suitable fuses of that low a current
and voltage rating. In practice you use the closest you can get (often 100 ma ). Don't take that
too literal and use 1A or 5A fuses.

7.4 POWER SUPPLY DESIGN:-

Power supply is the first and the most important part of our project. For our project
we require +5V regulated power supply with maximum current rating500mA.

29
SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE
USING OPTOCOUPLER.

Following basic building blocks are required to generate regulated power supply.

Step-down Rectifie Filter Three Regulated O/P


Mains 230V transformer r
A.C. Ckt. Terminal
Voltage

7.5 STEP DOWN TRANSFORMER:-

Step down transformer is the first part of regulated power supply. To step down
the mains 230V A.C. we require step down transformer. Following are the main characteristic of
electronic transformer.
1) Power transformers are usually designed to operate from source of low impedance at
a single freq.
2) It is required to construct with sufficient insulation of necessary dielectric strength.
3) Transformer ratings are expressed in volt–amp. The volt-amp of each secondary
winding or windings are added for the total secondary VA. To this are added the load
losses.
4) Temperature rise of a transformer is decided on two well-known factors i.e. losses on
transformer and heat dissipating or cooling facility provided unit.

7.6 RECTIFIER UNIT:-

Rectifier unit is a ckt. which converts A.C. into pulsating D.C. Generally semi-
conducting diode is used as rectifying element due to its property of conducting current in
one direction only. Generally there are two types of rectifier.

1) Half wave rectifier


2) Full wave rectifier.
In half wave rectifier only half cycle of mains A.C. is rectified so its efficiency
is very poor. So we use full wave bridge type rectifier, in which four diodes are used. In each
half cycle, two diodes conduct at a time and we get maximum efficiency at o/p.

30
SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE
USING OPTOCOUPLER.

Following are the main advantages and disadvantages of a full-wave bridge type rectifier ckt.

Advantages:-

1) The need of center tapped transformer is eliminated.


2) The o/p is twice that of center tap circuit for the same secondary voltage.
3) The PIV rating of diode is half of the center tap circuit.

Disadvantages:-
1) It requires four diodes.
2) As during each half cycle of A.C. input, two diodes are conducting therefore
voltage drop in internal resistance of rectifying unit will be twice as compared
to center tap circuit.

7.7 FILTER CIRCUIT :-

Generally a rectifier is required to produce pure D.C. supply for using at various
places in the electronic circuit. However, the o/p of rectifier has pulsating character i.e. if such a
D.C. is applied to electronic circuit it will produce a hum i.e. it will contain A.C. and D.C.
components. The A.C. components are undesirable and must be kept away from the load. To do
so a filter circuit is used which removes (or filters out) the A.C. components reaching the load.
Obviously a filter circuit is installed between rectifier and voltage regulator. In our project we
use capacitor filter because of its low cost, small size and little weight and good characteristic.
Capacitors are connected in parallel to the rectifier o/p because it passes A.C. but does not pass
D.C. at all.

31
SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE
USING OPTOCOUPLER.

7.8 THREE TERMINAL VOLTAGE REGULATOR :-

A voltage regulator is a ckt. that supplies constant voltage regardless of change in


load current. IC voltage regulators are versatile and relatively cheaper. The 7800 series consists
of three terminal positive voltage regulator. These ICs are designed as fixed voltage regulator
and with adequate heat sink, can deliver o/p current in excess of 1A. These devices do not
require external component. This IC also has internal thermal overload protection and internal
short circuit and current limiting protection. For our project we use 7805 voltage regulator IC.

7.9 DESIGN OF STEP DOWN TRANSFORMER:-

The following information must be available to the designer before he


commences for the design of transformer.

1) Power Output.
2) Operating Voltage.
3) Frequency Range.
4)Efficiency and Regulation.

SIZE OF CORE :-
Size of core is one of the first considerations in regard of weight and volume of
transformer. This depends on type of core and winding configuration used. Generally following
formula is used to find area or size of core.

P1
Ai = -----------
0.87

Ai = Area of cross - section in Sq. cm. and

P1 = Primary voltage.
32
SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE
USING OPTOCOUPLER.

In transformer P1 = P2

For our project we required +5V regulated output. So transformer secondary rating is
12V, 500mA.

So secondary power wattage is,

-3
P2 = 12 x 500 x 10 w.= 6w.

6
So Ai =
0.87

= 2.62

Generally 10% of area should be added to core to accommodate all turns for low
Iron losses and compact size.

So Ai = 2.88.

TURNS PER VOLT

Turns per volt of transformer are given by relation

10,000
Turns / Volt = -----------------------
4.44 f Bm Ai

Here,

f is the frequency in Hz

2
Bm is flux density in Wb/m
Ai is net area of cross section.

33
SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE
USING OPTOCOUPLER.

Following table gives the value of turns per volt for 50 Hz frequency.

2
Flux density Wb/m 1.14 1.01 0.91 0.83 0.76
Turns per volt 40/Ai 45/Ai 50/Ai 55/Ai 60/Ai

Generally lower the flux density better be quality of transformer.


2
For project for 50 Hz the turns per Volt for 0.91 Wb/m from above table.

Turns per Volt = 50 / Ai


50
=
2.88

 17

Thus for Primary winding = 220 x 17 = 3800.

& for Secondary winding = 12 x 17 = 204.

WIRE SIZE

As stated above size depends upon the current to be carried out by the winding,
2 2
which depends upon current density of 3.1 A/mm . For less copper losses 1.6 A/mm or 2.4
2
A/mm may be used. Generally even size guage of wire are used.

34
SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE
USING OPTOCOUPLER.

7.10 RECTIFIER DESIGN:-

R.M.S. Secondary voltage at secondary of transformer is 12V.


So maximum voltage Vm across Secondary is

= Rms. Voltage x 2

= 12 x 2

= 16.97

D.C. O/p Voltage at rectifier O/p is

2 Vm
Vdc = ----------

2 x 16.97

= -----------------------

= 10.80 V

PIV rating of each diode is ,

PIV = 2 Vm.
= 2 x 16.97

= 34 V

& maximum forward current which flow from each diode is 500mA.

So from above parameter we select diode IN 4007 from diode selection manual.

35
SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE
USING OPTOCOUPLER.

7.11 DESIGN OF FILTER CAPACITOR:-

Formula for calculating filter capacitor is,

1
C = ----------------------
43 r f RL.
r = ripple present at o/p of rectifier.

(Which is maximum 0.1 for full wave rectifier)

F = frequency of mains A.C.

RL = I/p impedance of voltage regulator IC.

1
------------------------------
C =
43 x 0.1 x 50 x 28

= 1030 f

 1000 f.

And voltage rating of filter capacitor is double of Vdc i.e. rectifier o/p which is
20V. So we choose 1000 f / 25V filter capacitor.

36
SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE USING
OPTOCOUPLER.

7.12 IC 7805 (VOLTAGE REGULATOR IC):-

123 Specifications :
Available o/p D.C. Voltage = +5V.

Line Regulation = 0.03

Load Regulation = 0.5

Vin maximum =35V

Ripple Rejection = 66-80 (db)

37
SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE
USING OPTOCOUPLER.

CHAPTER NO.:-08
APPLICATION GUIDELINS
8.1 POWER SUPPLY:-

The supply should be of +5 V, With maximum allowable transients

Of 10 m V.

To achieve a better / suitable contrast for the display , the voltage ( VL) at

Pin 3 should be adjusted properly .

A module should not be inserted or removed from a live circuit. The ground

Terminal of the power supply must be isolated properly so that no voltage is


induced in it.

The module should be isolated from other circuits, so that stray voltage are

Not induced , which could cause a flickering display.

8.2HARDWARE:-

Develop a uniquely decoded ‗ E ‘ strobe pulse , active high ,


to Accompany each module transaction.

Address or control lines can be assigned to drive the RS and R / W inputs.

38
SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE
USING OPTOCOUPLER.

Utilize the Host`s extended timing mode ,if available , when transacting with the
module . use instructions which prolog the read and write or other

Appropriate data strobes, so as to realize the interface timing requirements.

8.3 MOUNTING:-

Cover the Display surface with a transparent protective plate , to protect


the polarizer .

Don‘t touch the display surface with surface with bare hands or any hard

Materials . this will stain the display area and degraded the insulation between
terminals.

Do not use organic solvents to clean the display panel as these may adversely
affect the polarizers. Dust may be removed by adhesive tape or with absorbent
cotton and petroleumbenzene.

The processing or even a slight deformation of the claws of the metal frame

Will have effect on the connection of the output signal and causes an abnormal
display.

Don‘t damage or modify the pattern wiring, or drill attachment holes in thePCB.

When assembling the module and into another equipment, the space between the
module and the fitting plate should have enough height, to avoid causing stress to
the module surface .

Make sure that there is enough space behind the module , to dessipate
The heat generated by the IC while functioning for longer durations .

When an electrically powered screw do not bring the sucking while cleaning by
a vaccum cleaner may destroy the module.

39
SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE
USING OPTOCOUPLER.

8.4 ENVIRONMENTAL PRECAUTIONS:-

Operate the LCD module under the relative condition of 40 degree c and 50%
relative humidity .

Lower temperature can causes retardation of the blinking speed of the


display , while higher temperature make the overall display discolor .

When the temperature gets to the within the normal limits , the display will
be normal . peel-off may occur with high temperature and humidity .

Contact with water or oil over a long period of time may causes deformation or
colour fading of the display .

Condensation on the terminals can causes electro – chemical reaction disrupting


the terminal curcuit.

8.5 TROUBLE SHOOTING:-

INITIALIZATION:-

When the power supply is given to the module , with the pin 3 ( VL ) connected
to ground , all the pixcels of a character gets activated in the following manner :

All the characters of a signal line display , as in CDM 16108 .

The first eight characters of a signal display , operated in the two line display
mode , as in CDM 16116.

The first line of characters of a two line display , as in CDM16216 and 40216.

40
SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE
USING OPTOCOUPLER.

CHAPTER NO.:-09

CHARACTER DISPLAY POSITION AND DISPLAY DATA


RAM ADDRESS

The DD RAM is used to store display data of 8 – bit character codes present In

the character Font Table. The DD RAM address, corresponds to specific

Display position on the LCD. The DD RAM Address should be set in the Address counter,
so as to enable the display of character on the LCD. The

Co- ordination between the DD RAM address and the display position of

The LCD. Is describe below .

One line display mode :

01 02 03 04 05…78 79 80 Display position

00 01 02 03 04 …4D 4E 4F DD RAM address

When the controller IC is used alone , eight characters can be displayed: -

01 02 03 04 05 06 07 08 Display position

00 01 02 03 04 05 06 07 DD RAM address

( 8 char * 2 line display mode ) can be displayed :

01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 Display position.

00 01 02 03 04 05 06 07 40 41 42 43 44 45 46 47 DD RAM address.

41
SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE
USING OPTOCOUPLER.

9.1 CONTROLLER DISPLAY:-

When the controller IC is used along with one Driver IC up to sixteen character can be
displayed :

01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 Display position

00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F DD RAMaddress.

Controller display Driver display

When the display is shifted by instruction :

Display shifted 01 02 03 04 ….13 14 15 16 Display position

To right 4F 00 01 02…. 0B 0E 0F 10 DD RAM address

Display shifted 01 02 03 04 ….13 14 15 16 Display position

To left 01 02 03 04….0D 0E 0F 10 DD RAM address

The maximum of eighty character , which is the capacity of the DD RAM

Can be displayed:

01 02…..07 08 09 ….. 16 17…. 72 73……80


00 01…..06 07 08 ……0F 10…..47 48……4F

Controller Driver1 Driver2,3…8 Driver 9

Display Display Display Display

42
SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE
USING OPTOCOUPLER.

9.2TWO LINE DISPLAY MODE:-

01 02 ……..39 40 Display position

First line 00 01 ……..26 27 DD RAM address

second line 40 41 …….66 67 DD RAM address

When the controller IC is used alone , sixteen characters

( 8 characters * 2 line ) can be displayed :

01 02 03 04 05 06 07 08 Display position

First line 00 01 02 03 04 05 06 08 DD RAM address

Second line 40 41 42 43 44 45 46 47 DD RAM addresss

When the display is shifted by instruction :-

01 02 03 04 05 06 07 08

Display First line 27 00 01 02 03 04 05 06

Shifted Second line 67 40 41 42 43 44 45 46

To right 01 02 03 04 05 06 07 08

DisplayFirst line 01 02 03 04 05 06 07 08
Shifted Second line 41 42 43 44 45 46 47 48

To left

43
SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE
USING OPTOCOUPLER.

When the controller IC- is used along with one Driver IC, thirty two
Character ( 16 character * 2 line ) can be displayed ):

01 02….. 07 08 09 10 ……15 16 First line01


01……06 07 08 09…….0E 0F Second line 40 41 ……46 47
48 49……4E 4F

Controller
display Driver display

When the display is shifted by instruction

01…….08 09……..16 Display position

Display First line 27…….06 07……..0E DD RAM address


Shifted Second line 67……..46 47……..4E DD RAM address

To left

Controller display Driver display

01 02 …….07 08 09 10……..15 16

Display First line 01 02……..07 08 09 0A…….10

Shifted Second line 67 68……..47 48 49 4A……..4F 50

To left

Controller Driver

Display Display

44
SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE
USING OPTOCOUPLER.

Since the controller IC has a maximum DD RAM capacity of eighty

Characters, four number of Driver IC can be connected to the controller

IC in the two line display mode :

01…. 08 09…. 16 17 …..32 33….40

First line 00….07 08…..0F 10…...1F 20….27

Second line 40…..47 48…..4F 50…..5F 60….67

Controller Driver Driver2&3 Driver 4

Display display display display

9.3 FOUR LINE DISPLAY MODE:-

01 02 03 04….17 18 19 20 Display position

First line 00 01 02 03….10 11 12 13 DD RAM address

Second line 40 41 42 43….50 51 52 53 DDRAM address

Third line 14 15 16 17….24 25 26 27 DD RAM address

Fourth line 54 55 56 57 ….64 65 66 67 DD RAM address

45
SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE
USING OPTOCOUPLER.

CHAPTER NO.:-10

CHARACTER GENERATOR RAM PROGRAMMING

The CG RAM allows the user to create special characters or symbols, using

Software . For 5 * 8 dot format , eight character patterns and for 5 * 10 dot

Format, four character patterns can be programmed . These character patterns can be accessed
as if they were in the CG RAM . These special characters can be displayed by mentioning the
character codes OOH-07HOr 08H-0FH.

10.1 PROGRAMMING CHARACTER PATTERNS IN THE CG RAM:-

Enter the CG RAM address , by the instruction ‗Set CG RAM address ‘.

The three bits of CG RAM address , bits 0-2, correspond to the line position

Of each character pattern .

By the instruction ‗ CG RAM data write ‘ enter the character pattern data ,

Line by line . The data bus lines DB0 – DB7. correspond to CG RAM data

Bits 0-7.

The CG RAM address would be automatically incremented /

decremented , Per the ‗ Entry Mode Set ‘instruction executed.

The corresponding pixel of the character pattern is activated if it is set


46
SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE
USING OPTOCOUPLER.

To 1 and not , if it is set to 0.

The last line of the character pattern i. E. the curser position , should be all 0s.

Out of the eight bits ( 0-7 ) used as CG RAM data, only five bits ( 0-4 )

Are used for character patterns . The remaining three bits (5-7 ) , can

Therefore be used as data RAM.

10.2 DISPLAYING CHARACTER PATTERNS ON THE LCD :-

The CG RAM is selected , when the four higher order bits (4-7) , of

The eight bit character codes are all zeros.

When the character patterns eight bit character code is written to the

Corresponding DD RAM address of the Display , the special characters

Are displayed .

The limitation of eight special characters can be circumvented , by creating

A library of custom symbols , with each set totaling eight characters. These

Eight characters can be displayed at one go, by reloading the CG RAM with

The different sets of character patterns.

47
SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE
USING OPTOCOUPLER.

CHAPTER NO.:-11
PCB DESIGNING AND FABRICATION

INTRODUCTION TO PRINTED CIRCUIT BOARDS


It is caller PCB in short, printed circuit pattern applied to one or both sides of an
insulating base, depending upon that, that, and it is called single sided PCB or double-sided PCB.
Conductor materials available are silver, brass, aluminum and copper; copper is most
widely used which is used here also. The thickness of conducting material depends upon the
current carrying capacity of the circuit.
The printed circuit board usually serves three functions:
1. It provides mechanical support to the components mounted on it.
2. It provides necessary electrical interconnection.
3. It acts as heat sink i.e. it provides a conduction path leading to removal of
most of the heat generated in the circuit.
11.1 Cu Clad:-
The base of laminate is either paper of glass fiber cloth. Cu foil, which is produced by the
method of electroplating, is placed on laminate and both are kept under hydraulic pressure for
proper adhesive pressure for proper adhesive. These Cu clad are easily available in the market.

11.2 TYPES OF LAMINATES:-


National Electrical Manufacturers Association (NEMA) has various grades of laminates
that are obtained by different resins & filters.
1. Phenol
Phenol & Formaldehyde produce phenolic paper base laminate it has phenolic
resins with proper filter. This is Brown in color & opaque. Disadvantage is poor
moisture resistance
2. Epoxy Laminates
Epoxy paper this is also paper based but impregnated with epoxy resin, yellowish
white & translucent.

48
SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE
USING OPTOCOUPLER.

Epoxy Glass; This base material has high mechanical strength and good electrical
properties usually green in color & semitransparent.
There are a variety of laminates available. We have selected Fiber Glass epoxy
laminate.

PCB fabrication includes following steps:


1) Layout of the circuit
2) Artwork designing
3) Printing
4) Etching
5) Drilling
6) Mounting of components & soldering
7) Finishing

1) Layout:-

The layout of a PCB has to incorporate all the information on the board before
one can go onto the all work preparation. Detailed circuit diagram, the design
concept and the philosophy behind the equipment are very important for the
layout.
Layout Scale depending on the accuracy required artwork should be produced at a 1:1 or
2:1 or even 4:1 scale. The layout is best prepared on the same scale as the artwork to prevent the
entire problem, which might be caused by redrawing of the layout to the artwork scale. The
layout/artwork scale commonly applied is 2:1 with a 1:1 scale, no demanding single sided boards
can be designed but sufficient care should be taken, particularly during the artwork preparation.

49
SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE
USING OPTOCOUPLER.

Procedure:-
The first rule is to replace each and every PCB layout as viewed from the component
side. This rule must be strictly followed to avoid confusion, which would otherwise be caused.
Another important rule is not to start the designing of a layout unless an absolutely clear
circuit diagram is available.
Among the components, the larger ones are placed first and the space in between is filled
with smaller ones. Components requiring input/output connecting come near the connector. All
components are placed in such a manner that de-soldering of other components is not necessary
if they have to be replaced.

Layout sketch
The end product of the layout designing is the pencil sketched component and conductor
drawing which is caller ‗layout sketch‘. It contains all information for the preparation of the
network.

Component holes
In a given PCB, most of the holes required are one particular diameter. Holes of a
different are shown with a code in the actual layout sketch.

Conductor Holes
A code can be used for the conductor with a special width.
Minimum spacing should also be provided.
A) Holes B) Conductor Widths
Standard holes Standard width, 0.5 mm
1.1 mm 1 mm
1.5 mm 2 mm
3.2 mm 4 mm

50
SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE
USING OPTOCOUPLER.

(2) Artwork :-
The generation of PCB artwork should be considered as the first step of the PCB
manufacturing process. The importance of a perfect artwork should not be under estimated.
Problems like inaccurate registration, broken annular rings or too critical spacing are often due to
bad artwork. And even with the most sophisticated PCB production facilities, PCB can be made
better than the quality of the artwork used.

Basic Approaches
For ink drawing on white cardboard paper, good quality Indian ink and ink-pen set are
minimum requirements.
Drawing practice – drawing procedure is very at-least by 0.1 – 0.2, and solder pad
locations.
And conductors can easily be displaced by 0.3 – 0.5 mm

(3) Screen Printing:-


The process of screen – printing is well known to the printing industry because of its
inherent capabilities of printing a wide range of inks on almost any kind of surface including
glass, metal, plastic fabrics, wooer, etc.
Found their way into an extremely broad field of applications.
Screen – printing offers the advantages of wide control on the ink deposition, thickness
though the selection of suitable mass density and composition. In the production of PCB‘s. It is
successfully employed in printing of
 Etch resists
 Plate resists
 Solder stop lacquers
 Notation printing
In its basic form, the screen-printing process is very simple. A screen fabric with uniform
meshes and opening is stretched and fixed on a solid frame of metal or wood. The circuit pattern
area open, while the meshes in the rest of the area is closed.

51
SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE
USING OPTOCOUPLER.

In the actual printing step, ink is forced by the moving squeeze thorough the open meshes
onto the surface of the material to be printed.
The ink deposition, in a magnified cross section, shows the shape of a trapezoid.

Pattern Transfer onto the Screen:-


There are two different methods in use, and each method has its own advantages and
disadvantages.
With the direct method, the screen is prepared, by coating a photographic emulsion
directly onto the screen fabric and exposing it in the pattern area. The indirect method makes use
of a separate screen process film, supported on a backing sheet. The film on its backing sheet
that is there after pressed onto the screen fabric and sticks there. Finally, the backing sheet is
peeled off, opening all those screen meshes, which are not covered by the film pattern.
The direct method provides very durable screen stencils with a higher dimensional
accuracy but the finest details are not reproduced
The indirect method is more suitable for smaller series and where the finest details to be
reproduced.
The indirect method is faster but dimensionally less accurate and the screen stencils are
less durable, more sensitive to mechanical damages and interruption in printing.

(4) Etching:-
In all subtractive PCB process, etching is one of the most important steps. The final
copper pattern is formed by selective removal of all the unwanted copper, which is not protected
by an etching unit.
Solutions, which are used in etching process, are known as enchants.
1. Ferric Chloride
2. Cupric Chloride
3. Chromic Acid
4. Alkaline Ammonia

52
SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE
USING OPTOCOUPLER.

Of these Ferric Chloride is widely used because it has short etching time and it can be
stored for a long time. Etching of PCBs as required in modern electronic equipment
production, is usually done in spray type etching machines.
Tank or bubble etching, in which the boards kept in tank, were lowered and fully
immersed into the agitated, has almost disappeared.

(5) Component Mounting:-


Careful mounting of components on PCB increases the reliability of assembly.
1. One leads must be cleaned before they are inserted in PCB holes. Asymmetric lead
bending must be avoided; the ENT leads must fit into holes properly so that they can be
soldered.
2. When the space is to be saved then vertical mounting is preferred. The vertical lead must
have an insulating sleeve.
3. Where jumper wire crosses over conductors, they must be insulted.
4. For mounting of PCBs, TO5, DIP packages special jigs must be used of easy insertion.
5. While mounting transistors, each lead must have insulating sleeve.
All the flat radial components such as resistors, diodes, and inductors are mounted
and soldered. Then IC bases are soldered. The vertical components such as
transistors, gang condenser and FET are mounted & soldered.

(6) Soldering:-
The next process after the component mounting is soldering; solder pint is achieved by
heating the solder and base metal about he melting point of the solders used.
The necessary heat depends upon:
1. The nature and type of joints
2. Melting temperature of solder
3. Flux

53
SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE
USING OPTOCOUPLER.

Soldering techniques are of so many types but we are using iron soldering.
Iron soldering:-
Soldering iron consists of an insulating handle connected through a metal shaft, of a bit
accurately makes contact with the component parts of the joint and solder and heats them up.
The electrical heating element is located in the hollow shank or handle to heat the bit.

Functions of the Bit:-


It stores heat and convey it from the heat source to the work. It may be required to store
surplus solder from the joint. It may be required to store molten solder and flux to the work.
The it surface must be lined or wetted; this encourages flow of solder into the joint. When
the surface of the work becomes estted by solder, a continuous film of liquid metal between the
bit and the work provides a path of high thermal conductivity through which heat can flow into
the work piece.
Solder bit are made up of copper; this metal has good wetting properly, heat capability ad
thermal conductivity. Tin-lead solder affects copper during soldering operation. Production of
copper bit can be made with thick iron coating followed by Ni/Tin plating. The life of the bit is
increased by a factor of 10 to 15. Solder irons are specified in terms of wattage. Depending on
heat input intended for working and types of work (Continuous or individual) the choice of the
solder iron can be made.

Procedure of Soldering
The points to be joined must be cleaned first and fluxed. The hard solder iron and solder
wire is applied to the work. The melted solder becomes bright and fluid. The iron must be
removed after sufficient time and joint is allowed to coal. At the end, finishing is done.

54
SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE
USING OPTOCOUPLER.

11.2 PCB Designing using computer aided designing (CAD):-


CAD has many advantages over manual designing, important among them is:
1. Changes can be easily made because we don‘t have to erase our pencil
work on paper repeatedly.
2. Time is saved.
3. Before taking printout we can have preview of the design etc.

55
SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE
USING OPTOCOUPLER.

CHAPTER NO.:-12

ADVANTAGE, DISADVANTAGES & APPLICATIONS

ADVANTAGE:-
 PWM duty cycle control techniques enable greater efficiency of the DC motor.
 PWM switching control methods improve speed control and reduce the power losses in
the system.
 The pulses reach the full supply voltage and will produce more torque in a motor by
being able to overcome the internal motor resistances more easily.

DISADVANTAGES:-
 The main Disadvantages of PWM circuits are the added complexity and the possibility
of generating radio frequency interference .
 It can give speed below the full speed, not above. It cannot be used for fast controlling
of speed.

APPLICATIONS:-

1) In door opening system for home


2) In remote control trolley system in coalmines
3) In industrial robotic system
4) At any type of motor control system
5) In railway gate control system

56
SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE
USING OPTOCOUPLER.

CHAPTER NO.:-13
LIST OF COMPONUNT

1) Ic1---- Micro controller ic 89S52

2) Ic2----MAX 232

3) Ic4—MCT2E

5) Ic3 -----LD293D

RESISTANCE
R1---22K,

R2, R3,Rp-----680ohm,

R4---- 150 ohm

R5,R6--- 10k

Variable resistance
VR1-----10K

CAPACITOR
Disc type ceramic
Ca, Cb—22pf

ELECTROLYTIC
Cp---1000mfd/25v, C1,C2,C3,C4,C5,C6---10mfd/63v

57
SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE
USING OPTOCOUPLER.

DIODE
D1 to D4---1N4007

LED---5sq.mm led

CRYSTAL
X1---11.0592MHz

TRANSFORMER
230v primary to 0-15 volt secondary 1 amp transformer.

16X2 Alphanumeric LCD Display

DC MOTOR

RS232 PC CONNECTOR

58
SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE
USING OPTOCOUPLER.

CHAPTER NO.:-14

COST OF COMPONUNT

1)Ic1 ---- Micro controller ic 89S52 -----------125/-

2)Ic2 ----MAX 232------------- 35/-

3)Ic4—MCT2E------------- 30/-

5)Ic3 -----LD293D--------- 75/-

RESISTANCE:----25 PAISA EACH


R1---22K,

R2, R3,Rp-----680ohm,

R4---- 150 ohm

R5,R6--- 10k

VARIABLE RESISTANCE
VR1-----10K------5/-

CAPACITOR

DISC TYPE CERAMIC


Ca, Cb—22pf----------2/-EACH

59
SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE
USING OPTOCOUPLER.

ELECTROLYTIC
Cp---1000mfd/25v--------12/-,

C1, C2, C3, C4, C5, C6---10mfd/63v------6/- EACH

DIODE
D1 to D4---1N4007--------------1/- EACH

LED---5sq.mm led----1/-

CRYSTAL
X1---11.0592MHz----------- 25/-

TRANSFORMER
230v primary to 0-15 volt secondary 1 amp transformer.---120/-

16X2 Alphanumeric LCD Display-------------- 750/-

DC MOTOR-------------- 125/-

60
SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE
USING OPTOCOUPLER.

CHAPTER NO.:-16
CONCLUSION

A project can open the door of knowledge for a particular topic. It introduces a
student to work in practical field. We got such kind of a project ―Speed control of
a DC motor with the aid of computer‘s parallel port‖ which introduced us with the
controlling of a DC motor in a programmable manner as well as visual basic
programming language. We saw that there is a difference between theoretical
design and practical implementation. This is due to the inherent properties of the
circuit equipments. Finally, we can say that this practical work will help us in our
working field.

61
SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE
USING OPTOCOUPLER.

CHAPTER NO.:-17
REFERENCE

1) Programming and customizing the 8051 micro

controller Author:-Myke Predko

2) The 8051 Micro controller Architecture, Programming &

Application Author:-Kenneth J.Ayala

3) Opto Electronic Circuit

Manual Author:-R.M. Marston

4) Microprocessor Data Hand book

Publication:-B.P.B. Publication

5) Towers International Transistor

Selector Publication:-B.P.B. Publication

6) A Monogram on Electronic circuit Design

Principal Author:-N.C.GOYAL-- R.K.KHETAN

Publication:-KHANNA Publication

CHAPTER NO. 18

62

You might also like