motor shield V2 not working

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

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
Thespark505
 
Posts: 3
Joined: Mon Dec 19, 2016 4:54 pm

motor shield V2 not working

Post by Thespark505 »

Hello Guys, I have soldered the Adafruit motor shield as shown in attached picture( red loop), Wired arduino uno A4 to scl and A5 to SDA , and powered the motor shield with a 9V battery. When I connect the motors to the shield and upload dc test example they don't work. 1 Motor connected to port 1 of the shield. I don't think that the motor shield receiving any information from the UNO. Is it my soldering or something else??
I prefer to use the motor shield on a a bread board or is it only working with stacking??

I've used the following example:

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_MS_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);
}
Attachments
mshieldv2.jpg
mshieldv2.jpg (1018.25 KiB) Viewed 291 times

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

Re: motor shield V2 not working

Post by adafruit_support_bill »

You don't have a 5v connection. You need 5v on the 5v pin to power the logic circuits on the board.

User avatar
Thespark505
 
Posts: 3
Joined: Mon Dec 19, 2016 4:54 pm

Re: motor shield V2 not working

Post by Thespark505 »

So you are saying that I need to solder these two pins 5V and GND, and connect them to the Arduino 5V and GND?
Attachments
mshieldv2_5v.png
mshieldv2_5v.png (597.12 KiB) Viewed 263 times

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

Re: motor shield V2 not working

Post by adafruit_support_bill »

Yes.

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

Return to “Arduino Shields from Adafruit”