Pages: [1]   Go Down
Author Topic: servo works when connected with usb but not with 9v reg power supply  (Read 896 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So i just bought this continuous rotation servo

http://www.frys.com/product/5230077?source=googleps&gclid=CJ2viqmr_bQCFUqoPAodPQsAGw

and i have this exact power supply

http://www.adafruit.com/products/63

When i transfer the sketch via usb to the arduino uno, it works when the uno is being powered by usb. When i connect the arduino to the power supply. It doesn't. It just hums a little bit but doesn't move at all. Does anyone know what's going on? do i need an external power supply for the servo? That doesn't seem to make much sense though.

Here's the sketch
Code:
#include <Servo.h>
Servo myServo;        // Create Servo object to control the servo

void setup() {
  myServo.attach(9);  // Servo is connected to digital pin 9
}

void loop() {
  myServo.writeMicroseconds(1700);  // Counter clockwise
  delay(2000);                      // Wait 2 seconds
  myServo.writeMicroseconds(1300);  // Clockwise
  delay(2000);
  myServo.writeMicroseconds(1500);  // Stop
  delay(2000);
}
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 178
Posts: 8064
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Is your servo connected to +5V (Red), Gnd (Black) and Pin 9 (Yellow or White)?
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Indiana, US
Offline Offline
Full Member
***
Karma: 12
Posts: 204
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

... And make sure the grounds are connected.
Logged

There are 10 types of people in the world, those that understand binary, and those that don't.

Left Coast, CA (USA)
Online Online
Brattain Member
*****
Karma: 331
Posts: 16464
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That is weird it should work with that power pack if it works on USB. You should probably try and measure the board's 5V pin when on USB and then when on external power pack and see if there is a difference.

As a general rule it's just never a good idea to power a servo from the arduino 5V pin no matter what the power source is. Servos should use their independent regulated +5vdc power source with the ground also wired to a arduino ground pin.

Lefty
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

what kind of power supply? i don't want to constantly be replacing batteries...
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 178
Posts: 8064
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

what kind of power supply? i don't want to constantly be replacing batteries...

6V and about 1A per servo.
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm very new to electronics so forgive me. Will getting a another 9v reg wall wart, cutting the ends and plugging those into a breadboard with a voltage regulator work and be the cheapest/best option? If so, how would i go about sharing the ground with the arduino? Would i just leave the ground cable from the wall wart unplugged and use a jumper from the breadboard to the ground on the arduino?
Logged

Offline Offline
Edison Member
*
Karma: 27
Posts: 2033
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You probably don't need another wall wart.   What I would try doing,  is taking another wire from the 9V of the supply to another regular to supply the servo power supply,   separately from using the 5V regulator chip on the arduino board.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm not sure i understand. The wall wart i have plugs straight into the barrel jack of the arduino. How would i get another wire from it?
Logged

Left Coast, CA (USA)
Online Online
Brattain Member
*****
Karma: 331
Posts: 16464
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm not sure i understand. The wall wart i have plugs straight into the barrel jack of the arduino. How would i get another wire from it?

The shield Vin pin is wired to the barrel jack's positive terminal (through a series polarity protection diode) so it's avalible for your use as a 'raw' 9vdc in your case using that 9v power module you showed. But keep in mind that your servo may still draw more current then the 9vdc module might be able to supply and in any event you can't draw more then 1 amp from the Vin pin because of the polarity protection diode which is rated for 1 amp maximum current.

 Servos have motors in them, motors tend to draw lots of current depending on the mechanical load placed on them, so planning proper power management for servo(s) is not a slam dunk easy task sometimes.

Lefty
« Last Edit: January 23, 2013, 11:26:20 am by retrolefty » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

do you have a suggestion?
Logged

Offline Offline
Full Member
***
Karma: 5
Posts: 113
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Will the board run other sketches while using the 9V supply? e.g. run the LED on pin 13?
What voltage is actually being supplied? you need about 7.5V minimum.
If the current draw is too big for the supply, then the voltage may be collapsing too much and causing the Arduino to reset. Try adding a 100 to 1000 uf cap across the 9V supply as a ballast if the voltage is sagging.
Logged

For whom does the clock pulse? It pulses for you!

Pages: [1]   Go Up
Jump to: