rotating turret for the PING))) to provide ranging data.
Adding the Turret
Figure 1 shows how easy it is to add a ranging turret
to the S3. The main body of the servomotor was hot-glued
to the back of a PING))) sensor, and a four-pin header was
hot-glued to the servomotor’s output shaft.
This allows the turret to be mounted by simply
plugging it into the solderless breadboard also shown in
the figure. The breadboard was attached to the S3 using
Note also that the servomotor and the PING))) are
connected to the S3 hacker port (which also supplies both
5V and 3.3V to power external sensors). Figure 2 shows
the turret mounted on the S3 in its operating position.
I wanted a project that would demonstrate not only
the PING))) turret, but also the line and IR sensors. Figure
3 shows what I came up with. The S3 will
use its line sensors to follow the line shown,
starting from the left side.
While following the line, the S3’s IR
sensors will be utilized to detect objects
blocking the path. When an object is
detected, the turret will be pointed forward
and the PING))) data used to move the S3
until it is two inches from the obstacle.
At that point, the S3 will reorient itself in
preparation to follow the contour of the
object until it finds the line again. It does this
by turning the turret to the left and using
the PING))) to maintain a fixed distance from
The line sensors will be monitored
during the line following, and when the line
is detected, the S3 will reorient again, this
time preparing to resume the line following
The S3 will continue following the line until it finds a
second obstacle before terminating the program.
Everything could have been done with only the PING)))
turret and the line sensors, but this approach also
demonstrates how to use the IR sensors (which have the
advantage of providing detection data faster than obtaining
range information from the PING)))).
Figure 4 shows the main portion of the program used
to implement this project. It starts by setting up three speed
variables that will be used to control the robot’s movements
throughout the program. The servomotor is then positioned
You would expect this to be 90°, but my servo and
SERVO 02.2018 37