Download as pdf or txt
Download as pdf or txt
You are on page 1of 14

Food

Living

Outside

Play

Technology

Workshop

Using Servos
by Higgs Boson on December 21, 2011

Table of Contents
Using Servos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Intro: Using Servos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Step 1: What is a Servo motor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Step 2: Testing the servo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Step 3: New code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Step 4: Prepare the sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Step 5: Using the sensor with the servo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Step 6: Using a 555 and a potentiometer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Step 7: Using a 555 and push buttons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Advertisements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

http://www.instructables.com/id/Using-Servos/

Author:Higgs Boson Ben's science wonderland


Science is my passion. I find myself constantly working on countless experiments, from low energy particle accelerators to good old simple electronics. I also
like making model rockets, and playing cello.

Intro: Using Servos


In this instructable, I am going to show you what a servo motor is, how to use it, and ideas for starting projects using it. I used arduino to control my servo, I added how to
use a 555 in some of the later steps.

Step 1: What is a Servo motor


If you are like me, then you knew very little about servo motors, and how to use them, so we should start from the beginning. A Servo motor uses pulse width modulation
(pwm) from a microcontroller or a 555 timing IC (or something different I haven't heard about) to know what position to move its horn to. They can move both clockwise or
counterclockwise thanks to an H bridge which is hardwired into them. Most Servos, unlike conventional electric motors do not move in continuous rotations. the standard
servo moves anywhere between 0 and 180 degrees, which make them useful for animatronics and robotics. The servo has three wires coming out of it which usually
ends in a female jack. the wire colors are black, which gets connected to ground, red which gets connected to the positive power supply, and white or yellow which gets
connected to the output of the microcontroller or 555 IC, and receives the pwm. Okay now that you know the basics, lets get started

Step 2: Testing the servo


the first thing that you should do is make sure your servo motor is working. because the servos wires end in a female header, you cannot plug it into the arduino (unless
you have a shield. insert solid core wires into the headers, so you can attach it to the pins of the arduino (or anything else). When you downloaded your programming
environment for arduino, it should have two examples for the servo. The one we are going to use first is called sweep. Go to the "open" icon next to save near the top of
the window on the environment. click on it, and a list of files should come up. go down to the one that says servo, and put your mouse over it. two files should come out of
it. one called "sweep" and one called "knob". click on the one called sweep, compile the code and upload it to your board. if everything is connected correctly, the servo
should begin to go back and forth from 0 to 180 degrees. If you cannot find the code, copy this:
// Sweep
// by BARRAGAN <http://barraganstudio.com>
// This example code is in the public domain.
#include <Servo.h>
Servo myservo; // create servo object to control a servo
// a maximum of eight servo objects can be created
int pos = 0; // variable to store the servo position
void setup()
{
myservo.attach(9); // attaches the servo on pin 9 to the servo object
}
void loop()
{
for(pos = 0; pos < 180; pos += 1) // goes from 0 degrees to 180 degrees
{ // in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
for(pos = 180; pos>=1; pos-=1) // goes from 180 degrees to 0 degrees
{
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
}

http://www.instructables.com/id/Using-Servos/

be sure to plug in the white wire to digital pin 9, the black wire to one of the ground pins on arduino, and the red wire to the 5v pin on the arduino board.

Image Notes
1. white wire from the servo goes to pin 9.
2. connect black to ground and red to 5v

Step 3: New code


Now that you know your servo works, you can begin to incorporate sensors into the mix. the first thing you should do is use a potentiometer. Use anything between 10
and 100k. keep the servo attached as it was using the sweep example. attach the top pin on the pot to 3.3v on the arduino. Connect the bottom pin to ground on the
board. Connect the center of wiper pin of the pot to A0 (the first analog pin) on arduino. go to "open" on the IDE again. Go to servo and open "Knob". compile the code
and upload it to your board. When the program is running you will be able to control the position of the servo with a potentiometer. If you cannot find the code, copy this:
// Controlling a servo position using a potentiometer (variable resistor)
// by Michal Rinott <http://people.interaction-ivrea.it/m.rinott>
#include <Servo.h>
Servo myservo; // create servo object to control a servo
int potpin = 0; // analog pin used to connect the potentiometer
int val; // variable to read the value from the analog pin
void setup()
{
myservo.attach(9); // attaches the servo on pin 9 to the servo object
}
void loop()
{
val = analogRead(potpin); // reads the value of the potentiometer (value between 0 and 1023)
val = map(val, 0, 1023, 0, 179); // scale it to use it with the servo (value between 0 and 180)
myservo.write(val); // sets the servo position according to the scaled value
delay(15); // waits for the servo to get there

http://www.instructables.com/id/Using-Servos/

Image Notes
1. wiper pin
2. top pin goes to 3.3v
3. bottom pin goes to ground

Step 4: Prepare the sensor


The sensor that I used that would probably work very well was the QRD1114 reflective sensor which has a discrete infrared LED, and phototransistor. to get the sensor to
work, you must connect it in a very specific way. you could use other reflective sensor, but this one just seemed convenient, and I am using it in another project so they
are readily available for me.
to setup this sensor you will need:
one QRD-1114
one 10k resistor
one 68 or 100ohm resistor
wire

http://www.instructables.com/id/Using-Servos/

Image Notes
1. follow this schematic. other setups will not work with the arduino.

Image Notes
1. qrd1114
2. 10k
3. 68ohm

http://www.instructables.com/id/Using-Servos/

Step 5: Using the sensor with the servo


Now that you have your sensor setup so that it will work for with arduino, you can replace the pot with it to make a servo that moves when something is in front of it and
moves back when nothing is in front of it. use the same code that you did for the potentiometer. but this time instead of using the pot, connect pin one on the qrd to A0 on
the arduino board. connect the two resistors to 3.3v, and connect pin 4 and 2 on the qrd to the ground on the board. run the program and when there is something about
1 cm from the sensor the motor will turn one way, and when the object moves away from the sensor the servo will move back. try adding a photo cell to make a light
sensitive servo. using sensors with the servo, you can make robots, animatronics, and more. Have fun!

Image Notes
1. connect the sensor as in the schematic.

Image Notes
1. the qrd1114

Step 6: Using a 555 and a potentiometer


this is a simple circuit using a 555 to control the servo with a potentiometer. The circuit was originally meant as a tone generator, but with some simple modifications it
became a servo tester. follow the schematic and it should work, but if you have any questions or problems, leave a comment and I will try to help you.'
to make this circuit you are going to need:
-one 555 timer
-one .1 f ceramic disk capacitor
-one 1k resistor
-one 100 ohm resistor
-one 100k potentiometer
- a lot of jumper wires

Image Notes
1. connect pin three to the white wire from the servo.

http://www.instructables.com/id/Using-Servos/

Image Notes
1. the original circuit was meant for tone generation. here's the schematic.

Image Notes
1. wires to the servo

Image Notes
1. connect 4 to 8, and 2 to 6. connect 8 to 6v and 1 to ground.

Image Notes
1. place this .1 uf cap from 2 to ground.
2. 1k resistor from 8 to 7.
3. 100 ohm from 3 to white servo wires.

Image Notes
1. connect one outside pin on the pot to pin 2
2. connect the other outside pin to pin 7
3. connect wiper pin to pin 6.

Step 7: Using a 555 and push buttons


I like this 555 circuit more than the one that uses the pot. the servo acts less spastic, and is easier to control. When you hit one button the servo will go clock wise and
when you hit the other button it will go counter clock wise.
for this circuit you are going to need:
-one 555 timer
-one .1 f capacitor
-one 1k resistor
-two 100 ohm resistor
-one 33k resistor
-two push buttons
build the circuit from the previous step accept do not add the pot, add the push buttons and resistors in place of it.

http://www.instructables.com/id/Using-Servos/

Image Notes
1. this should be 100 ohm. it works better than 22k.

Image Notes
1. build the previous circuit up to the point where you add the pot.

Image Notes
1. connect the buttons like this.
2. undefined
3. connect the 33k to one button and the 100 ohm to the other.

http://www.instructables.com/id/Using-Servos/

Image Notes
1. connect the resistors to pin 7 and the other terminal of the button to pin 6.

Related Instructables

Arduino+Servo+Potentiometer
Robotic Spider
by biomech75
V8 by
FoamboardRC

Arduino
thumbstick
controller by
biomech75

Controlling
Servos Using
the SSC-32
Servo Controller
and Arduino
Uno by yhtomitsy

Arduino + 2
Servos +
Thumbstick
(joystick) by
biomech75

Arduino Robotic
Arm by
biomech75

Advertisements

Comments
44 comments Add Comment

kdlaster says:

Jan 31, 2015. 9:16 PM REPLY

I have to ask. What kind of awesomeness is that breadboard? It looks like built in features to make life much easier!

Higgs Boson says:

Feb 1, 2015. 10:39 AM REPLY

It came as a Radio Shack starter electronics kit I got years ago. It certainly has been very handy for prototyping.

Mawtees says:

Oct 8, 2014. 4:39 PM REPLY

how do you pull of the female jack?

Higgs Boson says:

Oct 13, 2014. 3:38 PM REPLY

You don't. you can just insert jumper wires directly into it, but if you really don't want it you can cut it off and strip the wires.

Mawtees says:

Oct 8, 2014. 4:40 PM REPLY

how do you pull of the female jack?

goyaam jaim says:


hi , i want to make robot , can u help me to guide me how can i use it for back and forth movement

http://www.instructables.com/id/Using-Servos/

Aug 23, 2014. 8:12 AM REPLY

rokas.lepsys says:

Aug 20, 2014. 12:15 AM REPLY

will it work with a potentiometer?

peng.s.lim says:

Aug 12, 2014. 12:46 AM REPLY

Hi, may i know for step 6, where do i put in the potentialmeter? Please advise me on it. Thanks!

omar elattal says:

May 14, 2014. 2:16 PM REPLY

one more thing Can you help me how to control a one servo using a JOYSTICK [OR] KEYPAD

Higgs Boson says:

May 23, 2014. 3:02 PM REPLY


I'm sure you can find code all over the internet for arduino, but you could modify the knob example for them since most joystick modules are nothing but
two potentiometers. You would need to change how you map your values since the pots probably start centered for zero instead of at on extreme, but it
should be pretty straight forward.

omar elattal says:

May 14, 2014. 1:59 PM REPLY

man you are so great THANK YOU i searched about this a lot :)

mushfiq1996 says:

Apr 9, 2014. 7:14 AM REPLY

Help ASAP. Emergency Please. How i can rotate my servo to a specific angle for reading from amoisture sensor?

Higgs Boson says:

Apr 9, 2014. 2:50 PM REPLY

The easiest thing would be to use a microcontroller.

Higgs Boson says:

Apr 9, 2014. 2:53 PM REPLY


Using the arduino you could map the values from your sensor to 180 degrees and then use the Servo.write command to move your servo to an angle
corresponding to the reading. that is pretty much what is done in the Knob example under servos in the arduino ide. You would just replace the pot
with your new sensor and maybe rework some of the values to get the desired effect.

Paulg42 says:

Dec 10, 2013. 5:40 PM REPLY


Hi, Im Fairly new to electronics and I just cant get this circuit to work and I need it for a school project !! Does the potentiometer HAVE to be 100k ohm in
order for it to work ? because I was using a 10k and the it was only when I attached the battery that it jolted a degree or two in one direction but that was it !!

Liammc-c says:

Nov 20, 2013. 4:25 AM REPLY


Hi, i am currently completing my L3 extended diploma in mechanical and electrical engineering and i have to complete a project of my choice. I need to turn
a Continuous Rotation servo without any push buttons, the circuit will need to turn on the servo after 4 hours have passed, any ideas for the circuit?
any comments will be helpful- thanks

ataylor999 says:

Oct 23, 2013. 9:39 AM REPLY


Hey, I have a quick question. I have 3 servos that we have taken the casing and gears off of. we need to attach propellers to the motors and test that the
servos are working. what is a quick and easy way to do this?
Step by step instructions would be great! Thanks!

Higgs Boson says:

Nov 10, 2013. 7:10 AM REPLY


You could use any of the methods shown here. This should get the motor running, but with the Servo's potentiometer removed you may run into
problems with direction control. If you just want forward and backwards control then leave the pot connected and just glue it in the 90 degree position.
This way any signal past 90 degrees will result in one direction, and anything below whill result in the opposite direction.

infanati says:

Jun 25, 2013. 7:53 AM REPLY


Hi, I started on a project using IR sensors but for some reason my servos only keep moving forward even if the sensor detects an object ahead. I checked
the code and it seems to be fine. the connections are according to the codes. so im not quite sure whats going on there. any ideas?

Higgs Boson says:

Jun 25, 2013. 8:03 PM REPLY


Try sending the values from the sensor to the serial read on the IDE. If there is a problem with your connections these values will likely be sporadic. Also,
it would be good to see how it responds to objects near it. Although it would be intuitive that the value would increase when an object is near, it may
decrease (depending on how it is connected). That would be a good starting point if you're sure it's not the code.

http://www.instructables.com/id/Using-Servos/

infanati says:
this is the code that im using for my servos, and I have also added a pic of my connections to the arduino.
#include // Include servo library
Servo servoLeft; // Declare left and right servos
Servo servoRight;
void setup() // Built-in initialization block
{
pinMode(10, INPUT); pinMode(9, OUTPUT); // Left IR LED & Receiver
pinMode(3, INPUT); pinMode(2, OUTPUT); // Right IR LED & Receiver
tone(4, 3000, 1000); // Play tone for 1 second
delay(1000); // Delay to finish tone
servoLeft.attach(13); // Attach left signal to pin 13
servoRight.attach(12); // Attach right signal to pin 12
}
void loop() // Main loop auto-repeats
{
int irLeft = irDetect(9, 10, 38000); // Check for object on left
int irRight = irDetect(2, 3, 38000); // Check for object on right
if((irLeft == 0) && (irRight == 0)) // If both sides detect
{
maneuver(-200, -200, 20); // Backward 20 milliseconds
}
else if(irLeft == 0) // If only left side detects
{
maneuver(200, -200, 20); // Right for 20 ms
}
else if(irRight == 0) // If only right side detects
{
maneuver(-200, 200, 20); // Left for 20 ms
}
else // Otherwise, no IR detects
{
maneuver(200, 200, 20); // Forward 20 ms
}
}
int irDetect(int irLedPin, int irReceiverPin, long frequency)
{
tone(irLedPin, frequency, 8); // IRLED 38 kHz for at least 1 ms
delay(1); // Wait 1 ms
int ir = digitalRead(irReceiverPin); // IR receiver -> ir variable
delay(1); // Down time before recheck
return ir; // Return 1 no detect, 0 detect
}
void maneuver(int speedLeft, int speedRight, int msTime)
{
// speedLeft, speedRight ranges: Backward Linear Stop Linear Forward
// -200 -100......0......100 200
servoLeft.writeMicroseconds(1500 + speedLeft); // Set left servo speed
servoRight.writeMicroseconds(1500 - speedRight); // Set right servo speed
if(msTime==-1) // if msTime = -1
{
servoLeft.detach(); // Stop servo signals
servoRight.detach();
}
delay(msTime); // Delay for msTime
}

http://www.instructables.com/id/Using-Servos/

Jun 26, 2013. 1:15 AM REPLY

Higgs Boson says:

Jul 2, 2013. 9:56 AM REPLY


It's interesting that you connected the LEDs to I/O pins instead of directly to a power rail. I/O pins can't always supply enough current to drive the
LEDs at full brightness which could be causing your problem. You may try connecting them to power and ground rails directly (with a resistor of
course). What sensor are you using? Is the photo transistor in the same package as the LED?

infanati says:

Jul 3, 2013. 9:55 AM REPLY


even with the LEDs connected directly to the power supply the servos still only turn one way. The phototransistors are separate from the
LEDs. I have used black tape around the LEDs so that the light is only emitted forward and not directly at the PT.

Higgs Boson says:

Jul 3, 2013. 10:50 AM REPLY


Are you absolutely sure the light from the LEDs is reaching the phototransistors when reflected from objects?

infanati says:

Jul 4, 2013. 4:50 AM REPLY


i think so. I even used a camera to check if the LEDs were bright enough when hitting the object. I also did another test by places a
white LED on the power line going to the PT and it was lighting up every time my hand came close. so I'm not sure why is it that it's
not working with the Arduino. I even tried using another arduino but the problem continues.

Higgs Boson says:

Jul 5, 2013. 8:02 AM REPLY


Try connecting the emitter of the photo transistor to ground, and the collector to power through a 10k resistor. Connect the I/O pin
between the resistor and and the collector pin. You may need to change it in the code so that it responds to obstacles on a low
value instead of a high value.

Goh Tai Wei Glen says:

Jul 1, 2013. 9:41 AM REPLY


Hi, I'm trying to make a obstacle avoiding robot(well, sort of) but having some issues with and was hoping you could help.
I've successfully made the robot avoid static obstacles moving through a standard course. However, I was wondering if there is a way to latch the angle of
the servo so as to free my controller to use the sensors to sense the environment so it's able to react to the changes in the environment(moving obstacle).
All these should be happening while the robot is moving around the obstacles. Your help is greatly appreciated. Thank you.

Higgs Boson says:

Jul 2, 2013. 9:50 AM REPLY


I'm a little confused, if you could please clarify a little, that would help a lot. So you have a sensor mounted to a servo (I think). Do you want to get it to
lock onto moving obstacles to detect them, or do you want to lock the angle at a certain point so that your sensor is free to take readings?

silentskorn says:

Jun 26, 2013. 7:33 AM REPLY


Hi, thank you for some simple instructions to help me understand servos. I am a complete novice when it comes to servos, arduinos and everything involved
with them. I was wondering how possible it would be to connect 2 servos to one pot, switch, throttle, etc. Also if it is possible to have one servo go lets say 90
degrees (only for an example) clockwise and the other servo go 90 degrees counter clockwise at the same time and vise versa? Thanks

Higgs Boson says:

Jun 27, 2013. 8:01 AM REPLY


Using arduino that would be completely possible. You could maybe even pull it off with another more passive driver if you know what you are doing, but
tweeking the code would be much easier.

r_ray says:

Dec 13, 2012. 11:47 PM REPLY


Hello, I am very new to arduino and I am looking to use sensors to cause a servo motor to turn one way when something is close and the other way when
something isn't just as your example above does. However, I am trying to get the sensor distance to be greater so that the approach of human interaction
causes the motor to move, rather than the range only being 1cm. I was considering using an ultrasonic sensor rather than infrared, are you able to give me
any advice? Any help would be hugely appreciated?

http://www.instructables.com/id/Using-Servos/

Higgs Boson says:

Dec 15, 2012. 7:24 AM REPLY


The range finder would be better suited, but you also may consider a PIR sensor, as they are easy to use, but are more of a motion sensor than a
distance sensor. It really depends on what you want the end result to be as to which sensor you use.

ratankumarsaha says:

Dec 31, 2011. 1:16 AM REPLY

which electrical thing contain this servo motor..how can find it??????????
RATAN BANGLADESH.....

Tariq802 says:

Mar 19, 2012. 9:23 AM REPLY

try a local hobby store if not radio shack. any place that specializes in rc stuff...

smitlrx says:

Dec 31, 2011. 4:47 AM REPLY


Unfortunately servo's are not used often in standard equipment. The are however used in remote controlled airplanes, helicopters, cars and boats to
facilitate the operation of the vehicle, like steering and acceleration. One can buy the remotes and normally you get the receiver and a couple of servo's
with. You can also buy all these units separately.

Higgs Boson says:

Dec 31, 2011. 2:50 PM REPLY


I was able to find mine at radio shack, so they are pretty common. you don't need to take anything apart to find them. if they are not at your local
store, try amazon or ebay.

nilved says:

Jan 28, 2012. 12:45 AM REPLY

could you hook up the arduino with multiple servos and pots to control them and if so can you post a comment with the code

A.C.E. says:

Feb 28, 2012. 12:51 PM REPLY


While Higgs is getting more servos, Ill try to help you understand a bit. When you create the servo object (Servo myservo;) this is creating one servo
object with the name of "myservo". If you wanted 3 servos, you would need three of those lines, but with different names, such as:
Servo myservo1;
Servo myservo2;
Servo myservo3;
you would also need more potentiometers, so youd need to add more potpins, and have the potentiometers hooked up to their respective pins, I think
that would look like this:
int potpin1 = 0;
int potpin2 = 1;
int potpin3 = 2;
where potpin1 is what we are calling analog pin 0, but will control myservo1. You also need more variables to store the data from the potpins, so make
those too.
int val1;
int val2;
int val3;
the numbers will correspond with the servos of the same number.
now you just need to add the commands for checking all 3 servos into the loop, which would look like this:
void loop()
{
val1 = analogRead(potpin1); // reads the value of potentiometer 1
val1 = map(val1, 0, 1023, 0, 179); // scale it
myservo1.write(val1); // sets servo 1's position according to the scaled value
val2 = analogRead(potpin2); // reads the value of potentiometer 2
val2 = map(val2, 0, 1023, 0, 179); // scale it
myservo2.write(val2); // sets servo 2's position according to the scaled value
val3 = analogRead(potpin3); // reads the value of potentiometer 3
val3 = map(val3, 0, 1023, 0, 179); // scale it
myservo3.write(val3); // sets servo 3's position according to the scaled value
delay(15); // delays for 15ms to let the servos catch up
}
I think this would work, but someone check over my work because I'm a complete noob at arduino coding. Someone with an arduino and 3 servos should
write this and see if it works :p

Tariq802 says:
before you can start reading and writing you also need to attach the servo objects to their pins ie:
void setup() {
myservo1.attach(9); //attach servo 1 to pin 9
myservo2.attach(10); //attach servo 2 to pin 10
myservo3.attach(11); //attach servo 3 to pin 11
}

http://www.instructables.com/id/Using-Servos/

Mar 19, 2012. 9:15 AM REPLY

etc.

Tariq802 says:

Mar 19, 2012. 9:21 AM REPLY


you're also going to want to use a power supply separate from the arduino board if you're using a lot of servos, otherwise you might break
something. it could probably handle 3 servos but i definately wouldn't go with more than that without isolating the power supply

Higgs Boson says:

Jan 28, 2012. 2:46 PM REPLY

Yes you can. I'll try and post the code in a few days.

Higgs Boson says:

Feb 8, 2012. 6:12 AM REPLY

Sorry. This may take longer because I need to get more servos (all of mine are being used in projects right now).

bertus52x11 says:

Jan 3, 2012. 6:38 AM REPLY

Did you find the little particles yet...?

nima_juniper says:
thank you that was very useful for me

http://www.instructables.com/id/Using-Servos/

Dec 27, 2011. 3:27 AM REPLY

You might also like