
CIRCBot
Part 3: Sensors & Output
This project accompanies Part 3 of Servo Magazine's series,
Beginner's Robotics on $50 a Month. It covers building the IR
sensors, the bump sensors and installing the LCD display.
The first part of the article can be found in the February issue of Servo
Magazine.
The Part 3 kit is available here.
Click here for
the Bascom source code used for CircBot (zipped).
Main Board Connections

Click the image above to see a close up picture of
the main board wiring.
IR Obstacle
Sensor Circuit -
Part 2
IR test circuit that was
described in the magazine section of this article could be used as is for
a sensor. However, it would be
nice to get as much light out of the IR LED's as possible since that
would increase the range of the sensor.
The resistor used in the test circuit made sure that there was
enough load on the sensor's GL pin for the sensor to operate properly.
Replacing the resistor with two more IR LED's will keep the GL
pin loaded and will increase the amount of IR light.
Using the IR test circuit with three LED's would be sufficient
if all you wanted was to tell if there was something immediately in front
of the bot. However, it is
often useful to also be able to tell if the object in front of the bot is
more towards the left or right side of the bot.
For example, a sumo bot needs to turn toward an obstacle (i.e. the
opponent's sumo bot).
By
making two sets of IR lights and placing one set on each side of the
sensor, we can cause more light to be toward one side or the other of the
sensor's field of view by putting power to one set of lights or the
other.
You could use output pins form the microcontroller to power the
LED's. However, there is a limit to the amount of current a pin on the
microcontroller can source. Three
IR LED's will require more current than the microcontroller can provide.
If hooked directly to a microcontroller pin, they would cause the
power available to the rest of the chip to drop so low that the chip will
reset.
To get around this problem, we will use an inverter chip as a
buffer. The inverter will
limit the amount of current drawn from the microcontroller.
By running multiple inverters in parallel, we can increase the
amount of current available form the inverter to run the LED's.
The table in Figure 11 shows how to
wire a test circuit for the inverter.
Use the visible LED from the multiplexer test circuit to test the
output of the two-inverter chains. We'll
make the IR LED chains when we build the bump sensors in the next section.
|
Item
|
From
|
To
|
Notes
|
|
74HC04
Inverter Chip
|
F20
|
E15
|
Pin
1 @ F30 (chip faces backwards)
|
|
Wire
(GRN)
|
D14
|
D16
|
Length
5mm
|
|
Wire
(GRN)
|
C15
|
C17
|
Length
5mm
|
|
Wire
(GRN)
|
D17
|
D18
|
Length
3mm
|
|
Wire
(GRN)
|
G15
|
G17
|
Length
5mm
|
|
Wire
(GRN)
|
H16
|
H18
|
Length
5mm
|
|
Wire
(GRN)
|
G18
|
G19
|
Length
3mm
|
|
LED
|
A14
|
Upper
GND 14
|
Temporary,
remove after test
|
|
LED
|
J15
|
Lower
GND 15
|
Temporary,
remove after test
|
|
Test
Lead (RED)
|
Any
+V spot
|
Tester
board
|
Temporary,
remove after test
|
|
Test
Lead (BLK)
|
Any
GND spot
|
Tester
board
|
Temporary,
remove after test
|
|
Test
Lead (BLUE)
|
D19
|
Tester
board
|
Temporary,
remove after test
|
|
Test
Lead (GRN)
|
G20
|
Tester
board
|
Temporary,
remove after test
|
|
Wire
(GRN)
|
C19
|
G27
|
Length
30mm Install AFTER test
|
|
Wire
(GRN)
|
J20
|
J28
|
Length
20mm Install AFTER test
|
Figure
11 Inverter Wiring
The Bump Sensors
There will be objects that the
IR detector will not see. If a
material either absorbs IR or is transparent at IR frequencies, the IR
detector will not see it. Bump
sensors provide a method for your bot to sense these obstacles.
There are dozens of designs out there for making bump sensors.
They range from the simple to the complex.
On the simple end is a springy wire connected on one end to GND
with the other end terminating in mid-air just in front of a contact pad
which is wired to a terminal on the microcontroller (the terminal is also
connect to +5V through a 100 KW
resistor). When something
pushes the wire to contact the pad, the terminal on the microcontroller
goes from reading 5V to reading 0V. On
the complex end there are multi-lever linkages with molded parts that
surround a bot and activate different combinations of switches depending
on where contact is made.

Figure 12
Front Breadboard
(Click to Image to View)
he bump sensors for this bot fall somewhere in between.
They use micro-switches which are pushed by a bumper made of
ceiling hanging wire and electrical tape.
It works, but with a little creativity, you should be able to come
up with better designs. Use
Google to search for bump sensor on the net for ideas.
We'll install the micro-switches and their circuitry first and
then make the actual bumpers. Figure
12 shows the small breadboard with the IR sensor, its LED chains,
and the bump switch circuitry. The
table in Figure 13 describes how assemble
the circuit in the previous figure.
|
Item
|
From
|
To
|
Notes
|
|
IR
LED
|
A5
|
A6
|
Neg
side at A6
|
|
IR
LED
|
A7
|
A8
|
Neg
side at A8
|
|
IR
LED
|
C6
|
C7
|
Neg
side at C7
|
|
IR
LED
|
A25
|
A24
|
Neg
side at A24
|
|
IR
LED
|
A23
|
A22
|
Neg
side at A22
|
|
IR
LED
|
C24
|
C23
|
Neg
side at C23
|
|
Small
Capacitor
|
Upper
+V 18
|
Upper
GND 18
|
|
|
IR
Sensor
|
See
|
Picture
|
GL
Pin 4 @ A15, Signal pin 2 @ A16
|
|
Wire
(GRN)
|
C15
|
C8
|
Length
17mm
|
|
Wire
(Grn)
|
D16
|
D1
|
Length
37mm
|
|
Wire
(GRN)
|
E15
|
E22
|
Length
17mm
|
|
Wire
(GRN)
|
E25
|
E3
|
Length
54mm
|
|
Wire
(GRN)
|
D5
|
D2
|
Length
7mm
|
|
Wire
(RED)
|
Upper
+V 28
|
A28
|
Length
10mm
|
|
Wire
(BLK)
|
Upper
GND 29
|
A29
|
Length
7mm
|
|
100
K resistor
|
D30
|
D28
|
Length
5mm
|
|
Wire
(GRN)
|
E30
|
F30
|
Length
7mm
|
|
Wire
(BLK)
|
E29
|
F29
|
Length
7mm
|
|
Wire
(RED)
|
E28
|
F27
|
Length
8mm
|
|
Wire
(GRN)
|
E27
|
F26
|
Length
8mm
|
|
Wire
(BLK)
|
F27
|
G26
|
Length
3mm
|
|
Wire
(BLK)
|
J29
|
Lower
GND 29
|
Length
10mm
|
|
Wire
(RED)
|
H27
|
Lower
+V 27
|
Length
12mm
|
|
Switch
|
G30
|
J28
|
Break
off center tab, face tab side to center
|
|
Wire
(GRN)
|
G26
|
G4
|
Length
54mm
|
|
Wire
(GRN)
|
F4
|
F3
|
Length
3mm
|
|
Wire
(BLK)
|
G2
|
F1
|
Length
4mm
|
|
Wire
(BLK)
|
Lower
GND 2
|
J2
|
Length
10mm
|
|
100
K Resistor
|
Lower
+V 4
|
J4
|
Length
7mm
|
|
Switch
|
G3
|
J1
|
Break
off center tab, face tab side to center
|
Figure
13 Front
Breadboard Wiring
You will need to make some jumper wires to connect the small
breadboard to the main board. Cut two 4-1/2 inch pieces from the six
stranded cable which was left over from building the programming cable in
last month's article. Slide
all of the wires out of the sleeves.
Cut one red and one black wire down to 2-1/2 inches.
Strip 9mm (about 1/4") off the ends of all the wires from one set
and off the ends of the blue wire from the other set.
Break off a set of four header pins from the strip of header pins.
Solder the wires to the pins in the following order: Blue, Black,
Red, Gr |