my first topic hrhr ... well i am new here and with my arduino. i build one 3x3x3 led cube for fun and then one 4x4x4 wich looks much more like a cube...finally.
my project:
is a Laser-safety shutter for our LaserTable. For that i will use a hallswitch and some magnets for the signal. If someone moves the important part the magnetic field changes and boom the shutter goes down. Hallswitch was easy to read out but the servo is controlling me, not i controll the servo.
The Problem:
I tried to run the sweep example from the library and the servo is just twitching. Servo is hooked up on pin10(orange cable, signal), GND(brown) and the power 5V(red). Dont work...
Then i tried to use an external Power supply. Again pin10 Signal, i connected the GND form the arduino with the GND form the external powersupply and the red cable to the power supply. Dont work...
On that .png drawing you show your external power supply as having three connections, ground, - , and +. Perhaps the ground is just a protection ground and not referenced to the - side of the power supply. Just move your ground wire from the ground terminal on the power supply to the - terminal on the power supply and see if it does not then work properly.
If you are using the "Sweep" sketch included with the download, the servo signal line is connected to pin 9, not pin 10. It works fine on my Ubuntu 10.04 system.
puzzu:
I checked the pin in sweep and i already changed it to 10. So the pin is correct.
Moving the ground wire from my ground terminal to the - terminal on the power supply killed my servo...
Any ideas why?
If you could post a link of a datasheet for your specific power supply maybe we could help, but otherwise we would just be guessing. So killed your servo means they not longer function as before if you move the ground wire back to where you first had it?
Well that is a triple output power supply, that has 3 different output voltages, all which are adjustable, none that are referenced to ground unless you wire them as such. So there is no telling how much voltage you applied to the servos. You original posting drawing showed a single output power supply, that so we had no way to figure out what you were working with. I suspect you have applied both a +5vdc and a -5vdc to your servos which mean they received 10vdc which is above their maximum, maybe even more as we don't know what values the voltages were adjusted to. That is a very nice and capable power supply but you much have a good understanding of it to proper and safely use it in your projects. Sorry if I contributed to any damage caused by my suggestion.
yes i applied +5vdc, and i checked with the oscilloscope it is +5 and -5...i had to order some new servos for my next try...well i made again a crappy paint picture of my wiring. Will it work this way?
With 2,5 vdc on the 0-6V output?
I fell me so dump at the moment. Maybee i will understand why it dont work all the time soon...
i observed something new. The new servo run the sweep example from 0 to 180 degrees and then started twitching. Thus i rotated the servo with my hands back and then again connected it to the arduino. And it again only goes from 0 to 180 degrees up but not back?
Do i have to add something to the normal code to get it working? Signal on pin9, vdc on 5V pin, GND on GND.
Servo myservo; // create servo object to control a servo
// a maximum of eight servo objects can be created
int pos = 180; // 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
}
}
puzzu:
yes i applied +5vdc, and i checked with the oscilloscope it is +5 and -5
Are you using an ordinary hobby servo from an analog radio control system?
You don't need a scope, you need a DC voltmeter between the servo +ve and ground connections. This should read the same as the voltage the servo is designed to work with - typically 5V for an ordinary RC servo, but you haven't said what you're using. The servo ground needs to be connect to the Arduino ground, and the servo signal needs to be connected to the Arduino signal pin.
If you're using a different type of servo it may have different power and signal requirements,so you need to be clear about what sort of servo you're using.