Spark Core with Pololu MD03A Dual Motor Driver

Hi Guys,
I am trying to interface the spark wifi core with the dual motor driver from Pololu (pls see below) to run two dc motors.
Pololu hardware: http://www.pololu.com/product/707/specs#note1

Connections are as follows:

D0 connected to 1INA on pololu
D1 connected to 1INB
D3 connected to 1PWM
VIN connected to +5V IN
GND connected to GND
DC power supply connected to GND and VIN+ of the output side of the polulu driver.
OUT1A and OUT1B of pololu driver connected to motor.

Here is the code i used…

int InA1 = D0;
int InB1 = D1;
int PWM1 = D3;  //PWM1 connects to pin 3
int PWM1_val = 127; //(25% = 64; 50% = 127; 75% = 191; 100% = 255)

void setup() {
  pinMode(InA1, OUTPUT);
  pinMode(InB1, OUTPUT);
  pinMode(PWM1, OUTPUT);
}

void loop() {
    digitalWrite(InA1, HIGH);
    digitalWrite(InB1, LOW);
    analogWrite(PWM1, PWM1_val);
}

I am powering the core using a standard 5V DC power supply that can provide up to 1A.
When I run the code…nothing is happening. The Pololu motor driver does not seem to get powered. I know that the pololu motor driver works because I have used it with mBed board successfully.
Any help will be appreciated.

BTW:I am connecting only one motor for now.

Thanks,
P

@puddlerocks, the code looks about right but the code in loop() should only executed once so it should be moved to seltup(), leaving loop() empty for now.

One thing I noticed is that the minimum voltage for a “high” input on the PWM and INA pins is 3.25V, which may be right on the edge of what the Spark puts out. You may want to measure this voltage with a multimeter (on InA1 for example) to see if it meets the criteria. Let me know what you get. :smile:

1 Like