CHAPTER 14

image

Variable Resistors

The brightness sensors and balancing dial at the front of Sandwich are variable resistors. In this chapter, you’ll learn about variable resistors and you’ll prototype the first portion of the line-following circuit. Along the way, you’ll run across techniques for simplifying schematics.

Thus far, the resistors you’ve experimented with have had fixed values. That is, their resistance stays the same all the time.

For the LED power indicator circuit, the brightness of the LED is based on the value of the resistor installed. To change the brightness, you need to remove the resistor and replace it with a resistor of a different value. It would be nice if the circuit had a resistor that could alter its value so that you could change the brightness of the LED without having to switch parts.

Potentiometers

Potentiometers (see Figure 14-1) are variable resistors. Their resistance changes by turning a control knob or dial. You’ve probably operated potentiometers plenty of times without even knowing it. For example, potentiometers commonly control stereo volume as well as analog television brightness and contrast.

9781484213605_Fig14-01.jpg

Figure 14-1. A variety of potentiometers

You can adjust all potentiometers down to zero ohms (no resistance). The value printed on the potentiometer indicates its maximum value. For example, you can adjust a 500 Ω potentiometer from

0 Ω up to 500 Ω. You can adjust a 10 kΩ potentiometer from 0 Ω to 10 kΩ.

There are a wide variety of potentiometer sizes and packages available. However, like switches, only a small subset of potentiometers fit into a solderless breadboard. The other potentiometer sizes tend to have oddly spaced or thick leads.

Trimpot

Trimpot is short for trimmer potentiometer. Sometimes they’re called trimmers. They’re lightweight, take up very little space, and most fit into solderless breadboards (see Figure 14-2).

9781484213605_Fig14-02.jpg

Figure 14-2. A breadboard-compatible single-turn trimpot

Unlike full-size potentiometers, trimpots don’t have finger-friendly control knobs. Instead, they’re adjusted with a small screwdriver. This can be a pain when you want to make an adjustment; however, it does reduce the likelihood of accidental changes. Trimpots are often used for values that won’t be adjusted very often and are usually set by a service technician as opposed to a consumer.

Trimpot dials are more delicate than full-size potentiometers. Trimpots wear out after as little as a hundred turns, as opposed to tens of thousands of turns for a full-size potentiometer. This shouldn’t be an issue since trimpots are adjusted less often.

Recall Sandwich’s sensor balancing dial. The robot needs to be in place on a track to determine if the left pair of sensors sees the same values as the right pair of sensors. However, the dial rarely needs tweaking after the initial adjustment is made to compensate for manufacturing variations or soldering inconsistencies. For those reasons, Sandwich has a tiny hole for a screwdriver to access a trimpot (see Figure 14-3) instead of a full-size, externally mounted potentiometer.

9781484213605_Fig14-03.jpg

Figure 14-3. Adjusting Sandwich’s trimpot with a flathead screwdriver through an access hole

Turning the Dial

Most potentiometers have single-turn dials. That is, they rotate from their minimum value (0 Ω) to their maximum value (printed on the case) within one rotation of the dial. With only a single rotation, you can quickly change the value and you can easily tell by the dial angle when the potentiometer is at the beginning, middle, or ending of its range.

Multiturn potentiometers (see Figure 14-4) take many turns (25, for example) to adjust through their entire range. This makes it possible to fine-tune an exact value, since each twist of the screwdriver only tweaks the resistance a little bit. Also, if the dial slips a little bit on its own due to vibration or temperature changes, a multiturn potentiometer changes value less than a single turn potentiometer.

9781484213605_Fig14-04.jpg

Figure 14-4. A breadboard-compatible multiturn trimpot

An easy way to identify a multiturn trimpot is to look for a metal screw offset to the side of the trimpot (see Figure 14-4) instead of a plastic dial in the center (see Figure 14-2). Multiturn trimpots are more complex internally, and therefore more expensive than single-turn trimpots.

You will want to make very fine adjustments to the line-follower’s sensor balance. Also, you don’t want the value to change much due to vibrations as the robot moves. Therefore, a multiturn trimpot (see Figure 14-3) would be a good choice for the line-following robot’s sensor balance.

Obtaining Assorted Trimpots

It’s worthwhile to have a variety of sizes and ranges of trimpots. Table 14-1 lists suppliers of assorted kits.

Table 14-1. Assorted Value Trimmer Potentiometers

Tab1

Trimpots are also available individually or in bulk packets of the same resistance value. After determining your favorite resistance values and dial style, consider stocking up. I like 500 Ω, 2 kΩ, 10 kΩ, 25 kΩ, 100 kΩ, and 1 MΩ.

If you only want a pair of 20 kilohm multiturn potentiometers used in the Sandwich robot, the part numbers are: Solarbotics RT20k, Electronix Express 18MPT20K, Mouser Electronics 652-3296W-1-203, or Digi-Key 490-2881.

Testing Potentiometers

The maximum resistance value of the potentiometer usually appears printed on the casing as a three-digit code. The third digit is the number of zeros to add to the end of the first two digits. For example, “501” is 500 Ω. “103” is 10,000 Ω. “254” is 250,000 Ω.

To measure a potentiometer, set up your multimeter the same way as you would to measure the resistance of a normal fixed resistor. An important difference is a potentiometer has three leads, not two.

Measuring the Maximum Resistance of a Potentiometer

To determine the maximum resistance of any kind of potentiometer, connect the multimeter test probes to the first and third leads (see Figure 14-5). This should be approximately the same as the value printed on the potentiometer’s case.

9781484213605_Fig14-05.jpg

Figure 14-5. Hook probes connected to the first and third pins of a trimpot to measure maximum value

Turning the potentiometer control dial has no effect on the resistance between the first and third leads. Swapping the black and red test probes on the potentiometer makes no difference, just like a fixed resistor.

Measuring the Variable Resistance of a Potentiometer

Connect the multimeter test probes to the first and middle leads of a potentiometer to display the changing resistance as the potentiometer control dial is turned (see Figure 14-6). As the dial is turned to the left, the resistance to the first lead decreases and the resistance to the third lead increases. The reverse occurs as the dial is turned to the right, the resistance to the first lead increases and the resistance to the third lead decreases.

9781484213605_Fig14-06.jpg

Figure 14-6. Hook probes connected to the first and middle pins of a trimpot to measure varying values

When dialed all the way to one extreme, the resistance between the middle pin and either the first or the third pin should be 0 Ω. When dialed all the way to the other extreme, the resistance should be the maximum value printed on the potentiometer’s case.

Linear Versus Logarithmic/Exponential

Turn the potentiometer dial to the middle. Is the measured resistance approximately half the maximum value? If it is, then the potentiometer is probably a linear taper. This means that the resistance changes at a steady rate as you turn the dial. That’s desirable for most robotic applications.

If the resistance value halfway through the dial is much more or much less than half the maximum value, then the potentiometer is probably a logarithmic or exponential taper. That’s less desirable for most robotic applications. Logarithmic taper potentiometers are often used in stereos to increase the volume in multiples to reflect the perceptions of human hearing.

Variable Brightness LED Circuit

The schematic in Figure 14-7 is very similar to the LED power indicator schematic shown earlier in the book. The battery (B1) and the LED (D1) stay the same.

9781484213605_Fig14-07.jpg

Figure 14-7. Schematic of a simple circuit to vary the brightness of an LED

However, a potentiometer (R2) now appears between the fixed resistor (R1) and the LED (D1). Notice that the schematic symbol for a potentiometer looks somewhat like a fixed resistor, except there’s an arrow in the middle. You can imagine this arrow sliding back and forth on the resistor, jumping in at some value in between.

Also noteworthy is that the letter “R” is assigned to the potentiometer (R2) because it is in the resistor family, even though it has a variable resistance. Recall that “D” is assigned to an LED (D1) because it is in the diode family, even though it is a light-emitting variation.

Since you’ve got a potentiometer whose resistance spans a broad range, why bother to include a fixed resistor (R1)? After all, a 100 kΩ potentiometer provides all the usable values of 470 Ω and up.

Unfortunately, the user has the ability to turn the potentiometer all the way down to no resistance (0 Ω). Without a minimum value enforced by the fixed resistor (R1), the LED would be connected to the full strength of the battery and would be destroyed. Unless you’re designing a self-destruct button, you generally want to guard against extreme ranges on adjustable controls.

Image Tip  Whenever you install a potentiometer, ask yourself what would happen if it were dialed to zero and what would happen if it were dialed to the maximum. Consider the voltages and currents under those extremes, and then test the design with a multimeter to be sure they’re within the values that the surrounding components can tolerate.

Building the Variable Brightness LED Circuit

Make sure power is disabled on the solderless breadboard. Never connect or disconnect parts to a live (powered on) system.

The variable brightness LED circuit (see Figure 14-7) is easy to build on a breadboard. See Figure 14-8 for a photograph of an actual example.

9781484213605_Fig14-08.jpg

Figure 14-8. Variable brightness LED circuit built on a solderless breadboard

Note that the fixed resistor (R1) goes into the same 5-position group as the center lead of the trimpot (R2). The first lead of the trimpot (R2) is connected to the LED (D1), but the third lead is not connected to anything.

Power up! Turn the trimpot dial with a small screwdriver and observe the brightness of the LED. If you have a very efficient LED, the light may remain visible even when the trimpot dial is turned all the way to the right. If you have a poor-efficiency LED, the light may not be visible even when the trimpot dial is halfway.

Try different values of trimpots. Recall that R1 is protecting the circuit against too much current, so you’re free to experiment with any value potentiometer.

Brightness Balancing Circuit

Take a look at the schematic in Figure 14-9. Where did the battery go?

9781484213605_Fig14-09.jpg

Figure 14-9. Schematic of brightness balanced LEDs

The circuit has been simplified by substituting the words “+9 VDC” for the battery. This takes up less space and focuses attention on the heart of the circuit. Also, this doesn’t falsely lead you to believe you must use a battery. For example, a wall adapter power supply providing the same voltage would be fine.

What happened to the bottom of the schematic? The LEDs are each connected to three ever-shortening horizontal lines. Again, a simplification. These are the power return lines. It’s less distracting to show abbreviated return lines rather than having them cross all over the illustration.

The schematic is cleaned up and simplified by eliminating the battery and chopping all of the power return lines. For such a small circuit, it may not seem like much, but this commonly accepted technique really tidies up large schematics.

Building the Brightness Balanced LEDs Circuit

Looking at Figure 14-10, it may strike you that the actual built circuit looks a lot like the schematic (see Figure 14-9). This is yet another reason for drawing the schematic without the battery or power return lines.

9781484213605_Fig14-10.jpg

Figure 14-10. Brightness balanced LEDs circuit built on a solderless breadboard

In this circuit, an LED (D2) has been connected to the third lead of the trimpot (R2). The maximum value of the trimpot has been decreased to only 500 Ω.

When the trimpot dial is in the center, the resistance is split evenly between the two LEDs, 250 Ω each. As the dial is turned left and right, the resistance is delivered unequally between the two LEDs. The brightness of one LED increases and the brightness of the other LED decreases. It’s like the speaker balance control on a car stereo.

Cadmium-Sulfide Photoresistors

Cadmium-sulfide photoresistors (see Figure 14-11) are extremely popular in robotics. They’re lightweight, inexpensive, fascinating to look at, and mimic the visible-light responsiveness of the human eye.

9781484213605_Fig14-11.jpg

Figure 14-11. Standard cadmium-sulfide photoresistor

Image Note  Thorough readers with good memories will dredge up my advice not to purchase or use components containing the element cadmium. Despite my research, I haven’t been able to locate a suitable replacement photoresistor without cadmium. “Well, it’s not got much cadmium in it.”

Cadmium-sulfide can be abbreviated CdS. Sometimes, photoresistors are called photocells or photoconductors. It’s the same component no matter the name.

Potentiometers change resistance in response to rotations of their dials, whereas photoresistors change their resistance in response to the amount of light shining on them. Pretty cool!

Obtaining Assorted Photoresistors

Encapsulated photoresistors (see Figure 14-12) are available for outdoor or rugged uses. An opaque metal case and clear plastic lens protect the sensor against moisture, dust, and soil. The opaque metal also prevents light coming from the rear from affecting the resistance.

9781484213605_Fig14-12.jpg

Figure 14-12. Encapsulated and exposed ceramic cadmium-sulfide photoresistors

Like potentiometers, photoresistors are available in a variety of resistance ranges and physical sizes. Larger photoresistors change resistance more slowly, but are generally more sensitive to the true lighting conditions as they have a larger “eye” to experience more of the lightness or darkness.

Table 14-2 lists suppliers of assorted photoresistors. It’s much cheaper to buy an assorted bagful rather than specific values. I highly recommend buying several Electronic Goldmine (http://www.goldmine-elec.com/) bags, because of the variety and low price.

Table 14-2. Assorted Cadmium-Sulfide Photoresistors

Tab2

Experiencing the Variable Resistance of a Photoresistor

Attach a photoresistor to your multimeter using the same method as measuring a fixed resistor (see Figure 14-13). Watch the resistance change as you bring the photoresistor towards a light or cover it with your hand. Really, this is worth trying.

9781484213605_Fig14-13.jpg

Figure 14-13. Hook probes connected to a cadmium-sulfide photoresistor to measure varying values

Light-Controlled Circuit

Substitute a photoresistor for the potentiometer in the variable brightness LED circuit presented earlier in this chapter (see Figure 14-7). See Figure 14-14 for a photograph of the revised circuit built on a breadboard. As the room darkens, the LED also darkens. As the room brightens, the LED also brightens. Putting your finger over the photoresistor also does the trick.

9781484213605_Fig14-14.jpg

Figure 14-14. Light-controlled variable-brightness LED circuit built on a solderless breadboard

Remember when you had to choose a resistor size to compromise between LED brightness and battery life? With a photoresistor, the circuit can automatically brighten the LED so that it’s visible in daylight, but conserve battery power in dim areas where the LED is perfectly noticeable.

Photoresistors are commonly found in automatic nightlights and streetlights. In these applications, the photoresistors are hooked up to circuitry that turns on a bulb when the ambient lighting gets dark.

Balanced Brightness-Sensing Circuit

Sandwich, the line-following robot, uses four cadmium-sulfide photoresistors in pairs to detect the amount of light at front of the robot. Figure 14-15 is an exact schematic of the robot’s brightness-sensing circuit.

9781484213605_Fig14-15.jpg

Figure 14-15. Balanced brightness-sensing circuit

Part List for Balanced Brightness-Sensing Circuit

  • -- – 9 VDC power supply
  • R1 – 470 Ω resistor (yellow, violet, brown)
  • R2 – 20 kΩ trimpot
  • R3, R4, R5, R6 – Roughly 100 Ω bright to 450 kΩ dark cadmium-sulfide photoresistors

Brightness-Sensing Pairs

R3 through R6 are photoresistors (notice the variable resistor symbol with a circle drawn around it and “light” arrows coming in). Each photoresistor changes resistance depending on the amount of light it receives. R3 and R4 are paired to sense the right side of the floor beneath the robot. R5 and R6 are paired to sense the left side of the floor beneath the robot.

A pair of photoresistors can detect a physically wider area than can a single photoresistor. Another advantage to using a pair is that you can hand–select them to average out manufacturing discrepancies in minimum and maximum values.

Matching Photoresistors

Individual photoresistors have appreciably different overall resistance ranges even if they look the same or came from the same production batch. This is especially true if purchased in mixed bags. It’s important to match similar resistance groups and sort them into their own piles. You can balance your line-following robot with photoresistors that are slightly different, but not with photoresistors that are radically different.

Photoresistor matching is a simple process. Connect a photoresistor to your multimeter and hold it up to a light. Write down the Ω value. Now hold the photoresistor under a table (or other dark area) and write down the new Ω value. As you make your way through a pile of photoresistors, you’ll get a sense for how closely the high and low values can match.

Your primary goal in testing the photoresistors is to knock out any defective ones. These will not change value or will have really low or really high values—especially compared to the rest of the lot.

Your secondary goal is to roughly match the photoresistors. Again, stick one up to a light bulb, count to 5, and record the value. Stick it under a dark desk, count to 5, and record the value. Good enough.

Because of the balancing potentiometer (R1) and the striking contrast of the line on the floor, the photoresistors don’t have to be matched exactly. Truth be told, the four photoresistors for Sandwich were picked at random from a previously defective-removed lot. And Sandwich performs beautifully. Subsequently built Sandwich clones had more carefully matched values, but show no differences in performance.

In order of testing, Table 14-3 shows the values I found for otherwise identical-looking photoresistors.

Table 14-3. Sample Photoresistors Values

Label

Resistance Pressed Against Light bulb

Resistance Under Dark Desk

A

123 Ω

260 kΩ

B

130 Ω

338 kΩ

C

115 Ω

400 kΩ

D

124 Ω

370 kΩ

E

105 Ω

440 kΩ

F

128 Ω

470 kΩ

G

110 Ω

430 kΩ

H

115 Ω

434 kΩ

I

119 Ω

550 kΩ

I would pair photoresistors ‘C’ and ‘H’ on one side of a line-following robot and photoresistors ‘G’ and ‘D’ on the other side. The sensor order would be ‘C,’ ‘H,’ ‘G,’ and ‘D.’ ‘C’ and ‘H’ have a combined range of 230 Ω to 834 kΩ, whereas ‘G’ and ‘D’ have a combined range of 234 Ω to 800 kΩ. In the center of the robot, ‘H’ and ‘G’ have similar ranges. On the sides of the robot, ‘C’ and ‘D’ also react similarly.

You don’t have to go to all of this effort. But imagine the bad luck of a robot comparing photoresistor ‘A’ with photoresistor ‘I.’ Both photoresistors react the same to light lines, but the resistance of photoresistor ‘I’ would be double that of photoresistor ‘A’ when looking at the same dark surface.

None of the photoresistors in Table 14-3 are bad or damaged. A bad photoresistor I ran across ranged from 4 MΩ in light to greater than 40 MΩ in darkness. That’s extremely different than the other photoresistors. If you find a part like that, dispose of it properly before it gets into one of your creations. In an assorted grab bag, expect as many as 10% of the photoresistors to be faulty.

Resistance-Balancing Potentiometer

Referring back to Figure 14-15, R2 is a 20 kΩ potentiometer. As the dial is turned, it splits the resistance supplied to each branch that leads to each pair of photoresistors. R2 works the same way it did in the brightness balanced LED’s circuit (see Figure 14-9).

In the middle of its range, R2 provides 10 kΩ resistance to the left side and 10 kΩ to the right side. Jamming it in one direction provides 20 kΩ resistance to one side and 0 Ω resistance to the other (or vice-versa). Table 14-3 shows that the maximum anticipated difference in bright ranges isn’t very much, so R2 provides plenty of resistance to equalize the photo-resistance of both sides in bright conditions. The robot has headlights to run in dim conditions so dark balancing isn’t necessary.

Current-Limiting Resistor

In Figure 14-15, R1 is called a current-limiting resistor. Because all of the other resistors are variable, there might come an occasion when a combination would resist so little that lots of electricity from the battery would be wasted.

For example, if R2 were dialed down so that 0 Ω was supplied to one pair of photoresistors and that pair was looking at a bright floor (around 100 Ω each) then only a total of 200 Ω resistance (0 Ω + 100 Ω + 100 Ω) would exist through that path. The formula for determining current is:

(V / Ω) × 1000 = mA
Thus: (9 V / 200 Ω) × 1000 = 45 mA

But, by adding a 470 Ω resistor (R1), the worst case becomes 670 Ω (470 Ω + 0 Ω + 100 Ω + 100 Ω).

Thus: (9 V / 670 Ω) × 1000 = 13 mA

With R1, this branch of the circuit draws ¼ the power in the worst case, yet provides the same function. R1 doesn’t have much of an effect in the average case because R2 is dialed to around 10,000 Ω. In that case, the current drawn is less than 1 mA for each path.

If you’re careful to not adjust the potentiometer to either end of its dial, then R1 is technically unnecessary. Still, it’s nice to know R1 is there so that you can dial the potentiometer to any value without possibility of component harm or extreme battery waste.

When you create your own designs, be sure to add a minimum-value fixed resistor to any path that is otherwise controlled by variable resistors.

Test Points

The schematic (see Figure 14-15) features test points, labeled TP1 and TP2. No components physically exist at TP1 and TP2; they’re just good spots to attach a multimeter for testing voltage. In fact, it turns out that these test points are great spots to test voltage.

Calculating the Voltages

When the battery is connected, the electricity flows through R1 to R2 and then splits into two paths. Considering just one path for the moment, the electricity then flows through R4 and R3 and then it finally returns to the battery.

We know the voltage starts out around 9 V and always ends up at 0 V when it reaches the other end of the battery. Along the way, how does the voltage get apportioned between the components?

  1. Add up all of the resistance in the path. We’re going to assume the photoresistors are looking at bright light (100 Ω) for this example.
    R1 Ω + R2 Ω + R4 Ω + R3 Ω = total Ω of the path
    This example: 470 Ω + 10,000 Ω + 100 Ω + 100 Ω = 10,670 Ω
  2. For any resistor of interest, divide its resistance by the total to determine what share of the voltage it will use.
    R1 Ω / total Ω = R1's share
    This example: 470 Ω / 10,670 Ω = 0.044
  3. Determine the amount of voltage being used in the path.
    V at beginning - V at the end = total V used in the path
    This example: 9 V - 0 V = 9 V
  4. Multiply the resistor’s share by the voltage used in the path to determine how much voltage is used in that resistor.
    R1's share × total V of path = V of R1
    This example: 0.044 × 9 V = 0.4 V

Let’s check the value for R2:

R2 W / total W = R2's share
This example: 10,000 Ω / 10,670 Ω = 0.937
R2's share × total V of path = V of R2
This example: 0.937 × 9 V = 8.43 V

What’s the deal with that? R2 has the largest resistance, so most of the voltage (pressure) was used up getting through it. Thus far, R1 and R2 have used up 8.83 V out of 9 V.

R4 Ω / total Ω = R4's share
This example: 100 Ω / 10,670 Ω = 0.00937
R4's share × total V of path = V of R4
This example: 0.00937 × 9 V = 0.08 V

And R3:

R3 Ω / total Ω = R3's share
This example: 100 Ω / 10,670 Ω = 0.00937
R3's share × total V of path = V of R3
This example: 0.00937 × 9 V = 0.08 V

Evaluating Test Point 1

Now that all of the voltages used along that path have been calculated, it is possible to determine the voltage at test point 1 (TP1). The battery starts out at 9 V. R1 and R2 use 8.83 V combined. So, around 0.17 V must be remaining by the time the electricity reaches TP1 (see Figure 14-16).

9781484213605_Fig14-16.jpg

Figure 14-16. Voltages used by each resistor on one branch of the balanced brightness-sensing circuit

As the floor in front of the robot becomes darker, the photoresistors increase in resistance. If instead of 100 Ω, each the photoresistors reach 6,000 Ω each, the share of voltage used by each part changes.

  1. Add up all of the resistance in the path. We’re going to assume the photoresistors are looking at darker flooring (6,000 Ω) for this example.
    R1 Ω + R2 Ω + R4 Ω + R3 Ω = total Ω of the path
    This example: 470 Ω + 10,000 Ω + 6,000 Ω + 6,000 Ω = 22,470 Ω
  2. For any resistor of interest, divide its resistance by the total to determine what share of the voltage it will use.
    R1 Ω / total Ω = R1's share
    This example: 470 Ω / 22,470 Ω = 0.021
  3. Determine the amount of voltage being used in the path.
    V at beginning - V at the end = total V used in the path
    This example: 9 V - 0 V = 9 V
  4. Multiply the resistor’s share by the voltage used in the path to determine how much voltage is used in that resistor.
    R1's share × total V of path = V of R1
    This example: 0.021 × 9 V = 0.19 V

Plugging in the values for the other resistors results in:

R2 V = 4.0 V
R4 V = 2.4 V
R3 V = 2.4 V

As less light reaches the sensors (R3 and R4), their resistance increases. As their resistance increases, they use up a greater portion of the voltage in that path. As such, the voltage at TP1 increases (see Figure 14-17).

9781484213605_Fig14-17.jpg

Figure 14-17. Voltage changes at TP1 when sensors have less light

The voltage at TP1 and the voltage at TP2 vary based on the amount of light seen by the pair of photoresistors on their respective sides. Not only does this circuit balance the sets of photoresistors, but it also converts their variable resistance into variable voltage.

Converting Resistance to Voltage with a Voltage Divider

Combining a variable resistor (such as a photoresistor sensor) with other resistors and taking the voltage value between them is called a voltage divider. The balanced brightness-sensing circuit is nothing more than voltage dividers dividing up voltages among bunches of resistors. Along with current-limiting resistors, voltage dividers are among the most important and most often used techniques within a circuit.

Chips are good at reading voltages. The next time you have a chip and you’d like to connect it to a variable resistor, think of voltage dividers. And the next time you think of voltage dividers, think of two or more resistors and measuring in between them.

Building the Balanced Brightness-Sensing Circuit

Assemble the balanced brightness-sensing circuit on a solderless breadboard (see Figure 14-18). Build it on the far-right side of the board so space remains for the other line-following circuits to be added in the next chapters.

9781484213605_Fig14-18.jpg

Figure 14-18. Balanced brightness-sensing circuit built on a solderless breadboard

The trimpot (R2) will probably be marked “203,” which represents “20” followed by three zeros, which is 20,000 Ω. Before adding the trimpot to the circuit, dial it to its halfway point. (Attach the trimpot’s first and second leads to a multimeter as you turn the dial to watch the resistance settle to around 10,000 Ω.)

After the circuit is complete, check the voltage at TP1 with power turned on. Recall that to test voltage at a point, you connect the multimeter’s black test probe to the negative bus and connect the multimeter’s red test probe to the point of interest (in this case, TP1).

If you bring R3 or R4 toward a light bulb, the voltage at TP1 decreases. If you cover either R3 or R4 with your finger, the voltage at TP1 increases. In fact, you can witness a change in voltage by merely casting a shadow over the sensors as you move your hand back and forth.

After experimenting with TP1 for a while, switch over to TP2. Sensors R5 and R6 provide the voltage effect for TP2. Even so, you may notice that covering R3 and R4 produces a slight increase in voltage.

Because R1 is shared by both pairs of sensors, R1’s voltage usage is affected by the resistance of all four sensors. When R1’s voltage usage decreases because of one set of sensors, the other set of sensors takes up the slack, thus increasing the voltage at that pair’s test point. It’s not a consequential effect for line following. However, it is noteworthy that when two paths have a component in common, their values can affect each other.

Inability to Balance the Brightness-Sensing Circuit

As designed, changing the dial on the trimpot (R2) affects the voltages at TP1 and TP2. If you have two multimeters, you can connect one to each test point and adjust the trimpot until the voltages match.

You can attempt to swap a single multimeter between the test points. However, you’re likely to cast dissimilar shadows or nudge the sensors to different angles as you try. Balancing the circuit with a single multimeter is difficult.

Wouldn’t it be helpful to have something that constantly compared both pairs of sensors and turned on an LED to indicate which sensor had a higher voltage? That’s exactly what you’ll add to the breadboard in the next chapter.

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

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