The first article of this series showed how to build an inexpensive entry-level robot platform that could be powered with either DC motors or servomotors. The article also explained how a RobotBASIC RROS chip can greatly reduce the complexities associated with hardware
interfacing and the low-level programming generally
required for motor control.
This second installment will add sensory capabilities to
the robots developed last month, and simple programs will
demonstrate how easily sensor data can be obtained and
used to control the behavior of an RROS-based robot.
Adding a PING))) Ranger
Let’s start by adding a Parallax PING))) ultrasonic
ranging sensor to the DC robot discussed last month. Other
than adding the PING))) sensor, no physical modifications
need to be made to the robot. The new robot is shown in
Figure 2 shows the updated
schematic with the PING))) sensor
added. Only three connections are
required (5V, ground, and signal).
Using the PING))) is very easy
because RobotBASIC provides an
rRange() function for reading the
Using the Ranging
The program in Figure 3
moves the robot forward until it’s
five inches from an obstacle (the
units returned by rRange() are 1/2
After initialization, a while-loop
continually moves the robot
forward in tiny increments, while
Readers that have never built a robot often find the low-level programming
needed to control motors and interrogate sensors to be intimidating. This
final article in a two-part series shows how easy it is to add sensors to the
inexpensive motorized platforms developed last month.
42 SERVO 01.2018