Basic Optoisolated Transistor Driver for Microcontroller

13
Part 1: Basic Transistor Drivers for Micro- Controllers The output of most digital circuits and micro- processors is only five volts at most a few milli-amps. Most electrical and electronic devices require voltages and currents that will destroy digital circuits, so we must rely on what I'll broadly call driver circuits. To our left illustrates a digital output driving a typical low-power light emitting diode. On this page we will look at transistor driver circuits using both bipolar transistors and power MOSFETs and will use them as electrical switches. Also note the concept of sink/source as we go along. When a "switch" supplies a voltage (on the "hot" side) such as a household light switch, we say the switch "sources" the voltage. If we put the switch on the neutral side of the load, we say we "sink" the voltage. All of the examples below assume a negative shared common.

Transcript of Basic Optoisolated Transistor Driver for Microcontroller

Page 1: Basic Optoisolated Transistor Driver for Microcontroller

Part 1: Basic Transistor Drivers for Micro-Controllers

The output of most digital circuits and micro-processors is only five volts at most a few milli-amps. Most electrical and electronic devices require voltages and currents that will destroy digital circuits, so we must rely on what I'll broadly call driver circuits. To our left illustrates a digital output driving a typical low-power light emitting diode.

On this page we will look at transistor driver circuits using both bipolar transistors and power MOSFETs and will use them as electrical switches. Also note the concept of sink/source as we go along. When a "switch" supplies a voltage (on the "hot" side) such as a household light switch, we say the switch "sources" the voltage. If we put the switch on the neutral side of the load, we say we "sink" the voltage. All of the examples below assume a negative shared common.

Illustrated to the right is the most common driver circuit. It consists of a NPN bipolar transistor controlling a light bulb. For most of this page I'll assume a 24 volt, 100 mA light bulb as a load. We have a negative 24 volt ground tied to digital ground. Note a digital "HIGH" is 5 volts (VCC) and a digital "LOW" (VSS) is zero volts. The "HIGH" is switched to 5 volts inside the "chip" while a "LOW" is switched to ground inside the "chip." Another digital state is known as floating and is open to both VSS and VCC.

In this example a digital "HIGH" on the input "sources" a current in the base/emitter of Q9 (limited by R1) which causes a larger current flow in the collector/emitter circuit and through the lamp. If Q9 has a gain of 50 and the base current through R1 is 5 mA, then the collector current will be 250 mA. In this case it's only 100 mA limited by the lamp. In many of these transistor circuits R1 ranges from 1000 to 2200 ohms for 5 volts.

Page 2: Basic Optoisolated Transistor Driver for Microcontroller

In this example we are using a NPN darlington transistor. They have very high gain and require little base current. In reality they are two transistors with common collectors and one emitter tied to the other's base. If each transistor had a gain of 100, then to total gain would be 100 X 100 = 10,000.

Like the example above we would say the transistor "sinks" the load. In the case of using a TIP120 R2 should be 1000-ohms.

In this example we use a PNP darlington. (TIP125)

Page 3: Basic Optoisolated Transistor Driver for Microcontroller

When Q11 switches on current flows through R5 switching Q6 on. Here Q6 will "source" the load. In the case of using 24 volts R5 should be between 2200 to 5600 ohms while R4 should be 2200-ohms.

The internal circuits of the above two Darlingtons shows opposite electrical polarities. The diodes are used to protect

the transistors from surges created when switching magnetic loads.

Page 4: Basic Optoisolated Transistor Driver for Microcontroller

Switching on a MOSFET

Page 5: Basic Optoisolated Transistor Driver for Microcontroller

Here is the basic driver using a N-channel MOSFET. Unlike bipoler transistors MOSFETs are voltage operated devices, not current operated. An electrical charge (voltage) on the gate (G) relative to the source (S) will switch on the device. The only purpose of R3 (100K) is to bleed-off any remaining charge on gate terminal. In this case we "sink" the load.

Page 6: Basic Optoisolated Transistor Driver for Microcontroller

In this example we use a P-channel power MOSFET. The source terminal (S) is connected to the positive of the power supply and while Q10 is off (no 5 volts in) we have 24 volts on the collector (C) of Q10. When 5

volts is supplied Q10 switches on dropping the collector voltage to zero. Q5 will switch on and "source" the load.

R6 should be 10,000-ohms and R5 2200-ohms.

In summery we have looked at a number of bipolar transistor and MOSFET driver circuits. They all have a flaw of having to be electrically connected to low voltage digital circuits. With opto-isolators we can sever this connection of the higher-voltage power supplies totally from the low-voltage digital circuits if desired. In fact we can even change the polarity of the higher voltage supplies without regards to the digital circuits common negative grounds if we desire.

See Part 2: Opto-Isolated Transistor Drivers for Micro-Controllers.

Page 7: Basic Optoisolated Transistor Driver for Microcontroller

Part 2: Opto-Isolated Transistor Drivers for Micro-Controllers

In part 1 we looked at a number of bipolar transistor and MOSFET driver circuits. They had a flaw of having to be electrically connected to low voltage digital circuits. See Part 1.

With opto-isolators we can sever this connection including the use of higher-voltage power supplies totally isolated from the low-voltage digital circuits. In fact we can even change the polarity of the higher voltage supplies without regard to the digital circuit common negative grounds if needed.

On the left is basic opto-coupler or opto-isolator. The voltage level at point Vo is at VCC with S1 open. When S1 is closed the infra-red light from the light emitting diode D1 falls on the base of Q1 causing it to conduct to ground like a switch. The voltage at point Vo drops to zero.

Q1 is a NPN bipolar photo transistor and both the LED and transistor are often one physical device. Again an important note is the output has no electrical connection to the input and can isolate several thousand volts. Also see More sample circuits.

Page 8: Basic Optoisolated Transistor Driver for Microcontroller

The output transistor of a 4N25 is still a low power device, so we must use it to to drive higher power components for greater loads.

Page 9: Basic Optoisolated Transistor Driver for Microcontroller

Here we drive a NPN Darlinton power transistor. With a gain of 1000 very little base current is needed to be switched though

the 4N25. The TIP120 has a maximum base current (Ib) of 150 mA while the 4N25 has a maximum collector current of 150 mA. R2

can be 5600-10,000 ohms.

Page 10: Basic Optoisolated Transistor Driver for Microcontroller

Here we switch a N-channel MOSFET to "sink" the load.R3 can be 100K ohms.

Page 11: Basic Optoisolated Transistor Driver for Microcontroller

In these two examples we sever the 24 volt supply totally from the digital circuits. In fact we could have done this with all of the circuits on this page. Here we switch on a

P-channel power MOSFET to "source" the load. R6 = 10K and BATT2 is limited to 30 volts because of the 4N25.

Same as above except we use a PNP Darlington.

Page 12: Basic Optoisolated Transistor Driver for Microcontroller