This is only a preview of the September 1999 issue of Silicon Chip. You can view 34 of the 96 pages in the full issue, including the advertisments. For full access, purchase the issue for $10.00 or subscribe for access to the latest issues. Items relevant to "Autonomouse The Robot":
Items relevant to "Voice Direct Speech Recognition Module":
Items relevant to "Digital Electrolytic Capacitance Meter":
Items relevant to "An XYZ Table With Stepper Motor Control; Pt.5":
Purchase a printed copy of this issue for $10.00. |
AUTONOMOUSE
HEROBOT
T
Pt 1: By JOHN CLARKE
This clever little robot runs around the floor and stops if
it finds anything in its way. It then turns to one side or the
other and moves forward again. Light chasers run in one
direction or another, depending on what it’s doing.
18 Silicon Chip
Fig.1: the block diagram comprises three main sections: light sensing, forward/reverse motor control and
the light chasers.
A
UTONOMOUSE THE ROBOT is
autonomous – it runs around by
itself without any need for its
controller (you) to direct it in any way.
It will “see” objects in its way and can
turn away from them or reverse to
avoid collisions. It also has a variety
of light displays which vary according
to its actions. Its features include:
• Forward and reverse light chaser.
• Clockwise and anticlockwise turning light chaser.
• Rear flashing light.
• Steers away from objects.
• Reverses from potential collisions.
• Adjustable speed.
• Adjustable sensitivity of object
detection range.
• Object sensing immune to effects
of normal ambient light.
• Automatic slowing before reversing to prevent motor/gear damage.
Autonomouse the Robot moves on
three wheels, with two at the front
and a swivelling castor at the rear. The
side wheels are independently driven
to allow the robot to steer and reverse.
Autonomouse is built as a basic
shell using several PC boards soldered
together. The two “eyes” are located
on the front of the case and provide
the robot with straight-ahead and
peripheral vision. It is dressed with
red transparent acrylic on its front,
top and rear.
Autonomouse will steer away from
an obstacle it detects with its peripheral vision. If this is not effective in
avoiding the object, the robot will
stop, reverse up and turn around. An
object directly in front of the robot
will cause it to reverse up and turn
directly.
When Autonomouse travels forward, a row of eight LEDs at the front
flash sequentially from top to bottom
to show the direction of travel. If
Autonomouse reverses, the LEDs
chase from bottom to top. At the top
of the robot are eight LEDs arranged
in a circle which sequentially chase
clockwise or anticlockwise whenever
it turns left or right. This chaser does
not operate if the robot is going forwards or in reverse.
Fig.1 shows the block diagram of
the Robot. It comprises three main
sections: light sensing, motor control
and the light chasers.
The light sensing section has a
38kHz driver which modulates infrared LEDs. There is an IRLED and
sensor associated with each sensor,
one for the right, one for the centre
and one for the left.
The IR sensors will detect infrared
signals at 38kHz and reject any other
light signals. This makes them much
less sensitive to natural light or other
September 1999 19
Fig.2: the circuit has several sections which are duplicated, such as
the left and right motor drivers, the two 8-LED chasers and the left
and right timers (IC2, IC4).
20 Silicon Chip
September 1999 21
Fig.3: these waveforms show the operation of the 38kHz
drive to the infrared LEDs. The top trace is the output at
pin 3 of IC1 at 4V peak-to-peak. The lower trace is the
voltage at the base of transistor Q1.
Fig.4: these waveforms show the operation of the
infrared detectors. The top trace shows the output
from one of the infrared detectors in the presence
of a relatively strong 38kHz IR signal. The output
is low for most of the time. The lower trace is
the infrared detector output in the presence of a
weaker 38kHz signal. It is low for only some of
the time.
Fig.5 (left): these oscilloscope waveforms show the
operation of IC8a which produces the pulse width drive
for the H-bridge drive circuits to the motors. The lower
trace is the triangle waveform at around 400Hz. This
triangle waveform is compared with the voltage at pin
2, shown by the straight line. The output is the top trace
which goes high whenever the triangle waveform is above
the voltage at pin 2.
light sources such as incandescent
or fluorescent lights which produce
a 100Hz modulated signal. When a
sensor detects a 38kHz signal, it will
produce an output to indicate that
there is an obstruction in the way.
The robot will steer left if it detects
a relatively weak signal from the right
detector and steer right if it detects
a weak signal from the left sensor. If
any of the detectors receive a strong
reflected signal, the robot will reverse
to avoid the obstacle.
Output from the left sensor is used
to trigger right timer IC2 and reverse
timer IC3. Similarly, the right sensor
output triggers the left timer IC4 and
also reverse timer IC3.
When a weak signal is received by
the left infrared detector, the right
timer is triggered but there is insuf22 Silicon Chip
ficient signal to trigger the reverse
timer. A strong signal received by
the left infrared detector will also
trigger the reverse timer. Similarly
a weak signal to the right detector
will only trigger the left timer, but a
strong signal will trigger the reverse
timer as well.
The right timer drives the forward/
reverse circuitry which controls the
right motor. If the right timer is not
triggered by the left infrared detector
then the motor is driven in the for
ward direction. The motor reverses
whenever the right timer is triggered.
The two LED chasers each comprise
an up/down counter (IC10 or IC12)
which drives a one-of-10 decoder
(IC11 or IC13) which then drives
eight LEDs. Reverse timer IC3 makes
the counters count down rather than
count up and this changes the direction of the LED chaser.
Circuit description
Fig.2 shows the full circuit details.
IC1 is powered from a 6V battery via
switch S1a while the other ICs are
powered at 5V via low dropout regulator REG1. The motors are powered
from a separate 6V battery and switch
ed via S1b. We use two battery packs
so that the heavy load drawn from the
motors does not have any effect on
the control circuitry. IC1 is separately
powered from 6V to prevent its oscillation entering the 5V supply rail and
being injected into the very sensitive
infrared detectors IRD1 & IRD2.
IC1 is a 555 timer running at 38kHz
to drive the IR LEDs. The 38kHz
output at pin 3 is clamped to an am-
plitude of 0.6V by diode D1. This is
done to maintain a constant signal
level regardless of the battery voltage.
Following D1, the signal is lightly
filtered with the 3.3kΩ resistor and
.0033µF capacitor and fed to trimpot
VR2 which sets the signal level to
transistor Q1 which functions as an
emitter follower to drive the three
IRLEDs via separate 470Ω resistors.
The oscilloscope waveforms in
Fig.3 show the operation of the 38kHz
drive to the infrared LEDs. The top
trace is the output at pin 3 of IC1 at
4V peak-to-peak. The lower trace is
the voltage at the base of transistor Q1.
Note that the voltage is nominally at
+2.6V with a 360mV 38kHz modulation swing.
Note that each IRLEDs is driven
at a nominal 1.2mA which is then
modulated at 38kHz. This is to make
sure that the 38kHz signal from each
LED is about the same.
The infrared light from the three IR
LEDs is picked up by infrared detectors IRD1 and IRD2. These comprise
an infrared optotransistor, preamp
lifier and 38kHz filter circuitry. A
strong 38kHz infrared signal will
cause the IRD output to go low.
This is shown in the waveforms of
Fig.4. The top trace shows the output
from one of the infrared detectors in
the presence of a relatively strong
38kHz IR signal. The output is low
for most of the time. The lower trace
is the infrared detector output in the
presence of a weaker 38kHz signal. It
is low for only some of the time.
The output from IRD1 triggers the
right timer IC2 via the 27kΩ resistor
and diode D2. Pin 2 of IC2 needs to
be pulled below about +1.7V in order
to switch the timer output at pin 3 to
a high level. This means that the output from IRD1 must be low for more
than 2/3rds of the time. IC2’s output
stays high until pins 2 & 6 reach about
+3.3V and then pin 3 goes low. The
1µF capacitor at pins 2 & 6 effectively
integrates the output of IRD1. So pins
2 & 6 are pulled down by IRD1 and
pulled up by the 390kΩ resistor.
The output from IRD1 also triggers
reverse timer IC3 via diode D3 but
here the filter components at pins 2
& 6 are a 10µF capacitor and a 100kΩ
resistor. These components mean that
the output from IRD1 must be low
most of the time in order to trigger
IC3. In fact, if IRD1’s output were
permanently low, the voltage at pin 2
Parts List
1 PC board, code 08409991, 114 x
145mm (Board 1)
1 PC board, code 08409992, 114 x
128mm (Board 2)
1 PC board, code 08409993, 114 x
72mm (Board 3)
2 motor/gearbox drives (Jaycar
YG-2725)
2 4 x AA cell holders and battery
snaps
8 AA alkaline cells
1 DPDT miniature toggle switch
(S1)
1 plastic panel, 75 x 110 (battery
support panel)
1 piece of double sided PC board,
114 x 69mm (rear panel)
1 piece of single sided PC board,
45 x 105mm (castor bracket)
2 35 x 20mm pieces of PC board
(motor/gearbox mounting)
3 pieces of red transparent acrylic,
60 x 90mm, 60 x 140mm and
60 x 60mm
2 64mm diameter wheels (see
text)
1 30mm furniture castor
12 15mm long tapped spacers
(Perspex or Acrylic mounting)
6 9mm long tapped spacers
(rear Perspex panel and motor
mountings at motor end)
4 6mm long tapped spacers (motor
mounts gear end)
26 M3 x 6mm screws
4 M3 x 15mm screws
5 M3 Nylon insulating washers
(to insulate PC tracks for some
screws and spacers)
1 5mm LED bezel
1 20mm length of 5mm black
plastic tubing (IRLED1 &
IRLED3
1 70mm length of 5 x 0.75mm
sheet brass or equivalent (rear
panel support)
1 500mm length of red hookup
wire
1 500mm length of black hookup
wire
1 300mm length of yellow hookup
wire
1 300mm length of green hookup
wire
1 300mm length of blue hookup
wire
would be +1.5V, just below the 1.67V
threshold. This means the IRD1 must
detect a very strong signal in order to
stay low long enough to trigger IC3.
1 600mm length of 0.8mm tinned
copper wire (links)
29 PC stakes
3 50kΩ (503) horizontal trimpots
(VR1,VR3,VR4)
1 10kΩ (103) horizontal trimpot
(VR2)
Semiconductors
2 IRLED receivers (IRD1-IRD2)
(Jaycar ZD-1952 or equivalent)
3 5mm infrared LEDs (IRLED1IRLED3)
6 555 timers (IC1-IC4,IC7,IC14)
2 4030 quad 2-input XOR gates
(IC5,IC9)
1 4081 quad 2-input AND gate
(IC6)
1 LM393 dual comparator (IC8)
2 4029 4-bit up/down counters
(IC10,IC12)
2 4028 1-of-10 decoders
(IC11,IC13)
16 3mm red LEDs (LEDs1-LED16)
1 5mm red flashing LED (LED17)
1 LM2940-T5 low dropout 5V
regulator (REG1)
4 BC640 PNP transistors (Q2,Q3,
Q10,Q11)
4 BC639 NPN transistors (Q4,Q5,
Q12,Q13)
10 BC338 NPN transistors (Q1,
Q6-Q9,Q14-Q17,Q18)
14 1N914, 1N4148 diodes (D1D14)
Capacitors
1 2200µF 25VW PC electrolytic
2 470µF 25VW PC electrolytic
14 10µF 16VW PC electrolytic
4 1µF 16VW PC electrolytic
4 0.1µF MKT polyester
1 .039µF MKT polyester
1 .0033µF MKT polyester
1 330pF ceramic or MKT polyester
Resistors (1%, 0.25W)
3 390kΩ
8 2.2kΩ
3 100kΩ
3 1kΩ
2 27kΩ
3 470Ω
3 22kΩ
4 56Ω
22 10kΩ
4 22Ω
1 3.3kΩ
Miscellaneous
Double-sided adhesive tape.
The timeout period for IC3 is 2.9
seconds and this sets the reversing
time for the robot. The triggering
time is also significant; it takes one
September 1999 23
Table 2: Capacitor Codes
Value
0.1µF
.039µF
.0033µF
330pF
IEC
104
393
332
331
EIA
100n
39n
3n3
330p
tied high, pin 12 must be low for pin
11 to go high and so IC5a operates as
an inverter. With pin 8 tied low, if pin
9 goes high, so will pin 10 and so IC5b
operates as a buffer or non-inverter.
IC5c is set up as a timer. When its
pin 5 goes high, pin 6 stays low until
the 10µF capacitor charges via the
10kΩ resistor. Thus the output goes
high for this period then goes low.
Similarly, when pin 5 input is taken
low, the output goes high again until
the 10µF capacitor discharges via the
10kΩ resistor.
This output controls the motor
speed voltage at pin 2 of comparator
IC8a via diode D10. It does this by
momentarily pulling the 1µF capacitor voltage high whenever the output
of IC2 changes.
Pulse width modulation
Comparator IC8a provides the pulse
width modulation signal to drive the
right motor. It compares the speed
voltage at its pin 2 with the triangle
waveform at its pin 3. The triangle
waveform is generated by 555 timer
IC7, operating at around 400Hz. If the
voltage at pin 2 is low, the resulting
pulses from the output of IC8a will be
high most of the time (ie, wide pulses)
and the motor will run at full speed.
By pulling pin 2 of IC8a high
whenever the output of IC2 changes
we effectively stop the motor before
applying a reverse voltage.
Fig.6: this is the component overlay for board 2. Note that the IRLEDs and IR
detectors will be angled to optimise collision avoidance.
second for the timer to be triggered
due to the 100kΩ resistor and 10µF
capacitor time constant. The reverse
timer is activated when the robot
encounters a solid obstruction that it
has not been able to avoid by simple
steering manoeuvres.
IRD2 and IC4 operate in the same
way as IRD1 and IC2. IRD2 also triggers IC3 via diode D4.
IC2 drives IC5a, IC5b & IC5c via
diode D6. IC5a, IC5b and IC5c are
2-input exclusive OR (XOR) gates.
The gate outputs only go high when
one input is at a different logic level
to the other. Thus, with pin 13 of IC5a
Table 1: Resistor Colour Codes
No.
3
3
2
3
22
1
8
3
3
4
4
24 Silicon Chip
Value
390kΩ
100kΩ
27kΩ
22kΩ
10kΩ
3.3kΩ
2.2kΩ
1kΩ
470Ω
56Ω
22Ω
4-Band Code (1%)
orange white yellow brown
brown black yellow brown
red violet orange brown
red red orange brown
brown black orange brown
orange orange red brown
red red red brown
brown black red brown
yellow violet brown brown
green blue black brown
red red black brown
5-Band Code (1%)
orange white black orange brown
brown black black orange brown
red violet black red brown
red red black red brown
brown black black red brown
orange orange black brown brown
red red black brown brown
brown black black brown brown
yellow violet black black brown
green blue black gold brown
red red black gold brown
SMART FASTCHARGERS®
2 NEW MODELS WITH OPTIONS
TO SUIT YOUR NEEDS & BUDGET
Now with 240V AC + 12V DC operation
PLUS fully automatic voltage detection
Use these REFLEX® chargers for all your
Nicads and NIMH batteries: Power tools
Torches Radio equip. Mobile phones
Video cameras Field test instruments
RC models incl. indoor flight Laptops
Photographic equip. Toys Others
Rugged, compact and very portable.
Designed for maximum battery capacity
and longest battery life.
AVOIDS THE WELL KNOWN MEMORY EFFECT.
SAVES MONEY & TIME: Restore most Nicads with
memory effect to capacity. Recover batteries with
very low remaining voltage.
CHARGES VERY FAST plus ELIMINATES THE
NEED TO DISCHARGE: charge standard batteries in
minimum 3 min., max. 1 to 4 hrs, depending on mA/h
rating. Partially empty batteries are just topped up.
Batteries always remain cool; this increases the total
battery life and also the battery’s reliability.
DESIGNED AND MADE IN AUSTRALIA
For a FREE, detailed technical description please
Ph (03) 6492 1368; Fax (03) 6492 1329; or
email smartfastchargers<at>bigpond.com
2567 Wilmot Rd., Devonport, TAS 7310
The oscilloscope waveforms of
Fig.5 show the operation of IC8a. The
lower trace is the triangle waveform
at around 400Hz. This triangle waveform is compared with the voltage at
pin 2, shown by the straight line. The
output is the top trace which goes high
whenever the triangle waveform is
above the voltage at pin 2.
The left motor circuitry, comprising
IC9a, IC9b, IC9c and IC8b, operates in
the same way as just described and
IC8b is fed with the triangle waveform
from IC7.
IC6a and IC6b are AND gates which
have the pulse signal connected to
one of their inputs; they control the
right motor H-bridge circuit, depending on the outputs from IC5b & IC5c.
The H-bridge for the right motor
comprises transistors Q2-Q9. When
IC6a’s output is high, Q6 and Q9 are
on and they turn on Q2 and Q5 which
drive the motor in one direction while
transistors Q3 & Q4 are off.
When IC6b’s output goes high, Q7
& Q8 are turned on and they turn on
Q3 and Q4 to drive the motor in the
opposite direction.
The lefthand motor H-drive circuit
is the same as for the right and uses
transistors Q10-Q17 controlled by
IC6c & IC6d. Both H-drive circuits are
powered from the 6V supply reserved
for the motor drive and they are each
decoupled with 470µF capacitors to
suppress the voltage spikes which can
occur with the pulsing of the motors.
LED17, a flashing LED, is connected
across the battery supply to provide
further visual activity.
LED chasers
The forward/reverse chaser comprises IC10, IC11 & IC14 and LEDs
1-8. IC14 is a 555 timer operating at
• RESELLER FOR MAJOR KIT
RETAILERS
• PROTOTYPING EQUIPMENT
• CB RADIO SALES AND ACCESSORIES
• FULL ON-SITE SERVICE AND
REPAIR FACILITIES
• LARGE RANGE OF
ELECTRONIC DISPOSALS
(COME IN AND BROWSE)
Ph (03) 9723 3860
Fax (03) 9725 9443
Come In & See
Our New Store
M
W OR A
EL D IL
C ER
O
M
E
Board 2 sits on top of the unit, while board 1 sits beneath it and forms the base
of the chassis. Board 3 is mounted vertically, at the front.
ELECTRONIC
COMPONENTS &
ACCESSORIES
Truscott’s
ELECTRONIC WORLD Pty Ltd
ACN 069 935 397
27 The Mall, South Croydon, Vic 3136
email: truscott<at>acepia.net.au
www.electronicworld.aus.as
September 1999 25
Fig.7: this diagram shows the component layouts for boards 1 & 3. Take care to
ensure that the correct part is used at each location.
about 16Hz to clock IC10 which is a
4029 4-bit up/down counter. This has
its pin 9 connected to ground to select
binary coded decimal (BCD) mode so
26 Silicon Chip
that it counts up to 10 only. The up/
down input at pin 10 connects to pin 3
of IC3 which goes high when the robot
is in reverse. Thus, IC10 counts down
when the robot is going forward and
counts up when reversing.
The 4-bit outputs from IC10 connect to IC11, the BCD-to-decimal decoder, and it drives the eight LEDs in
sequence. Why only eight LEDs when
IC11 has 10 outputs available? Well,
we have to let the bean counters have
their way on some occasions so they
got to eliminate two LEDs!
The turning chaser comprises
counter IC12, decoder IC13 and LEDs
9-16. The circuit is very similar to
the forward/reverse chaser but there
are some differences incorporated to
enable the LEDs to be switched off and
also to ensure that during the chase
sequence, at least one LED is always
lit. IC14 clocks IC12 which is set up
as a binary counter with pin 9 tied
high. Thus IC12 counts in a binary
sequence from 1-8 and we use only
three outputs. The Q4 output from IC4
is not connected but we play around
with the D input (pin 11) of IC13 to
make it do what we want.
Taking the D input high prevents
any of the eight LEDs from lighting.
This is because a high D input represents a count beyond 8 and we are
only decoding the first 8 counts; any
count over 8 will not be decoded and
the LEDs will be off.
So the D input is pulled high by the
two 10kΩ resistors associated with
transistor Q18. Q18 is turned on via
diode D12 or D13 when either the left
or right motor timers (IC2 or IC4) have
a high output at pin 3 and so pin 11
of IC13 is pulled low. This starts the
LED chaser sequence, because the
low D input means that the robot is
turning left or right.
The direction of the chaser depends
on the voltage at the up/down input at
pin 10 of IC12. It counts up whenever
the right motor timer (IC2) output is
high. In this case, the up count means
a clockwise rotation of the chaser
since the LEDs are in a circle. If Q18
is turned on via the left timer output,
then the up/down input is low and
the counter counts down and gives an
anticlockwise direction for the chaser.
If the reverse timer, IC3, has a high
output, then the D input to IC13 is
pulled high via diode D14 and the
LEDs go out.
Construction
Autonomouse is built on three PC
boards: Board 1 is coded 08409991
and measures 114 x 145mm; Board
2 is coded 08409992 and measures
114 x 128mm and board 3 is coded
08409993 and measures 114 x 72mm.
A piece of double-sided PC board (114
x 69mm) forms the rear panel.
Fig.8: these are the full-size etching patterns for boards 1 and 3. Check your
boards carefully before installing any of the parts.
The three PC boards and rear panel
board are soldered together to form
the robot body. The front, top and a
section of the rear are covered in red
transparent Acrylic or Perspex to
house the LED chasers and flasher and
are mounted on tapped brass spacers.
The 6V batteries each consist of a
September 1999 27
This view shows how Autonomouse goes
together. The motor/gearbox assembly is
mounted on board 3 (details next month).
Fig.9: actual size artwork for board 2.
28 Silicon Chip
4-AA cell holder and these are mounted on a platform panel measuring
75 x 110 x 2mm which attaches to
board 1 on tapped spacers. The battery holders are held in place with
double-sided adhesive tape.
The two motor/gearbox sets are
located on board 3. They are located
with metal standoffs and held with
brackets made from pieces of PC board
measuring 35 x 20mm.
You can start construction by
checking the three PC boards for defects such as shorts or broken tracks.
Repair these if necessary before assembly. Note that board 1 requires
a couple of notches in its front edge
nearest transistors Q4 & Q12. The
shape of the notches is marked out in
the copper pattern and is necessary
to allow clearance for the screws for
the spacers on board 3.
Figs.6 & 7 show the component
layouts for the three boards. Insert
and solder in all the wire links and
PC stakes on the three boards. The
resistors can be installed next, and
you can use Table 1 as a guide to the
resistor colour codes.
Next, install the ICs, taking care to
mount each in its correct position and
with the correct orientation.
Trimpots VR3 & VR4 should be
mounted on the copper side of board
1 to allow adjustment when the robot
is assembled. VR1 & VR2 are mounted on the top side of board 2 in the
normal manner. The transistors and
diodes can follow, again taking care
with their orientation; don’t get the
BC338s, BD639s and BD640s mixed
up.
The capacitors can be mounted next
and note that the electrolytic types
must be placed with the polarity as
shown. Table 2 shows the relevant
capacitor codes.
All the red LEDs should be mounted with their tops about 12mm above
the board. This will allow clearance
for the red acrylic which is supported
on 15mm spacers. The three infrared
LEDs are mounted at right angles to
the PC board by bending their leads
over in a gentle arc (not with pliers).
The two infrared detectors, IRD1 &
IRD2, are mounted with 1mm of lead
protruding from the copper side of the
PC board; don’t shorten their leads.
That’s all we have room for this
month. In Pt.2, we shall complete the
construction and tell you how to test
SC
your Autonomouse.
|