Hardware Reference
In-Depth Information
To obtain even more performance out of that driver (if you need it), you could
choose a resistor closer to the actual value desired (1150 Ω). It turns out that a 1% resistor
can be had at exactly 1 . 15 k Ω:
I
=
=
=
´
0 002 50
100
I H
CBFE
.
.
mA
Be careful that your design does not stress the transistor beyond its maximum ratings
(power and current). You might be willing to risk the cheap transistor, but keep in mind
that the poor little thing might be holding back a higher voltage (like a river dam). If the
transistor is destroyed, the high voltage may come crashing into the base circuit and
cause damage to the Pi's GPIO pin. So be nice to Q1 !
Substitution
You don't have to use my choice of the 2N2222A transistor for driving a load. Substitute
what you have or what you plan to order. Today's DMMs can measure the transistor H FE ,
so that makes planning easier when using junk box parts.
Another critical factor in selecting a part is the power capability of the transistor.
You should probably know exactly what that limit is, unless you are driving an extremely
light load. Finally, it is important to know what the maximum voltage ratings are for the
selected transistor, if you plan to drive voltages higher than 3 V. You need to be able to
count on it holding back those higher voltages in the collector circuit to prevent damage
to the Pi.
Inductive Loads
Inductive loads like relays and motors present a special problem. They generate a high
reverse voltage when current is switched off or interrupted. When the relay coil is turned
off, the magnetic field collapses around the coil of wire. This induces a high voltage,
which can damage the Pi (and can also provide a mild electric shock).
Electric motors exhibit a similar problem. As the DC current sparks and stutters
at the commutator inside the motor, high reverse voltage spikes are sent back into the
driving circuit. This is due to the magnetic field collapsing around the motor windings.
Consequently, inductive loads need a reverse-biased diode across the load to short
out any induced currents. The diode conducts only when the back electromotive force
(EMF) is generated by the inductive load.
Figure 10-9 shows diode D 1 reverse biased across the relay coil winding L 1 (or motor).
The diode bleeds away any reverse current that might be generated. Use a diode with
sufficient current-carrying capability (matching at least the current in Q 1 ).
 
Search WWH ::




Custom Search