Servo Question
I am using a HS-311 servo on a basic stamp 2 BOE board. And can't seem to get my servo to move more than a degree
or so. Most of the time the servo just sits there buzzing.
I have the white control lead connected to a 220ohm resistor then into pin14
The red and black are going to an external power supply of 5.5V
When I run the following program the servo just sits there buzzing, I have tried changing the values on the pulsout between
500/1000 with no effect. I have also tried some of the servo tutorial programs to see if I could get something to affect
the servo but the most I could get was a barely visible flip-flop back and forth on the servo.
' {$STAMP BS2}
' {$PBASIC 2.5}
DO
PULSOUT 14, 500
PAUSE 20
LOOP
I cant see anything wrong with any of my wiring (there are only 3 connections!) any ideas anyone?
thanks in advance
Tim
Also can someone tell me if it is possible to control a digital servo with the Basic Stamp 2. Would I use the same Pulsout
program (If I can get this one to work that is!)
or so. Most of the time the servo just sits there buzzing.
I have the white control lead connected to a 220ohm resistor then into pin14
The red and black are going to an external power supply of 5.5V
When I run the following program the servo just sits there buzzing, I have tried changing the values on the pulsout between
500/1000 with no effect. I have also tried some of the servo tutorial programs to see if I could get something to affect
the servo but the most I could get was a barely visible flip-flop back and forth on the servo.
' {$STAMP BS2}
' {$PBASIC 2.5}
DO
PULSOUT 14, 500
PAUSE 20
LOOP
I cant see anything wrong with any of my wiring (there are only 3 connections!) any ideas anyone?
thanks in advance
Tim
Also can someone tell me if it is possible to control a digital servo with the Basic Stamp 2. Would I use the same Pulsout
program (If I can get this one to work that is!)
Comments
1) Make sure the servo power supply ground (black lead) is connected to or is the same as the Stamp's power supply.
2) It's usually better to have a little more "headroom" for the Stamp's and the BOE's regulator. 0.5V is just a bit too close. You should be using something more like 6V for Vin, but no more than 7.2V if you're driving servos off it.
Most digital servos work exactly the same as analog servos except their internal controller is digital instead of analog. Some newer servos also have the ability to provide position feedback and/or work via a high speed serial protocol which is usually proprietary.
seperate power supply for the servos, eg the board powered by the 9v battery and the servos powered by 4 x 1.5v batteries?
The way I have it set up is I split the white wire off the servo and plugged it into pin 14 (am I right using a 220 resistor in the line?) and have
the black and red connected to 4x1.5v batteries. I did this because I read that if you are powering the board off a 9v battery this could fry
the servos.
Thanks again for your help
You're correct that you can't power the servos with a 9V supply without damaging them. Connecting the grounds together doesn't supply 9V power to them as long as the +9V wire doesn't go to the servos.
Using a 220 Ohm (or even as high as 1K) resistor in series with the servo control signal helps attenuate noise from the servo motor that may come back from the servo (induced in the control line). It's also a good general rule that putting a 220 Ohm resistor in any I/O line from the Stamp can protect the I/O pin from an accidental wrong connection of that pin to some unexpected voltage source, usually connecting a Stamp output by accident to some other device's output pin with the two pins in opposite states (one high and one low).