CHAPTER 23 ■ THE MOTHERBOARD
If you want to try to determine the best value for your white LEDs, set up the headlight portion of the
circuit in Figure 23-1 on a solderless breadboard (you don’t need the other parts of the circuit for these
tests). Then, proceed as follows:
- Temporarily replace R9 with a low resistance, say 40 W to 50 W.
- Dial R10 to any value over 200 W.
- Insert a multimeter in mA mode between R10 and LED9. That is, R10 and LED9
should NOT be connected together. The multimeter’s red lead should be in the
mA socket and it should attach to the bottom of R10. The black lead should be in
the COM socket and should attach to the top of LED9. Electricity has no choice
but to pass through the bottom of R10, into the multimeter to be counted, and
out to the top of LED9. - Apply power from a fresh battery (usually near 9.6 V). You’re trying to find the
absolute maximum brightness. - Carefully adjust the dial on R10 until the meter reads 30 mA. The dangerous
thing about this is that R10 could accidently get adjusted to zero ohms, and with
R9 so low, the battery could fry the LEDs. Therefore, adjust the dial very slowly. - Disconnect power from the circuit.
- Remove the multimeter and attach the bottom of R10 to the top of LED9. They
are now reconnected like it shows in the schematic. - Change the multimeter to resistance mode. The red lead should be in the
W socket and the black lead in COM. - Connect the multimeter’s red lead to the top of R9 and the black lead to the
bottom of R10. This measures the combined resistance of R9 and R10. That’s the
final value you want to use for your robot’s R9.
Using the white LEDs in the Solarbotics kit, and adjusting R10 until 30 mA flowed through them, I
measured the resistance for R9 and R10 to be 106 W. That’s close enough that I’ll use a 100 W resistor for R9.
Now, if the robot struggles to follow a line, I can adjust the headlights to be significantly brighter with a 100 W
resistance, instead of 150 W resistance.
The second optimization, choosing a value for R1, is almost all mathematical.
One at a time, measure the resistance of your cadmium-sulfide sensors under a desk or in a relatively
dark place. Don’t completely cover them up. You want an idea for the maximum resistance when they are
looking at a black line or black surface.
- Assuming you’re going to evenly distribute the sensors, calculate the “dark”
values of each pair. My examples were 150 kW, 500 kW, 400 kW, and 550 kW. So,
550 kW is the maximum. I’d pair 150 kW with 550 kW = 700 kW, and 500 kW with
400 kW = 900 kW. - Now use this formula: R1 = ((pair1 pair2) / (pair1 + pair2) - (R2 / 2)) 0.25. This
calculates the resistance of the sensors in parallel, minus the resistance of the
potentiometer for one of the sensor branches, with an approximate percentage
that would provide the comparator’s required top-end 1.5 V when the battery is
almost exhausted (7 V). For my example: R1 = ((700 kW 900 kW) / (700 kW +
900 kW) - (20 kW / 2)) 0.25 = 96 kW.