CHAPTER 25 ■ LAUNCHING THE LINE-FOLLOWER
Be sure to place the diode so that the anode (plain end) connects to the power switch and the cathode
(banded end) connects to the positive power bus. The diode should be the only “wire” connecting the switch
and the bus.
There is a small cost or another benefit to adding the diode, depending on how you look at it. A Schottky
diode drops up to 0.45 V in exchange for the service of passing current through it. This means the motors
would receive a little less power, and would move at a slower speed.
Eliminating Surges with Capacitors
Because this robot has a simple brain without memory, doesn’t require voltage regulation, and has fairly
insensitive circuitry, the robot isn’t harmed by brief losses of power. That being said, I have noticed the LEDs
dim a bit when both motors kick in at the same time.
Think of capacitors as tiny rechargeable batteries. They charge up when voltage is available, and
discharge when voltage drops down. Although they don’t hold much electricity, they can be used as local
power sources when power has been diverted from the battery to the motors.
The electrical location and storage capacity of a capacitor determines its effectiveness in filtering spikes,
electrical noise, and sudden current draws. For example, a large-value capacitor (thousands of microfarads)
placed across the power buses can supply current to the entire circuit. Whereas a smaller-value capacitor
can charge and discharge more quickly than a larger-value capacitor (thus smoothing out higher-frequency
transitions), it has a lower capacity, and is therefore more suited for caring for only a few chips. The filtering
effect is most pronounced on the chips nearest the small-value capacitor.
There are two appropriate locations for capacitors in the line-following circuit. You can attach the
leads of a large-value capacitor, say 330 mF (microfarad), to the positive and negative power buses. That
capacitor would be called C1. It can supply large amounts of power more quickly than the battery can, thus
temporarily providing more than enough current for the entire robot each time a motor starts-up.
And, you could attach the leads of a tiny, 0.1 mF capacitor to the positive and negative pins of the
comparator. That capacitor would be called C2.
Although they aren’t necessary for this robot, capacitors are vital in more complicated circuits.
Chapters 7 and 8 of Intermediate Robot Building by David Cook (Apress, 2010) discuss capacitor values,
circuit locations, and capacitor chemistry in detail.
Figure 25-9. Schematic of reverse battery protection circuit