CHAPTER 16

image

Transistor Switches

When a chip pin provides current like the positive terminal of a battery, it is said to “source” current. When a chip pin receives current like the negative terminal of a battery, it is said to “sink” current. These terms are reminiscent of the water analogy, where water comes out of the source and then goes into the sink.

Many chips have the same limitation as the LM393 comparator as far as their inability to source or sink significant amounts of current. Not only is maximum current an issue, but also older chips can’t source as much current as they can sink. So, designers connected LEDs and other circuits “backwards” to these older chips, to take advantage of the stronger draining. (That dissimilarity has disappeared in newer chips that have dedicated hardware to provide more current and at equal levels.)

A chip’s low current handling capability isn’t usually a serious issue, because most chips use their pins only to pass signals to other chips. When a heavier load needs to be serviced, a discrete transistor is well-suited for the job.

There are many, many kinds of transistors. Their sizes and attributes are tailored for desired amplification, switching speed, price, noise, power usage, voltage tolerance, and/or current delivery. Although intermediate and advanced robots use mixed types of transistors, only a couple of general-purpose transistors dominate beginner robots.

In this chapter, you’ll learn about transistors, specifically the 2907A PNP. You’ll connect transistors to your LM393 comparator so that the robot can be brilliantly lit by three LEDs on both sides.

Defining Negative Power

Most batteries’ terminals are labeled with a positive (‘+’) and a negative (‘-’). If you connect your multimeter correctly to the battery terminals, you’ll see a number in voltage mode. If you then switch the probes to the opposite battery terminals, you’ll see the same number with a minus sign. The battery hasn’t changed, only the meter’s perspective.

The technically questionable term “negative power” is used in this chapter and throughout the book because it appropriately reminds the reader of connecting to the negative terminal of a battery.

However, any voltage lower than another is relatively negative. Let’s say you have two test points, the first has 9 V and the second has 4 V. If you connect something to the 9 V point, then the 4 V point is -5 V in comparison. You could say the second test point has negative voltage in comparison to the first test point. Like a battery and a multimeter, if you connect the part in the opposite direction, the voltage will be opposite.

Electrical power is more than just a difference in voltage. The term “power” is a combination of voltage and current. As used in this book, the term negative power is used to suggest that there is both a negative voltage and that sufficient electricity is allowed to flow to that negative voltage point. For example, the negative terminal on a battery has both a negative voltage and the capability for electrical current to flow to it, so it could be said to have negative power.

Focusing on the 2907A Transistor

The 2907A transistor (see Figure 16-1) is more formally referred to as the 2N2907A. It is a bipolar PNP general-purpose amplifier.

9781484213605_Fig16-01.jpg

Figure 16-1. Fairchild 2907A transistor in a TO-92 package

  • Bipolar indicates the type of semiconductor technology. Bipolar semiconductors are popular because they’re fast, static-electricity resistant, and can deliver plenty of current. However, bipolar semiconductors use more energy (and therefore emit more heat) than field-effect semiconductors.
  • PNP indicates that the transistor turns on with negative power. Just the opposite, NPN transistors turn on with positive power. (Each letter indicates a layer of doped silicon.)
  • General Purpose indicates that the transistor operates with characteristics similar to most transistors. Compare that with high-speed, low-noise, or power transistors that have special abilities tailored for specific duties.
  • Amplifier indicates the transistor can magnify a signal. Some other transistors are designed more for switching, buffering, or acting as adaptors from one voltage to another.

Like all bipolar transistors, the 2907A has three leads labeled emitter, base, and collector (not always in that order). Transistor experts hook them up in bizarre ways to achieve funky abilities. However, this book focuses on the more mundane, yet popular, arrangements. For the line-following robot, the 2907A transistor will be acting as a switch controlled by the comparator’s output.

Pushing the 2907A’s Button

You can connect most transistors to act as electronically controlled pushbuttons. “Pressing” a PNP transistor’s base lead with negative power turns on the circuit. Disconnecting the base lead or applying positive power turns off the circuit. (A thorough example circuit appears later in this chapter).

This may seem a little backwards. Usually something turns on when positive power is applied; NPN transistors work that way. However, since the LM393 comparator only connects its output signals to negative power, an appropriate transistor was chosen that turns on when it’s connected to negative power.

So, the LM393 comparator signals to the 2907A transistor to turn on the LEDs and motor by connecting the transistor’s base lead to negative power. The transistor is the muscle; the comparator is the brain.

Checking the Datasheet

Recall that a datasheet, which lists important facts about a part, is available from the manufacturer or retailer.

The 2907A datasheet indicates that it is capable of sourcing 500 mA of current continuously (as opposed to short bursts). Wow. That’s a big improvement over 6 mA for the LM393 comparator. The 2907A provides plenty of electrical flow for the LEDs and the motor, with room to spare.

Just like a chip, it is expected for each part to use a little bit of power for itself. The datasheet indicates that there is a small, continuous electrical drain for enabling the 2907A transistor. There is also a slight voltage loss of 0.2 V for the circuit being switched. But these power costs are insignificant on this robot.

Obtaining 2907A Transistors

Table 16-1 lists suppliers of 2907A transistors in the solderless-breadboard–compatible TO-92 package. Because bipolar transistors are so inexpensive, you can afford to reduce the individual price by purchasing ten at a time.

Table 16-1. Suppliers of 2907A Transistors in TO-92 Package

Tab1

Plain 2907 (without the A at the end) transistors are available. They are acceptable replacements for 2907A transistors in the line-following circuit. However, the 2907 transistor has reduced capabilities in several categories (collector-emitter breakdown voltage, collector cutoff current, and gain), and, as such, is not always a suitable replacement for the 2907A in all circuits.

Testing Bipolar Transistors with a Multimeter

Depending on your multimeter, there are a couple of methods of testing a transistor. The more informative testing method requires a multimeter with a transistor test socket. The other testing method is for multimeters with a diode test function. Later in this chapter, a sample circuit is provided that allows a transistor to be tested even if your meter has neither a transistor test socket nor a diode test mode.

The following instructions should be applicable to most meters. However, it’s best to follow the specific instructions provided with your meter.

Testing with a Multimeter that Has a Transistor Socket

When using a meter with a transistor test socket, you’ll need to test the transistor differently depending on whether you have access to the transistor’s datasheet.

Testing a Transistor When You Have the Datasheet

If you have access to a transistor’s data sheet, then you already know a lot about the transistor. You know whether it is NPN or PNP. You know which lead is the emitter, the base, and the collector. You also know approximately how much it can amplify, which is called “gain.”

Since you already know the transistor type and pinouts, you’d probably be testing to determine if the transistor is working and to compare its gain to other transistors in the same batch.

  1. Turn the multimeter dial to hFE (see Figure 16-2) or the appropriate function for your meter.

    9781484213605_Fig16-02.jpg

    Figure 16-2. Dialing the transistor gain test (hFE) on a multimeter

  2. For a 2907A transistor, Figure 16-3 shows the correct insertion. All of the transistor leads are inserted on the PNP side of the socket. The emitter connects to ‘E,’ the base connects to ‘B,’ and the collector connects to ‘C.’

    When looking at a datasheet, pay attention to the rounded and the flat sides of the transistor’s package. Otherwise, you might connect the leads in reverse by mistake (however, no damage will result if improperly inserted into a multimeter).

  3. For the 2907A, the meter should display a number between 75 hFE and 300 hFE. This is the unique amount of gain for this individual transistor.

    9781484213605_Fig16-03.jpg

    Figure 16-3. Inserting the 2907A into the multimeter transistor test socket (examples from two different sockets found on various meters)

Understanding the Importance of Transistor Gain

Current applied to the transistor’s base is multiplied by the hFE to determine the amount of current the transistor will produce. A transistor with 30 hFE gain and 2 mA current on its base lead allows 60 mA of current to flow between the emitter and collector.

2 mA × 30 hFE = 60 mA

The circuit attached to the collector isn’t required to use all of the current, but it is restricted to that maximum (in this case 60 mA).

By varying the amount of current provided to the transistor’s base, you can control the amount of current provided to the attached circuit. This technique is used in some battery chargers to limit the maximum current that the battery can draw, thus preventing the battery from overheating or exploding.

A transistor is a current-controlled device. Just like an LED, the output of a transistor depends largely on the current provided to it.

Gain Varies from Transistor to Transistor

The hFE varies from transistor model to transistor model. It even varies from transistor to transistor within the same batch from the factory. In a lot of ten 2907A transistors, I got results from 151 hFE to Q 173 hFE. The datasheet guaranteed a minimum of 75 hFE, so the actual numbers were very good.

The variations in gain cause headaches to stereo manufacturers as they result in speaker outputs with different sound volumes. However, since the LM393 comparator is going to be giving at least 6 mA to the base of the transistor, even a minimum gain of 75 is going to result in 450 mA available to the attached circuit.

Switching Off and On Rather Than Amplifying

When a PNP transistor is used as a switch, the base lead is provided either no current to turn the transistor completely off or plenty of negative power at the base lead to turn the transistor completely on. Putting a transistor into a fully powered state is called saturation. This is a legitimate and common technique.

When a transistor is used as an amplifier, for example for an audio speaker, the transistor is provided user-adjustable levels of current to the base lead through a potentiometer. This results in audio volume control.

Testing a Transistor When You Don’t Have the Datasheet

If you don’t have access to a transistor’s data sheet, then you’ll need to try various combinations of insertions into the multimeter’s transistor test socket.

  1. Turn the multimeter dial to hFE (see Figure 16-2) or the appropriate function for your meter.
  2. Try each of the combinations of the NPN holes. On my multimeter, the transistor can fit into the socket with EBC or BCE (E for emitter, B for base, C for collector). Then, I can flip the transistor in the opposite direction and get CBE and ECB. This allows for all combinations with either the base or the collector in the middle.
  3. If you encounter the correct combination, the meter should display a number between 10 hFE and 600 hFE, with the extremes being more atypical. Numbers below 10 hFE or above the maximum of the meter usually signify the transistor is installed incorrectly.
  4. After trying the NPN combinations, try each of the combinations of the PNP holes.
  5. One of the connections in the NPN or PNP holes should have resulted in a gain between 10 hFE and 600 hFE. The other combinations should have displayed values below 10 hFE or above 600 hFE. The set of holes that worked tells you whether the transistor is NPN or PNP, and which lead is the emitter, base, and collector.

Even if you have the datasheet for a transistor, trying the other combinations of holes can indicate that the transistor is damaged if it gains too much when installed in the wrong holes. Often, a damaged transistor won’t provide useful gain despite being installed correctly in the multimeter’s transistor socket.

If the transistor’s gain isn’t within the reasonable range for any of the holes, it may be because:

  • the transistor wasn’t fully inserted into the test socket
  • the transistor isn’t a bipolar semiconductor (perhaps it’s field-effect)
  • the transistor is damaged
  • the transistor is designed for really high gain
  • the transistor is designed for really low gain

Testing with a Multimeter that Has a Diode Test

If your multimeter doesn’t have a transistor test socket, you can still determine the transistor type (NPN or PNP) and which lead is the base. For this experiment, you can pick either a PNP (like the 2907A) or NPN transistor. I’ve produced test results for both types, so that you can compare your transistor to my samples.

  1. Turn the multimeter dial to diode test mode and prepare the test probes like you were going to test an LED (see Figure 16-4).

    9781484213605_Fig16-04.jpg

    Figure 16-4. Setting up a multimeter for testing a transistor with the diode test function

  2. With a pair of transistor leads at a time, connect each of the leads to the multimeter test probes and write down the value. For example, connect the transistor’s first lead to the red test probe and connect the transistor’s second lead to the black test probe and record the value.
  3. Continue until you’ve tested all lead combinations as shown in the first column of Table 16-2.

Of all the combinations, only two should have a voltage drop of between 0.5 and 0.7. All of the other combinations should be infinity. Sample results appear in Table 16-2.

Table 16-2. Example Diode Test Results for Two Different Bipolar Transistor Types

Leads

Sample PNP

Sample NPN

1 red & 2 black

0.623 V

infinity

1 red & 3 black

infinity

infinity

2 red & 3 black

infinity

0.606 V

2 red & 1 black

infinity

0.610 V

3 red & 1 black

infinity

infinity

3 red & 2 black

0.619 V

infinity

The transistor lead that is present in both conducting lead combinations is the base lead. Referring to Table 16-2, for Sample PNP, the base lead is 2 (the middle lead) because it appears in test combinations 1 & 2 and 3 & 2. For Sample NPN, the base lead is also 2 (the middle lead) because it appears in test combinations 2 & 3 and 2 & 1. Although these examples both had base leads in the middle, that won’t be the case with all transistors.

Furthermore, if the base lead conducted when it was connected to the red test probe, the transistor is NPN. Otherwise it is PNP. For Sample PNP, the base lead conducted when it was connected to the black test probe, so it is a PNP transistor. For Sample NPN, the base lead conducted when it was connected to the red test probe, so it is an NPN transistor.

If you’d like to reproduce the test results, Sample PNP is a 2907A transistor (no surprise) and Sample NPN is a 2222A transistor. The 2222A has very similar attributes to the 2907A, and is often used to replace the 2907A when a positive-power—activated transistor is needed.

The diode test can only determine the base lead. In order to determine the emitter and collector, a test circuit needs to be made on a breadboard.

Bipolar Transistor Test Circuits

A couple of example circuits may be helpful in understanding how a transistor can act as a switch. The first example that will be presented is for PNP transistors, which take negative power to turn on. The second example is for NPN transistors, which take positive power to turn on.

You can place a transistor in these test circuits and determine:

  • whether the transistor is NPN or PNP
  • which lead is the emitter, base, and collector
  • the transistor’s gain (hFE)

Examining the Schematic for the PNP Transistor Test Circuit

Figure 16-5 is a schematic of a PNP transistor test circuit. LED1 turns on when a PNP transistor is correctly inserted for Q1. NPN transistors or incorrectly inserted PNP transistors won’t work, but no harm will be done.

9781484213605_Fig16-05.jpg

Figure 16-5. Schematic for a PNP transistor test circuit

Image Note  In a schematic, the letter ‘Q’ is used to label transistors because the letter ‘T’ usually labels transformers. Transformers existed long before transistors were invented.

The direction of the arrow in the schematic symbol for a PNP transistor indicates that it is PNP. The arrowhead inside the symbol’s circle points toward the base pin (marked with a ‘B’). The arrow indicates the direction electricity must flow. Therefore, the emitter (marked with an ‘E’) must connect to positive power. The electricity then flows from the emitter, through the base and collector (marked with a ‘C’), and eventually out to negative power.

Resistor R1 and LED1 should be familiar to you. They form a simple LED indicator circuit. No matter how much of the battery’s current is made available by the transistor (Q1), the resistor (R1) limits the amount of current LED1 actually receives.

Resistor R2 also provides a current-limiting function. It prevents the transistor (Q1) from having too much current flow through it. Not only does R2 prevent too much current flowing from the emitter to the base, but it also controls the maximum current that the LED Indicator circuit can have.

Dimming the LED for Reverse Connections

Most transistors have some gain (3 hFE to 5 hFE) even when connected backwards. We want a circuit that only lights the LED significantly when the transistor is wired correctly (gain of over 75 hFE). To achieve this, R2 is a very large resistor value and LED1 is restricted to being a standard LED (not high efficiency or high brightness).

With the large resistance of 470 kΩ, R2 doesn’t allow much current to flow through the base. The amount of current flowing through the base is multiplied by the transistor’s gain to determine the maximum current that is permitted to flow through the collector. Low gain (if the transistor is connected backwards) multiplied by low base current means LED1 will be limited to a low maximum current.

Unfortunately, a high-efficiency LED can still illuminate with very little current. So, that’s why you should use an ordinary LED.

Image Note  Usually you’ll want to use high-efficiency or ultra-bright LEDs because their low current appetites save battery power. These LEDs work perfectly well with transistors. It’s just that in the case of the transistor testing circuit, we want a current hog.

Building the PNP Transistor Test Circuit

You can build the PNP transistor test circuit to look very much like the schematic. See Figure 16-6 for a photograph.

9781484213605_Fig16-06.jpg

Figure 16-6. PNP transistor test circuit built on a solderless breadboard

Correcting Problems with the PNP Transistor Test Circuit

If the LED doesn’t light, you can temporarily pull Q1 and connect a jumper between the positive bus and the top of R1. This is safe because R1 and LED1 form a complete LED indicator circuit by themselves. If it doesn’t light with a direct connection to power, you’ve probably got the LED in backwards.

After you’ve determined that the LED indicator circuit portion is functioning, you should check that the bottom of R2 is connected to negative power. If it is, try flipping Q1 around, paying attention to the flat side. If you insert Q1 backwards or if R2 isn’t connected to negative power, the LED won’t turn on.

Experimenting with the Functioning PNP Transistor Test Circuit

Whatever you do, don’t remove or bypass either R1 or R2. Without the resistors, the amount of current flowing through either Q1 or LED1 would exceed their maximum rating. They would quickly be destroyed.

With a functioning circuit, try flipping Q1 around to see the LED turn off.

Rather than using a flat jumper between R2 and ground, try a reinforced jumper. After seeing the LED turn on, you can pull the reinforced jumper from the bottom of R2 and see that that LED turns off. Connect the jumper to positive power to see that the LED stays off. The base lead of a PNP transistor must be connected to negative power to turn on the circuit that is attached to its collector.

Gathering Data About the PNP Transistor

When you insert a bipolar transistor with the leads in the proper orientation, the LED lights. Assuming it is a bipolar transistor, the circuit is now telling you that the transistor is a PNP. You also know which lead is the emitter, base, or collector, as the LED only lights when the leads match the schematic.

With power applied to a functioning circuit, try measuring the current flowing through R2. If you used a reinforced jumper at the bottom of R2, simply disconnect the jumper from negative power and instead connect it to the red test probe of the multimeter. Connect the black test probe to negative power. My meter indicated only 0.0164 mA (or 16.4 μA) flows through R2.

Try measuring the current flowing through R1. My meter indicated 3.1 mA. These numbers allow the calculation of the gain of the transistor.

3.1 mA collector current / 0.0164 mA base current = 189 hFE transistor gain

That’s higher than the 171 hFE indicated by my multimeter test for this transistor. However, gain varies depending on how much current is applied and consumed.

This PNP test circuit will become the circuit actually used in the line-following robot. It will take the 6 mA of negative power from the LM393 and will provide hundreds of mA to the three LED indicators and motor.

Examining the Schematic for the NPN Transistor Test Circuit

The NPN circuit is an upside down version of the PNP circuit. Compare Figure 16-7 to Figure 16-5. All of the components and their values stay the same except for Q1.

9781484213605_Fig16-07.jpg

Figure 16-7. Schematic for an NPN transistor test circuit

Q1’s collector has flipped to the other side of the transistor, but the LED indicator circuit (LED1 and R1) is still connected to the collector lead. The arrow remains on the emitter of the transistor symbol, but the arrowhead no longer faces the base. The arrow shows the direction of electrical flow.

R2 is connected to positive power, as is LED1. This is the most significant difference between PNP and NPN transistors. NPN transistors turn on via positive power to the base, and they connect the attached circuit to negative power. PNP transistors turn on via negative power to the base, and they connect the attached circuit to positive power.

Building the NPN Transistor Test Circuit

If you’ve built the PNP transistor test circuit (see Figure 16-6), rotate the breadboard upside down and hold it near Figure 16-8. It looks almost exactly the same! All the parts are in the same place and orientation, except the notch in LED1.

9781484213605_Fig16-08.jpg

Figure 16-8. NPN transistor test circuit built on a solderless breadboard

I can’t think of a more concrete example to demonstrate that PNP and NPN transistors are generally identical in function except the negative and positive are reversed.

Pay attention to the flat side of the NPN transistor (Q1). You may mistakenly want to install it with the label facing you. Also, as with the PNP transistor test circuit, you can follow the same steps with the NPN transistor test circuit to determine the transistor’s emitter, base, collector, and gain.

Brightness Comparator Circuit with Transistors

Recall the brightness comparator circuit from the prior chapter. The diagram shown in Figure 16-9 is very similar to that earlier circuit, except that transistors now switch the LEDs.

9781484213605_Fig16-09.jpg

Figure 16-9. Wiring diagram of a brightness comparator circuit with transistors

Calculating Current-Limiting Transistors

R17 and R18 are current-limiting resistors. They protect transistors Q7 and Q8 from too much current flowing through them. The 1 kΩ resistor values are much lower than the 470 kΩ current-limiting resistor used in Figure 16-5. Here’s the formula for determining how much current will flow through the base lead:

((V battery - 0.6 V bipolar transistor uses) / Ω base current-limiting resistor) x 1000 to convert to mA = maximum base current
Thus: ((9 V - 0.6 V) / 1000 Ω) x 1000 = 8.4 mA

Based on this math, 1 kΩ resistors allow up to 8.4 mA to flow through the base lead. Notice that the transistor uses up a bit of voltage (0.6 V) for itself. Now that you know how much current is supplied to the base, you can determine how much maximum current is supplied to the attached circuit.

8.4 mA base current x 75 hFE minimum transistor gain = 630 mA

Identifying Stresses Beyond Official Limitations

There are a couple of potential issues with the choice of 1 kΩ for current-limiting resistors R17 and R18.

Taking Into Account the LM393’s Worst-Case Minimum Limit

The LM393 comparator officially only guarantees it can provide 6 mA, not the 8.4 mA permitted by the resistors. The values of R17 and R18 could be made a little higher (more resistive) to prevent stressing of the comparator outputs.

Image Note  There are a number of potential outcomes when a circuit design exceeds the minimum and maximum values listed on a component’s datasheet: The first scenario, and the most likely, is that the component will continue to perform even moderately beyond the official limitations. This is because the manufacturer understates capabilities in the official datasheets so that the manufacturer can confidently guarantee performance within the specified ranges.

The second scenario is that the component would simply not provide any greater amount, but wouldn’t be damaged either. For example, the comparator would simply provide 6 mA even though the resistors would allow up to 8.4 mA.

The third scenario is that the component would not work at all, or at a significantly reduced level, but would not be harmed. For example, a chip run at lower than minimum voltage might slow down, provide incorrect output, or temporarily cease operating.

The fourth scenario is that the component would wear or age more rapidly. For example, a motor run faster and hotter than the limits might slowly become less and less efficient and then fail earlier.

The last scenario is that the component would fail utterly, perhaps being destroyed or significantly damaged. For example, a 20 mA LED dies when run at 200 mA.

The trick is in knowing how a component is going to behave outside the official limits. Although you can take an educated guess, there’s usually no way to be sure in advance.

((V battery - 0.6 V bipolar transistor uses) / mA desired base current) × 1000 to convert from mA = Ω desired current-limiting resistor value
((9 V - 0.6 V) / 6 mA) × 1000 = 1400 Ω

Oops. That didn’t take into account that the battery might start as high as 10 V.

((10 V - 0.6 V) / 6 mA) 1000 = 1566 Ω

If you happen to find some resistors at or above 1566 Ω, you could design the circuit for the worst case. However, according to the datasheet, typically the comparator provides 16 mA. So, 1 kΩ resistors limiting current to 8.4 mA is fine. Additionally, as the battery voltage declines with use, the current will also drop.

Looking Out for Heavy Current Through the Attached Circuit

The other issue with an 8.4 mA base current is that some manufacturers only guarantee their 2907A can provide a maximum of 500 mA through the collector to the attached circuit. The 8.4 mA base current was calculated as being able to drive 630 mA.

It gets worse. The transistor’s datasheet claims the transistor’s gain could be as high as 300 hFE.

8.4 mA base current × 300 hFE transistor gain = 2520 mA collector current

2520 mA? A TO-92–encased bipolar transistor supplying that much current is going to melt!

Because the gain varies from transistor to transistor (even within a batch), it isn’t reliable to design a circuit based on a particular gain. Instead, make sure the circuit attached to the transistor limits its own current below the transistor’s maximum as listed in the transistor’s datasheet. In this circuit, R7 and R8 protect the transistor as well as the LEDs.

Building the Brightness Comparator Circuit with Transistors

When building the circuit, leave a little room on the breadboard between the left and right indicators (driven by Q7 and Q8) shown in Figure 16-10. Motors will be attached to the transistors in a future chapter.

9781484213605_Fig16-10.jpg

Figure 16-10. Brightness comparator circuit with transistors built on a solderless breadboard

The finished circuit should perform the same as the original brightness comparator circuit, but with the addition of more LEDs. Wave your hand in front of the photoresistors to test it.

If any of the LEDs are backwards, the other LEDs in that strand won’t light. Interestingly, properly installed LEDs light even with the transistor installed backwards. This is because not much gain is needed yet. However, with the motors installed, a backwards transistor isn’t going to be able to supply enough current to light the lights and engage the motors.

Summarizing PNP and NPN Transistors

When your robot needs to provide more power to a circuit than an ordinary chip can provide, attach a transistor. When the chip is providing positive power, use an NPN transistor at the negative end of the circuit you wish to control. Otherwise, use a PNP transistor at the positive end of the circuit you wish to control.

Transistors can turn all kinds of circuits and devices on and off. The examples in this chapter only involved LEDs, but there’s no reason a variety of circuits couldn’t be attached to a transistor’s collector. In fact, that’s how many power-saving devices are designed. When the brains decide enough idle time has passed, the base current provided to various transistors is stopped, thus turning off unneeded circuits.

The line-following circuit is nearly complete. By connecting transistors to the comparator, you can install three LEDs on both sides of the robot. In fact, the transistors drive enough current under the control of the comparator that the board is now ready for motors.

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

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