Page 269 - Robot Builder's Bonanza
P. 269
238 USING DC MOTORS
If you prefer an all- electronic approach, see the next sections on using transistors, where
the half- bridge concept comes up again.
CURRENT SPECS FOR RELAYS
When selecting relays for your robot, make sure the contacts are rated for the motors you are
using. All relays carry contact ratings, and they vary from a low of about 0.5 amp to over 50
amps, at 125 volts. Higher- capacity relays are larger and require more current to operate.
This means they need bigger transistors to trigger them and require much more care in select-
ing all the components in the system. Not very pretty.
As this book is primarily about creating amateur robots under about 20 to 30 pounds,
you’ll be using smaller motors, which means smaller relays. For the robots described in this
book, you don’t need a relay rated higher than 2 or 3 amps. If you plan on building bigger
robots with much bigger motors, you should consider the motor bridge module, detailed later
in this chapter.
SIMPLIFIED RELAY DRIVER ELECTRONICS
With two motors you need four relays, which means four transistors, four diodes, and four
resistors. What are these extra components for?
• The transistors are used to boost the current from the digital gate (for example, from your
microcontroller), as not all gates have sufficient current to directly drive the relay. The
transistors act as current amplifiers.
• The diodes protect the transistors from current that flows backward from the relay coil
when it is switched off. This happens because, when the relay coil is deengergized, some
of the current that was flowing through it is regurgitated back out. This back EMF (EMF
stands for electromotive force) can damage the transistor; the diode prevents this mess
from happening.
• The resistors control the amount of current flowing from the digital gate to the transistor.
Without the resistor, the transistor would suck up too much current and possibly damage
the gate.
A typical value for these resistors is between 1 k (1000 ohms) and 4.7 k (4700 ohms),
assuming 5- volt circuitry. The lower the value of the resistor, the more current will flow from
the gate and to the base of the transistor. Use the 1 k value for larger relays that need more
current; otherwise, select a higher value.
G Use the highest- value resistor connected to the base of the transistor that allows for reliable
operation of the relay. You might start with 4.7 k and work downward until you find a resistor
value that works best for your specific circuit.
The transistor- resistor- diode combination is the typical way of connecting a relay to the rest
of your electronics. But you can save some space and wiring time by using a single 16- pin IC
that has everything built in. The ULN2003 integrated circuit contains seven drivers; each
driver is the equivalent of the transistor- diode- resistor combo in the previous examples.
To use, connect the control gate to a driver input, and connect its output to the relay, as
shown in Figure 22- 7. The illustration shows using only one of the available seven drivers. You
22-chapter-22.indd 238 4/21/11 11:50 AM