Make Electronics

(nextflipdebug2) #1
What Next? 291

Experiment 33: Moving in Steps

Initially I suggested a step time of 1/4 second just so that you could see what
was happening. When you’re actually using this circuit, you’ll never need it to
run as slowly as that. So you can increase the entire range of speeds. Remove
the 22 μF timing capacitors and substitute, say, 4.7 μF capacitors, or smaller.
Now when you adjust the potentiometer, you’ll get a useful range of speed.


Adding Autonomy


Currently, the circuit simply does what you tell it to do. The next step is to
make it autonomous—in other words, give it the illusion of making up its own
mind. I’m thinking that instead of a trimmer potentiometer, we could substi-
tute a photocell, properly known as a photoresistor. Typically, the resistance of
a cadmium sulfide photo resistor is highest in the dark, and lowest when light
shines on it.


One problem with photoresistors is that they’re not as widely available as
many other types of electronic components. If you search Mouser.com, for
instance, you’ll find virtually nothing. Partly this is because the online search
function at Mouser is the weakest feature of the site, and partly it’s because
Mouser is not oriented toward hobbyists. What you need to do is conduct a
“product search.” Go to http://www.google.com/products, enter the search terms
“CdS” and “photocell,” and you’ll find a bunch of cheap cadmium sulfide com-
ponents from places you may never have heard of.


Because photoresistors seem to come and go as erratically as DC motors, I am
not offering any part numbers. You can buy any product that has an appropri-
ate minimum resistance (in bright light) and maximum resistance (in the dark).
If you find a component that ranges from 500 to 3,000Ω, that would be a good
choice. If the only ones you can find have a higher minimum than 500Ω, you
could consider putting a couple of them in parallel.


Setting Up Your Light Seeking Robot


Why would you want to control the speed of a stepper motor by using a photo
resistor? Because the original objective was to build a robot that is attracted
to light.


The idea is simple enough: use two stepper motors, each controlling the
speed of one wheel of the cart. Use two photoresistors, each controlling the
speed of the opposite stepper motor. When the righthand photoresistor picks
up more light, its resistance lowers, causing the lefthand set of timers to run
faster, which will make the lefthand wheel run faster. Thus, the cart will turn
toward the light. Figure 5-119 illustrates the concept.


Before you start wiring more 555 timers, though, you might consider doing
the job with a more appropriate component. The ULN2001A and ULN2003A
are chips containing Darlington amplifiers specifically designed to deliver cur-
rent to inductive loads such as solenoids, relays, and (you guessed it) motors.
Each chip has seven inputs that require very little current, and seven outputs
that can deliver 500mA each. The inputs are TTL and CMOS compatible (the
2001A has a wider tolerance for voltages than the 2003A) and each channel of


Photo-
Resistors

Stepper
Motors

555 Timers 555 Timers

Figure 5-119. If two photoresistors control
the speed of two 555-timer arrays, the
difference in speed between one wheel
and the other can turn the cart toward a
light source.
Free download pdf