# Diodes and Transistors

## Diodes

Symbol for a diode:

We can take advantage of the properties of a p-n junction to make a diode, which is an electrical component that only allows current flow in one direction. A diode made of silicon needs about 0.7V across it in the forward direction (forward biased) in order to conduct. At a large negative voltage (reverse biased), the diode fails and the current forces its way though. This is known as diode breakdown.

### Applications of Diodes

#### Half-Wave Rectifier

A half-wave rectifier cuts off half of a sine wave, leaving only the positive or negative side (although not perfectly, because of the diode voltage drop).

The schematic for a simple rectifier:

The graph for half-wave rectifier:

#### Flyback Diode

An approximate model of a DC motor is a resistor and inductor in series. (For more details on DC motors, see the section on brushed DC motors.) If there is a current ${\displaystyle i}$ through the motor, and we suddenly break the circuit by opening a switch, for instance, there will be a spike in the voltage across the inductor. This is because the current has to instantly go to zero (there is no longer a path for it), and the voltage across the inductor is proportional to the rate of change of current, ${\displaystyle v_{L}=L(di/dt)}$. This may exhibit itself in a spark at the switch. A mechanical analog of instantly zeroing the current through an inductor is bringing the velocity of a moving mass to zero, instantly.

To alleviate this problem, we can put a flyback diode across the motor terminals, as shown below:

This diode allows current to continue flowing through the motor, satisfying the inductor's "desire" to continue to allow current to flow. The energy in the inductor is dissipated over time by the resistance of the motor, and the current drops smoothly to zero. Note that no current flows through the diode when the switch is closed, as it is reverse biased.

The flyback diode must be sufficiently large to carry the potentially large currents of the motor.

Question: If the voltage supply is +10V relative to ground and the diode drop is 0.7V, what is the voltage across the inductor immediately after the switch is opened? Make sure you have the sign right, where positive voltage means the left side has a higher potential than the right side. (Remember, the voltage across an inductor can change discontinuously, but not the current, if there is any possible path for the current.)

#### Peak Detector

We can make a peak detector if we hook up our circuit like this:

The graph of the input and output voltages looks like this:

Each time the input voltage dips, the diode prevents the capacitor from draining.

There are two problems with this circuit: First, the voltage at ${\displaystyle V_{out}}$ is always one diode drop less than the maximum ${\displaystyle V_{in}}$. Second, the circuit has a very low impedance, and the capacitor drains a lot of current. A better peak detector can be built with op-amps.

#### Voltage Clamp

A voltage clamp limits the output voltage, which is useful when we need to protect circuits from high voltages. We specify the maximum and minimum voltage we want by applying voltages across a diode. We must also take into account the voltage drop, so the voltages we apply should be ${\displaystyle V_{max}-0.7}$ and ${\displaystyle V_{min}+0.7}$

In this circuit, if ${\displaystyle V_{in}}$ exceeds ${\displaystyle V_{max}}$, diode ${\displaystyle D_{1}}$ becomes forward biased and conducts, thus forcing ${\displaystyle V_{out}}$ to stay at ${\displaystyle V_{max}}$. If ${\displaystyle V_{in}}$ drops lower than ${\displaystyle V_{min}}$, diode ${\displaystyle D_{2}}$ conducts and prevents the ${\displaystyle V_{out}}$ from dropping any lower.

## Zener Diodes

symbol for a zener diode:

Zener diodes have a low breakdown voltage, or zener voltage, and can allow reverse current to flow without being destroyed. A good zener diode can also maintain a fairly constant voltage over a large range of currents. The voltage-current graph of a zener diode looks like this:

### Voltage Regulator

We can use a zener diode to build a voltage regulator like this:

${\displaystyle V_{out}}$ is the reverse breakdown voltage or zener voltage. In the circuit, V is greater than VZ. This voltage regulator can only step down the voltage, not up.

Even if the current through the diode fluctuates, the voltage remains fairly stable. Choose a resistance R large enough such that the power specs of the zener diode are not exceeded, but not so large that it limits our current too much.

For example, if our diode has a zener voltage of 5V and can handle 1W, and our voltage source has a maximum voltage of 20V:

The largest amount of current our diode ever has to handle is the current through the diode when there is no external load. Therefore:

${\displaystyle I_{z(max)}={\frac {(20-5)V}{R}}}$

${\displaystyle P=IV=I(5V)=\left({\frac {(20-5)V}{R}}\right)(5V)=1W}$

${\displaystyle R={\frac {(15V)(5V)}{1W}}=75\Omega }$

This means that we need at least 75Ω to protect our diode. Keep in mind that we must meet the power ratings for our resistor as well.

Because current is flowing through the resistor and diode even when there is no load, power is being wasted. We can do better with voltage regulator chips like a 7805 chip (78xx for xx volts).

## LEDs (Light Emitting Diode)

symbol for an LED:

An LED is a type of diode that emits visible or infrared light proportional to the current passing through it (up to a maximum before it burns out).

A typical LED shines its brightest between 5mA and 30mA. Beyond its rated current, it may burn out.

A photograph of an LED

Notice that on the LED pictured at the right, one of the legs is longer. The longer leg is the positive terminal. However, do not rely on the length of the leg to determine the polarity, because you will probably snip the legs short later on. Instead, look at the side of the plastic lens, and notice that it's not perfectly round; one side is flattened. The flattened side is the ground.

## Photodiode

Symbol for a photodiode:

Go to the photodiode page for information on photodiodes.

## Bipolar Junction Transistors (BJT)

The symbols for transistors:

There are two types of of BJTs; n-p-n and p-n-p:

npn

pnp

For the transistors, we have the following relationship for the voltages and curents:

${\displaystyle I_{E}=I_{C}+I_{B}}$

${\displaystyle V_{BE}=V_{B}-V_{E}}$

${\displaystyle V_{CE}=V_{C}-V_{E}}$

Under normal operation, BE is forward biased, and CB is reverse biased.

BJTs have three regions of operation:

Cutoff (${\displaystyle V_{BE}<0.7V}$): ${\displaystyle I_{C}=0}$ (no collector current)

Active (${\displaystyle V_{BE}}$${\displaystyle 0.7V}$): ${\displaystyle I_{C}=}$β${\displaystyle I_{B}}$ (collector current is proportional to base current by factor β, which is typically about 100)

Saturated (${\displaystyle V_{BE}}$${\displaystyle 0.7V}$): ${\displaystyle V_{CE}}$${\displaystyle 0.2V}$ (for npn); collector current is mainly limited by its subsequent circuitry.

### Applications of BJTs

#### Common Emitter Amplifier Circuit

In a common emitter circuit, the emitter of a transistor is grounded and an input voltage is applied to the resistor at the base. An example common emitter circuit with a transistor (β=100) is drawn below:

If ${\displaystyle V_{in}}$ < 0.7V (same as the diode drop), the p-n junction is not forward biased, there is no base current, and ${\displaystyle I_{C}}$ is equal to 0.

If ${\displaystyle V_{in}}$ > 0.7V, then

${\displaystyle I_{B}=(V_{in}-V_{B})/10000}$Ω${\displaystyle =(V_{in}-0.7)/10000}$Ω

${\displaystyle I_{C}=}$β${\displaystyle (V_{in}-0.7)/10000}$Ω

Now we calculate how large ${\displaystyle V_{in}}$ has to be to saturate the transistor. When ${\displaystyle V_{CE}=0.2V}$, the transistor becomes saturated. If the drop across the collector and emitter of the transistor is equal to 0.2V, then the drop across the resistor at the collector must equal 9.8V. Thus:

${\displaystyle I_{C}=9.8/1000}$Ω${\displaystyle =9.8mA}$

${\displaystyle I_{B}=I_{C}/}$β${\displaystyle =0.098mA}$

Then we find ${\displaystyle V_{in}}$:

${\displaystyle V_{in}-0.7=(0.098mA)(10000}$Ω${\displaystyle )}$

${\displaystyle V_{in}=1.68V}$ or greater.

cutoff:${\displaystyle V_{in}}$ < 0.7V

active:0.7V < ${\displaystyle V_{in}}$ <1.68V

saturated:1.68V < ${\displaystyle V_{in}}$

If we are using the transistor as a switch, we should fully saturate it to save power and reduce heat.

#### Emitter Follower

The emitter follower is a very simple current amplifier, taking advantage of the fact that ${\displaystyle I_{C}=}$β${\displaystyle I_{B}}$. The high input impedance means that our imput signal does not need to "work" as hard.

${\displaystyle V_{E}=V_{in}-0.7V}$

#### Push-Pull Follower

If we put two emitter followers together (npn transistor for positive voltages; pnp transistor for negative voltages), we get a push-pull follower.

If ${\displaystyle V_{in}}$ > 0.7V, then the current is amplified by the npn transistor.

If ${\displaystyle V_{in}}$ < -0.7V, then the current is amplified by the pnp transistor.

Beware that there is a “dead band” when Vin is between 0.7V and -0.7V, because the voltage has not pass the cutoff voltage for either transistor. This is known as crossover distortion.

##### Push-Pull Follower Example: A (Poor) Motor Speed Controller

Suppose we want to control the speed of a motor by varying the input voltage between +5V and -5V. We attempt to do this by setting put a voltage divider with a potentiometer like in the circuit below.

We model our motor with a simple resistor ${\displaystyle R_{L}}$. If ${\displaystyle R_{L}}$ is infinitely large (no current flowing through), then there will be a 7.2V drop across ${\displaystyle R_{1}}$ and ${\displaystyle R_{3}}$, and ${\displaystyle V_{in}}$ can take a value between 4.8V and -4.8V.

For the maximum voltage case (we turn the POT all the way to one side), our circuit with voltage sources looks like this:

We know that ${\displaystyle R_{L}}$ is not infinitely large because motors can draw quite a lot of current. If ${\displaystyle R_{L}=0}$ (short circuit), then the ${\displaystyle V_{in}=0V}$. We can expect ${\displaystyle V_{in}}$ to be somewhere between 0V and 4.8V.

We can solve the circuit with the following equations:

KCL:

${\displaystyle I_{1}=I_{2}+I_{3}}$

KVL:

${\displaystyle 12-750I_{1}-R_{L}I_{2}=0}$

${\displaystyle 12+R_{L}I_{2}-1750I_{3}=0}$

${\displaystyle V_{in}=I_{2}R_{L}}$

Solving the equations yields:

${\displaystyle V_{in}=24R_{L}/(2625+5R_{L})}$

If ${\displaystyle R_{L}=10}$Ω, we can plug it in and find that ${\displaystyle V_{in}}$ is only equal to 0.0897V and the current is equal to 8.97mA—not nearly enough to drive the motor.

It turns out that the voltage controlling circuit cannot supply much current, so the low impedance of the motor drains what current is available very quickly and pulls down the output voltage. When the impedance of the power source is much larger than the impedance of the load, this is known as loading.

We can't use this circuit to drive a motor directly, because our controller needs to see a high impedance, but our motor has a low impedance—we need a way to isolate the controller from the motor. This is where we can use our push-pull current amplifier. We connect it to our circuit as shown below to better isolate the controller from the motor and amplify the current. Unfortunately, the transistors only have a gain of about 100, so the controller circuit still does not see an infinite impedance.

#### Emitter Follower Voltage Regulator

With our previous voltage regulator with the zener diode, we had the problems of the zener diode wasting power and needing a high power diode if there was a lot of current going through the diode. If we add an emitter-follower, we can use a much smaller diode and less current to achieve the same effect.

#### Darlington Pair

If we need a very high current gain, we replace a transistor with a Darlington pair. The current gain is now:

${\displaystyle \beta =\beta _{1}\beta _{2}}$

## Field Effect Transistors (FET)

FETs are a type of transistor that uses a voltage input to control its conductivity (as opposed to using the current like a BJT). The input impedance is very high and thus draws very little current. There are three general types of FETs:

1.enhancement mode metal-oxide-semiconductor FETs (MOSFETs)

2.depletion mode MOSFETs

3.Junction FETs (JFETs)

### MOSFETs

The symbol for a MOSFET looks like this:

where G is for gate, S for source, D for drain, and B for substrate.

However, since B is usually connected to S, the symbol is often simply drawn as:

Electrons flow from the source to the drain, so the current flows from drain to source. The gate receives the input voltage. The gate pin is offset towards to source pin to help is differentiate between the source and drain pins.

MOSFETS come in enhancement and depletion modes. An enhancement mode MOSFET allows a current to flow only if a positive voltage is applied, while depletion mode MOSFETs allows a current to flow even if no voltage difference is applied. Increasing the voltage increases the current, and it takes a negative voltage to turn off a depletion mode MOSFET. MOSFETS, like BJTs, also come in p and n types. The different MOSFETS and their corresponding symbols are below:

MOSFETS
n-channel p-channel
Enhancement
Depletion

### JFETs

JFETs are very similar to MOSFETS, but they only come in the depletion-mode variety. JFET consume little power, so they are often found in low-power applications. The symbols for JFETs are below:

MOSFETS
n-channel p-channel
Depletion

## Phototransistor

Symbol for a phototransistor:

Notice that the phototransistor only has two legs.

The collector current of a phototransistor is proportional to the light or infrared light received.

${\displaystyle V_{out}}$ can take a value between 0V and ${\displaystyle V_{s}-0.2V}$.