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.
Motor Shield V2.0 DC Motor Test
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- adafruit_support_mike
- Posts: 67446
- Joined: Thu Feb 11, 2010 2:51 pm
Re: Motor Shield V2.0 DC Motor Test
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.
Also, please post the exact code you're using (between code tags please) and we'll see if there are any clues in that.
- kline19
- Posts: 11
- Joined: Mon Oct 06, 2014 7:32 pm
Re: Motor Shield V2.0 DC Motor Test
Hi, thanks for your response!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.
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.
- kline19
- Posts: 11
- Joined: Mon Oct 06, 2014 7:32 pm
Re: Motor Shield V2.0 DC Motor Test
Here is the state of my soldering skills. I wonder if the soldering might be the problem?
- kline19
- Posts: 11
- Joined: Mon Oct 06, 2014 7:32 pm
Re: Motor Shield V2.0 DC Motor Test
The spec. sheet for the DC Motor is given on this link: http://www.jameco.com/Jameco/Products/ProdDS/151442.pdf
- adafruit_support_bill
- Posts: 88090
- Joined: Sat Feb 07, 2009 10:11 am
Re: Motor Shield V2.0 DC Motor Test
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
- gaelix
- Posts: 4
- Joined: Wed Oct 15, 2014 3:49 pm
Re: Motor Shield V2.0 DC Motor Test
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:
I fixed the suspicious solderings, but i can't run the motor anyway..
Kline19 did you find a solution?
Serial Monitor prints this:
- adafruit_support_bill
- Posts: 88090
- Joined: Sat Feb 07, 2009 10:11 am
Re: Motor Shield V2.0 DC Motor Test
@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.
Also, post photos of all your soldering and connections to the board. And tell us what motors and power supply you are using.
- kline19
- Posts: 11
- Joined: Mon Oct 06, 2014 7:32 pm
Re: Motor Shield V2.0 DC Motor Test
Yes, after redoing some of the soldering. I was able to get motor moving by using the ADA Fruit DC motor test program.
- gaelix
- Posts: 4
- Joined: Wed Oct 15, 2014 3:49 pm
Re: Motor Shield V2.0 DC Motor Test
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:
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!
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:
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!
- adafruit_support_bill
- Posts: 88090
- Joined: Sat Feb 07, 2009 10:11 am
Re: Motor Shield V2.0 DC Motor Test
5 alkaline cells in parallel is 1.5v. Are you sure they are not in series?5 AA Batteries (1.5V 3A) in parallel. (for a total 7.5V)
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.
- gaelix
- Posts: 4
- Joined: Wed Oct 15, 2014 3:49 pm
Re: Motor Shield V2.0 DC Motor Test
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.
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.
- adafruit_support_bill
- Posts: 88090
- Joined: Sat Feb 07, 2009 10:11 am
Re: Motor Shield V2.0 DC Motor Test
Please post the code you are using to test.
- gaelix
- Posts: 4
- Joined: Wed Oct 15, 2014 3:49 pm
Re: Motor Shield V2.0 DC Motor Test
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
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);
}
- adafruit_support_bill
- Posts: 88090
- Joined: Sat Feb 07, 2009 10:11 am
Re: Motor Shield V2.0 DC Motor Test
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?
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?
Please be positive and constructive with your questions and comments.