Arduino mega + motor shield...

Hello, and sorry for my bad english...
I have arduino mega, and ladyada's motor shield v1.0(Motor Shield - Arduino motor/stepper/servo control) and i want connect 4 DC motors(TT Geared Motor with Back Shaft (180rpm 6v L Shape) - DFRobot).
Mega powered by USB or 9v jack, Shield powered by 5xAAA battery. I want test one motor, wired him to M1 terminal on motor shield. Then i run typical code for test:

#include <AFMotor.h>
AF_DCMotor motor(1);
void setup() {
Serial.begin(9600); // set up Serial library at 9600 bps
Serial.println("Motor test!");
motor.setSpeed(200); // set the speed to 200/255
}
void loop() {
Serial.print("tick");

motor.run(FORWARD); // turn it on going forward
delay(10000);
Serial.print("tock");
motor.run(BACKWARD); // the other way
delay(10000);

Serial.print("tack");
motor.run(RELEASE); // stopped
delay(1000);
}
but motor goes not work :frowning: When i connect motor directly to battery module, he work.
But when motor connected to shield, he does not work, but sometimes it makes a noise. I use the voltmeter to test a voltage. On the shield's ext_pwr 8V, on the unplugged terminals 6v, but when i plug in motors - voltage drops to 0 :frowning:

Please help me fix this trouble...

What happens to the battery voltage when you connect the motor? Perhaps they are flat?

That is strange, I kinda have the same set up.

I have the jumper removed, and when I call the motor pin I have this:

AF_DCMotor motor(1, MOTOR12_2KHZ);

Try that, them are the only two differences from what I did

MarkT:
What happens to the battery voltage when you connect the motor? Perhaps they are flat?

the battery voltage drops to 0V when i connect motor.
But, if i connect motor without motor shield, directly to battery module - it's ok.

Code:

AF_DCMotor motor(1, MOTOR12_2KHZ);

Try that, them are the only two differences from what I did

I tried it, but no effect...

May be my arduino or motor shield has broken?

Could be the L293D chip is bad. Have you tried the motor hooked up to M3 or M4?

Could be the L293D chip is bad. Have you tried the motor hooked up to M3 or M4?

Yes, of course... and i tried use new batteries, but no effect

You need to unplug the EXT_PWR jumper
Motors are using the usb cable as power source and not the battery pack.

panosip:
You need to unplug the EXT_PWR jumper
Motors are using the usb cable as power source and not the battery pack.

Hello, and thanks for your advice.
But, i already unplug the EXT_PWR jumper, he is installed on the single leg) But, no effect(

I unplug the L293D driver chip and connect directly to arduino, battery pack and motor, and use the pin 9 to enable 1, pin 4 to input 1, and pin 3 to input 2, then i run this code:

const int motor1Pin = 3; // H-bridge leg 1 (pin 2, 1A)
const int motor2Pin = 4; // H-bridge leg 2 (pin 7, 2A)
const int enablePin = 9; // H-bridge enable pin
void setup()
{ // set all the other pins you're using as outputs:
pinMode(motor1Pin, OUTPUT);
pinMode(motor2Pin, OUTPUT);
pinMode(enablePin, OUTPUT); // set enablePin high so that motor can turn on:
digitalWrite(enablePin, HIGH);
}

void loop()
{
digitalWrite(motor1Pin, LOW); // set leg 1 of the H-bridge low
digitalWrite(motor2Pin, HIGH); // set leg 2 of the H-bridge high delay(1000); // set leg 1 of the H-bridge high
digitalWrite(motor2Pin, LOW); // set leg 2 of the H-bridge low delay(1000);

}

And motor run, but very slowly((( Why? I connect battery pack red wire to Vs, and black wire to GND.
This is the photo.

Then, i connect Enable 1 to +5V from Arduino, Input 1 to +5V from Ardiono, and Input 2 to GND, and motor run fast!
What do you think, this is ardiuino' s problem? Or L293D chip is bad?