5 min read

In this article by Richard Grimmett author of the book Raspberry Pi Robotic Projects – Third Edition we will start with simple but impressive project where you’ll take a toy robot and give it much more functionality. You’ll start with an R2D2 toy robot and modify it to add a web cam, voice recognition, and motors so that it can get around.

Creating your own R2D2 will require a bit of mechanical work, you’ll need a drill and perhaps a Dremel tool, but most of the mechanical work will be removing the parts you don’t need so you can add some exciting new capabities.

(For more resources related to this topic, see here.)

Modifying the R2D2

There are several R2D2 toys that can provide the basis for this project. Both are available from online retailers. This project will use one that is both inexpensive but also provides such interesting features as a top that turns and a wonderful place to put a webcam. It is the Imperial Toy R2D2 bubble machine. Here is a picture of the unit:

Raspberry Pi Robotic Projects - Third Edition

The unit can be purchased at amazon.com, toyrus.com, and a number of other retailers. It is normally used as a bubble machine that uses a canister of soap bubbles to produce bubbles, but you’ll take all of that capability out to make your R2D2 much more like the original robot.

Adding wheels and motors

In order to make your R2D2 a reality the first thing you’ll want to do is add wheels to the robot. In order to do this you’ll need to take the robot apart, separating the two main plastic pieces that make up the lower body of the robot. Once you have done this both the right and left arms can be removed from the body. You’ll need to add two wheels that are controlled by DC motors to these arms.

Perhaps the best way to do this is to purchase a simple, two-wheeled car that is available at many online electronics stores like amazon.com, ebay.com, or bandgood.com. Here is a picture of the parts that come with the car:

Raspberry Pi Robotic Projects - Third Edition

You’ll be using these pieces to add mobility to your robot.  The two yellow pieces are dc motors. So, let’s start with those. To add these to the two arms on either side of the robot, you’ll need to separate the two halves of the arm, and then remove material from one of the halves, like this:

Raspberry Pi Robotic Projects - Third Edition

You can use a Dremel tool to do this, or any kind of device that can cut plastic. This will leave a place for your wheel. Now you’ll want to cut the plastic kit of your car up to provide a platform to connect to your R2D2 arm.

Raspberry Pi Robotic Projects - Third Edition

You’ll cut your plastic car up using this as a pattern, you’ll want to end up with the two pieces that have the + sign cutouts, and this is where you’ll mount your wheels and also the piece you’ll attach to the R2D2 arm. The image below will help you understand this better.

Raspberry Pi Robotic Projects - Third Edition

On the cut out side that has not been removed, mark and drill two holes to fix the clear plastic to the bottom of the arm. Then fix the wheel to the plastic, then the plastic to the bottom of the arm as shown in the picture. You’ll connect two wires, one to each of the polarities on the motor, and then run the wires up to the top of the arm and out the small holes. These wires will eventually go into the body of the robot through small holes that you will drill where the arms connect to the body, like this:

Raspberry Pi Robotic Projects - Third Edition

You’ll repeat this process for the other arm. For the third, center arm, you’ll want to connect the small, spinning white wheel to the bottom of the arm. Here is a picture:

Raspberry Pi Robotic Projects - Third Edition

Now that you have motors and wheels connected to the bottom of arms you’ll need to connect these to the Raspberry Pi. There are several different ways to connect and drive these two DC motors, but perhaps the easiest is to add a shield that can directly drive a DC motor.

This motor shield is an additional piece of hardware that installs on the top of Raspberry Pi and can source the voltage and current to power both motors.

The RaspiRobot Board V3 is available online and can provide these signals. The specifics on the board can be found at http://www.monkmakes.com/rrb3/.

Here is a picture of the board:

Raspberry Pi Robotic Projects - Third Edition

The board will provide the drive signals for the motors on each of the wheels. The following are the steps to connect Raspberry Pi to the board:

First, connect the battery power connector to the power connector on the side of the board.

Next, connect the two wires from one of the motors to the L motor connectors on the board.

Connect the other two wires from the other motor to the R motor connectors on the board.

Once completed your connections should look like this:

 Raspberry Pi Robotic Projects - Third Edition

The red and black wires go to the battery, the green and yellow to left motor, the blue and white to the right motor. Now you will be able to control both the speed and the direction of the motors through the motor control board.

Summary

Thus we have covered some aspect of building first project, your own R2D2. You can now move it around, program it to respond to voice commands, or run it remotely from a computer, tablet or phone. Following in this theme your next robot will look and act like WALL-E.

Resources for Article:


Further resources on this subject:


LEAVE A REPLY

Please enter your comment!
Please enter your name here