02 Interfacing High Power Devices.2016

Preview:

Citation preview

1

02-Interfacing High Power Devices

By : Mohamed Fawzy

Programming AVR Microcontrollers

© Mohamed F.A.B 2015

Lecture Notes:

2

o Set Your Phone To Vibration Mode.

o Ask any time.

o During labs, Feel Free To Check Any Materials or

Internet.

o Slides are self content.

o Feel Free To Share This Materials With Your Friends.

o Work Hard For Achieving Most Of This Course.

© Mohamed F.A.B 2015

3

Don't Forget !!!!

© Mohamed F.A.B 2015

Any Expert Was Once A Beginner

4

Agenda.

Lesson (6):

Control High Power Devices By MC.

Lesson (7):

Interfacing DC Motor and Control Its Direction.

© Mohamed F.A.B 2015

Lesson (8):

Interfacing Stepper Motor.

5

Lesson(6).

© Mohamed F.A.B 2015

Lesson (6):

Control High Power Devices By MC.

6

Lesson (6) Topics.

© Mohamed F.A.B 2015

► Transistor Overview.

► Using Transistor as a Switch.

► Darlington transistor array (ULN2003 & ULN 2803).

► Opto-coupler Overview.

► Control 12VDC with MC.

► Relay Overview.

► Control High Power Devices 220 VAC.

7

Transistor Overview.

© Mohamed F.A.B 2015

o There are two types of transistors:

PNP TransistorNPN Transistor

NPN is the most common used transistor, so we only

cover it in our tutorial.

NOTE:

o There are two Applications of transistors Usage:

o Transistor as a switch.

o Transistor as an Amplifier.

8

Transistor Parameters.

© Mohamed F.A.B 2015

IC

IE

IB VCE

VBE

+

-

+

-

IE=IB+IC

IB is very small

So, IE=IC

VBE(sat)=0.7 Volt(Datasheet).

9

Transistor Operation Regions.

© Mohamed F.A.B 2015

Cut-OFF Region

The input and Base are grounded ( 0v ).

Transistor is “fully-OFF” (Cut-off region).

No Collector current flows ( IC = 0 ).

VOUT = VCE = VCC.

Transistor operates as an “open switch”.

Saturation Region

The input and Base are connected to VCC.

Transistor is “fully-ON” (saturation region).

Max Collector current flows ( IC = Vcc/RL ).

VCE = 0 ( ideal saturation ).

VOUT = VCE.

Transistor operates as a “closed switch”.

In this two regions, transistor Work as a switch.

NOTE:

10

Cont’

© Mohamed F.A.B 2015

VBE

0.7 IB

Ic

Cut-OFF

Saturation

11

Transistor As a switch?

© Mohamed F.A.B 2015

Most of microcontrollers work within 5

volt environment and the I/O port

can only handle current up to 20mA.

if we want to attach the

microcontroller’s I/O port to different

voltage level circuit or to drive

devices with more than 40mA, we

need to use the interface circuit.

There are Popular methods:

Transistor as a switch.

Opto-Coupler.

Relay.

Contactor.

12

Designing Transistor as a switch circuit .

© Mohamed F.A.B 2015

find the minimum Base current required to turn the transistor

“fully-ON” (saturated) for a load that requires 200mA of

current when the input voltage is increased to 5.0V. Also

calculate the new value of RB.

Ic Is the current needed for switching the load.

ß Founded in Datasheet for transistor.

NOTE:

Example.

13

NPN Transistors.

© Mohamed F.A.B 2015

Transistor V IC ßBC547 45V 100mA 110

2N3904 40V 200mA 100

BC517 30V 500mA 30000

BC337 45V 800mA 100

2N2222 40V 1A 200

BD139 80V 1.5A 40

TIP31A 60V 3A 100

TIP41A 60V 6A 30

TIP120 60V 5A 1000

TIP142 100V 10A 500

2N3055 60V 15A 10

14

Example.

© Mohamed F.A.B 2015

Vin

5V

We need to control LED which work with 3V and 20mA DC by small signal 3.3v.

Here, we can choose BC547 (Vce =45V, Ic=100mA, ß=110).

=20𝑚𝐴

110= 0.182𝑚𝐴

=3.3 − 0.7

5 ∗ 0.182= 2.857𝐾Ω

Here, result is IB in active region, to get IBin saturation we need to multiply IB by 5

or 10.

NOTE:

Typical Value for 2.857 𝑲𝜴 is 2.7 𝑲𝜴

P(RB)=RB * (𝐼𝐵)2 𝑤𝑎𝑡𝑡

15

Example.

© Mohamed F.A.B 2015

We need to control a DC Motor Work with 24V by small signal(5V).

Vin

24VIc(max for motor)=24

𝑅(𝑚𝑜𝑡𝑜𝑟 𝑐𝑜𝑖𝑙)= 24𝑉

17Ω=1.4A

Here, we will choose TIP41.(Vce=60V, Ic=6A, ß=30).

=1.5

30= 0.05𝐴

=5 − 1.8

5 ∗ 0.05= 12.8Ω

Typical Value for 12.8𝜴 is 10𝜴

P(RB)=RB * (𝐼𝐵)2 = 10 ∗ (0.25)2 = 0.625 𝑤𝑎𝑡𝑡

So, we must choose 1 watt Resistor.

Why using Flywheel Diode?

16

Darlington Transistor.

© Mohamed F.A.B 2015

Vcc Sometimes the DC current gain of the

bipolar transistor is too low to directly

switch the load current or voltage, so

multiple switching transistors are used.

the current gain of the first transistor is

multiplied with that of the current gain

of the second transistor to produce a

device which acts like a single

transistor with a very high current gain

for a much smaller Base current.

if the first input transistor has a current gain of 100 and the second switching transistor has a current gain of 50 then the total current gain will be 100 x 50 = 5000. So for example, if our load current from above is 200mA, then the Darlington base current is only 200mA/5000 = 40uA. A huge reduction from the previous 1mA for a single transistor. Ic=IB* ß

Example.

17

ULN2003 & ULN2803.

© Mohamed F.A.B 2015

It is an array of some Darlington transistors in one package.

ULN2003 contains 7 channels but ULN2803 contains 8 channels.

We can use diode connected to COM as a flywheel diode.

NOTE:

18

Opto-Coupler (Optoisolator).

© Mohamed F.A.B 2015

An Optocoupler, also known as an Optoisolator

or Photo-coupler, is an electronic components

that interconnects two separate electrical

circuits by means of a light sensitive optical

interface.

for example driving motors, motors can

produce what is called back E.M.F and a high

voltage spike produced by a sudden change

of current.

An opto-isolator has a LED transmitter and

photo-sensor receiver separated from each

other by a gap.

Optocoupler is equivalent to previous transistor

circuit but only differ in the way of transistor

biasing.

19

Relay.

© Mohamed F.A.B 2015

A relay is an electromagnetic switch which is used to switch

High Voltage/Current using Low power circuits.

Relay isolates low power circuits from high power circuits.

It is activated by energizing a coil wounded on a soft iron core.

A relay should not be directly connected to a microcontroller,

it needs a driving circuit.

A relay should not be connected directly to a microcontroller

due to following reasons:

A microcontroller is not able to supply current required

for the working of a relay.

A relay is activated by energizing its coil. Microcontroller

may stop working by the negative voltages produced in

the relay due to its back E.M.F.

20

Relay Interface Circuit.

© Mohamed F.A.B 2015

220V Load

We need to control 220VAC Lamp using small signal from MC.

I(relay coil) =25mA.

Vin=5V.

VBE=0.7V.

=25𝑚𝐴

100= 0.25𝑚𝐴 (𝐴𝑐𝑡𝑖𝑣𝑒)

=5 − 0.7

5 ∗ 0.25= 3.44 𝐾Ω

Typical Value for 3.44 K𝜴 is 3.4 K𝜴

We can connect contactor (coil) instead of 220V Lamp and control 3 phase motor or another high power device .

NOTE:

Example(3).

21

Relay Advantage and disadvantage.

© Mohamed F.A.B 2015

Advantages:

1- It can pass both AC and DC current.

2- It can work with high voltage and high current.

3- One relay can control multiple device.

Dis-advantages:

1- It has a bigger package than transistor.

2- It can not be ON and OFF rapidly.

3- It need higher current than transistor to work.

4- Digital ICs or micro-controller can not active it.

22

Lesson (7).

© Mohamed F.A.B 2015

Lesson (7):Interfacing DC Motor and Control Its Direction.

23

Lesson (7) Topics.

© Mohamed F.A.B 2015

► Motor Direction Control Theory.

► H-Bridge Theory.

► H-Bridge Using Relays.

► H-Bridge Using NPN Transistors.

24

DC Motor Direction Control Theory.

© Mohamed F.A.B 2015

Simply, We can control DC Motor Direction

by changing Power Source Polarity.

Clockwise Direction. Anti-Clockwise Direction.

M-

+

M+

-

25

H-Bridge Circuit Theory.

© Mohamed F.A.B 2015

It is so hard to control its direction with mechanical switches as we

need to press two switches for one direction.

So, we can use relay or transistor instead of mechanical switches.

NOTE:

26

H-Bridge Circuit Using Relays.

© Mohamed F.A.B 2015

Don't Be Confused Between Motor Power Supply and Relay Coil Power Supply.

NOTE:

27

H-Bridge Using NPN Transistors.

© Mohamed F.A.B 2015

12V

A B Direction

0 0 STOP

0 1 CCW

1 0 CW

1 1 STOP

For High power Motors we can use TIP122 or TIP 120

Transistors or MOSFET Transistors.

NOTE:

28

H-Bridge Using L298N.

© Mohamed F.A.B 2015

Specifications of L298N

Double H bridge Drive Chip (Two Motors).

Logical voltage: 5V (MC Control Signal).

Drive voltage: 5V-35V (Motor Voltage Source).

Logical current: 0-36mA (MC Control Signal).

Drive current: 2A (MAX single bridge).

Max power: 25W.

29

H-Bridge Using L298N.

© Mohamed F.A.B 2015

30

Questions:

© Mohamed F.A.B 2015

Thank You All

31

mo7amed.fawzy33@gmail.com

01006032792

fawzy.fab@gmail.com

© Mohamed F.A.B 2015

Recommended