remaining two pins of the three-pin headers, so servo
connections, sensor connections, and almost anything that
has a serial communication type setup can easily be connected
without running a bunch of jumper wires. It makes a great
robotics or industrial controller board and costs about the
same as a BASIC Stamp or Atom module.
A schematic of the robot is shown in Figure 6. The
RoboBoard reads the GP2D15 sensors individually as
digital inputs at P0 and P1. PortB on the PIC (P0-P7 on the
Atom PIC) has internal weak 10K pull-up resistors to 5 volts,
optionally connected to each PIC pin.
The Sharp digital sensors are really open collector
outputs and require a 10K external pull-up resistor. By
connecting the Sharp sensors to the P0 and P1 pins, I can use
the Atom Basic “SETPULLUPS” command to supply the
hardware pull-ups internal to the PIC.
The GP2D12 is connected to the AX0 pin, which is one
of the A/D pins on the RoboBoard. Reading this sensor is
easy with the Atom Basic “ADIN” command. No pull-up is
required, since the IRD outputs a voltage.
The servomotors are connected to the P8 and P9 pins of
the RoboBoard. The PIC’s I/O is so powerful that it can drive
the servomotors without any extra hardware. The “SERVO”
command makes driving them easy, as well.
The three LED indicators are connected to the P12, P13,
and P14 pins. These are easily controlled with a simple
“HIGH” or “LOW” command.
Beyond this, the rest of the hardware just includes a
battery supply of four AA batteries. They supply enough
power to run the RoboBoard, Sharp sensors, and the
servomotors. I also have a 9 volt battery powering the
module during programming. The RoboBoard has a jumper
that allows separate power for the I/O and micro, which
can be handy.
Next, the constants are defined to make the listing
easier to follow. I label each LED and servo connection using
the “con” directive. The P# format are the pin names on the
RoboBoard headers that are set up to accept three-pin
connectors, just like the servomotor connectors.
‘[ Constants ]
‘ Left LED indicator
‘ Center LED indicator
‘ Right LED indicator
‘ Left Servomotor
‘ Right Servomotor
The software is the key to
this project. I’ll try to step
through the Atom Basic
language software listing so
you can understand how the
robot’s logic works. The first
section of the program
describes its purpose and
defines all the hardware
connections. These all have a
single quotation mark in front
of the line to tell the compiler
that they are comment lines.
‘ Hardware Connections:
SERVO 07.2004 55