The program begins by drawing three obstacles on the
screen and initializing the simulated robot at pixel position
400,500 at a random orientation. A pen is dropped to leave
a GREEN trail as the robot moves. The color green is made
invisible so the trail will not appear as an object to the
robot. If you want to know more about any command,
RobotBASIC comes with a 300 page HELP file.
The simulated robot has five feel sensors as shown in
Figure 6. The S3 has only two IR sensors to detect
obstacles in front of the robot. The RROSS maps this
information into RobotBASIC’s rFeel() function as follows.
If the S3 detects an object on its right, sensor position
2 is activated. Objects on the left activate position 8, and if
both sensors detect an object, position 4 indicates
something is probably directly ahead. This is especially true
for the S3 because the entire IR beam detection area is very
For the simulator to more accurately mimic the S3, we
must ignore feel positions 16 and 1 by forming a binary
AND with 14 ( 8+ 4+ 2). Depending on the final sensor value,
the program turns the robot randomly to the right or left,
or a complete about-face. If no sensors are active, the robot
simply moves forward. As you can see from Figure 5, this
moves the robot around its environment in a random
Controlling the S3
We can use this same program to control the S3 by
simply inserting the statement rCommPort 5 to the very
beginning of the program. Note: Use the port number for
your Bluetooth port instead of the 5 shown. That’s it! The
S3 will roam around its environment just like the simulation.
Since the S3 has a hole for a pen, it can leave a trail if
you have a large paper or whiteboard. Figure 7 shows the
real robot moving randomly on a small whiteboard.
The walls in the figure can easily be made with foam
board. The round obstacles were made from cut-down oat
boxes. Imagine a 4x8 foot whiteboard (available from
Lowes and Home Depot) serving as a customizable project
space for schools and/or robot clubs.
When the simulator uses all five of its sensors, it works
perfectly. When using only the three middle sensors, its
limited peripheral vision makes it possible (though not likely)
to collide with objects slightly left or right of the sensor
As expected, this is also true of the S3.
A Multiple PING)))
Adding three PING))) sensors (ultrasonic rangers
from Parallax) to the S3 provides a much larger
scanning area. This improvement is due to the broad
ultrasonic beam (compared to IR) and the wider
orientation of the sensors.
In most cases, this augmentation can eliminate
collisions, but it also allows the S3 to scan to the left
and right while moving forward. This makes behaviors
like autonomous navigation and wall following
You can make your own PING))) mount or even
just hot-glue the PING))) sensors to the S3. However,
the 3D printed mount in Figure 8 (available from
RobotBASIC) complements the S3 nicely. All electrical
42 SERVO 03.2018
Figure 6. A new book, RobotBASIC Projects for the Scribbler S3, is
available on Amazon.com. It provides numerous projects
and a detailed explanation of the RROSS: how to use it,
how it works, and how to custom it.