I tried looking this up, because I figured it would be extremely common, but didn't find anything.
My arduino works completely fine in every respect, except for some reason if I plug the arduino into the usb, with a servo attached to arduino (yellow wire to pin 9, middle red to +5v, and brown to Ground), the servo starts glitching, as well as the arduino/pc. I get lots of blinky lights from the arduino like its not initializing properly, and the pc doesn't detect it correctly, everythings just kinda going crazy.
I've been getting around the problem by simply unplugging pin 9 whenever I upload code, and then unplugging the usb before reattaching pin 9. That makes everything work, although I'm still curious why this is happening, does it happen to everyone? It does seem to make it impossible to use the serial monitor on a project involving a servo.
I'm using windows 7 64bit, Arduino 0022, Arduino Duemilanove
I don't have any other battery plugged in when plugging into the usb. Just usb power only. Not sure how many amps the servo is, but its a very small 9gram servo. One of the extremely common HXT900
Well its not just the servo that's glitching. Its the arduino as well, the power and pin13 lights just go crazy and it never actually connects. All the while, the computer is very rapidly making the noises it makes when a usb device is plugged in and unplugged. As if I'm plugging it in and unplugging it 5 times per second. It just goes on like that forever and doesn't connect or initialize right.
If I just unplug the servo signal wire, it works fine. And it works fine every other time I'm doing something that doesn't involve a servo, even with other sorts of various sensors attached, but for some reason I just can't seem to plug it in with a servo attached or everything bugs out.
If I just unplug the servo signal wire, it works fine. And it works fine every other time I'm doing something that doesn't involve a servo, even with other sorts of various sensors attached, but for some reason I just can't seem to plug it in with a servo attached or everything bugs out.
The Arduino board uses a 500ma thermofuse to protect the 500ma current limit for USB powered devices. Your servo upon powering up is causing the problems you are seeing. I always recommend that servos are powered from a external regulated power source, or perhaps four series wired AA batteries. The Arduino is designed to control external devices, but to necessarily able to power all kinds of external devices.
Depending on what the servo is attached to, it might be drawing too much current for the power supply, even though it's a small 9g one. It could be flipping the egulator in and out of current-limit shutdown, which would definitely make the Arduino act wacky.