How To Make an Obstacle Avoiding Arduino Robot

 by generalgeek314
Featured

Step 2: Centering Servos

First, we need to calibrate the servos so that our robot stops when we want it too. 

Actually, before you do that, you need to set up the Arduino with your computer! Go do this quick little tutorial here: http://arduino.cc/en/Guide/HomePage, and then come back (I'll be waiting).

Finished? Good! You should now be able to get your Arduino blinking an LED. Now, you're going to get it to center your servo motors. Download the attached Arduino file (.ino) and open it with the Arduino IDE. Next hook up your servo motors like in the picture. The black wire should be connected to ground on your Arduino (labeled "GND"),  the red one to 5 volts (labeled "5V"), and the white one to pin 11 (labeled "~11"). Make the connections from the Arduino pins to the servo with some male-to-male jumpers. 

Now, upload the program to your Arduino board. Once it runs, one of two things will happen:
1) Your motor won't spin: You're done! Now go back and repeat for the other motor.
2) Your motor will spin. Adjust the potentiometer (see picture 2) with a phillips head screwdriver to stop it from spinning. Slowly turn the screwdriver in either direction until you find the setting that makes it stop. Remember to be gentle and turn slowly... otherwise you'll probably overshoot and have to turn the screwdriver the other way. 
 
Remove these adsRemove these ads by Signing Up
gasconmarvinlogico says: Jan 28, 2013. 4:56 AM
hello im just wondering. my left and right servo won't spin 360degrees but it only spin to 180 degrees.. how to make it spin to 360...
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!