Page 313 - Making things move_ DIY mechanisms for inventors, hobbyists, and artists
P. 313
290 Making Things Move
NOTE A phototransistor works just like a TIP120 transistor, but instead of
having a third leg as the base, IR light acts as the base. IR light is just light
that’s out of the range of colors we can see. We’ll generate this light with an
IR LED in a minute. When you shine IR light on a phototransistor, it allows
power to flow through it from collector to emitter. So why do we need both
kinds of transistors? Even though the phototransistor here behaves like the
TIP120, it doesn’t allow enough power to flow through it to run our motor.
So we use the phototransistor as a sensor, and when light hits it, it sends a
signal to the bigger TIP120 transistor to let motor power flow.
7. Also connect the long leg (emitter) of the phototransistor to ground through
the 22KΩ resistor.
8. Connect the short leg (collector) of the phototransistor directly to 5V power.
9. Connect one of the motor wires to the collector (middle leg) of the TIP120
transistor on the breadboard. Connect the other motor wire to the 9V battery
power column.
10. Plug the IR LED into the breadboard and bend the legs so it’s facing the same
direction as the phototransistor. It’s also a good idea to solder hook-up wires
to the IR LED and use those to plug into the breadboard, so you can adjust the
position of the LED later. The wires from the IR LED legs are the twisted pair in
Figure 10-8 right at the center of the breadboard, on the bottom.
11. Connect the short leg of the IR LED to ground through the switch (in the off
position). Connect the long leg of the IR LED to the 5V power column through
a 100Ω resistor.
12. Flip the switch to on. Put your hand or a white piece of paper in front of the IR
LED and phototransistor. The closer you get, the more light from the LED will
bounce off your hand into the phototransistor, and the faster the motor will
spin! If you get far enough away, it won’t spin at all. Don’t believe me that the
IR LED is actually on? If you have a camera phone, pretend you’re about to
take a picture of your setup. Although our eyes can’t see IR light directly, the