3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Control an OWI Robotic Arm with Arduino

Step 3Load 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:

« Previous StepDownload PDFView All StepsNext Step »

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
7
Followers
1
Author:zlite(DIY Drones)
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 BookTour Father of five...
more »