Adafruit Motor Shield v 1.2

Hi,

I have an Adafruit Motor Shield v 1.2 and I wanted to use it to power 2 DC Motors for my Robot.

The motors are working just fine on their own but as soon as I want to use the Motorshield to control them they just do not start. So I searched for the fault.
I tried powering the Motor Shield with a Battery-Pack with 12V and with one with 6V. first with 6V because that is what is recommended for them.
The motors did not start spinning so I decided to measure the V on M1 M2 M3 and M4.

First I activated M1 and M2 - on M1 i got 2.5V and M2 2.1V. How can that be different?

Then M3 and M4 (M1 and M2 deactivated) - both below 1V. - I just do not understand it.

That explains why the motors where not spinning but I do not understand why the voltage is so low. I also tried to change motor speed in the script or powering the arduino via the DC jack, powering both the arduino and shield separately but nothing seems to work. I think the shield might be broken.

What do you guys think? Help would be appreciated.

The motors I got: Product not found!
The arduino and shield: http://www.banggood.com/L293D-Motor-Drive-Shield-Mega2560-Module-Board-Kit-For-Arduino-Mega-p-1032288.html?cur_warehouse=CN
Battery Pack (12V - 6V looks the same) 12V 8 x AA Battery Clip Slot Holder Stack Box Case 6 Inch Leads Wire Sale - Banggood USA-arrival notice-arrival notice

What do you guys think?

We think you forgot to read the "read this before posting" thread very carefully and
neglected to post your code as a result.

You claim to have an Adafruit motor shield, yet the link is to a chinese knock-off version.

Hi,

Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

What level of PWM are you trying to run the motors, most DC motor will stall below 40% PWM, for testing run the PWM at 200 out of 255.
I put my robot base on a block and let the wheels spin, to test.

Tom... :slight_smile:

Sorry for not posting properly - my bad. Here is my code by the way. Yes I am using a Knock-off from DK-Electronics.

So you mean by changing the motorSpeed I am changing the PWM value and thus the voltage should behave accordingly right?
The Voltage should be exactly the same on every Motor through the board I guess?

As you can see in my code I am using an ultrasonic sensor too. No problems with that. :slight_smile:

#include <AFMotor.h>

AF_DCMotor motor(1);
AF_DCMotor motor2(2);

long cm;
long laenge;

const int TrigPin=52;
const int EchoPin=53;


void setup() {
  Serial.begin(9600);
  pinMode(TrigPin,OUTPUT);
  pinMode(EchoPin,INPUT);

  motor.setSpeed(255);
  motor2.setSpeed(255);
}


void loop() {
  long duration, cm;

  digitalWrite(TrigPin, LOW);
  delayMicroseconds(2);
  digitalWrite(TrigPin, HIGH);
  delayMicroseconds(5);
  digitalWrite(TrigPin, LOW);

  laenge = pulseIn(EchoPin, HIGH);

  cm = (laenge*34)/2000;
  Serial.print(cm);
  Serial.println("cm");

  if (cm < 25) {
    Serial.println("Obstacle detected");
    Serial.println("Turning!");
    motor.setSpeed(0);
    motor2.setSpeed(0);
    delay(2000);
    motor.setSpeed(50);
    motor2.setSpeed(50);
    motor.run(BACKWARD);
    motor2.run(FORWARD);
  }
  else {
    Serial.println("No Obstacle detected");
    motor.setSpeed(255);
    motor2.setSpeed(255);
    motor.run(FORWARD);
    motor2.run(FORWARD);
  }

}