Forum >2A motor shield shorts when setting motors to reverse
2A motor shield shorts when setting motors to reverse

I am having some problems with the motorshield. if I set the direction of both motors to high, everything is fine, when i switch them to low, to make the motors go backwards, there is a short and the arduino shuts off. Am I doing something wrong?
Code i have used:
[code]int el = 6;
int ml = 7;
int er = 5;
int mr = 4;
int btpin = 12;
char val;
void setup(){
pinMode(ml, OUTPUT);
pinMode(mr, OUTPUT);
pinMode(btpin, OUTPUT);
digitalWrite(btpin, HIGH);
Serial.begin(9600);
}
void loop(){
if(Serial.available()){;}
val = Serial.read();
if (val == 'w'){
digitalWrite(ml,HIGH);
digitalWrite(mr,HIGH);
analogWrite(el, 255);
analogWrite(er, 255);
}
if (val == 's'){
digitalWrite(ml,LOW);
digitalWrite(mr,LOW);
analogWrite(el, 255);
analogWrite(er, 255);
}
}
[/code]
I am using the motorshield in PWM mode and the only thing i have wired up (besides motors) is a bluetooth module.
Code i have used:
[code]int el = 6;
int ml = 7;
int er = 5;
int mr = 4;
int btpin = 12;
char val;
void setup(){
pinMode(ml, OUTPUT);
pinMode(mr, OUTPUT);
pinMode(btpin, OUTPUT);
digitalWrite(btpin, HIGH);
Serial.begin(9600);
}
void loop(){
if(Serial.available()){;}
val = Serial.read();
if (val == 'w'){
digitalWrite(ml,HIGH);
digitalWrite(mr,HIGH);
analogWrite(el, 255);
analogWrite(er, 255);
}
if (val == 's'){
digitalWrite(ml,LOW);
digitalWrite(mr,LOW);
analogWrite(el, 255);
analogWrite(er, 255);
}
}
[/code]
I am using the motorshield in PWM mode and the only thing i have wired up (besides motors) is a bluetooth module.
2012-01-26 22:09:40 Hi,
Could you try powering the Arduino via USB, and powering the motor shield directly on the terminals? Make sure to change the power select jumpers.
could you paste the code you are using? Also, have you tried recharging your battery. It might be too weak to drive the motors.
Hector
Could you try powering the Arduino via USB, and powering the motor shield directly on the terminals? Make sure to change the power select jumpers.
could you paste the code you are using? Also, have you tried recharging your battery. It might be too weak to drive the motors.

2012-01-26 08:06:57 I am talking about the DRI0009 shield with 2 DC motors, powered by a 12 volt battery via VIN from arduino.
I am not sure what current the battery can supply, but when I was using a breadboard and a H-bridge (so its the same setup, without utilizing a motorshield) I could power the motors just fine and could reverse direction without problems.
But I have done some more testing (all other components removed) and the thing is, when I switch the direction of one motor while leaving the other motor running, everything's fine, but when switching both motors at the same time, the battery cuts off. If I have the arduino connected via usb, the motors start drawing their power from usb when the battery cuts off and the motors begin to crawl. This wasn't the case with my h-bridge on breadboard setup, so I didn't think I was drawing a too large current.
nilz
I am not sure what current the battery can supply, but when I was using a breadboard and a H-bridge (so its the same setup, without utilizing a motorshield) I could power the motors just fine and could reverse direction without problems.
But I have done some more testing (all other components removed) and the thing is, when I switch the direction of one motor while leaving the other motor running, everything's fine, but when switching both motors at the same time, the battery cuts off. If I have the arduino connected via usb, the motors start drawing their power from usb when the battery cuts off and the motors begin to crawl. This wasn't the case with my h-bridge on breadboard setup, so I didn't think I was drawing a too large current.

2012-01-25 03:36:59 Hi,
I'm not sure which motor shield you are using. We have a few. Please give me the SKU.
[url=https://www.dfrobot.com/index.php?route=product/category&path=51]https://www.dfrobot.com/index.php?route=product/category&path=51[/url]
Also, if you are having trouble getting something to work, disconnect everything and leave only the components under test. So please remove the Bluetooth.
Please let me know:
1. how are you supplying power to the motor shield, and to the Arduino?
2. which motors are you using?
3. How much current and voltage are you supplying??
4. how are things wired up?
5. Could you attach a picture of your setup??
If you are only using USB power to drive the motors as well as the Arduino, this could be your problem. The USB power is not enough to get the motors moving properly. You should probably use a Battery, or at the very least a power adapter supplying at least 7V and 1A current.
Hector
I'm not sure which motor shield you are using. We have a few. Please give me the SKU.
[url=https://www.dfrobot.com/index.php?route=product/category&path=51]https://www.dfrobot.com/index.php?route=product/category&path=51[/url]
Also, if you are having trouble getting something to work, disconnect everything and leave only the components under test. So please remove the Bluetooth.
Please let me know:
1. how are you supplying power to the motor shield, and to the Arduino?
2. which motors are you using?
3. How much current and voltage are you supplying??
4. how are things wired up?
5. Could you attach a picture of your setup??
If you are only using USB power to drive the motors as well as the Arduino, this could be your problem. The USB power is not enough to get the motors moving properly. You should probably use a Battery, or at the very least a power adapter supplying at least 7V and 1A current.
