MG995 Servo and DC motor arduino from external supply won't work

Hi!

We're trying to control an MG995 servo and a Johnson DC motor from Arduino at the same time. The DC motor is connected to a 6v (4xAA) battery supply and controlled by the Arduino with a transistor (like this: http://bildr.org/blog/wp-content/uploads/2011/03/tip120-solenoid.png ). The servo is connected to the Arduino's 5V and ground and controlled by a pin. We have common grounds.

When the Arduino is connected to the PC with a USB cable everything works fine. However if we supply the Arduino from an external battery the programme doesn't work properly or doesn't work at all. We tried a PP3 and two 4,5v batteries in series, none of them works. Seems like the servo is expecting more current or something like that. How could we make this thing work from an external supply?

Please help! Here's the code we used for a simple testing:

#include <Servo.h>
Servo myPointer;
int servoPin=3;
int dc=9;

void setup() {
  myPointer.attach(servoPin);
  pinMode (dc, OUTPUT);
}

void loop() {
 myPointer.write(60); //Turn servo to 60 degrees
 analogWrite(dc,255); //Turn on the DC motor
 delay(2000);         //Wait 2 secs
 myPointer.write(120); //Turn the servo to 120 degrees
 delay(2000);          //Wait 2 secs
   
 analogWrite(dc,0);    //Turn off the DC motor
 delay(2000);
}

Hi,
Welcome to the forum.

PP3 and two 4,5v batteries in series, none of them works

Your servo will need up to 1A to operate,so PP3 smoke detector battery is useless.
Your 2 x 4.5V, you haven't said how big they are.

The computer USB is pwerful enough to get one of those servos running, but not advisable.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Thanks.. Tom... :slight_smile:

Sure thing Tom, that's the two batteries we used: https://img.conrad.hu/medias/global/ce/8000_8999/8700/8730/8736/614386_ZB_00_FB.EPS_1000.jpg

And I attached the circuit as well.

The transistor is a TIP122 by the way, but we could use a MOSFET instead. Should we use another supply for the servo too? What should we connect to the Arduino to make this thing run? We would like to control a car with the motors, that's why we need to make it portable.

Thanks ahead! :slight_smile:
David

Hi,
Ops Batteries

I'm not sure of their capacity.
I'm surprised they are still made, I used to use them in my much younger days for experimenting.
Ops diagram

Tom.. :slight_smile:

Hi,

Should we use another supply for the servo too? What should we connect to the Arduino to make this thing run?

Yes, one that is capable of 1A to check that your fault is power supply.

Tom... :slight_smile:

Hi!

TomGeorge:
Yes, one that is capable of 1A to check that your fault is power supply.

Do you think that a phone charger (powerbank) like this could do the job maybe?

Output: 5V/2.1A
I could connect it to the arduino using an USB to 2.1 mm cable or USB A-B cable (just don't have one right now).

David