Introduction: Control an OWI Robotic Arm With Arduino

About: Founder of DIY Drones and 3D Robotics. Editor in Chief of Wired Magazine, author of the books "The Long Tail", "Free", and the forthcoming "Makers". Founder of GeekDad and Boo…
The OWI Robotic Edge Arm is a cheap and terrific 5-degree-of-freedom robotic arm that just costs $37. It's a great kit to build with a kid and won't take more than a couple hours to finish. Out of the box, it can only be controlled manually with a remote control. You can buy a USB control interface for it, but it's a waste of $27. It just lets you add a series of timed moves, but it's not really scriptable, you can't have it loop and because it just uses timing, there's no reliable repeatability.

What you want is real computer control, with closed-loop feedback for precision. Good news: it's super easy to connect an Arduino board to the OWI arm and let it do all the work! You won't even have to take the OWI arm apart or damage it.

Here's a video showing it in action, under fully autonomous Arduino control:


Here's what you'll need.

1) OWI Robot Edge Arm ($37)
2) An Arduino Uno board ($30)
3) An Adafruit Motor Shield ($19.50)
4) One potentiometer and at least three little trimpots ($5)
5) Some perfboard to mount the pots ($5)
6) Some jumper wires ($6) and pin headers ($7.50)

The total should be around $100. But you may have some of this already, and if not, you'll be able to reuse these boards and other parts for countless other projects.

Step 1: Connecting the Motors

Since the Adafruit Motor Shield only has four motor drivers, we're only going to connect the four OWI Arm joints (not the "fingers"). If you want to control the fingers, too, you can attach a relay to one of the digital outputs on the shield and put microswitches on the fingers to mark "open" and "closed". But I couldn't be bothered myself--the fingers aren't that important.

Just use a little solid (not stranded) wire to attach each OWI motor connector to a Motor Shield output. Strip a quarter inch at each end and plug one end into the OWI Robot Arm motor connectors and screw down the other ends in the Adafruit Motor Shield connectors, as shown here.

Step 2: Attach the Sensors

Each joint needs a potentiometer to measure its position, for "closed loop" feedback control. In the pictures here, I've shown a number of different kinds of pots, ranging from big metal ones to little "trimpots". In the intro, I linked to these, which are good general-purpose pots, but if you want smaller trimpots you can use these, which are shown in the arm picture here. I tend to use 10k pots, but you can use whatever you've got handy--just change the input thresholds in the Arduino code in the next section as appropriate for whatever readings you get.

Each pot has three wires: +5v, GND and variable. You'll connect them to the Motor Shield analog pass-through ports as shown, with the variable wire closest to the edge of the board.

On the Adafruit Motor Shield I've soldered three rows of break-away pin headers for the variable, +5v and GND pins on the shield here. You can cut off one plug of your jumper wires and solder it to each connect of the pot, and plug the other one into the Motor Shield. Or, if you have some RC three-wire cables around (like these female-to-female connectors that I've used here) , you can just cut them in half and use them for less wire clutter and confusion. The Motor Shield pins aren't quite the standard spacing, so you have to bend them a tiny bit, but it's no big deal.

In the picture, I've attached the base rotation sensor with some standard 22 gauge metal plumbers tape that you can get in any hardware store. It's pretty easy to bend it, cut it and screw it into the OWI Robotic Arm, either using existing holes or drilling new ones for small metal screws. I used a small length of wire to go through the slot in the pot and the holes in the plumber's tape to keep the pot shaft stationary as the pot body moves beneath it with the motion of the robot arm joint.

For other arm joints you can solder the trimpots into the perfboard as shown in the picture and hot glue that to the OWI Robotic Arms joints. Then hot glue some stiff piano wire onto the trimpot thumbwheel and connect it to a stationary point of reference for that arm. I typically use a small bolt as the anchor point for the wire, as shown in the pictures, so it can move back and forth bit without stressing the glue joint on the trimpot wheel. That's also the case for the bottom one, where the wire can move up and down in a hole drilled in the plastic base.

Note: there are many different and good ways to attach the sensors--these are just the way I did it. These work well, but you can mount them any way you want as long as they have a clear range of motion.

Step 3: Load the Arduino Code

Here's a simple Arduino sketch to show how to read the sensors, drive the motors and otherwise create a script to control each arm. This one first displays the sensor readings, then moves the base motor (arm rotation) and waits for you to hit "enter" in the Arduino Serial Terminal (remember to select "CRs" as the line ending type in that window) to go to the next step. Then it moves the other arm joints and prints out the new sensor readings from each one.

From this foundation, it's easy to see how to write full scripts that control all the joints. What's cool about this kind of "closed loop" control is that it's infinitely repeatable. Every time you do it you should get the same response, which is what you'd expect from a robot. (The pots have some variability, but the arm precision has been good to about half a centimeter in my tests, with no "drift".)


Just download the sketch and unzip it into your regular Arduino sketchfile folder. Remember that you must also download the Adafruit Motor library and place it in the "libraries" subfolder in your Arduino sketchfile folder.

Here's a video of simple base movement in action:

Hack It! Challenge

Participated in the
Hack It! Challenge