Introduction: Control an OWI Robotic Arm With Arduino

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:

Comments

author
Dainbramaged (author)2011-12-28

What voltage do you supply to the motors using this shield? I thought they run on ~3V but the h-bridge you're using seems to have a min of 4.5V. Do the motors seem to cope ok with this?

author
zlite (author)Dainbramaged2011-12-28

Yes, they're fine with that voltage. The stock OWI kit uses four 1.5v batteries in series, so that's 6v. We're running them at somewhat lower voltage (4.5-5v) out of the shield, but there's no noticeable performance difference.

author
nhecht (author)zlite2012-01-08

Actually, the circuit is set up so that only two of the batteries supply power to a motor at the same time, so the motor only sees 3 V. The circuit's "ground" is the middle of the battery string, which is connected to one side of each motor. The hand controller will connect the other motor pin to the pair above the ground for forward motion, and the other pair for backward motion.

I'm running my own Arduino-controlled OWI arm using a 5V supply for the motors, and it seems to be working fine, for now. We'll see how the motors hold up as time goes on.

author
shumakriss (author)nhecht2017-07-14

It's been 6 years and I'm hoping this still reaches someone. I rushed into buying a bench top power supply only to realize how this wiring really worked. Are you using a single 5V supply with an H bridge, shield, or HAT or something? I actually purchased their USB conversion kit too but if I can't power it continuously I can't use and machine learning techniques with it.

author
mistergjk made it! (author)2016-12-13

I intended to use your example initially. Then i took it the the next level by removing all the limiting factors, like the pots and the plumbers tape. I connected the motor shield to an Arduino Mega 2560 and then inserted an IR remote into the circuit, the outcome was good. The next step is to use one L293D to also control the gripper via the IR remote. Also the Serial Monitor tells you which position the arm is at the beginning of the movement.

image.jpgIMG_0199.JPG
author
Palms made it! (author)2015-12-07

Nice mod, I have the same robot arm and I was working on the same feedback lacking problem! I'm still working on it, but as a small enhancement I suggest you this change to the horizontal feedback I made instead of the plumber tape and potentiometer. The tape causes a very limited horizontal movement, so I reversed the logic and put a small trimmer UNDERNEATH the motor, and a Meccano bracket properly bended. Simply cut the extra yellow plastic pin from lower side of the motor, and using hot glue fix a trimmer (with its small perfboard) underneath. I also needed to drill a hole to enlarge it enough to fit trimmer head, then fixed this with hot glue too. I also put 4 rubber feet to the robot base, making enough space for the bracket to freely move. This solution will give a movement of around 180 degrees. Attached here are some picutres to let you/anyone know how I did it. I can now start working on other modding (like replacing the useless LED with an IR sensor, an ultrasonic sensor, etc;-)) Cheers!

IMG_20151206_225635453_HDR.jpgIMG_20151206_225642074.jpgIMG_20151206_225714032.jpgIMG_20151206_225745200.jpgIMG_20151207_092736067_HDR.jpgIMG_20151207_093317383_HDR.jpgIMG_20151207_094617517_HDR.jpg
author
FredO24 (author)Palms2016-11-13

Hey, where did you buy the metal brackets?

author
Palms (author)FredO242016-11-14

Since they're regular Meccano brackets, I used them from an old Meccano box. But you could find pretty similar ones from almost any local hardware shop.

author
mkinoma (author)Palms2016-08-05

Nice. The Meccano brackets are a lot more rigid. And I guess the feet are spread farther apart than the limits of the base rotation?. And it looks a bit tidier and more elegant.

author
Palms (author)mkinoma2016-08-07

Yep, you have nearly 180 degrees for z-axis, thus a wider arm movement. I tried to fit an optical sensor inside the motor itself, but it's too small to be abe to fit mine...

author
mistergjk (author)2016-10-24

This is a good product build. I am amazingly impressed, yet I was hoping for alittle clarification as to which motors are conected to which analog inputs on the motor shield for the example code included?

author
Jos_gusa (author)2016-08-26

With the DC Cable how many voltage you used for the arduino?

author
DavidB552 (author)2016-03-21

Sorry I dont quite get what the pots are for ?

author
mkinoma (author)DavidB5522016-08-05

The motor controller cannot know how far the motors have turned the joint; even if it knows that running it for 2.3 seconds moves it by x degrees, there are too many factors that can mess up the timing.

The pots will return distinct voltage values for every angle, consistently. For example, when the elbow is at some specific position, say about a third of the way through its travel, the pot will read, say, 1.6523443 volts or something like that. So if the controller is told "drive this motor forward until its pot returns 1.65 volts" it will stop at about the same angle every time.

author
DavidB552 (author)mkinoma2016-08-05

Ok thank you good explanation in a sense is this getting a motor to behave a bit more liker a stepper motor then ?

author
zlite (author)DavidB5522016-08-06

Actually, a bit more like a servo, which also has internal pots.

author
zlite (author)DavidB5522016-03-21

The pots are to give position feedback to "close the loop" on the system. Otherwise it won't know where the arms are.

author
melk76 (author)2016-06-29

How exactly is this powered? I was intending on plugging the ardiono into my USB port and jsut using that, but I'm worried there won't be enough current. Could someone please plainly explain how to power everything (shield, arduino and motors)? I'm also worried the shield needs too high a voltage! And i read somewhere that these motors are only rated for around 3v :s

Thanks for any help! :)

author
mkinoma (author)melk762016-08-05

According to the manufacturer (http://www.owirobot.com/robotic-arm-edge-1/) each 3V motor runs at
255mA at full tilt -- with no load. And there are five motors. Just
being installed in the robot means there's a load, and it will go
higher, all the way to the listed "stall current" of over 3 amps. The
design is such that the motors cannot continuously stall in this robot,
but still -- no microcontroller can deliver that directly even for a
split second. You will definitely need a motor controller. I don't
even think relays, transistors or MOSFETs will work because you've got
to be able to reverse the polarity. By the time you've added all the
circuitry to support it you've pretty much built a motor controller, so
probably better to just buy one straight away.

author
dshookowsky (author)2016-04-17

Has anyone tried to use these flex sensors for feedback? https://www.sparkfun.com/products/10264

author
ArunimaM (author)2015-11-03

can u plz show the connections clearly ? can we do the same thing using pcduino board?

author
TheGreatResistor (author)2015-08-03

nope you need a motor shield

author
AbhishekK13 (author)2015-06-16

author
AbhishekK13 (author)2015-06-16

Hey,
I bought OWI kit from amazon. It seems the speed of the motors is a bit slow.
Are there any methods to increase the speed of the motors?
Something like passing more current. But i doubt more current may burn the motors.

author
Moon74 (author)2015-01-09

Hello zlite,

Great project and idea!

What is the name of the software you are using on the youtube video "simple base movement in action"? I will add the pots and I would like to control it from my PC like you are doing on your video.

Thanks in advance!

author
zlite (author)Moon742015-06-06

That's just Arduino

author
joesinstructables made it! (author)2014-07-11

Clever idea. Thanks for sharing it.

image.jpg
author
Moon74 (author)joesinstructables2015-01-15

Hello! Great that you made it!

Are you using the "Serial Monitor" to control the base with the keyboard? How can I assign the keys?

Thanks!

author
Moon74 (author)2015-01-15

Hello! Are you using the "Serial Monitor" to control the base with the keyboard? How can I assign the keys?

Thanks!

author
Datawolf (author)2012-01-03

Does a shield exist that would enable the control of the 5 motors ?
I would love to program an arduino for the arm to pick up a light, or something like that.

author
dhoni11 (author)Datawolf2013-10-29

@Datawolf could u program an arduino for my robotic arm to pick up objects with a gripper.?? plz rply soon

author
Datawolf (author)dhoni112014-11-22

Gasp. I wish I had enough time for my own projects !
Good luck

author
Datawolf (author)dhoni112013-10-29

Unfortunately I didn't found a shield to drive 5 motors.
And even that, I don't have time enough for my own arduino, which is gathering dust in its drawer...

author

The AVR328P has 6 PWM outputs and 6 Analog inputs (if you don't use the I2C bus), you possibly just want to wire your motor driver yourself instead of using shields.

author
zlite (author)Datawolf2012-01-03

Datawolf: I don't know of a 5-motor shield, but you can add a single motor shield (stacked) to the Adafruit one to get five total.

Here's one:
http://www.robotshop.com/dfrobot-arduino-compatiable-motor-shield-1.html

author
froibo (author)zlite2012-02-21

Just to clarify, by fingers you are referring to the vise, correct? I have yet to get my arm yet, but I would think it would be disappointing if it was not able to grab anything.

author
ндогонят (author)2014-11-22

The simplest is still to use an Arduino Mini/Nano clone (with USB included) that sell for about $2 (shipping included), and plug it into your homemade motor driver (basically, relays activated by transistors), and you're free to design your motor drivers the way you want. That's the base design I use for servos and step motors.

author
benoitvillemont (author)2013-07-01

Is the link for "potentiometer" is good?? I think it's a trimpots and doesn't match to the potientiometer that you use on photographies. Is the good link is that: http://www.adafruit.com/products/562 ???

author
cdragos george (author)2013-06-20

very good tutorial for OWI Robotic Arm. I'm looking forward to find tutorials for other robotic arm kits 

author
WVvan (author)2013-02-17

A big THANK YOU for the idea about how to mount the pot to sense position. I've been beating my head for the last couple days trying to figure out a similar problem. I'll be using your design. Much better than what I had in mind. Kudos!

author
bahaa_monier (author)2012-11-12

Is it possible to use External DC Power 6v ?
i tried to do it but it going one side only ,
i connected the possiteve signal to the + and the possiteve to GND and -
but it not working .
can help please ????

author
learning curve (author)2012-05-05

Hi there, i am just wondering if it would be possible to control the arm without the potentiometer and trim pots? I have got the Arm going with a basic loop BACKWARD, FORWARD , and only one motor at a time (using adafruit DC test) i was hoping to be able to use the serial monitor like you have done as well, is this possible without modification to the arm?

author
nmered (author)2012-04-10

Great instructions! I got a sensor-less version of this set-up running. Now I'm looking to control the fingers. You mentioned adding relays and microswitches to the digital outputs. Do you have any hardware specs on these parts? I'm new to electronics in general and am using this project to get in to the basics.

author

Check this one out on youtube. The dude attached a freakin' cam.

http://www.youtube.com/watch?v=3_v7zDarCcM

author
dustynrobots (author)2011-11-09

What kind of motors are in the arm as-shipped? If they're servos, as I assume, they already have pots in them. I wonder if it's possible to use the existing pots (if they do actually exist) and something like the OpenServo board from Sparkfun (http://www.sparkfun.com/products/9014) with the Arduino for control, and avoid the additional wiring. Thoughts?

author
zlite (author)dustynrobots2011-11-09

Dusty: They're not servos. Just standard toy brushed motors with gears. No pots or any other feedback.

author
dustynrobots (author)zlite2011-11-09

oh okay got it - thanks for clarifying!

author
blinkyblinky (author)2011-10-31

I have one but...the motors are two slow.

author
mrrepel (author)2011-10-31

Looks nice ! Still waiting for my robot arm to arrive. Nice coding,i want to use an old PS2 mouse with rotary encoders. I'll use some of your code :)

About This Instructable

162,923views

176favorites

License:

Bio: 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 ... More »
More by zlite:Control an OWI Robotic Arm with Arduino
Add instructable to: