small 12-tooth gear is directly attached to the servo and
drives the 36-tooth gear adjacent to it. The gear drive
assembly is then fastened inside R2D2’s body, taking care
to align it properly by making sure that the center axle is
perpendicular to the robot’s base, and centered with the
hole on the robot’s dome (head). A VEX shaft collar was
then used so that it would not slip. Refer to Figure 5.
In order to allow the servo to rotate the robot’s head
to the maximum limits, you must first find out where the
mechanical stops are and center the robot’s head to be in
between the clockwise and counter-clockwise stops. Then,
attach the rod through the center of the large gear.
Alignment is crucial, so use a flashlight to make sure
the shaft is centered in the hole at the base of the dome.
Otherwise, the robot’s head may not turn smoothly. Once
aligned, fasten the gears using VEX shaft collars as shown,
and then use hot glue to attach the gear box to the inside
of R2D2’s body, making it level with the bottom of the
access panel. You can attach the inside “T” metal strip to
the inner lining of R2D2’s body by carefully dripping the
glue down inside to land at each end of the metal strip. I
found that three hot glued mount points are sufficient to
hold the gear box when the head is rotated.
R2D2 Control Subsystem
The yellow 75 MHz receiver is hot glued conveniently
2” above the main body bottom access panel so as not to
be in the way of the battery. Just add hot glue to the
receiver module and use the bottom access panel to attach
it inside the body wall. The yellow cable from the receiver
module should be routed to the bottom access panel
through a small notch cut out to pass all the electrical wires
(including the VEX servo cable) once the microcontroller is
mounted on the bottom of R2D2.
A VEX 7.2V volt battery is also placed inside R2D2
across the bottom access panel for easy access when it
requires recharging, and also helps lower the robot’s center
of gravity. You may also want to hot glue a
battery mount to help insure that the battery
does not move around inside the robot’s body.
Again, the power cables are routed through the
small square notch cutout.
Next, we attach the PIC microcontroller v0.5
to the bottom of the access panel by drilling three
holes. We can use three VEX bolts and nuts to
fasten the microcontroller under R2D2’s body.
When access is needed to the battery or other
inner component, just unscrew the
microcontroller and then fasten it back with the
nuts and bolts when done.
The VEX motors, servo, bumper wwitches,
The wires leading from the left and right motor are
directly connected to the motor inputs as shown in the
figure. Make sure that wires leading from the motors are
not dragging on the ground. Use some zip ties to hold
them if necessary.
Optional bumper switches can be connected to digital
inputs 9 and 10 (shown on the schematic) and are used to
stop the robot if they are triggered by hitting an obstacle.
The optional ultrasonic range finder is connected as
shown in the schematic. Make sure the right cables go to
the interrupt input and digital output 11.
No coding in easyC is necessary to get R2D2
operational. Just download the default VEX firmware
provided with the microcontroller if you have not already
done so; use the orange USB cable and it should work as
long as the electrical connections were made according to
Figure 6. This includes the functionality of the optional
bumper switches if they were installed. The optional
ultrasonic range finder is the only exception; it requires
additional logic which is not part of this project. I intend to
use it in the future for obstacle avoidance behaviors for
The first step is to align and test the two motors and
servo that make up the R2D2 motion subsystem. Start this
process by laying R2D2 down before attempting the initial
alignments/tests so that it won’t fall or crash into
something. Power-up the microcontroller and then power-
Figure 5. The gearing subassembly mounted inside R2D2's body, used to
turn R2D2's head clockwise or counter-clockwise via a servo.
38 SERVO 10.2016