Introduction: 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.

Check out my new project on sending a balloon into space!!
https://www.instructables.com/id/My-Space-Balloon-Project-Stratohab-Success-High/

Step 1: 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!

Step 2: Making Your Servos Move 360 Degrees

So you have your servo's great! Now twist the the external spoked plastic thing.... Wow! It only goes 180 degrees what are we going to do about that?

We're gonna make it move all of the way around....

Basically changing some of the mechanics inside it.
Follow this tutorial and get your servo to go all of the way around and you can go to the next step!

Hacking Some Servos

This should give you two perfectly, well yea, they move all the way around.

Step 3: Putting It All Together

Use some of the very sticky mounting tape and put it onto the piece of metal, like this. Also do this to the lego wheels.

Then attach the (giant) in my case battery to the top of the metal. Then place the Ping sensor into a piece of pcb and make it with the end of the servo you cut off and now you have most of it done.

Then attach the Arduino on top of the battery. For a little size comparison here is how large this robot should be....

Step 4: Attach the Electronics.

Simple put if you would like to put a breadboard or circuit board on top to make this easier.

1. Attach both servo red wires (+) to (+) on arduino.
2. Attach both servo black wires (-) to GND on arduino.
3. Attach a wire you can solder on to the PING sensor, that is positive to positive on arduino.
4. Then the negative to the negative.
5. The signal wire on the ping goes to digital 7 on arduino.
6. The left servo white wire goes to 5 and right servo white wire goes to 6.

Then upload to arduino using the Arduino environment which you can find info on here this code.
arduino.cc

Thanks you to the person who made his code here it is..

http://www.obscurereality.org/?p=45

YOU will also need to get the servo library whoch can be found here...
arduino.cc also

Thanks you for viewing this instructable and i hope some of you get to make this cool robot..

Comments

author
admin made it!(author)2009-02-13

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!

author
assadollahi made it!(author)2013-11-05

hey, the link to the code doesn't work anymore. could you post it here?

author
wilb made it!(author)2013-10-06

Could someone please post the code. The link provided does not work.
good simple project if I had the code

author
jackjackboom made it!(author)2012-08-09

Or you could buy continuous rotation servos at radio shack for $12 apiece. These puppies have an H-Bridge inside them so that you don't need a motor shield.

author
Cello62 made it!(author)2012-01-17

Hello
Post the code pls!!! The link doesn't works.
Thanks

author
kamid99 made it!(author)2011-11-04

Would this be a good science project for a 7th grader??

author
olivier12125 made it!(author)2010-09-02

hey the code on the site is also with other components so can you post yours

author
pgurudatt made it!(author)2011-10-11

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,?

author
robotkid249 made it!(author)2011-05-22

https://www.instructables.com/answers/Would-You-Guys-Like-a-Wireless-Power-Kit/

author
computerlover made it!(author)2010-12-14

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!

author
occrushmegamanx made it!(author)2009-07-10

: '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

author
robotkid249 made it!(author)2009-07-01

Replace #include with #include

author
robotkid249 made it!(author)2009-06-30

afw11, on the top of the code where it says #include put the full library "phrase" for the servo. That should fix your problem.

author
robotkid249 made it!(author)2009-06-19

Wow these are easy questions any engineer should know. Red is positive. Black is negative. The only wires on the ping sensor besides signal are positive and negative. The battery goes to the arduino power input.

author
robotkid249 made it!(author)2009-06-18

The left servo goes to digital pin 6, and the right servo goes to 5. It is in the code, i think..

author
kheks made it!(author)2009-02-21

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 .???

author
fynflood made it!(author)2009-05-22

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

author
fynflood made it!(author)2009-05-22

Hey, nice work... thanks for shout out too ;)

author
robotkid249 made it!(author)2009-02-21

That picture got messed up
R = reciever P = paper E = emiter

/// //////// ///
R--P---E

author
robotkid249 made it!(author)2009-02-21

YA theres prolly a ir receiver emitter where the scroll wheel is. Pull that out. When the infrared light reflects off a wall and goes to a receiver the arduino will know a wall is there.

Like this ////// ******
RE paper EM
To arduino pins

About This Instructable

44,099views

56favorites

License:

Bio: I'm 17. I enjoy making cool stuff, and promoting the "maker" community. Vote for my space balloon in the hurricane laser contest and hands ... More »
More by robotkid249:My Space Balloon: Project Stratohab Success!! High School Student's BudgetElectricity Generating Kite!Wireless Power
Add instructable to: