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.

How to Make an Obstacles Avoiding Robot- Arduino Style

How to Make an Obstacles Avoiding Robot- Arduino Style
You've always wanted to make one of those cool robots that can basically avoid any object. Yet you didn't have enough money to buy one of those really expensive ones, with already cut parts where all the materials where there for you. If you're like me you like to use some parts you already have around, like scrap metal and plastic. This is the project for you.
 
Remove these adsRemove these ads by Signing Up
 

Step 1Get the Materials

Get the Materials
Arduino- which you can get at the maker shed
http://www.makershed.com/ProductDetails.asp?ProductCode=MKSP4

Then you'll need a Ping UltraSonic Sensor which you'll find at most radioshack stores...
http://www.radioshack.com/product/index.jsp?productId=2909789

A base and scrap metal or plastic that you have lying around.

Some extra wires.

Some cheap mounting tape from Walgreens or the dollar store.

Two Futaba S3003 servos.

Some lego wheels -4 of them ......or other small wheels.

Also a rechargeable battery. (The only reason is that the servos use a lot of energy.

Now your all set to go!

« Previous StepDownload PDFView All StepsNext Step »
27 comments
Feb 13, 2009. 11:44 AMadmin says:
This is a great Instructable, but you need to add a main image of the final project to the intro step. Please do that and leave me a message when you have so that we can publish your work. Thanks!
Jan 17, 2012. 6:27 AMCello62 says:
Hello
Post the code pls!!! The link doesn't works.
Thanks
Nov 4, 2011. 11:03 AMkamid99 says:
Would this be a good science project for a 7th grader??
Sep 2, 2010. 4:10 PMolivier12125 says:
hey the code on the site is also with other components so can you post yours
Oct 11, 2011. 11:06 PMpgurudatt says:
Can you plz show the wiring of your robot . I havea competition in two days. can you wire dc motors and write the same programe and logic for that,?
Dec 14, 2010. 5:50 PMcomputerlover says:
I am still having problems with the code. I changed everything I could and uploaded the libraries. If you could upload working code that would be greatly appreciated!
Jul 1, 2009. 1:56 PMafw11 says:
Nope, it is still coming up with error: 'class Servo' has no member named 'refresh'. Did you run into this problem?
Jul 10, 2009. 9:56 PMoccrushmegamanx says:
: 'class Servo' has no member named 'refresh'. Did you run into this problem? How did you fix the problem because I have the same problem
Jul 13, 2009. 2:10 PMafw11 says:
Yeah, I was really annoyed by that. To fix it you need to use the servo library and the software servo library.At the beginning of the code where it defines "Servo leftservo", change "Servo" into "Software Servo" You can download libraries from the Arduino website. Also, I would download the Arduino 0016 environment.
Jul 3, 2009. 11:54 AMafw11 says:
Haha! I have fixed that problem, but now have a new one. If I plug in the power supply, the servos turn for a second and then stop. Also the ultrasonic sensor gets hot. What battery configuration did you use?
Jul 6, 2009. 8:13 AMafw11 says:
Thanks, that fixed it after I rebooted my computer. One quick question, what battery configuration did you use?
Jul 1, 2009. 5:59 AMafw11 says:
Soryry, I can't get to my computer where the program is stored to look at it, so how would I do that?
Jul 1, 2009. 11:02 AMafw11 says:
What I mean is, how would that piece of code look like?
Jun 30, 2009. 6:04 PMafw11 says:
Ok, so I have the code, but every time I compile it the software comes up with this error; In function 'void moveServoLeftTo (int, int)' : error: 'class Servo" has no member named "refresh" In function 'void moveServoRightTo(int, int)' : I included the servo library, is there anything else I need to add?
Jun 19, 2009. 6:23 PMafw11 says:
OK that helps, but where does the battery hook up again? Where do the PING sensor wires go? Sig(nal) goes to digital 7 but where do the other ones go? Where do the black and red servo wires go?
May 30, 2009. 12:31 PMafw11 says:
(removed by author or community request)
Jun 16, 2009. 1:54 PMafw11 says:
Also, where do you hook up the battery? Do you hook up the servo black wires to the same GND? Also, where do the the other servo wires go to? digital 5 and 6, or analog 5 and 7?
Feb 21, 2009. 8:34 AMkheks says:
dude i have a optical mouse which i no longer use . can i by any means use it to detect weather there is a obstacle in front .???
May 22, 2009. 10:39 AMfynflood says:
You can do this with an old ball mouse for sure.. It seems like I've seen someone hack an optical mouse to do this, but I can't dig it up.

That being said, here's the link to get you started using a ball mouse:
http://hackaday.com/2008/05/16/how-to-scavenge-a-mouse-for-parts/#more-1838
May 22, 2009. 10:31 AMfynflood says:
Hey, nice work... thanks for shout out too ;)

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!
188
Followers
5
Author:robotkid249
"I am always doing that which I cannot do, in order that I may learn how to do it." -Pablo Picasso "Everyone can be smart. Everyone is given a box of crayons in Kindergarden." There are only two mis...
more »