Chapter 5

Working with Diodes and LEDs

In This Chapter

arrow Sussing out how semiconductors work

arrow Introducing the simple diode

arrow Changing AC to DC with diodes

arrow Lighting up with LEDs

From roughly 1900 to 1950, the world of electronics was dominated by a now all but obsolete technology: vacuum tubes. These glass tubes were large, expensive and fragile and required a lot of current. In the 1940s, however, researchers made a technological breakthrough, which led to new components that were a quantum-leap improvement over vacuum tubes. These components are called semiconductors.

This chapter introduces you to the most basic kind of semiconductor, called a diode. Although diodes look a little like resistors (for details, check out Chapter 2 of this minibook), they behave very differently. Diodes have one ability that sets them apart: they let current flow freely in one direction, but block current if it tries to flow in the other direction. In other words, a diode is like a turnstile gate that you can walk through in one direction but not the other. This characteristic turns out to be incredibly useful in electronic circuits.

What Is a Semiconductor?

As its name implies, a semiconductor is a material that conducts current, but only partly. The conductivity of a semiconductor is somewhere between that of an insulator, which has almost no conductivity, and a conductor, which has almost full conductivity. Most semiconductors are crystals made of certain materials, most commonly silicon.

To understand how semiconductors work, you need to know a little about how electrons are organised in an atom. As a result, this section is fairly difficult, because it delves just a little into the physics of how semiconductors work at the atomic level.

tip.eps You don’t have to understand the physics of diodes to use them in your circuits, and so you can skip over this section if you want, and go straight to ‘Discovering Diodes’, later in this chapter. However, we recommend perusing this section. Don’t worry if you have difficulty understanding how semiconductors work, just note the key terms, such as p-type, n-type and p-n junction, and move on.

Examining elements and atoms

The electrons in an atom are organised in layers, kind of like the layers of an onion. These layers are called shells. The outermost shell is called the valence shell. The electrons in this shell are the ones that form bonds with neighbouring atoms. Such bonds are called covalent bonds because they share valence electrons, which are also the electrons that sometimes go wandering off in search of other atoms.

Most conductors, including copper and silver, have just one electron in the valence shell. Atoms with just one valence electron have a hard time keeping that electron, which is what makes copper and silver such good conductors. When valence electrons travel, they create moving electric fields that push other electrons out of their way. That’s what causes current to flow.

Semiconductors, on the other hand, typically have four electrons in their valence shell. The best known elements with four valence electrons are carbon, silicon and germanium. Atoms with four valence electrons rarely lose one of them. However, they do like to share them with neighbouring atoms.

If all the neighbouring atoms are of the same type, all the valence electrons are able to bind with valence electrons from other atoms. When that happens, the atoms arrange themselves into neat and orderly structures called crystals. Semiconductors are made out of such crystals.

The most plentiful element with four valence electrons is carbon. However, carbon crystals are rarely used as semiconductors because they have other uses, such as in diamond rings. So instead, semiconductors are usually made from crystals of silicon and occasionally germanium.

Figure 5-1 shows the covalent bonds formed in a silicon crystal. Here, each circle represents a silicon atom and the lines between the atoms represent the shared electrons. Each of the four valence electrons in each silicon atom is shared with one neighbouring silicon atom. Thus, each silicon atom is bonded with four other silicon atoms.

9781118589717-fg020501.eps

Figure 5-1: Silicon crystals are formed when each silicon atom shares its outermost electrons with a neighbouring atom.

Doping is really rather clever

By themselves, pure silicon crystals are pretty, but not all that useful. With all four valence electrons interlocked with neighbouring atoms, getting current to flow through a pure silicon crystal isn’t easy. But things get interesting if you introduce small amounts of other elements into a crystal. Then the crystal starts to conduct in an interesting way.

remember.eps The process of deliberately introducing other elements into a crystal is called doping and the element introduced by doping is called a dopant. By carefully controlling the doping process and the dopants that are used, silicon crystals can transform into one of two distinct types of conductors:

check.png N-type semiconductor: Created when the dopant is an element that has five electrons in its valence layer. Phosphorus is commonly used for this purpose. The phosphorus atoms join right in the crystal structure of the silicon, each one bonding with four adjacent silicon atoms just like a silicon atom would. Because the phosphorus atom has five electrons in its valence shell, but only four of them are bonded to adjacent atoms, the fifth valence electron is left hanging out with nothing to bond to.

The extra valence electrons in the phosphorus atoms start to behave like the single valence electrons in a regular conductor such as copper. They are free to move about, as shown in Figure 5-2. This type of semiconductor has extra electrons and is called an n-type semiconductor.

9781118589717-fg020502.eps

Figure 5-2: An n-type semiconductor has extra electrons.

check.png P-type semiconductor: Created when the dopant is an element (such as boron) that has only three electrons in the valence shell. When a small amount of boron is incorporated into the crystal, the boron atom is able to bond with four silicon atoms, but because it has only three electrons to offer, a gap is created where an electron would normally be, as shown in Figure 5-3. This electron gap is called a hole. The hole behaves like a positive charge, and so semiconductors doped in this way are called p-type semiconductors.

Like a positive charge, holes attract electrons. But when an electron moves into a hole, the electron leaves a new hole at its previous location. Thus, in a p-type semiconductor, holes are constantly moving around within the crystal as electrons constantly try to fill them up. A p-type semiconductor is like crazed pieces of Swiss cheese in which you can’t quite get a fix on the holes because they’re always moving.

The physics behind the n- and p- designations is complex but you can think of the n- as standing for the negatively charged electronics that are free to move in an n-type semiconductor and the p- standing for the holes that behave like positive charges in a p-type semiconductor.

9781118589717-fg020503.eps

Figure 5-3: A p-type semiconductor has holes where electrons should be.

When voltage is applied to an n-type or a p-type semiconductor, current flows, for the same reason that it flows in a regular conductor: the negative side of the voltage pushes electrons and the positive side pulls them. The result is that the random electron and hole movement that’s always present in a semiconductor becomes organised in one direction, creating measurable electric current.

Combining types into one-way junctions

By themselves, p-type and n-type semiconductors are just conductors. But if you put them together, an interesting and very useful thing happens: current can flow through the resulting semiconductor, but only in one direction.

remember.eps This p-n junction, as it’s called, is like a one-way gate. If you put positive voltage on the p side of the junction and negative voltage on the n side, current flows through the junction. But if you reverse the voltage, putting negative voltage on the p side and positive voltage on the n side, current doesn’t flow.

Picture a turnstile, such as the gates you have to go through to get into a sports stadium or an underground station: You can walk through the gate in one direction but not the other. That’s essentially what a p-n junction does. It allows current to flow one way but not the other.

To understand why p-n junctions allow current to flow in only one direction, you have to understand what happens right at the boundary between the p-type material and the n-type material. Because opposite charges attract, the extra electrons on the n-type side of the junction are attracted to the holes on the p-type side. So they start to drift across to the other side.

When an electron leaves the n-type side to fill a hole in the p-type side, a hole is left in the n-type side where the electron was. The result is as if the electron and the hole trade places. The boundary of a p-n junction ends up being populated by defectors: electrons and holes have crossed the boundary and are now on the wrong side of the junction.

The region occupied by electrons and holes that have crossed over is called the depletion zone. Because one side of the depletion zone has electrons (negative charges) and the other side has holes (positive charges), a voltage exists between the two edges of the depletion zone. This voltage has an interesting effect on the defectors: it beckons them to turn around and come home. In other words, the holes that jumped to the negative side of the junction attract the electrons that jumped to the positive side.

Imagine being an electron that has jumped over the boundary and into the p-type side of the junction. Being negatively charged, you’re attracted to move farther into the p side by the positively charged holes you see ahead of you. But you’re also attracted by the positively charged holes that now lie behind you – the very same hole you traded places with now exerts a pull on you that discourages you from going any farther.

Unable to make up your mind, you decide to just stay put. That’s exactly what happens to the electrons and holes that have crossed over to the other side. The depletion zone becomes stable – a state that’s called equilibrium.

Now consider what happens when the equilibrium is disturbed by a voltage placed across the p-n junction. The effect depends on which direction the voltage is applied, as follows:

check.png When you apply positive voltage to the p-type side and negative voltage to the n-type side, the depletion zone is pushed from both sides towards the centre, making it smaller. Electrons in the n-type side of the junction are pushed by the voltage towards the depletion zone and eventually collapse it completely. When that happens, the p-n junction becomes a conductor and current flows.

check.png When you apply voltage in the reverse direction, the depletion zone is pulled from both sides of the junction, and thus it expands. The larger it gets, the more of an insulator the p-n junction becomes. Thus, when voltage is applied in the reverse direction, current doesn’t flow through the junction.

Discovering Diodes

Diodes come in many shapes and sizes, but most of them resemble the ones shown in Figure 5-4. These diodes are about the size of resistors and are available from any electronics supply shop.

9781118589717-fg020504.tif

Figure 5-4: Several common varieties of diodes.

remember.eps A diode is a device made from a single p-n junction (which we describe in the earlier section ‘Combining types into one-way junction’). As Figure 5-5 shows, leads are attached to the two ends of the p-n junction, which is encased in an insulating package. These leads allow you to easily incorporate the diode into your circuits.

The lead attached to the n-type semiconductor is called the cathode. Thus, the cathode is the negative side of the diode. The positive side of the diode – that is, the lead attached to the p-type semiconductor – is called the anode.

9781118589717-fg020505.eps

Figure 5-5: A diode has a single p-n junction.

Boning up on bias

When a voltage source is connected to a diode such that the positive side of the voltage source is on the anode and the negative side is on the cathode, the diode becomes a conductor and allows current to flow. Voltage connected to the diode in this direction is called forward bias.

But if you reverse the voltage direction, applying the positive side to the cathode and the negative side to the anode, current doesn’t flow. In effect, the diode becomes an insulator. Voltage connected to the diode in this direction is called reverse bias.

remember.eps Forward bias allows current to flow through the diode. Reverse bias doesn’t allow current to flow. (Up to a point at least; as we explain in the later section ‘Moving voltage forward’, limits apply to how much reverse bias voltage a diode can hold at bay.)

9781118589717-ma012.tif  The schematic symbol for a diode is shown in the margin. The anode is on the left and the cathode is on the right. Here are two useful tricks for remembering which side of the symbol is the anode and which the cathode:

check.png tip.eps Think of the anode side of the symbol as an arrow that indicates the direction of conventional current flow – from positive to negative. Thus, the diode allows current to flow in the direction of the arrow.

check.png Think of the vertical line on the cathode side as a giant minus sign, indicating which side of the diode is negative for forward bias.

Figure 5-6 illustrates forward and reverse bias with two very simple circuits that connect a lamp to a battery with diodes. In the circuit on the left the diode is forward biased, and so current flows through the circuit and the lamp lights up. In the circuit on the right the diode is reverse biased, and so current doesn’t flow and the lamp remains dark.

Moving voltage forward – or in reverse

In a typical diode, a certain amount of forward – or reverse – voltage is required before any current will flow. This amount of voltage is usually very small: on most diodes, around half a volt. Up to this voltage, current doesn’t flow. When the forward or reverse voltage is reached, however, current flows easily through the diode. Figure 5-6 shows both a diode wired for forward bias, in which the lamp will light, and reverse bias, in which the lamp won’t light.

9781118589717-fg020506.eps

Figure 5-6: Forward and reverse bias on a rectifier diode.

This minimum threshold of voltage in the forward direction is called the diode’s forward voltage drop, because the circuit loses this voltage at the diode. For example, if you placed a voltmeter across the leads of the diode in the forward-biased circuit in Figure 5-6 (on the left), you’d read the forward voltage drop of the diode. Then, if you placed the voltmeter across the lamp terminals, the voltage would be the difference between the battery voltage (9 V) and the forward voltage drop of the diode.

For example, if the forward voltage drop of the diode is 0.7 V and the battery voltage exactly 9 V, the voltage across the lamp is 8.3 V.

Likewise, diodes also have a maximum reverse voltage they can withstand before they break down and allow current to flow backwards through the diode. This reverse voltage is called peak inverse voltage (PIV) (or sometimes peak reverse voltage).

warning_bomb.eps PIV is an important specification for diodes you use in your circuits, because you need to ensure that your diodes aren’t exposed to more than their PIV rating. In addition to the forward voltage drop and PIV, diodes are also rated for a maximum current rating. Exceed the current rating and the diode will probably be damaged beyond repair.

Meeting the many types of diodes

Diodes come in many different flavours. Some of them are exotic and rarely used by hobbyists, but many are commonly used. The following sections describe three types of diodes you’re likely to encounter: rectifier, signal and Zener diodes. In the later section ‘Introducing Light-Emitting Diodes’, you also discover light-emitting diodes (LEDs).

Rectifier diodes

A rectifier diode is designed specifically for circuits that need to convert alternating current (AC) to direct current (DC). The most common rectifier diodes are identified by the model numbers 1N4001 to 1N4007. These diodes can pass currents of up to 1 A, and they have PIV ratings that range from 50 to 1,000 V.

remember.eps Table 5-1 lists the PIVs for each of these common diodes. When choosing one of these diodes for your circuit, pick one that has a PIV that’s at least double the voltage to which you expect to expose it. For most battery-power circuits, the 50 V PIV of the 1N4001 is more than sufficient.

tb020501

Most rectifier diodes have a forward voltage drop of about 0.7 V and so need a minimum of 0.7 V to conduct current. For more details, check out the later section ‘Putting Rectifiers to Work’.

Signal diodes

A signal diode is designed for much smaller current loads than a rectifier diode and can typically handle about 100 mA or 200 mA of current.

The most commonly used signal diode is the 1N4148. This diode has a close brother called 1N914, which you can use in its place if you can’t find a 1N4148. This diode has a forward voltage drop of 0.7 and a PIV of 100 V, and can carry a maximum of 200 mA of current.

Here are a few other interesting points:

check.png Signal diodes are noticeably smaller than rectifier diodes and their cases are often made of glass. You have to look closely to see it, but a small black band marks the cathode end of a signal diode.

check.png Signal diodes are better than rectifier diodes when dealing with high-frequency signals. For this reason, they’re often used in circuits that process audio or radio frequency signals. Because of their ability to respond quickly at high frequencies, signal diodes are sometimes called high-speed diodes. They’re also sometimes called switching diodes because digital circuits (which you discover in Book VI) often use them as high-speed switches.

check.png Some signal diodes are made of germanium rather than silicon. (Germanium the crystal, not geranium the flower!) Germanium diodes have a much smaller forward voltage drop than silicon diodes – as low as 0.15 V. This makes them useful for radio applications, which often deal with very weak signals.



Zener diodes

In a normal diode, the PIV is usually pretty high – 50, 100 even 1,000 V. If the reverse voltage across the diode exceeds this number, current floods across the diode in the reverse direction in an avalanche, which usually results in the diode’s demise. Normal diodes aren’t designed to withstand a reverse avalanche of current, but Zener diodes are.

Zener diodes are specially designed to withstand current that flows when the PIV is reached or exceeded. And more than that, they’re designed so that as the reverse voltage applied to them exceeds the threshold voltage, current flows more and more in a way that holds the voltage drop across the diode at a fixed level. In other words, Zener diodes can be used to regulate the voltage across a circuit.

tip.eps In a Zener diode, the PIV is called the Zener voltage. This voltage can be quite low – in the range of a few volts – or it can be hundreds of volts.

Zener diodes are often used in circuits where a predictable voltage is required. For example, suppose that you have a circuit that will be damaged if you feed it with more than 5 V. In that case, you can place a 5 V Zener diode across the circuit, effectively limiting the circuit to 5 V. If more than 5 V is applied to the circuit, the Zener diode conducts the excess voltage away from the sensitive circuit.

9781118589717-ma013.tif  Zener diodes have their own variation of the standard diode schematic symbol, as shown in the margin. You can find out more about working with Zener diodes in Book IV, Chapter 3.

Blocking reverse polarity with a diode

Project 5-1 presents a simple little construction project that demonstrates a diode’s ability to conduct current in only one direction. For this project, you wire up a rectifier diode in series with a 3 V flashlight lamp and a pair of AA batteries. Use a DPDT knife switch between the battery and the diode/lamp circuit so that when the switch is changed from one position to the other, the polarity of the voltage across the diode and lamp is reversed. Thus, the lamp lights in only one of the two switch positions. Figure 5-7 shows the completed project.

9781118589717-fg020507.tif

Figure 5-7: The completed circuit for Project 5-1.

9781118589717-un020501a.eps

9781118589717-un020501b.eps

Putting Rectifiers to Work

One of the most common uses for rectifier diodes is to convert household AC into DC that can be used as an alternative to batteries. We just concentrate on one part of a complete DC power supply – the rectifier circuit, which is typically made from a set of cleverly interlocked diodes. (A rectifier is a circuit that converts alternating current to direct current.)

Looking at rectifier circuits

In household mains supply or lower-voltage AC supplies derived from it, the voltage swings from positive to negative in cycles that repeat 50 times per second. If you place a diode in series with an AC voltage, you eliminate the negative side of the voltage cycle and so end up with just positive voltage, as shown in Figure 5-8.

9781118589717-fg020508.eps

Figure 5-8: Using a diode to rectify AC.

If you look at the waveform of the voltage coming out of this rectifier diode, you see that it consists of intervals that alternate between a short increase of voltage and periods of no voltage at all. This is a form of DC because it consists entirely of positive voltage. However, it pulsates: first it’s on, then it’s off, then it’s on again and so on.

Overall, voltage rectified by a single diode is off half of the time. So although the positive voltage reaches the same peak level as the input voltage, the average level of the rectified voltage is only half the level of the input voltage. This type of rectifier circuit is sometimes called a half-wave rectifier, because it passes along only half of the incoming AC waveform.

A better type of rectifier circuit uses four rectifier diodes, in a special circuit called a bridge rectifier (see Figure 5-9).

9781118589717-fg020509.eps

Figure 5-9: A bridge rectifier circuit.

Look at how this rectifier works on both sides of the AC input signal:

check.png In the first half of the AC cycle, D2 and D3 conduct because they’re forward biased. Positive voltage is on the anode of D2 and negative voltage is on the cathode of D4. Thus, these two diodes work together to pass the first half of the signal through.

check.png In the second half of the AC cycle, D1 and D4 conduct because they’re forward biased. Positive voltage is on the anode of D1 and negative voltage is on the cathode of D3.

The net effect of the bridge rectifier is that both halves of the AC sine wave are allowed to pass through, but the negative half of the wave is inverted so that it becomes positive.

technicalstuff.eps The resulting DC signal doesn’t drop to zero for half of the cycle, but still doesn’t provide a steady DC voltage level. As we describe in Chapters 3 and 4 of this minibook, both capacitors and inductors can be used to slow down changes in current and voltage, and so they’re often used in power supply circuits to improve the quality of DC voltage coming out of a rectifier circuit. Check out how that’s done in Book IV, Chapter 3.

Building rectifier circuits

In Project 5-2, you build a simple half-wave circuit and a bridge rectifier circuit to see how diodes can convert AC to DC. You don’t light any lamps or anything with this circuit; instead, just use a voltmeter to verify that the diodes are doing their job. And to keep things safe, use a 9 VAC power adapter as the source for the alternating current (see Book 2 Chapter 3 for further specification of a suitable adapter).

tip.eps To make the voltage of the 9 VAC power adapter easier to work with, make sure that it’s not plugged in to the mains, cut off the low-voltage power plug, separate the two low-voltage wire leads, strip a bit of insulation from the ends and attach crocodile clips to the leads. The crocodile clips make connecting the supply to your experimental circuits much easier.

Before you build the project, use the multimeter to measure the AC voltage created by your power adapter. Although it may be marked as 9 VAC, the actual voltage you measure is likely to be slightly more than 9 VAC.

You can find more information about rectifiers and how they’re used in power supply circuits in Book IV, Chapter 3.

9781118589717-un020502a.eps

9781118589717-un020502b.eps

Introducing Light-Emitting Diodes

A light-emitting diode (LED) is a special type of diode that emits visible light when current passes through it. The most common type of LED emits red light, but you can also purchase LEDs that emit blue, green, yellow or white light.

You pronounce LED by spelling the letters out (el-ee-dee), not like the heavy metal ‘lead’ (or indeed Led Zeppelin!).

9781118589717-ma014.tif  The schematic diagram symbol for an LED is shown in the margin, and Figure 5-10 shows an LED. The two leads protruding from the bottom of an LED aren’t the same length: the shorter lead is the cathode and the anode is the longer lead.

9781118589717-fg020510.tif

Figure 5-10: A typical LED.

tip.eps You can obtain two LEDs, usually of different colours, combined into a single package: green and red are a common combination. In such cases, they’re usually wired opposite of one another so that you can control which LED lights by changing the polarity of the voltage applied across the LED. In some cases, a third lead is used. This lead is connected to the cathode of both LEDs. The third lead enables you to light both LEDs, which yields a third colour. For example, when both LEDs are lit in a green and red combination LED, the resulting colour is yellow.

Providing the necessary resistance

Whenever you use an LED in a circuit, you need to provide some resistance in series with it, as shown in the schematic diagram in Figure 5-11. In this example, the LED is connected to a 9 V DC supply through a 470 Ω resistor.

warning_bomb.eps Without resistance, the LED lights brightly for an instant and then burns itself out: it may even go bang!

9781118589717-fg020511.eps

Figure 5-11: Always use a resistor in series with an LED.

To determine the value of the resistor you need to use, you need to know three bits of information:

check.png Supply voltage: For example, 9 V.

check.png LED forward voltage drop: For most red LEDs, the forward voltage drop is 2 V. For other LED types, the voltage drop may be different. Check the specifications on the package if you use other types of LEDs.

check.png Desired current through the LED: Usually, you need to keep the current flowing through the LED under 20 mA.

When you know these three things, you can use Ohm’s law to calculate the desired resistance (check out Chapter 2 of this minibook). The calculation requires just four steps, as follows:

1. Calculate the resistor voltage drop.

You do that by subtracting the voltage drop of the LED (typically 2 V) from the total supply voltage. For example, if the total supply voltage is 9 V and the LED drops 2 V, the voltage drop for the resistor is 7 V.

2. Convert the desired current to amperes.

In Ohm’s law, the current has to be expressed in amperes. You can convert milliamperes to amperes by dividing the milliamperes by 1,000. Thus, if your desired current through the LED is 20 mA, you have to use 0.02 in your Ohm’s law calculation.

3. Divide the resistor voltage drop by the current in amperes.

This gives you the desired resistance in ohms. For example, if the resistor voltage drop is 7 V and the desired current is 20 mA, you need a 350 Ω resistor.

4. Round up to the nearest standard resistor value.

The next higher resistor value from 350 Ω is 390 Ω. If you can’t find a 390 Ω resistor, a 470 Ω will do the trick.

Note that the minor increases in resistances mean that slightly less current flows through the resistor, but the difference isn’t noticeable. However, avoid going to a lower resistor value. Lowering the resistance increases the current, which can damage the LED.

tip.eps If you’re going to place more than one LED together in series, just add up the voltage drops to calculate the size of the resistor you need. For example, if you have a 9 V battery to supply voltage to three LEDs, each with a 2 V drop, the total voltage drop is 6 V, and so the voltage drop across the resistor is 3 V. Using Ohm’s law, you can then calculate that the resistor needed to restrict the current flow to 20 mA is 150 Ω.

For 9 V and less, 14 W resistors are more than adequate. If you’re applying larger voltages to the LED circuit, you may need to use resistors that can handle more power. To calculate how much power in watts the resistor should be rated for, just multiply the voltage dropped across the resistor by the current in amps. For example, if the voltage drop on the resistor is 3 V and the current is 20 mA, the power dissipated by the resistor is 0.06 W, which is well under the limits of a 18 W resistor.

Detecting polarity with LEDs

In Project 5-3 you build a circuit that uses two LEDs to indicate the polarity of an input voltage. The voltage is provided by a 9 V battery connected to the circuit via a DPDT knife switch that’s wired to reverse the battery polarity. The two LEDs and their corresponding resistors are mounted on a small solderless breadboard. Figure 5-12 shows the completed circuit.

9781118589717-fg020512.tif

Figure 5-12: The completed LED polarity detector.

9781118589717-un020503a.eps

9781118589717-un020503b.eps

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset