Motor Shield V2.0 DC Motor Test

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
kline19
 
Posts: 11
Joined: Mon Oct 06, 2014 7:32 pm

Motor Shield V2.0 DC Motor Test

Post by kline19 »

Hello All:
I stacked up an Arduino UNO R3 with ADA Fruit Motor Shield V2.0. I am using the V2.o code library's DC Motor Testing program. The program uploads from the Arduino IDE and the green LED on the Motor Shield is clearly ON. I read 12.8V on the Power terminals (in blue) on the shield. But there is nothing happening to the DC motor. The voltage reading is in milliVolts on the M1 terminal. DC Motor powers up if I insert the battery terminals directly into the motor terminals which means motor is fine. The motor is hooked on M1 terminal which is also instantiated in the MotorShield program code as 1.

Please help! Thanks.
IMG_0266.JPG
IMG_0266.JPG (663.04 KiB) Viewed 916 times
IMG_0268.JPG
IMG_0268.JPG (663.95 KiB) Viewed 916 times
IMG_0267.JPG
IMG_0267.JPG (461.38 KiB) Viewed 916 times
IMG_0266.JPG
IMG_0266.JPG (663.04 KiB) Viewed 916 times

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: Motor Shield V2.0 DC Motor Test

Post by adafruit_support_mike »

How much current does the motor use when you connect it directly to the battery?

Also, please post the exact code you're using (between code tags please) and we'll see if there are any clues in that.

User avatar
kline19
 
Posts: 11
Joined: Mon Oct 06, 2014 7:32 pm

Re: Motor Shield V2.0 DC Motor Test

Post by kline19 »

adafruit_support_mike wrote:How much current does the motor use when you connect it directly to the battery?

Also, please post the exact code you're using (between code tags please) and we'll see if there are any clues in that.
Hi, thanks for your response!

It is drawing 65mA DC current.
The code is given below

Code: Select all

/* 
This is a test sketch for the Adafruit assembled Motor Shield for Arduino v2
It won't work with v1.x motor shields! Only for the v2's with built in PWM
control

For use with the Adafruit Motor Shield v2 
---->	http://www.adafruit.com/products/1438
*/

#include <Wire.h>
#include <Adafruit_MotorShield.h>
#include "utility/Adafruit_PWMServoDriver.h"

// Create the motor shield object with the default I2C address
Adafruit_MotorShield AFMS = Adafruit_MotorShield(); 
// Or, create it with a different I2C address (say for stacking)
// Adafruit_MotorShield AFMS = Adafruit_MotorShield(0x61); 

// Select which 'port' M1, M2, M3 or M4. In this case, M1
Adafruit_DCMotor *myMotor = AFMS.getMotor(1);
// You can also make another motor on port M2
//Adafruit_DCMotor *myOtherMotor = AFMS.getMotor(2);

void setup() {
  Serial.begin(9600);           // set up Serial library at 9600 bps
  Serial.println("Adafruit Motorshield v2 - DC Motor test!");

  AFMS.begin();  // create with the default frequency 1.6KHz
  //AFMS.begin(1000);  // OR with a different frequency, say 1KHz
  
  // Set the speed to start, from 0 (off) to 255 (max speed)
  myMotor->setSpeed(150);
  myMotor->run(FORWARD);
  // turn on motor
  myMotor->run(RELEASE);
}

void loop() {
  uint8_t i;
  
  Serial.print("tick");

  myMotor->run(FORWARD);
  for (i=0; i<255; i++) {
    myMotor->setSpeed(i);  
    delay(10);
  }
  for (i=255; i!=0; i--) {
    myMotor->setSpeed(i);  
    delay(10);
  }
  
  Serial.print("tock");

  myMotor->run(BACKWARD);
  for (i=0; i<255; i++) {
    myMotor->setSpeed(i);  
    delay(10);
  }
  for (i=255; i!=0; i--) {
    myMotor->setSpeed(i);  
    delay(10);
  }

  Serial.print("tech");
  myMotor->run(RELEASE);
  delay(1000);
}
Last edited by kline19 on Tue Oct 07, 2014 4:32 pm, edited 1 time in total.

User avatar
kline19
 
Posts: 11
Joined: Mon Oct 06, 2014 7:32 pm

Re: Motor Shield V2.0 DC Motor Test

Post by kline19 »

Here is the state of my soldering skills. I wonder if the soldering might be the problem?
IMG_0271.JPG
IMG_0271.JPG (84.74 KiB) Viewed 889 times
IMG_0272.JPG
IMG_0272.JPG (92.99 KiB) Viewed 889 times

User avatar
kline19
 
Posts: 11
Joined: Mon Oct 06, 2014 7:32 pm

Re: Motor Shield V2.0 DC Motor Test

Post by kline19 »

The spec. sheet for the DC Motor is given on this link: http://www.jameco.com/Jameco/Products/ProdDS/151442.pdf

User avatar
adafruit_support_bill
 
Posts: 88090
Joined: Sat Feb 07, 2009 10:11 am

Re: Motor Shield V2.0 DC Motor Test

Post by adafruit_support_bill »

Your current draw connected to the battery sounds pretty close to the no-load spec, so the motor is probably fine. There are a few suspicious looking solder joints there. Some have too much solder and are in danger of causing a short circuit. Others look like they might not have flowed well onto the solder pad. Have a look at this guide for some tips on cleaning those up: http://learn.adafruit.com/adafruit-guid ... n-problems

User avatar
gaelix
 
Posts: 4
Joined: Wed Oct 15, 2014 3:49 pm

Re: Motor Shield V2.0 DC Motor Test

Post by gaelix »

Hi there, i have exactly the same problem.
I fixed the suspicious solderings, but i can't run the motor anyway..
Kline19 did you find a solution?

Serial Monitor prints this:
Serial Monitor
Serial Monitor
errore.jpg (26.45 KiB) Viewed 842 times

User avatar
adafruit_support_bill
 
Posts: 88090
Joined: Sat Feb 07, 2009 10:11 am

Re: Motor Shield V2.0 DC Motor Test

Post by adafruit_support_bill »

@gaelix - check the Serial.begin() statement in your setup() function. Make sure that the baud rate set there is the same as the baud rate of your serial monitor (9600).

Also, post photos of all your soldering and connections to the board. And tell us what motors and power supply you are using.

User avatar
kline19
 
Posts: 11
Joined: Mon Oct 06, 2014 7:32 pm

Re: Motor Shield V2.0 DC Motor Test

Post by kline19 »

Yes, after redoing some of the soldering. I was able to get motor moving by using the ADA Fruit DC motor test program.

User avatar
gaelix
 
Posts: 4
Joined: Wed Oct 15, 2014 3:49 pm

Re: Motor Shield V2.0 DC Motor Test

Post by gaelix »

The baud rate is well set (9600 both in the serial.begin and in the serial monitor).
The motors i am using are these: http://www.dfrobot.com/index.php?route= ... uct_id=100
The power is supplied by 5 AA Batteries (1.5V 3A) in parallel. (for a total 7.5V)

These are the pictures of the connections and solderings:

Image
Image
Image
Image
Image

I am using (in the motors) a 0.1uF ceramic capacitor.

I tried to power motors directly from batteries and they all work fine, so i'm sure that at least the motor connections are well done!

User avatar
adafruit_support_bill
 
Posts: 88090
Joined: Sat Feb 07, 2009 10:11 am

Re: Motor Shield V2.0 DC Motor Test

Post by adafruit_support_bill »

5 AA Batteries (1.5V 3A) in parallel. (for a total 7.5V)
5 alkaline cells in parallel is 1.5v. Are you sure they are not in series?

What are you using to power the Arduino?

I see no power light on the motor shield. Double check that you are getting power at the external power terminals. Also double check the polarity.

User avatar
gaelix
 
Posts: 4
Joined: Wed Oct 15, 2014 3:49 pm

Re: Motor Shield V2.0 DC Motor Test

Post by gaelix »

I'm sorry! I actually meant in series obviously! :D
When i took the picture the power was off (i built a switch to power off the system when i'm not using it).
Here you have a picture of the board when the power is on:

http://s18.postimg.org/sqesfx461/20141016_222509.jpg

The Arduino is powered by the usb cable connected to the computer.

User avatar
adafruit_support_bill
 
Posts: 88090
Joined: Sat Feb 07, 2009 10:11 am

Re: Motor Shield V2.0 DC Motor Test

Post by adafruit_support_bill »

Please post the code you are using to test.

User avatar
gaelix
 
Posts: 4
Joined: Wed Oct 15, 2014 3:49 pm

Re: Motor Shield V2.0 DC Motor Test

Post by gaelix »

Today it worked for just one test. Then it stopped working again, and started again printing "weird" letters in the serial monitor..

Here is the code i'm using

Code: Select all

#include <Wire.h>
#include <Adafruit_MotorShield.h>
#include "utility/Adafruit_PWMServoDriver.h"

// Create the motor shield object with the default I2C address
Adafruit_MotorShield AFMS = Adafruit_MotorShield(); 
// Or, create it with a different I2C address (say for stacking)
// Adafruit_MotorShield AFMS = Adafruit_MotorShield(0x61); 

// Select which 'port' M1, M2, M3 or M4. In this case, M1
Adafruit_DCMotor *myMotor = AFMS.getMotor(1);
// You can also make another motor on port M2
//Adafruit_DCMotor *myOtherMotor = AFMS.getMotor(2);

void setup() {
  Serial.begin(9600);           // set up Serial library at 9600 bps
  Serial.println("Adafruit Motorshield v2 - DC Motor test!");

  AFMS.begin();  // create with the default frequency 1.6KHz
  //AFMS.begin(1000);  // OR with a different frequency, say 1KHz
  
  // Set the speed to start, from 0 (off) to 255 (max speed)
  myMotor->setSpeed(150);
  myMotor->run(FORWARD);
  // turn on motor
  myMotor->run(RELEASE);
}

void loop() {
  uint8_t i;
  
  Serial.print("tick");

  myMotor->run(FORWARD);
  for (i=0; i<255; i++) {
    myMotor->setSpeed(i);  
    delay(10);
  }
  for (i=255; i!=0; i--) {
    myMotor->setSpeed(i);  
    delay(10);
  }
  
  Serial.print("tock");

  myMotor->run(BACKWARD);
  for (i=0; i<255; i++) {
    myMotor->setSpeed(i);  
    delay(10);
  }
  for (i=255; i!=0; i--) {
    myMotor->setSpeed(i);  
    delay(10);
  }

  Serial.print("tech");
  myMotor->run(RELEASE);
  delay(1000);
}


User avatar
adafruit_support_bill
 
Posts: 88090
Joined: Sat Feb 07, 2009 10:11 am

Re: Motor Shield V2.0 DC Motor Test

Post by adafruit_support_bill »

The strange characters are puzzling.
If you disconnect the motors from the shield does it print OK?
If you remove the shield from the Arduino, does it print OK?
Can you post a photo of the back-side of the shield?

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino Shields from Adafruit”